webpackJsonp([27],[function(e,t,i){i(1594),i(1595),i(1596),i(1597),i(1598),i(1599),i(1600),i(1601),i(1602),i(1603),i(1604),i(1605),i(1606),i(1607),i(1608),i(1609),i(1610),i(1611),i(1612),i(1613),i(1614),i(1615),i(1616),i(1617),i(1618),i(1619),i(1620),i(1621),i(1622),i(1623),i(1624),i(1625),i(1626),i(1627),i(1628),i(1629),i(1630),i(1631),i(1632),i(1633),i(1634),i(1635),i(1636),i(1637),i(1638),i(1639),i(1640),i(1641),i(1642),i(1643),i(1644),i(1645),i(1646),i(1647),i(1648),i(1649),i(1650),e.exports=i(1651)},,,,,function(e,t,i){"use strict";var n=i(3),s=i(6).sprintf,o=i(7),r=i(9),a=i(126),l=i(178);l();var c=i(129),u=i(132),h=i(180),d=i(181),p=i(182),g=i(224),f=i(773),_=i(776),m=i(777),v=i(778),b=i(782),y=i(544),w=i(813),C=i(816),k=a.extend({getName:function(){return this.name=c.get("Context/name"),s("Context/%s",this.name)},logs:function(){var e=[i(817),i(833),i(834),i(835),i(836),i(837),i(838),i(839),i(840),i(841),i(842),i(843),i(844).default,i(847).default,i(853),i(854),i(855),i(856),i(857),i(858),i(859)];return n.union(e,a.prototype.logs.apply(this))},constructor:function(){a.apply(this,arguments),this.startHistory(),this.initializeApp()},bootloader:function(e){a.prototype.bootloader.apply(this,arguments),d.init(),u.log("Exec","Bootstrap/DOMEventor"),u.log("Exec","Bootstrap/Legacy"),i(860)},initializeApp:function(){h.bool("is_mobile_handset")?new b:new g,new f,new _,h.bool("indash_blogs")&&(this.peepr=new m),h.bool("ask_form")&&(this.askForm=new v({user:p()})),h.bool("livephotos_web")&&(this.livePhotos=y.getInstance()),r.locale(c.get("Context.language")),h.bool("lrec_on_blog_pages_peepr")&&(this.yamPlusAd=new w),new C},startHistory:function(e){o.History.started||n.isEmpty(this.routes)||(this.routeFound=o.history.start({pushState:"pushState"in window.history,hashChange:!!e&&!("pushState"in window.history),root:this.root}))}});e.exports=k},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(127),r=i(129),a=i(130),l=i(132),c=i(134),u=i(135),h=s.Router.extend({root:"/",constructor:function(e){e||(e={}),e.bootstrap||(e.bootstrap=o()),this.bootloader(e.bootstrap),s.Router.apply(this,arguments)},getName:function(){return"Prima/Router"},logs:function(){return[]},bootloader:function(e){n.isEmpty(e),r.setup(e),l.log("Exec","Bootstrap/Data"),a.setup(e.Translations,n.get(e,"Context.language_simple","en")),l.log("Exec","Bootstrap/Translations"),c.startLogs(this.logs()),l.log("Exec","Bootstrap/logs"),new u({})}},{start:function(e){return new this(e)}});e.exports=h},function(e,t,i){"use strict";var n=i(128),s=function(){var e=n("JSON"),t={},i=document.getElementById("bootloader");if(i){try{t=e.parse(i.getAttribute("data-bootstrap"))}catch(e){}i.parentNode.removeChild(i)}return t};e.exports=s},function(e,t){"use strict";function i(e,t){if(e in n)return n[e];var i=window[e];if(!t||!t(i)){var s=document.createElement("iframe");document.body.appendChild(s),i=s.contentWindow[e],document.body.removeChild(s)}return n[e]=i,i}var n={};e.exports=i},function(e,t,i){"use strict";function n(e){if(!r)throw new Error("Data hasn't been initialized with `setup`.");if(!a.isString(e))return null;var t=a.get(r,e.replace(/\//g,"."));return a.cloneDeep(t)}function s(e){if(!r)throw new Error("Data hasn't been initialized with `setup`.");return a.isString(e)?a.has(r,e.replace(/\//g,".")):null}function o(e){r=a.isObject(e)?e:{}}var r,a=i(3);e.exports={get:n,has:s,setup:a.once(o)}},function(e,t,i){"use strict";function n(e,t){r.addEntries(s.isObject(e)?e:{}),this.locale=t}var s=i(3),o=i(131),r=new o({name:"Translations"}),a=s.bind(r.get,r);a.setup=s.once(n),e.exports=a},function(e,t,i){"use strict";function n(e){e=s.extend({entries:{},name:"Dictionary"},e),this._hadLastLookup=!1,this._entries=e.entries,this._name=e.name}var s=i(3),o=(i(132),i(6).sprintf),r=function(e,t,i){null!=i||(i=this);var n=e.apply(i,t);return t=Array.prototype.slice.call(t,1),t.unshift(n),t};n.prototype.addEntries=function(e){return s.extend(this._entries,e),this},n.prototype.lookup=function(e){return s.has(this._entries,e)?(this._hadLastLookup=!0,this._entries[e]):(this._hadLastLookup=!1,e)},n.prototype.lookupWithFormatting=function(e){var t;return arguments.length>1?(t=this.lookup(o.apply(this,arguments)),this._hadLastLookup||(t=o.apply(this,r(this.lookup,arguments,this)))):t=this.lookup(e),t},n.prototype.get=function(e){var t=this.lookupWithFormatting.apply(this,arguments);return!this._hadLastLookup&&this.logMissing,t},n.prototype.getEntries=function(){return s.cloneDeep(this._entries)},e.exports=n},,,function(e,t,i){"use strict";var n=i(3),s={loadedLogs:[],startLogs:function(e){n.each(e,function(e){var t=e.start();this.loadedLogs.push(t.logKey)},this)},startLog:function(e){this.startLogs([e])}};e.exports=s},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null,n=(0,c.default)(e),s=null;i&&(s=(0,c.default)(i)),(0,c.default)(e+"[data-supply-logging]").each(function(e,i){var o=(0,c.default)(i),r=n.index(o)+1,a=o.data("supply-logging"),l=!0,u=!1,h=void 0;try{for(var d,g=a[Symbol.iterator]();!(l=(d=g.next()).done);l=!0){var _=d.value,m=_+"_"+r;t.pixels.hasOwnProperty(m)||(t.pixels[m]=new p.default(o,f.default.assign({location_id:_,ad_position:r},t.globalProperties),t,s))}}catch(e){u=!0,h=e}finally{try{!l&&g.return&&g.return()}finally{if(u)throw h}}})}},{key:"_getGlobalProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],i=!1;t&&t.err&&"error"===t.err.type&&(i=!0);var n={adblock_enabled:i,client_timestamp:Date.now(),view_duration:0};return f.default.get(e,"supplyLogging")&&(n.opt_out=!e.adsEnabled,n.nsfw=!!e.isAdult,n.optica_theme=!!e.isOptica),n}},{key:"_checkForAdblockers",value:function(){var e="Promise"in window?Promise:i(139);return new e(function(e,t){window.Tumblr.ABP&&t({err:{type:"error"}});var i=document.createElement("script");i.async=!0;var n=document.getElementsByTagName("head")[0];i.src="/load/view.php?a=aHR0cHM6Ly9hc3NldHMudHVtYmxyLmNvbS9hc3NldHMvc2NyaXB0cy90dW1ibHIvZGFzaGJvYXJkL3Nob3dhZHMuanM",n.appendChild(i);var s=function t(){i.removeEventListener("load",t),e()};i.addEventListener("load",s),i.addEventListener("error",function(e){t({err:e})})})}},{key:"_unloadPeeprPixels",value:function(){for(var e in this.pixels)if(this.pixels.hasOwnProperty(e)){var t=this.pixels[e];f.default.startsWith(e,"peepr")&&(t.onBeforeUnload(),delete this.pixels[e])}}},{key:"_onBeforeUnload",value:function(){for(var e in this.pixels)this.pixels.hasOwnProperty(e)&&this.pixels[e].onBeforeUnload()}},{key:"supplyLog",value:function(e){f.default.has(e,"event")&&h.default.trigger("Kraken:supply_"+e.event,{loggingData:e})}}]),e}();e.exports=_},function(e,t,i){"use strict";var n=i(3),s=i(7),o=function(){};o.extend=s.Model.extend,n.extend(o.prototype,s.Events),o.prototype.trigger=function(){return n.isObject(arguments[1])&&(arguments[1].loggingData=arguments[1].loggingData||{}),s.Events.trigger.apply(this,arguments)},e.exports=new o},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){var i=[],n=!0,s=!1,o=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){s=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(s)throw o}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=this,r=arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;s(this,e),this.element=t,this.manager=r,this.properties=i,this._onServed(),this.visibleTime=null,this.minimumVisibleTime=1e3,this.maximumVisibleTime=1e4,(0,h.isEmpty)(this.properties)||"dashboard_right_rail"!==this.properties.placement_id||u.default.on("darla:success",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=o(e,2),i=t[0],s=t[1];"AUTO"===i&&"LREC4"===s[0]&&"LREC"===s[1]&&n._onRotate()}),this._setupWatcher(a)}return r(e,[{key:"_setupWatcher",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?this.watcher=l.default.createContainer(t).create(this.element):this.watcher=l.default.create(this.element),this.watcher.enterViewport(function(){e._onVisible()}),(0,h.isEmpty)(this.properties)||"dashboard_right_rail"!==this.properties.placement_id?this.watcher.exitViewport(function(){e._onInvisible()}):u.default.on("ads-interaction:sidebar-ad-hidden",this._onInvisible,this)}},{key:"_onServed",value:function(){this._fireEvent("serve")}},{key:"_onVisible",value:function(){this.visibleTime=Date.now()}},{key:"_onInvisible",value:function(){this._setViewDuration(),!(0,h.isEmpty)(this.properties)&&this.properties.view_duration>=this.minimumVisibleTime&&(this._fireEvent("viewable"),this.watcher.destroy(),u.default.off("ads-interaction:sidebar-ad-hidden"))}},{key:"_setViewDuration",value:function(){this.visibleTime&&(this.properties.view_duration=Date.now()-this.visibleTime,this.properties.view_duration>=this.maximumVisibleTime&&(this.properties.view_duration=this.maximumVisibleTime))}},{key:"_fireEvent",value:function(e){this.properties.event=e,this.manager.supplyLog(this.properties)}},{key:"_onRotate",value:function(){this._setViewDuration(),this._fireEvent("rotate"),this._onVisible(),this.properties.view_duration=0}},{key:"onBeforeUnload",value:function(){this._setViewDuration(),this._fireEvent("unload"),this.watcher.destroy()}}]),e}();e.exports=d},,function(e,t,i){"use strict";function n(){try{Promise===o&&(Promise=s)}catch(e){}return o}var s;"undefined"!=typeof Promise&&(s=Promise);var o=i(140)();o.noConflict=n,e.exports=o},function(e,t,i){(function(t){"use strict";e.exports=function(){function n(){}function s(e,t){if(null==e||e.constructor!==o)throw new b("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new b("expecting a function but got "+g.classString(t))}function o(e){e!==w&&s(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function r(e){this.promise._resolveCallback(e)}function a(e){this.promise._rejectCallback(e,!1)}function l(e){var t=new o(w);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}var c,u=function(){return new b("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},h=function(){return new o.PromiseInspection(this._target())},d=function(e){return o.reject(new b(e))},p={},g=i(142);c=g.isNode?function(){var e=t.domain;return void 0===e&&(e=null),e}:function(){return null},g.notEnumerableProp(o,"_getDomain",c);var f=i(143),_=i(144),m=new _;f.defineProperty(o,"_async",{value:m});var v=i(149),b=o.TypeError=v.TypeError;o.RangeError=v.RangeError;var y=o.CancellationError=v.CancellationError;o.TimeoutError=v.TimeoutError,o.OperationalError=v.OperationalError,o.RejectionError=v.OperationalError,o.AggregateError=v.AggregateError;var w=function(){},C={},k={},x=i(150)(o,w),S=i(151)(o,w,x,d,n),T=i(152)(o),E=T.create,P=i(153)(o,T),I=(P.CapturedTrace,i(154)(o,x,k)),F=i(155)(k),A=i(156),M=g.errorObj,N=g.tryCatch;return o.prototype.toString=function(){return"[object Promise]"},o.prototype.caught=o.prototype.catch=function(e){var t=arguments.length;if(t>1){var i,n=new Array(t-1),s=0;for(i=0;i0&&"function"!=typeof e&&"function"!=typeof t){var i=".then() only accepts functions but was passed: "+g.classString(e);arguments.length>1&&(i+=", "+g.classString(t)),this._warn(i)}return this._then(e,t,void 0,void 0,void 0)},o.prototype.done=function(e,t){var i=this._then(e,t,void 0,void 0,void 0);i._setIsFinal()},o.prototype.spread=function(e){return"function"!=typeof e?d("expecting a function but got "+g.classString(e)):this.all()._then(e,void 0,void 0,C,void 0)},o.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},o.prototype.error=function(e){return this.caught(g.originatesFromRejection,e)},o.getNewLibraryCopy=e.exports,o.is=function(e){return e instanceof o},o.fromNode=o.fromCallback=function(e){var t=new o(w);t._captureStackTrace();var i=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=N(e)(A(t,i));return n===M&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},o.all=function(e){return new S(e).promise()},o.cast=function(e){var t=x(e);return t instanceof o||(t=new o(w),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(e){var t=new o(w);return t._captureStackTrace(),t._rejectCallback(e,!0),t},o.setScheduler=function(e){if("function"!=typeof e)throw new b("expecting a function but got "+g.classString(e));return m.setScheduler(e)},o.prototype._then=function(e,t,i,n,s){var r=void 0!==s,a=r?s:new o(w),l=this._target(),u=l._bitField;r||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var h=c();if(0!==(50397184&u)){var d,p,f=l._settlePromiseCtx;0!==(33554432&u)?(p=l._rejectionHandler0,d=e):0!==(16777216&u)?(p=l._fulfillmentHandler0,d=t,l._unsetRejectionIsUnhandled()):(f=l._settlePromiseLateCancellationObserver,p=new y("late cancellation observer"),l._attachExtraTrace(p),d=t),m.invoke(f,l,{handler:null===h?d:"function"==typeof d&&g.domainBind(h,d),promise:a,receiver:n,value:p})}else l._addCallbacks(e,t,a,n,h);return a},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(e){this._bitField=this._bitField&-65536|65535&e},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){m.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==p)return void 0===t&&this._isBound()?this._boundValue():t},o.prototype._promiseAt=function(e){return this[4*e-4+2]},o.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},o.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(e){var t=(e._bitField,e._fulfillmentHandler0),i=e._rejectionHandler0,n=e._promise0,s=e._receiverAt(0);void 0===s&&(s=p),this._addCallbacks(t,i,n,s,null)},o.prototype._migrateCallbackAt=function(e,t){var i=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),s=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=p),this._addCallbacks(i,n,s,o,null)},o.prototype._addCallbacks=function(e,t,i,n,s){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=i,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===s?e:g.domainBind(s,e)),"function"==typeof t&&(this._rejectionHandler0=null===s?t:g.domainBind(s,t));else{var r=4*o-4;this[r+2]=i,this[r+3]=n,"function"==typeof e&&(this[r+0]=null===s?e:g.domainBind(s,e)),"function"==typeof t&&(this[r+1]=null===s?t:g.domainBind(s,t))}return this._setLength(o+1),o},o.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},o.prototype._resolveCallback=function(e,t){if(0===(117506048&this._bitField)){if(e===this)return this._rejectCallback(u(),!1);var i=x(e,this);if(!(i instanceof o))return this._fulfill(e);t&&this._propagateFrom(i,2);var n=i._target();if(n===this)return void this._reject(u());var s=n._bitField;if(0===(50397184&s)){var r=this._length();r>0&&n._migrateCallback0(this);for(var a=1;a>>16)){if(e===this){var i=u();return this._attachExtraTrace(i),this._reject(i)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!==(134217728&t)?this._settlePromises():m.settlePromises(this))}},o.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16))return this._setRejected(),this._fulfillmentHandler0=e,this._isFinal()?m.fatalError(e,g.isNode):void((65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(e,t){for(var i=1;i0){if(0!==(16842752&e)){var i=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,i,e),this._rejectPromises(t,i)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var e=this._bitField;return 0!==(33554432&e)?this._rejectionHandler0:0!==(16777216&e)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){P.deprecated("Promise.defer","new Promise");var e=new o(w);return{promise:e,resolve:r,reject:a}},g.notEnumerableProp(o,"_makeSelfResolutionError",u),i(157)(o,w,x,d,P),i(158)(o,w,x,P),i(159)(o,S,d,P),i(160)(o),i(161)(o),i(162)(o,S,x,w,m,c),o.Promise=o,o.version="3.5.1",i(163)(o,S,d,x,w,P),i(164)(o),i(165)(o,d,x,E,w,P),i(166)(o,w,P),i(167)(o,d,w,x,n,P),i(168)(o),i(169)(o,w),i(170)(o,S,x,d),i(171)(o,w,x,d),i(172)(o,S,d,x,w,P),i(173)(o,S,P),i(174)(o,S,d),i(175)(o,w),i(176)(o,w),i(177)(o),g.toFastProperties(o),g.toFastProperties(o.prototype),l({a:1}),l({b:2}),l({c:3}),l(1),l(function(){}),l(void 0),l(!1),l(new o(w)),P.setBounds(_.firstLineError,g.lastLineError),o}}).call(t,i(141))},,function(e,t,i){(function(t,n){"use strict";function s(){try{var e=F;return F=null,e.apply(this,arguments)}catch(e){return I.e=e,I}}function o(e){return F=e,s}function r(e){return null==e||e===!0||e===!1||"string"==typeof e||"number"==typeof e}function a(e){return"function"==typeof e||"object"==typeof e&&null!==e}function l(e){return r(e)?new Error(m(e)):e}function c(e,t){var i,n=e.length,s=new Array(n+1);for(i=0;i1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),s=R.test(e+"")&&E.names(e).length>0;if(i||n||s)return!0}return!1}catch(e){return!1}}function g(e){function t(){}t.prototype=e;for(var i=8;i--;)new t;return e}function f(e){return O.test(e)}function _(e,t,i){for(var n=new Array(e),s=0;s10||e[0]>0}(),B.isNode&&B.toFastProperties(n);try{throw new Error}catch(e){B.lastLineError=e}e.exports=B}).call(t,function(){return this}(),i(141))},function(e,t){var i=function(){"use strict";return void 0===this}();if(i)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:i,propertyIsWritable:function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return!(i&&!i.writable&&!i.set)}};else{var n={}.hasOwnProperty,s={}.toString,o={}.constructor.prototype,r=function(e){var t=[];for(var i in e)n.call(e,i)&&t.push(i);return t},a=function(e,t){return{value:e[t]}},l=function(e,t,i){return e[t]=i.value,e},c=function(e){return e},u=function(e){try{return Object(e).constructor.prototype}catch(e){return o}},h=function(e){try{return"[object Array]"===s.call(e)}catch(e){return!1}};e.exports={isArray:h,keys:r,names:r,defineProperty:l,getDescriptor:a,freeze:c,getPrototypeOf:u,isES5:i,propertyIsWritable:function(){return!0}}}},function(e,t,i){(function(t){"use strict";function n(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=l}function s(e,t,i){this._lateQueue.push(e,t,i),this._queueTick()}function o(e,t,i){this._normalQueue.push(e,t,i),this._queueTick()}function r(e){this._normalQueue._pushOne(e),this._queueTick()}var a;try{throw new Error}catch(e){a=e}var l=i(145),c=i(148),u=i(142);n.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},n.prototype.hasCustomScheduler=function(){ return this._customScheduler},n.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},n.prototype.disableTrampolineIfNecessary=function(){u.hasDevTools&&(this._trampolineEnabled=!1)},n.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},n.prototype.fatalError=function(e,i){i?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},n.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},u.hasDevTools?(n.prototype.invokeLater=function(e,t,i){this._trampolineEnabled?s.call(this,e,t,i):this._schedule(function(){setTimeout(function(){e.call(t,i)},100)})},n.prototype.invoke=function(e,t,i){this._trampolineEnabled?o.call(this,e,t,i):this._schedule(function(){e.call(t,i)})},n.prototype.settlePromises=function(e){this._trampolineEnabled?r.call(this,e):this._schedule(function(){e._settlePromises()})}):(n.prototype.invokeLater=s,n.prototype.invoke=o,n.prototype.settlePromises=r),n.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if("function"==typeof t){var i=e.shift(),n=e.shift();t.call(i,n)}else t._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},e.exports=n,e.exports.firstLineError=a}).call(t,i(141))},function(e,t,i){(function(t,n,s){"use strict";var o,r=i(142),a=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},l=r.getNativePromise();if(r.isNode&&"undefined"==typeof MutationObserver){var c=t.setImmediate,u=n.nextTick;o=r.isRecentNode?function(e){c.call(t,e)}:function(e){u.call(n,e)}}else if("function"==typeof l&&"function"==typeof l.resolve){var h=l.resolve();o=function(e){h.then(e)}}else o="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof s?function(e){s(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:a:function(){var e=document.createElement("div"),t={attributes:!0},i=!1,n=document.createElement("div"),s=new MutationObserver(function(){e.classList.toggle("foo"),i=!1});s.observe(n,t);var o=function(){i||(i=!0,n.classList.toggle("foo"))};return function(i){var n=new MutationObserver(function(){n.disconnect(),i()});n.observe(e,t),o()}}();e.exports=o}).call(t,function(){return this}(),i(141),i(146).setImmediate)},function(e,t,i){function n(e,t){this._id=e,this._clearFn=t}var s=Function.prototype.apply;t.setTimeout=function(){return new n(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},i(147),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,i){(function(e,t){!function(e,i){"use strict";function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var i=0;i=0)return o[e]}var s=!1,o=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=o.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=i,t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var i=e.prototype._pushContext,o=e.prototype._popContext,r=e._peekContext,a=e.prototype._peekContext,l=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=i,e.prototype._popContext=o,e._peekContext=r,e.prototype._peekContext=a,e.prototype._promiseCreated=l,s=!1},s=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=n,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},function(e,t,i){(function(t){"use strict";e.exports=function(e,n){function s(e,t){return{promise:t}}function o(){return!1}function r(e,t,i){var n=this;try{e(t,i,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+$.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function a(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?$.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function l(){return this._onCancelField}function c(e){this._onCancelField=e}function u(){this._cancellationParent=void 0,this._onCancelField=void 0}function h(e,t){if(0!==(1&t)){this._cancellationParent=e;var i=e._branchesRemainingToCancel;void 0===i&&(i=0),e._branchesRemainingToCancel=i+1}0!==(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function d(e,t){0!==(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function p(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function g(){this._trace=new M(this._peekContext())}function f(e,t){if(L(e)){var i=this._trace;if(void 0!==i&&t&&(i=i._parent),void 0!==i)i.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=x(e);$.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),$.notEnumerableProp(e,"__stackCleaned__",!0)}}}function _(e,t,i,n,s){if(void 0===e&&null!==t&&J){if(void 0!==s&&s._returnedNonUndefined())return;if(0===(65535&n._bitField))return;i&&(i+=" ");var o="",r="";if(t._trace){for(var a=t._trace.stack.split("\n"),l=C(a),c=l.length-1;c>=0;--c){var u=l[c];if(!U.test(u)){var h=u.match(z);h&&(o="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(l.length>0)for(var d=l[0],c=0;c0&&(r="\n"+a[c-1]);break}}var p="a promise was created in a "+i+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+r;n._warn(p,!0,t)}}function m(e,t){var i=e+" is deprecated and will be removed in a future version.";return t&&(i+=" Use "+t+" instead."),v(i)}function v(t,i,n){if(re.warnings){var s,o=new V(t);if(i)n._attachExtraTrace(o);else if(re.longStackTraces&&(s=e._peekContext()))s.attachExtraTrace(o);else{var r=x(o);o.stack=r.message+"\n"+r.stack.join("\n")}te("warning",o)||S(o,"",!0)}}function b(e,t){for(var i=0;i=0;--a)if(n[a]===o){r=a;break}for(var a=r;a>=0;--a){var l=n[a];if(t[s]!==l)break;t.pop(),s--}t=n}}function C(e){for(var t=[],i=0;i0&&"SyntaxError"!=e.name&&(t=t.slice(i)),t}function x(e){var t=e.stack,i=e.toString();return t="string"==typeof t&&t.length>0?k(e):[" (No stack trace)"],{message:i,stack:"SyntaxError"==e.name?t:C(t)}}function S(e,t,i){if("undefined"!=typeof console){var n;if($.isObject(e)){var s=e.stack;n=t+q(s,e)}else n=t+String(e);"function"==typeof O?O(n,i):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function T(e,t,i,n){var s=!1;try{"function"==typeof t&&(s=!0,"rejectionHandled"===e?t(n):t(i,n))}catch(e){D.throwLater(e)}"unhandledRejection"===e?te(e,i,n)||s||S(i,"Unhandled rejection "):te(e,n)}function E(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():$.toString(e);var i=/\[object [a-zA-Z0-9$_]+\]/;if(i.test(t))try{var n=JSON.stringify(e);t=n}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+P(t)+">, no stack trace)"}function P(e){var t=41;return e.length=a||(ne=function(e){if(B.test(e))return!0;var t=F(e);return!!(t&&t.fileName===i&&r<=t.line&&t.line<=a)})}}function M(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);oe(this,M),t>32&&this.uncycle()}var N,R,O,j=e._getDomain,D=e._async,V=i(149).Warning,$=i(142),L=$.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,z=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,H=null,q=null,W=!1,G=!(0==$.env("BLUEBIRD_DEBUG")||!$.env("BLUEBIRD_DEBUG")&&"development"!==$.env("NODE_ENV")),K=!(0==$.env("BLUEBIRD_WARNINGS")||!G&&!$.env("BLUEBIRD_WARNINGS")),Q=!(0==$.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!$.env("BLUEBIRD_LONG_STACK_TRACES")),J=0!=$.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(K||!!$.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=e._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){T("rejectionHandled",N,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),T("unhandledRejection",R,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(e,t,i){return v(e,t,i||this)},e.onPossiblyUnhandledRejection=function(e){var t=j();R="function"==typeof e?null===t?e:$.domainBind(t,e):void 0},e.onUnhandledRejectionHandled=function(e){var t=j();N="function"==typeof e?null===t?e:$.domainBind(t,e):void 0};var X=function(){};e.longStackTraces=function(){if(D.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!re.longStackTraces&&I()){var t=e.prototype._captureStackTrace,i=e.prototype._attachExtraTrace;re.longStackTraces=!0,X=function(){if(D.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=i,n.deactivateLongStackTraces(),D.enableTrampoline(),re.longStackTraces=!1},e.prototype._captureStackTrace=g,e.prototype._attachExtraTrace=f,n.activateLongStackTraces(),D.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return re.longStackTraces&&I()};var Y=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return $.global.dispatchEvent(e),function(e,t){var i=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!$.global.dispatchEvent(i)}}if("function"==typeof Event){var e=new Event("CustomEvent");return $.global.dispatchEvent(e),function(e,t){var i=new Event(e.toLowerCase(),{cancelable:!0});return i.detail=t,!$.global.dispatchEvent(i)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),$.global.dispatchEvent(e),function(e,t){var i=document.createEvent("CustomEvent");return i.initCustomEvent(e.toLowerCase(),!1,!0,t),!$.global.dispatchEvent(i)}}catch(e){}return function(){return!1}}(),Z=function(){return $.isNode?function(){return t.emit.apply(t,arguments)}:$.global?function(e){var t="on"+e.toLowerCase(),i=$.global[t];return!!i&&(i.apply($.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),ee={promiseCreated:s,promiseFulfilled:s,promiseRejected:s,promiseResolved:s,promiseCancelled:s,promiseChained:function(e,t,i){return{promise:t,child:i}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,i){return{reason:t,promise:i}},rejectionHandled:s},te=function(e){var t=!1;try{t=Z.apply(null,arguments)}catch(e){D.throwLater(e),t=!0}var i=!1;try{i=Y(e,ee[e].apply(null,arguments))}catch(e){D.throwLater(e),i=!0}return i||t};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&X()),"warnings"in t){var i=t.warnings;re.warnings=!!i,J=re.warnings,$.isObject(i)&&"wForgottenReturn"in i&&(J=!!i.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!re.cancellation){if(D.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=u,e.prototype._propagateFrom=h,e.prototype._onCancel=l,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=r,ie=h,re.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!re.monitoring?(re.monitoring=!0,e.prototype._fireEvent=te):!t.monitoring&&re.monitoring&&(re.monitoring=!1,e.prototype._fireEvent=o)),e},e.prototype._fireEvent=o,e.prototype._execute=function(e,t,i){try{e(t,i)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};var ie=d,ne=function(){return!1},se=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;$.inherits(M,Error),n.CapturedTrace=M,M.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],i={},n=0,s=this;void 0!==s;++n)t.push(s),s=s._parent;e=this._length=n;for(var n=e-1;n>=0;--n){var o=t[n].stack;void 0===i[o]&&(i[o]=n)}for(var n=0;n0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var l=n>0?t[n-1]:this;a=0;--u)t[u]._length=c,c++;return}}}},M.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=x(e),i=t.message,n=[t.stack],s=this;void 0!==s;)n.push(C(s.stack.split("\n"))),s=s._parent;w(n),y(n),$.notEnumerableProp(e,"stack",b(i,n)),$.notEnumerableProp(e,"__stackCleaned__",!0)}};var oe=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():E(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,H=e,q=t;var i=Error.captureStackTrace;return ne=function(e){return B.test(e)},function(e,t){Error.stackTraceLimit+=6,i(e,t),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return H=/@/,q=t,W=!0,function(e){e.stack=(new Error).stack};var s;try{throw new Error}catch(e){s="stack"in e}return"stack"in n||!s||"number"!=typeof Error.stackTraceLimit?(q=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?E(t):t.toString()},null):(H=e,q=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(O=function(e){console.warn(e)},$.isNode&&t.stderr.isTTY?O=function(e,t){var i=t?"":"";console.warn(i+e+"\n")}:$.isNode||"string"!=typeof(new Error).stack||(O=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var re={warnings:K,longStackTraces:!1,cancellation:!1,monitoring:!1};return Q&&e.longStackTraces(),{longStackTraces:function(){return re.longStackTraces},warnings:function(){return re.warnings},cancellation:function(){return re.cancellation},monitoring:function(){return re.monitoring},propagateFromFunction:function(){return ie},boundValueFunction:function(){return p},checkForgottenReturns:_,setBounds:A,warn:v,deprecated:m,CapturedTrace:M,fireDomEvent:Y,fireGlobalEvent:Z}}}).call(t,i(141))},function(e,t,i){"use strict";e.exports=function(e,t,n){function s(e,t,i){this.promise=e,this.type=t,this.handler=i,this.called=!1,this.cancelPromise=null}function o(e){this.finallyHandler=e}function r(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function a(){return c.call(this,this.promise._target()._settledValue())}function l(e){if(!r(this,e))return d.e=e,d}function c(i){var s=this.promise,c=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?c.call(s._boundValue()):c.call(s._boundValue(),i);if(u===n)return u;if(void 0!==u){s._setReturnedNonUndefined();var p=t(u,s);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var g=new h("late cancellation observer");return s._attachExtraTrace(g),d.e=g,d}p.isPending()&&p._attachCancellationCallback(new o(this))}return p._then(a,l,void 0,this,void 0)}}}return s.isRejected()?(r(this),d.e=i,d):(r(this),i)}var u=i(142),h=e.CancellationError,d=u.errorObj,p=i(155)(n);return s.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){r(this.finallyHandler)},e.prototype._passThrough=function(e,t,i,n){return"function"!=typeof e?this.then():this._then(i,n,void 0,new s(this,t,e),void 0)},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,c,c)},e.prototype.tap=function(e){return this._passThrough(e,1,c)},e.prototype.tapCatch=function(t){var i=arguments.length;if(1===i)return this._passThrough(t,1,void 0,c);var n,s=new Array(i-1),o=0;for(n=0;n1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],u=arguments[2];l=r.isArray(c)?a(i).apply(u,c):a(i).call(u,c)}else l=a(i)();var h=n._popContext();return o.checkForgottenReturns(l,h,"Promise.try",n),n._resolveFromSyncValue(l),n},e.prototype._resolveFromSyncValue=function(e){e===r.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},function(e,t){"use strict";e.exports=function(e,t,i,n){var s=!1,o=function(e,t){this._reject(t)},r=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},a=function(e,t){0===(50397184&this._bitField)&&this._resolveCallback(t.target)},l=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){s||(s=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var c=i(o),u=new e(t);u._propagateFrom(this,1);var h=this._target();if(u._setBoundTo(c),c instanceof e){var d={promiseRejectionQueued:!1,promise:u,target:h,bindingPromise:c};h._then(t,r,void 0,u,d),c._then(a,l,void 0,u,d),u._setOnCancel(c)}else u._resolveCallback(h);return u},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=this._bitField&-2097153},e.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},e.bind=function(t,i){return e.resolve(i).bind(t)}}},function(e,t,i){"use strict";e.exports=function(e,t,n,s){var o=i(142),r=o.tryCatch,a=o.errorObj,l=e._async;e.prototype.break=e.prototype.cancel=function(){if(!s.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var i=e._cancellationParent;if(null==i||!i._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=i}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0; },e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var i=0;i0&&"function"==typeof arguments[o]&&(i=arguments[o],o<=8&&c)){var u=new e(s);u._captureStackTrace();for(var h=f[o-1],d=new h(i),p=_,g=0;g=1?r:0,new a(t,i,r,o).promise()}var c=e._getDomain,u=i(142),h=u.tryCatch,d=u.errorObj,p=e._async;u.inherits(a,t),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,i){var n=this._values,o=this.length(),a=this._preservedValues,l=this._limit;if(i<0){if(i=i*-1-1,n[i]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[i]=t,this._queue.push(i),!1;null!==a&&(a[i]=t);var c=this._promise,u=this._callback,p=c._boundValue();c._pushContext();var g=h(u).call(p,t,i,o),f=c._popContext();if(r.checkForgottenReturns(g,f,null!==a?"Promise.filter":"Promise.map",c),g===d)return this._reject(g.e),!0;var _=s(g,this._promise);if(_ instanceof e){_=_._target();var m=_._bitField;if(0===(50397184&m))return l>=1&&this._inFlight++,n[i]=_,_._proxy(this,(i+1)*-1),!1;if(0===(33554432&m))return 0!==(16777216&m)?(this._reject(_._reason()),!0):(this._cancel(),!0);g=_._value()}n[i]=g}var v=++this._totalResolved;return v>=o&&(null!==a?this._filter(n,a):this._resolve(n),!0)},a.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,i=this._values;e.length>0&&this._inFlight512){for(var s=Object.keys(i),o=0;o<256;++o)delete i[s[o]];i[" size"]=s.length-256}}return n};l=function(e){return f(e,p,s)},c=function(e){return f(e,g,o)},e.prototype.call=function(e){for(var t=arguments.length,i=new Array(Math.max(t-1,0)),s=1;s=c)return u._fulfill();var o=l(t[r++]);if(o instanceof e&&o._isDisposable()){try{o=n(o._getDisposer().tryDispose(i),t.promise)}catch(e){return a(e)}if(o instanceof e)return o._then(s,a,null,null,null)}s()}var r=0,c=t.length,u=new e(o);return s(),u}function u(e,t,i){this._data=e,this._promise=t,this._context=i}function h(e,t,i){this.constructor$(e,t,i)}function d(e){return u.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function p(e){this.length=e,this.promise=null,this[e-1]=null}var g=i(142),f=i(149).TypeError,_=i(142).inherits,m=g.errorObj,v=g.tryCatch,b={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():b},u.prototype.tryDispose=function(e){var t=this.resource(),i=this._context;void 0!==i&&i._pushContext();var n=t!==b?this.doDispose(t,e):null;return void 0!==i&&i._popContext(),this._promise._unsetDisposable(),this._data=null,n},u.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},_(h,u),h.prototype.doDispose=function(e,t){var i=this.data();return i.call(e,e,t)},p.prototype._resultCancelled=function(){for(var t=this.length,i=0;i0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(e){if("function"==typeof e)return new h(e,this,s());throw new f}}},function(e,t,i){"use strict";e.exports=function(e,t,n){function s(e){this.handle=e}function o(e){return clearTimeout(this.handle),e}function r(e){throw clearTimeout(this.handle),e}var a=i(142),l=e.TimeoutError;s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(e){return u(+this).thenReturn(e)},u=e.delay=function(i,o){var r,a;return void 0!==o?(r=e.resolve(o)._then(c,null,null,i,void 0),n.cancellation()&&o instanceof e&&r._setOnCancel(o)):(r=new e(t),a=setTimeout(function(){r._fulfill()},+i),n.cancellation()&&r._setOnCancel(new s(a)),r._captureStackTrace()),r._setAsyncGuaranteed(),r};e.prototype.delay=function(e){return u(e,this)};var h=function(e,t,i){var n;n="string"!=typeof t?t instanceof Error?t:new l("operation timed out"):new l(t),a.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=i&&i.cancel()};e.prototype.timeout=function(e,t){e=+e;var i,a,l=new s(setTimeout(function(){i.isPending()&&h(i,t,a)},e));return n.cancellation()?(a=this.then(),i=a._then(o,r,void 0,l,void 0),i._setOnCancel(l)):i=this._then(o,r,void 0,l,void 0),i}}},function(e,t,i){"use strict";e.exports=function(e,t,n,s,o,r){function a(t,i,n){for(var o=0;o=i;--n)t.push(n);for(var n=e+1;n<=3;++n)t.push(n);return t},T=function(e){return p.filledRange(e,"_arg","")},E=function(e){return p.filledRange(Math.max(e,3),"_arg","")},P=function(e){return"number"==typeof e.length?Math.max(Math.min(e.length,1024),0):0};h=function(i,n,s,o,r,a){function l(e){var t,i=T(e).join(", "),s=e>0?", ":"";return t=m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===n?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n",t.replace("{{args}}",i).replace(", ",s)}function c(){for(var e="",t=0;t=this._length){var n;if(this._isMap)n=d(this._values);else{n={};for(var s=this.length(),o=0,r=this.length();o>1},e.prototype.props=function(){return r(this)},e.props=function(e){return r(e)}}},function(e,t,i){"use strict";e.exports=function(e,t,n,s){function o(i,o){var l=n(i);if(l instanceof e)return a(l);if(i=r.asArray(i),null===i)return s("expecting an array or an iterable object but got "+r.classString(i));var c=new e(t);void 0!==o&&c._propagateFrom(o,3);for(var u=c._fulfill,h=c._reject,d=0,p=i.length;d=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseFulfilled=function(e,t){var i=new o;return i._bitField=33554432,i._settledValueField=e,this._promiseResolved(t,i)},s.prototype._promiseRejected=function(e,t){var i=new o;return i._bitField=16777216,i._settledValueField=e,this._promiseResolved(t,i)},e.settle=function(e){return n.deprecated(".settle()",".reflect()"),new s(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},function(e,t,i){"use strict";e.exports=function(e,t,n){function s(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var i=new s(e),o=i.promise();return i.setHowMany(t),i.init(),o}var r=i(142),a=i(149).RangeError,l=i(149).AggregateError,c=r.isArray,u={};r.inherits(s,t),s.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=c(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},s.prototype.init=function(){this._initialized=!0,this._init()},s.prototype.setUnwrap=function(){this._unwrap=!0},s.prototype.howMany=function(){return this._howMany},s.prototype.setHowMany=function(e){this._howMany=e},s.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},s.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},s.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},s.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new l,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},s.prototype._fulfilled=function(){return this._totalResolved},s.prototype._rejected=function(){return this._values.length-this.length()},s.prototype._addRejected=function(e){this._values.push(e)},s.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},s.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},s.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new a(t)},s.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(e,t){return o(e,t)},e.prototype.some=function(e){return o(this,e)},e._SomePromiseArray=s}},function(e,t){"use strict";e.exports=function(e,t){var i=e.map;e.prototype.filter=function(e,n){return i(this,e,n,t)},e.filter=function(e,n,s){return i(e,n,s,t)}}},function(e,t){"use strict";e.exports=function(e,t){function i(){return o(this)}function n(e,i){return s(e,i,t,t)}var s=e.reduce,o=e.all;e.prototype.each=function(e){return s(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return s(this,e,t,t)},e.each=function(e,n){return s(e,n,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=n}},function(e,t){"use strict";e.exports=function(e){function t(e){var t=new i(e),n=t.promise();return t.setHowMany(1),t.setUnwrap(),t.init(),n}var i=e._SomePromiseArray;e.any=function(e){return t(e)},e.prototype.any=function(){return t(this)}}},function(e,t,i){"use strict";var n=i(3),s=i(6).sprintf,o=i(130),r=i(179),a=(i(132),{__:o,sprintf:s,_subview:r}),l=function(){return n.extend(n.templateSettings.imports,a),a};e.exports=l},function(e,t){"use strict";e.exports=function(e){return''}},,function(e,t,i){"use strict";function n(){g.documentHeight=p.documentHeight,p.documentHeight=h.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 s(){function e(e){n(),u.trigger("DOMEventor:flatresize",p),t=!1}var t;d.on("resize.DOMEventor-nextResizeLoop",function(){t||(_(e),t=!0)})}function o(){function e(e){i--||(g.documentHeight=p.documentHeight,p.documentHeight=h.height(),i=1),g.windowScrollTop=g.windowScrollY=p.windowScrollTop,p.windowScrollTop=p.windowScrollY=d.scrollTop(),u.trigger("DOMEventor:flatscroll",p),t=!1}var t,i=0;d.on("scroll.DOMEventor-nextScrollLoop",function(){t||(_(e),t=!0)})}function r(){h.off("keydown.DOMEventor keyup.DOMEventor"),u.on("DOMEventor:startKeyboardObserver",f),u.off("DOMEventor:stopKeyboardObserver")}function a(){n(),o(),s(),f(),u.on("DOMEventor:updateRect",n)}var l=i(3),c=i(8),u=i(136),h=c(document),d=c(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 f,_=!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(e){window.setTimeout(function(){e()},50)};f=function(){var e=[],t={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"};h.on("keydown.DOMEventor keyup.DOMEventor",function(i){var n=i.type;if("keyup"===n||"keydown"===n){var s=c(i.target),o=i.which;if(!((s.is("input")||s.is("textarea")||s.is("select"))&&o>=48&&o<=90)||i.metaKey||i.ctrlKey||i.altKey){o>=48&&o<=90&&"keydown"===n&&(e[o]=1);var r="";for(var a in e)"keydown"===n&&o!==parseInt(a,10)&&(r+=t[a]?t[a]+"+":"");var l=n+":"+(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||"")+(t[o]||"");u.trigger("DOMEventor:"+l,i,l),"keyup"===n&&(e=[])}}}),u.off("DOMEventor:startKeyboardObserver"),u.on("DOMEventor:stopKeyboardObserver",r)};var m={init:l.once(a),rect:function(){return p},lastRect:function(){return g}};e.exports=m},function(e,t,i){"use strict";var n,s=i(183),o=i(129),r=i(136),a=function(){if(null==n){var e=o.get("Context/userinfo");n=!(!e||!e.name)&&new s(e),n&&(n.listenTo(r,"post:like:set",n.incrementLikeCount),n.listenTo(r,"post:unlike:set",n.decrementLikeCount),n.listenTo(r,"tumblelog:follow",n.incrementFollowingCount),n.listenTo(r,"tumblelog:unfollow",n.decrementFollowingCount))}return n};e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(184),o=i(185),r=i(189),a=s.extend({idAttribute:"name",initialize:function(e){this.channels=new r(e.channels)},incrementLikeCount:function(){var e=this.get("liked_post_count");this.set("liked_post_count",e+1)},decrementLikeCount:function(){var e=this.get("liked_post_count");e>0&&this.set("liked_post_count",e-1)},incrementFollowingCount:function(){var e=this.get("friend_count");this.set("friend_count",e+1)},decrementFollowingCount:function(){var e=this.get("friend_count");e>0&&this.set("friend_count",e-1)},getUnreadCount:function(){return this.channels.reduce(function(e,t){return parseInt(e,10)+parseInt(t.get("unread_count"),10)},0)},getChannel:function(e){return null==e&&(e=this.get("primary")),this.channels.findWhere({name:e})},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 e;return n.isEmpty(this._currentMessagingChannelUuid)&&(e=this.channels.findWhere({is_current:!0,can_send_messages:!0})||n.first(this.getChannelsEnabledForMessaging()),e&&(this._currentMessagingChannelUuid=e.get("uuid"))),this._currentMessagingChannelUuid},setCurrentMessagingChannelUuid:function(e){this._currentMessagingChannelUuid=e},toJSON:function(){var e=o.prototype.toJSON.apply(this,arguments);return e.channels=this.channels.toJSON(),e},getChannelProperty:function(e,t){var i=this.getChannel(e);if(!(i&&"get"in i))return null;var n=i.get(t);return"undefined"==typeof n?null:n}});e.exports=a},function(e,t,i){"use strict";function n(e,t){function i(e,t){var i,n;if(!s.isObject(e))throw new Error("SingletonModel requires attributes");if(i=e[d],s.isEmpty(i)&&!s.isNumber(i)&&s.defer(function(){throw new Error('SingletonModel attributes require a "'+d+'"')}),n=u[i],h[i]++||(h[i]=1),n)s.keys(e).length>=2&&n.set(e,t),n.collection!==!0&&(n.collection=!0);else{u[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,e,t),c.add(this)}return n||this}function n(){return this.id}function a(){return c}function l(){0===--h[this.id]&&(delete u[this.id],delete h[this.id],c.remove(this))}e||(e={}),t||(t={});var c=new o.Collection,u=Object.create(null),h=Object.create(null),d=e.idAttribute||r.prototype.idAttribute;return e.constructor=i,e.release=l,e.toString=n,e.toJSON=e.toJSON||r.prototype.toJSON,t.getCollection=a,r.extend(e,t)}var s=i(3),o=i(7),r=i(185);e.exports.extend=n},function(e,t,i){"use strict";var n=i(7),s=i(186),o=i(188),r=n.Model.extend({});s.applyTo(r.prototype),o.applyTo(r),e.exports=r},function(e,t,i){"use strict";var n=i(187),s=new n({before:{sync:function(e,t,i){i.withFormKey=!0}}});e.exports=s},function(e,t,i){"use strict";function n(e,t){u.each(t,function(t,i){var n=e[i];e[i]=function(){return t.apply(this,arguments),n.apply(this,arguments)}})}function s(e,t){u.each(t,function(t,i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return t.apply(this,arguments),e}})}function o(e,t){u.each(t,function(t,i){var n=e[i];e[i]=function(){var e=u.toArray(arguments);return e.unshift(u.bind(n,this)),t.apply(this,e)}})}function r(e,t){u.each(t,function(t,i){var n=i in e&&e[i];e[i]=function(){var e=u.toArray(arguments),i=n?u.bind(n,this):u.noop;return e.unshift(i),t.apply(this,e)}})}function a(e,t){u.defaults(e,t)}function l(e,t){u.extend(e,t)}function c(){this.mixins=u.filter(arguments,function(e){return e instanceof c}),this.properties=arguments[this.mixins.length]||{}}var u=i(3);c.prototype.mixins=null,c.prototype.properties=null,c.prototype.applyTo=function(e){var t=this.properties;a(e,t.defaults),l(e,t.extend),u.extend(e,u.omit(t,"before","after","around","onto","defaults","extend","applyTo")),u.invoke(this.mixins,"applyTo",e),n(e,t.before),s(e,t.after),o(e,t.around),r(e,t.onto),u.isFunction(t.applyTo)&&t.applyTo.apply(this,arguments)},c.before=n,c.after=s,c.around=o,c.onto=r,e.exports=c},function(e,t,i){"use strict";function n(e){var t=r.apply(this,arguments);return o.has(e,"mixins")&&e.mixins.forEach(function(e){e.applyTo(t.prototype)}),t}function s(e){e.extend=n}var o=i(3),r=i(7).Model.extend;e.exports.applyTo=s},function(e,t,i){"use strict";var n=i(190),s=i(191),o=n.extend({model:s});e.exports=o},function(e,t,i){"use strict";var n=i(7).Collection,s=i(186),o=i(188),n=n.extend();s.applyTo(n.prototype),o.applyTo(n),e.exports=n},function(e,t,i){"use strict";function n(e,t,i){var n=a.Deferred(),s={data:{tumblelog:e.get("name"),page_url:window.location.href}};["placement_id","pt","source","context","tlt","offset"].forEach(function(e){i.hasOwnProperty(e)&&(s.data[e]=i[e])});var o=function(){i.wait||e.set({following:t.following},i)},r=function(s,o){i.wait||e.set({following:!t.following},i),n.reject(o)},l=function(){i.wait&&e.set({following:t.following},i),n.resolve()},c=t.following?"/svc/follow":"/svc/unfollow";return a.ajax({beforeSend:o,cache:!i.force,data:s,error:r,type:"POST",success:l,url:c,withFormKey:!0}),n.promise()}function s(e,t){var i=a.Deferred(),n={};l.has(t,"is_tumblelog_popover")&&(n.is_tumblelog_popover=t.is_tumblelog_popover),l.has(t,"is_user_mention")&&(n.is_user_mention=t.is_user_mention);var s=function(e,t){i.reject(t)},o=function(t){l.has(t,"highlighted_posts")||(t={highlighted_posts:t}),e.set(t),i.resolve()};return a.ajax({cache:!t.force,data:n,error:s,type:"GET",success:o,url:p(e),withFormKey:!0}),i.promise()}function o(e,t){return c.promise(function(i,n){var s={tumblelog:e.get("name")};l.has(t,"include_member_data")&&(s.include_member_data=t.include_member_data),l.has(t,"include_activity_data")&&l.has(t,"include_member_data")&&(s.include_activity_data=t.include_activity_data),l.has(t,"include_activity_notifications")&&l.has(t,"include_member_data")&&(s.include_activity_notifications=t.include_activity_notifications);var o=function(e,t){n(t)},r=function(t){e.set(t.response),i()};a.ajax({data:s,type:"GET",error:o,success:r,url:"/svc/data/tumblelog",withFormKey:!0})})}function r(e,t){return a.ajax({cache:!t.force,data:t.data,type:"GET",url:"/svc/tumblelog_popover/"+e,withFormKey:!0})}var a=i(8),l=i(3),c=i(192),u=i(136),h=i(212),d=i(184),p=function(){function e(e){return e.has("avatar_url")&&e.has("global_theme_params")}return function(t){return e(t)?"/svc/"+t.get("name")+"/posts/highlighted":"/svc/tumblelog_popover/"+t.get("name")}}(),g=d.extend({save_following:function(e,t){t||(t={}),e||(e={}),e.following=!!e.following;var i=this;return t.force||i.get("following")!==e.following?n(i,e,t).then(l.bindKey(i,"save_following",e)):a.when(i.get("following"))},fetch_popover_data:function(e){e||(e={}),e.is_user_mention=!!e.is_user_mention,e.is_tumblelog_popover=!!e.is_tumblelog_popover;var t=this;return!e.force&&t.has("highlighted_posts")?a.when(t.get("highlighted_posts")):s(t,e).then(l.bindKey(t,"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(e){return this.save_following({following:!0},e)},_unfollow:function(e){this.save_following({following:!1},e)},requestUnfollow:function(e){var t=c.defer();return t.promise.then(l.bind(this._unfollow,this,e)).catch(l.noop),t},block:function(){return h.block({blockedTumblelog:this.id})},unblock:function(){return h.unblock({blockedTumblelog:this.id})},toggleSubscription:function(e){var t=this.get("name"),i=!!this.get("is_subscribed"),n=i?"DELETE":"POST",s={url:"/svc/blog/"+t+"/subscription",type:n,withFormKey:!0};return e&&(s.data={source:e}),c.promise(function(e,t){a.ajax(l.assign(s,{success:e,error:t}))}).then(l.bind(function(){this.set({is_subscribed:!i})},this))},defaults:null,idAttribute:"name",initialize:function(){this.bindEvents()},bindEvents:function(){var e=this.get("name");this.on("change:following",function(){if(this.previous("following")){var t=this.get("following")?"tumblelog:follow":"tumblelog:unfollow";u.trigger(t,{name:e,loggingData:e})}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 e={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:e,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(e){return e},validate:function(){return!1},destroy:function(){return this},fetch:function(){return this},save:function(){return this},url:function(){},urlRoot:function(){}},{collection:null,modelFromToken:function(e){var t,i=g.getCollection(),n=a.Deferred(),s=i.findWhere({token:e});return s?n.resolve(s):(t={data:{is_user_mention:!0}},r(e,t).then(function(t){var i=new g(t);i.set({token:e}),n.resolve(i)},function(){n.reject()})),n.promise()}});g.collection=g.getCollection(),e.exports=g},,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(130),r=i(129),a=i(213),l=i(192),c={_getCurrentTumblelog:function(){var e="",t=r.get("Context/userinfo");return t&&s.each(t.channels,function(t){t.is_current&&(e=t.name)}),e},block:function(e){e=e||{};var t={};return t.tumblelog=e.currentTumblelog||this._getCurrentTumblelog(),e.blockedTumblelog?t.blocked_tumblelog=e.blockedTumblelog:e.blockedPost&&(t.blocked_post=e.blockedPost),e.context&&(t.block_context=e.context),n.ajax({url:"/svc/block/add",type:"POST",data:t,withFormKey:!0})},unblock:function(e){e=e||{};var t={};return t.tumblelog=e.currentTumblelog||this._getCurrentTumblelog(),t.blocked_tumblelog=e.blockedTumblelog,n.ajax({url:"/svc/block/remove",type:"POST",data:t,withFormKey:!0})},confirmBlock:function(e){e=e||{};var t,i=e.currentTumblelog||this._getCurrentTumblelog(),n=l.defer();if(e.blockedTumblelog)t=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","

",e.blockedTumblelog,i,"

","");else{if(!e.blockedPost)return n.reject(),n.promise;t=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","

","

","")}return a.confirm(t,function(){n.resolve(e.blockedTumblelog?e.blockedTumblelog:e.blockedPost)},function(){n.reject()},o("Block"),o("Nevermind")),n.promise.catch(s.noop),n.promise}};e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(214),o=i(218),r=s.extend({name:"Dialog",initialize:function(e){this.dialogView=o,this.options=n.extend({},this.defaults,e)},alert:function(e,t,i){return this.dialogView.alert.call(this.dialogView,e,t,i)},confirm:function(e,t,i,n,s){return this.dialogView.confirm.call(this.dialogView,e,t,i,n,s)},dialog:function(e){return this.dialogView.dialog.call(this.dialogView,e)},isActive:function(e){return this.dialogView.isActive.call(this.dialogView,e)},close:function(e){return this.dialogView.close.call(this.dialogView,e)},getDialogEl:function(){return this.dialogView.getDialogEl.call(this.dialogView)},__:function(e){return this.dialogView.__.call(this.dialogView,e)}});e.exports=new r},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(215),r=i(129),a=(i(132),i(216)),l=i(217),c=["selector","container","rootEl","view","viewOptions","autoAppend"],u=o.extend({name:null,rootEl:null,selector:null,view:null,viewOptions:{},autoAppend:!1,defaults:{},constructor:function(e){e||(e={}),this.cid=n.uniqueId("component"),n.extend(this,n.pick(e,c));var t=n.result(this,"defaults"),i=n.extend({},t,n.pick(e,n.keys(t)));this.attributes={},this.set(i,{silent:!0}),this.changed={},(this.autoAppend||this.selector)&&this.setContainer(),this.selector||(this.selector=this.defaultSelector);var o=n.isFunction(this.viewOptions)?this.viewOptions.call(this.viewOptions,this):this.viewOptions;this.view&&this.view.prototype&&this.view.prototype instanceof s.View?this.view=new this.view(o):n.isFunction(this.view)&&(this.view=this.view.call(this,o)),this.initialize.apply(this,arguments),this.autoAppend&&this.append()},initialize:n.noop,setContainer:function(){return this.selector||(this.selector=this.defaultSelector),this.container=this.selector,this.container},getOwnData:function(){return this.data},remove:function(){n.result(this,"beforeRemove"),this.view&&n.isFunction(this.view.remove)&&this.view.remove();var e=["container","view","defaults","attributes"];return n.each(e,n.bind(function(e){this[e]&&delete this[e]},this)),this.stopListening(),this.trigger("remove"),this},append:function(){return this.view&&n.isFunction(this.view.render)&&(this.container?this.container.appendChild(this.view.render().el):this.view.render()),this.trigger("append"),this}});Object.defineProperties(u.prototype,{defaultSelector:{get:function(){return"[prima-component="+this.name+"]"},set:function(){}},container:{get:function(){return this._container},set:function(e){var t=a(e,this.rootEl);this._container=t}},data:{get:function(){return this._data||(this._data=r.get("Components/"+this.name)),this._data},set:function(e){this._data=e}}}),l.mixin.applyTo(u.prototype),e.exports=u},function(e,t,i){"use strict";function n(){}var s=i(7),o=i(188);n.extend=s.Model.extend,o.applyTo(n),e.exports=n},function(e,t,i){"use strict";function n(e){return e&&e.nodeType&&1===e.nodeType}var s=i(3);e.exports=function(e,t){if(n(e))return e;if(s.isString(e)){var i=(t||document).querySelector(e);if(n(i))return i}return!(!e||!e.jquery)&&e.get(0)}},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(187),r=s.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(e){this.set(e,!this.get(e))},_validate:n.constant(!0)},l=new o(n.extend({},a,{defaults:n.extend({},s.Events)}));e.exports={props:a,mixin:l}},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(219),r=i(136),a=i(130),l=i(220),c=o.extend({el:".ui_dialog",translations:{},defaultTemplates:{dialog:i(221),content:i(222),button:i(223)},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(e){this.options=s.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=n("body"),this._initClickLock(),this._setupKeys(),r&&!t.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(e){return!!s.isObject(e)&&this._dialog(e)},confirm:function(e,t,i,n,o){s.isString(e)&&(e={text:e});var r={callback_ok:t,callback_cancel:i,text_ok:n,text_cancel:o};e=s.extend(this.defaultDialog,r,e);var l={text:e.text,customClass:e.customClass||null,type:"confirm",visible_glass:!0,keycommand_maintain:e.keycommand_maintain||!1,templates:e.templates||null,escape_button:0,animate_in:{dialog_el:e.animate_in.dialog_el||".ui_dialog",dialog_class:e.animate_in.dialog_class||"fade-in-up"},buttons:{0:{text:e.text_cancel||a("Cancel"),close:!0,callback:s.isFunction(e.callback_cancel)?e.callback_cancel:function(){}},1:{text:e.text_ok||a("OK"),selected:!0,btn_class:"blue",close:!0,callback:s.isFunction(e.callback_ok)?e.callback_ok:function(){}}}};return this._dialog(l)},confirmPromise:function(e,t){this.confirm(t,e.resolve,e.reject)},alert:function(e,t,i){s.isString(e)&&(e={text:e});var n={callback_ok:t,text_ok:i};e=s.extend({},n,e);var o={text:e.text,customClass:e.customClass||null,type:"alert",visible_glass:!0,keycommand_maintain:e.keycommand_maintain||!1,templates:e.templates||null,escape_button:0,buttons:{0:{text:e.text_ok||a("OK"),selected:!0,btn_class:"blue",close:!0,callback:s.isFunction(e.callback_ok)?e.callback_ok:function(){}}}};return this._dialog(o)},getDialogEl:function(){return this.el},buttonClick:function(e){var t=n(e.currentTarget),i=t.data("btn-id");if(s.isUndefined(this.currentDialog.buttons[i])||t.hasClass("disabled"))return!1;var o=this.currentDialog.buttons[i],r=null;s.isFunction(o.callback)&&(r=o.callback(this)),r!==!1&&(!s.isUndefined(o.close)&&o.close||s.isUndefined(o.close))&&this.close()},isActive:function(e){return this.currentDialog!==!1&&this.currentDialog.uid===e},close:function(e){if(this.currentDialog===!1)return!1;if(s.isUndefined(e)&&(e=!1),e!==!1&&this.currentDialog.uid!==e)return!1;if(l.transition(this.$dialog_lock,s.bind(function(){this.$dialog_lock.hide(),n(".ui_dialog_pos").remove()},this)),l.animation(this.$dialog_el,s.bind(function(){n(".ui_dialog_pos").remove()},this)),this.$dialog_lock.removeClass("opaque"),this.$dialog_el.addClass("fade-out-down"),this.is_visible=!1,this.currentDialog.keycommand_maintain||r.trigger("keycommands:resume"),s.isFunction(this.currentDialog.on_close)&&this.currentDialog.on_close(),r.trigger("dialog:closed"),this.currentDialog=!1,n("html").removeClass("dialog_lock"),this.dialogQueueOrder.length>0){var t=this.dialogQueueOrder.shift(),i=this.dialogQueue[t];delete this.dialogQueue[t],this._dialog(i)}},_tab:function(e){var t=this.$el.find(".buttons .tab_frame"),i=t.filter(".focus"),n=t.index(i),s=t.length,o=!1;o=n+10&&(r.addClass("focus"),r.find("button").focus())},_formIsTabToButton:function(e,t){var i=this.$el.find(":focus");if(0===i.length)return!0;var n=this.$el.find(".buttons .tab_frame"),s=this.$el.find(":input:visible"),o=s.index(i);if(t&&o===s.length-1)return this.$el.find(":input:visible:first").focus(),e.preventDefault(),n.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 n.removeClass("focus init_focus"),!1},_select:function(e){var t=this.$el.find(".buttons .tab_frame.focus"),i=t;1===i.length&&i.find(".ui_button").click()},_formIsFocusOnButton:function(e){var t=this.$el.find(":focus");return 0!==t.length&&t.hasClass("ui_button")},_escape:function(e){if(!s.isUndefined(this.currentDialog.escape_button)){var t=this.$el.find(".btn_"+this.currentDialog.escape_button);t.length&&t.click()}},_dialog:function(e){if(s.isUndefined(e.uid)&&(e.uid=this._getUid()),this.currentDialog!==!1)return this.dialogQueueOrder.push(this.queueCounter),this.dialogQueue[this.queueCounter]=e,this.queueCounter++,e.uid;s.defaults(e,this.defaultDialog);var t=this._buildButtons(e.buttons);s.extend(e,{buttons_html:t});var i=this.templates;s.isObject(e.templates)&&(i=s.extend({},this.templates,e.templates));var o=s.isString(i.dialog)?s.template(i.dialog):i.dialog,a=s.isString(i.content)?s.template(i.content):i.content;e.content_html=a(e);var l=o(e);this.$dialog_lock.show(),s.isUndefined(e.visible_glass)?this.$dialog_lock.removeClass("opaque"):e.visible_glass&&s.defer(s.bind(function(){this.$dialog_lock.addClass("opaque")},this)),!s.isUndefined(e.scroll_lock)&&e.scroll_lock&&n("html").addClass("dialog_lock"),this.currentDialogId=e.uid,this.currentDialog=e;var c=n('
'+l+"
");return s.isString(e.customClass)&&c.addClass(e.customClass),c.appendTo(this.$body),this.setElement(c),this.is_visible=!0,this.$dialog_el=this.$el.find(e.animate_in.dialog_el),e.animate&&s.isObject(e.animate_in)&&this.$dialog_el.length&&this.$dialog_el.addClass(e.animate_in.dialog_class),this._focus(),this.currentDialog.keycommand_maintain||r.trigger("keycommands:suspend"),s.isUndefined(e.has_form)&&(e.has_form="auto"),"auto"===e.has_form&&(e.has_form=this.$el.find("form, input").length>0),s.isFunction(e.on_open)&&e.on_open(),this.el=this.$el[0],this.delegateEvents(),r.trigger("dialog:opened"),e.uid},_button:function(e,t,i,n){var o=s.isString(this.templates.button)?s.template(this.templates.button):this.templates.button,r=o({btn_class:t,text:e,btn_id:s.isUndefined(i)?"":i});return r='
'+r+"
"},_focus:function(){if(!this.currentDialog)return!1;for(var e in this.currentDialog.buttons){var t=this.currentDialog.buttons[e];if(!s.isUndefined(t.selected)&&t.selected){var i=this.$el.find(".btn_"+e);i.length>0&&i.parent().addClass("focus init_focus")}}}, _setupKeys:function(){n(document).on("keydown",s.bind(function(e){var t=e.ctrlKey||e.shiftKey||e.metaKey;if(this.is_visible&&!t){var i=e.keyCode||e.which;if(9===i&&this.currentDialog.key_tab){if(this.currentDialog.has_form&&!this._formIsTabToButton(e,!0))return;e.preventDefault(),this._tab(e)}if(13===i&&this.currentDialog.confirm_by_enter||32===i&&this.currentDialog.close_by_space){if(this.currentDialog.has_form&&32===i&&!this._formIsFocusOnButton(e))return;e.preventDefault(),this._select(e)}27===i&&this.currentDialog.key_close&&(e.preventDefault(),this._escape(e))}},this))},_buildButtons:function(e){if(!s.isObject(e))return"";var t=0;for(var i in e)e.hasOwnProperty(i)&&t++;for(var n="",o=0;o",{class:"ui_dialog_lock",css:{display:"none"}});n(document).ready(function(){e.prependTo("body")})},_getUid:function(){return this.uid++},__:function(e){return a(e)}});e.exports=new c},function(e,t,i){"use strict";function n(e,t){t||(t={}),e||(e=[]),s.each(e,function(e){s.isFunction(this[e])&&this[e].call(this,t)},this)}var s=i(3),o=i(7),r=i(188),a=["model","collection","el","id","attributes","className","tagName","events"],l=["_setup"],c=o.View.extend({constructor:function(e){this.cid=s.uniqueId("view"),e||(e={}),s.extend(this,s.pick(e,a)),this._elAttributes=this.attributes,this.attributes={},this._ensureElement(),this.setupMethods=s.union(l,this.constructor.__super__.setupMethods,this.setupMethods),n.call(this,this.setupMethods,e),this.initialize.apply(this,arguments),this.delegateEvents()},_setup:s.noop,_ensureElement:function(){if(this.el)this.setElement(s.result(this,"el"),!1);else{var e=s.extend({},s.result(this,"_elAttributes"));this.id&&(e.id=s.result(this,"id")),this.className&&(e.class=s.result(this,"className"));var t=o.$("<"+s.result(this,"tagName")+">").attr(e);this.setElement(t,!1)}}});r.applyTo(c),e.exports=c},function(e,t,i){"use strict";function n(){var e,t,i={animation:null,transition:null},n=document.createElement("div"),s={animation:"animationend",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in s)if(t in n.style){i.animation=s[t];break}var o={transition:"transitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(e in n.style){i.transition=o[e];break}return i}function s(e,t){a.animation?r(e).one(a.animation,function(e){t(e)}):setTimeout(function(e){t(e)},0)}function o(e,t){a.transition?r(e).one(a.transition,function(e){t(e)}):setTimeout(function(e){t(e)},0)}var r=i(8),a=n();e.exports={animation:s,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+='
'+(null==(__t=content_html)?"":__t)+'
'+(null==(__t=buttons_html)?"":__t)+"
";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+=''+(null==(__t=text)?"":__t)+"";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+='";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n,s=i(214),o=i(225),r=s.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()}});e.exports=function(){return n||(n=new r),n}},function(e,t,i){"use strict";var n=i(8),s=i(226),o=i(180),r=i(136),a=i(129),l=i(229),c=i(231),u=i(628),h=i(629),d=i(639),p=i(640),g=i(182),f=s.extend({defaults:{headerHeight:52,headerTop:0},events:{"click .tab_discover > a":"onClickExplore","click .login-button":"onClickLogin","click .signup-button":"onClickSignup",mouseenter:"__mouseenter",mouseleave:"__mouseleave"},initialize:function(){var e=o.bool("is_logged_in");this.logo=new u({el:'[prima-component="header-logo"]',data:a.get("Components/DesktopDashboardLogo")}),e&&(this.accountMenu=new h({el:".tab_nav_account"}),n(".tab_activity").length&&(this.activityMenu=new d({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.listenTo(r,"notificationBannerManager:update",this.onNotificationBannerChange),this.$window=n(window)},onNotificationBannerChange:function(e){var t=e.bannerHeight;this.set("headerTop",t)},enableCompose:function(){this.composeBtn=new l,this.switcher=new c},disableSticky:function(){this.$el.addClass("l-header-container--unstuck")},setTransparent:function(e){this.$el.toggleClass("l-header-container--transparent",!!e)},hide:function(){var e=this.$window.scrollTop()+this.get("headerTop"),t=e0&&e.canMessage();i?this.messaging=new p({inboxAnchorEl:t,inboxPopoverOptions:{isFixedPosition:"fixed"===this.$el.css("position")}}).render():t.length&&t.hide()},__mouseenter:function(){r.trigger("Header:mouseenter")},__mouseleave:function(){r.trigger("Header:mouseleave")}});e.exports=f},function(e,t,i){"use strict";function n(e,t,i){return s.isFunction(e)&&(e=e(t,i)),e instanceof o?e:t.$(e)}var s=i(3),o=i(8),r=i(7),a=i(192),l=i(227),c=i(228),u=i(217),h=i(219),d=h.extend({rendered:!1,disposed:!1,keepElement:!1,_setup:function(e){e||(e={});var t=s.extend({},s.result(this.constructor.__super__,"defaults"),s.result(this,"defaults"));s.extend(t,s.pick(e,s.keys(t))),this.attributes={},this.set(t),this.changed={};var i=this.render;this.render=s.bind(function(){this._beforeRender.apply(this,arguments),this.beforeRender.apply(this,arguments);var e=i.apply(this,arguments);return this.afterRender.apply(this,arguments),this._afterRender.apply(this,arguments),e},this);var n=this.remove;this.remove=s.bind(function(){if(this.disposed)return this;this._beforeRemove.apply(this,arguments),this.beforeRemove.apply(this,arguments);var e=n.apply(this,arguments);return this.afterRemove.apply(this,arguments),this._afterRemove.apply(this,arguments),e},this),this.subviews=s.extend({},this.subviews,e.subviews)},initialize:s.noop,_registerSubview:function(e){return this._subviews||(this._subviews=[]),this._subviews.push(e),e},appendSubview:function(e,t){return s.isString(t)&&(t=this.$(t)),this._registerSubview(e),e.render(),(t||this.$el).append(e.el),e},removeSubviews:function(){var e=s.flatten(this._subviews);e&&(s.invoke(e,"remove"),delete this._subviews)},renderSubviews:function(){this.subviews&&s.forEach(this.subviews,function(e,t){e instanceof r.View?this.renderSubview(e,{name:t}):e.collection?this.renderCollectionSubviews(t):this.renderSubview(t)},this)},_createDefaultContainerFunction:function(e){return s.bind(function(){return this.$('[data-subview="'+e+'[]"]')},this)},_createDefaultPrepareViewFunction:function(e){var t=this.subviews[e];return s.bind(function(i,n){var s=new t.constructor(n);return s.$el.attr("data-subview",e),i.append(s.$el),s},this)},renderCollectionSubviews:function(e){var t=this.subviews[e];if(t){var i=t.container||this._createDefaultContainerFunction(e),n=t.prepareView||this._createDefaultPrepareViewFunction(e),s=t.options||{},o=this.createCollectionSubviewRenderer(t.collection,i,n,s,e);this.rendered?o():this.once("rendered",o,this)}},renderSubview:function(e,t){var i,n,o,a;if(s.isString(e)){if(a=e,e=this.subviews[a],!e)return;i=e.container||'[data-subview="'+a+'"]',o=e.options||{},n=e.prepareView||function(t,i){if(!s.isEmpty(t)){var n=new e.constructor(i);return n.$el.attr("data-subview",a),t.replaceWith(n.$el),n}}}else e instanceof r.View&&(t||(t={}),a=t.name||"",i=t.container||'[data-subview="'+a+'"]',o=t.options||{},n=t.prepareView||function(t){return e.$el.attr("data-subview",a),t.replaceWith(e.$el),e});var l=this.createSubviewRenderer(i,n,o,a);this.rendered?l():this.once("rendered",l,this)},createSubviewRenderer:function(e,t,i,o){return s.bind(function(){if(this.el){i=i||{},s.isFunction(i)&&(i=i.call(i,this));var r=n(e,this,o);if(!s.isEmpty(r)){var a=t.call(this,r,i);o&&s.set(this,o,a),a.render(),this._registerSubview(a)}}},this)},createCollectionSubviewRenderer:function(e,t,i,o,a,l,c){var u;return s.bind(function(){if(this.el){var h=0;if(a&&(l?h=this[a].length:this[a]=[]),e===!0&&(e=this.collection),s.isFunction(e)&&(e=e(this)),e instanceof r.Collection&&(e=e.models),!s.isEmpty(e)){var d=n(t,this,a);s.isEmpty(d)||(l||(u=d,d=u.clone()),s.forEach(e,function(e,t){var n;n=s.isFunction(o)?o.call(o,this,e)||{}:s.extend({},o),n.model||(n.model=e);var r="";a&&(r=a+"["+(h+t)+"]"),c&&s.extend(n,c),this.createSubviewRenderer(d,i,n,r).call(this)},this),l||u.replaceWith(d))}}},this)},_beforeRender:s.noop,beforeRender:s.noop,render:function(){return!this.disposed&&(this.renderWithTemplate(),this)},afterRender:s.noop,_afterRender:function(){this.renderSubviews(),this.rendered=!0,this.trigger("rendered",this),this._verifySubviewsRendered()},getTemplateData:function(){var e=l(this);return this.model&&(e.model=l(this.model)),this.collection&&(e.collection={items:l(this.collection),length:this.collection.length}),e},renderWithTemplate:function(e){if(s.isUndefined(this.template))throw new Error("Template function needed.");var t;return t=s.isFunction(this.template)?this.template(e||this.getTemplateData()):this.template,this.$el.html(t),this},afterRenderSubviews:s.noop,_verifySubviewsRendered:function(){var e=s.bind(function(){this.afterRenderSubviews(),this.trigger("renderedSubviews")},this),t=s.reject(this._subviews,function(e){return e.rendered===!0||e._rendered===!0});s.isEmpty(t)?e():a.map(t,function(e){return a.promise(s.partial(function(t,i){e.once("rendered",t)},e))}).then(e)},_beforeRemove:function(){this.removeSubviews()},beforeRemove:s.noop,remove:function(){return this.keepElement?(this.undelegateEvents(),this.stopListening()):h.prototype.remove.apply(this,arguments),this},afterRemove:s.noop,_afterRemove:function(){var e=["el","$el","options","model","collection","subviews","_subviews","defaults","attributes"];s.forEach(e,s.bind(function(e){this[e]&&delete this[e]},this)),this.rendered=!1,this.disposed=!0}},{subviewWithOptions:function(e){return c.call(null,this,e)}});u.mixin.applyTo(d.prototype),e.exports=d},function(e,t,i){"use strict";function n(e){return s.isFunction(e.serialize)?e.serialize():s.isFunction(e.toJSON)?e.toJSON():void 0}var s=i(3);e.exports=n},function(e,t,i){"use strict";function n(e,t){return{constructor:e,options:function(e){var i=s.isFunction(t)?t(e):t;return s.extend(s.pick(e,e.viewOptionKeys),i)}}}var s=i(3);e.exports=n},function(e,t,i){"use strict";var n=i(219),s=i(136),o=i(230),r=n.extend({mixins:[o],el:".compose-button",events:{click:"toggleOpen"},defaults:{open:!1},loggingData:{source:"compose-button"},initialize:function(){this.on("change:open",this.onChangeOpen),this.listenTo(s,"fastCompose:init:complete",this.open),this.listenTo(s,"fastCompose:dismiss:complete",this.close)},toggleOpen:function(){this.toggle("open")},open:function(){this.set("open",!0)},close:function(){this.set("open",!1)},onChangeOpen:function(e,t){t?s.trigger("fastCompose:init",{loggingData:this.loggingData}):s.trigger("fastCompose:dismiss",{loggingData:this.loggingData})}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(187),r=i(217),a=new o(n.extend({},r.props,{defaults:n.extend({},s.Events),before:{initialize:function(){var e=n.defaults({},n.result(this,"defaults"));this.attributes={},this.set(e),this.changed={}}}}));e.exports=a},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(214),r=i(136),a=i(232),l=i(234),c=o.extend({name:"switcher",mixins:[a],keycommands:{"keydown:alt+c":"macFastCompose","keydown:z+c":"winFastCompose"},loggingData:{},initialize:function(){this.$body=n("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(e){"MacIntel"===navigator.platform&&this.initFastCompose(e)},winFastCompose:function(e){"Win32"===navigator.platform&&this.initFastCompose(e)},initFastCompose:function(e){this.suspended||this.fastCompose||(this.determineSource(e),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=n("
",{class:"glass show"}).appendTo(this.$body),s.defer(s.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(e){this.loggingData.source="fast-compose",e&&(e.originalEvent instanceof window.KeyboardEvent?this.loggingData.source="keycommand":e.loggingData&&e.loggingData.source&&(this.loggingData.source=e.loggingData.source))}});e.exports=c},function(e,t,i){"use strict";var n=i(187),s=i(136),o=i(3),r=i(233),a=new n({__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(e,t){this.listenTo(s,"DOMEventor:"+t,this.__keyFn)},__keyFn:function(e,t){!this.__keysDisabled&&r.shouldRun(t,this.__keyId)&&this[this.keycommands[t]].apply(this,arguments)},focusKeys:function(){r.focus(this.__keyId)},unfocusKeys:function(){r.unfocus(this.__keyId)},soloKeys:function(e){r.solo(this.__keyId,e)},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(e){(o.isEmpty(e)||e===this)&&r.remove(this.__keyId)}}});e.exports=a},function(e,t,i){"use strict";var n=i(215),s=i(3),o=n.extend({soloId:null,constructor:function(){this.keySets=[],this.soloBubblingWhitelist=[]},add:function(e){this.keySets.unshift(e)},remove:function(e){var t=this.getSetForId(e);t&&(this.unSolo(e),this.keySets=s.without(this.keySets,t),this.soloBubblingWhitelist=s.without(this.soloBubblingWhitelist,e))},focus:function(e){var t=this.getSetForId(e);t&&(this.keySets=s.without(this.keySets,t),this.keySets.unshift(t))},unfocus:function(e){var t=this.getSetForId(e);t&&(this.keySets=s.without(this.keySets,t),this.keySets.push(t))},solo:function(e,t){var i=this.getSetForId(e);i&&(this.soloId=e,t===!0&&this.soloBubblingWhitelist.push(e))},unSolo:function(e){this.soloId===e&&(this.soloId=null,this.soloBubblingWhitelist=s.without(this.soloBubblingWhitelist,e))},getSetForId:function(e){return this.keySets[s.findIndex(this.keySets,{id:e})]},getSetsWithKey:function(e){return s.where(this.keySets,{keys:[e]})},shouldRun:function(e,t){var i=this.getSetsWithKey(e);return this.soloId===t||!(!s.isEmpty(this.soloBubblingWhitelist)&&!s.contains(this.soloBubblingWhitelist,t))&&(!(i.length>1)||i[0].id===t)}});e.exports=new o},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(235),r=i(129),a=i(130),l=i(192),c=i(219),u=i(136),h=i(180),d=i(232),p=i(230),g=i(236),f=i(627),_=c.extend({template:f,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(e){this.loggingData=e?e.loggingData:{},s.forEach(this.get("icons"),function(e){e.label=a(e.label)}),this.$body=n("body"),this.$glass=null,this.$plexiInstance=n('.plexi[data-token="body-plexi"]'),this.resumeKeycommandsOnClose=!0},bindEvents:function(){this.listenTo(u,"DOMEventor:keydown:tab",this.disableKey),this.listenTo(u,"DOMEventor:keydown:shift+tab",this.disableKey),this.listenTo(this,"change:tabIndex",function(e,t){this.$(".selected").removeClass("selected"),this.$('[data-index="'+t+'"]').addClass("selected")})},render:function(){return this.$el.append(this.template(this.toJSON())),this.bindEvents(),this},open:function(){s.defer(s.bind(this.show,this))},show:function(){u.trigger("keycommands:suspend");var e=50;s.forEach(this.$(".tab-post-type"),function(t,i){var s=n(t),r=s.find(".post-type-icon"),a=s.find(".post-type-name");o.animate(r,{opacity:["1","0"],translateY:["0px","15px"]},{duration:150,delay:i*e}),o.animate(a,{opacity:["1","0"],translateY:["0px","-15px"]},{duration:150,delay:i*e})},this),n(".post-tab-switching").addClass("finish-animating")},enterCreate:function(e){var t=this.$(".selected");if(t.length){var i=t.attr("data-post-type");this.createNew(i),this.close()}},clickCreate:function(e){this.createNew(n(e.currentTarget).data("postType"))},disableKey:function(e){e.preventDefault()},mouseoverIcon:function(e){this.$(".selected").removeClass("selected"),this.set("tabIndex",n(e.currentTarget).data("index"))},nextIcon:function(e){var t=this.get("tabIndex")+1;t>=this.get("icons").length&&(t=0),this.set("tabIndex",t)},previousIcon:function(e){var t=this.get("tabIndex")-1;t<0&&(t=this.get("icons").length-1),this.set("tabIndex",t)},createNew:function(e){this.resumeKeycommandsOnClose=!1,r.has("Components/PostFormBuilder")?u.trigger("postForms:open",{updateURL:!1,postFormType:g.containerType("modal"),postType:e,fastCompose:!0,loggingData:this.loggingData}):u.trigger("fastCompose:create",{type:e,loggingData:this.loggingData})},close:function(){var e=50,t=this.$(".tab-post-type"),i=Math.floor(.5*(t.length-1));l.all(s.map(t,function(t,s){var r=n(t),a=Math.floor(Math.abs(s-i))*e;return o.animate(r,{opacity:["0","1"],translateY:["-500px","0px"]},{duration:150,delay:a})},this)).then(function(){u.trigger("fastCompose:close:complete")})},teardown:function(){return this.resumeKeycommandsOnClose&&u.trigger("keycommands:resume"),this.remove()}});e.exports=h.bool("is_logged_in")?_:s.noop},,function(e,t,i){"use strict";var n=(i(237),i(3)),s=i(8),o=i(192),r=i(238),a=i(240),l=i(214),c=i(136),u=i(181),h=(i(132),i(7)),d=(i(241),i(242)),p=i(243),g=i(246),f="/dashboard",_=i(130),m=s("body"),v=i(247),b=i(213),y=i(182),w=i(251),C=i(353),k=i(618),x=i(619),S=i(621),T=i(626),E=l.extend({name:"PostFormBuilder",initialize:function(){var e=this.data;if(this.user=y(),this.user){c.trigger("postForms:initializing"),v(n.bind(function(e){this.PostFormComponent=e},this));var t={baseRoute:null,currentChannel:null,supportImageSearch:!1,minFullWidthSize:300,redirectTo:!1,reblogActionContext:!1,updateURL:!0};n.extend(this,t,n.pick(e,n.keys(t))),this._addGlobalEventListeners(),this.user.set(e.limits),this.user.set(e.dashboardSettings),this.user.set("language",e.language||"en_US"),C.setEmbedRegexes(e.embedRegexes),this.glassView=new k,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(n.extend({$postButtonsContainer:this.postButtonsContainer.$el},e)),this.legacyEvents(),this._updateData=n.once(this.updateData),this.render()}},updateData:function(){var e=s.ajax({url:"/svc/post/get_post_form_builder_data",type:"POST",withFormKey:!0,data:{}});return e.then(n.bind(function(e){var t=e.response;return n.forEach(t.channels,function(e){var t=!!e.name&&this.user.getChannel(e.name);t&&t.set(n.omit(e,"name"))},this),this.user.set(t.limits),t},this))},legacyEvents:function e(){var e={"postForms:closed":["post:form:hide","keycommands:resume"],"postForms:saved":["post:form:success"],"postForms:opened":["post:form:show","keycommands:suspend"]};n.forEach(e,function(e,t){this.listenTo(c,t,function(){var t=n.toArray(arguments);n.each(e,function(e){c.trigger.apply(c,[].concat(e,t))},this)})},this)},_addGlobalEventListeners:function(){this.listenTo(c,"postForms:open",this.fetchAndCreatePostFormComponent),this.listenTo(c,"postForms:new",this._createPostFormNew),this.listenTo(c,"postForms:edit",this._createPostFormEdit),this.listenTo(c,"postForms:reblog",this._createPostFormReblog),this.listenTo(c,"postForms:saved",this.destroyPostForm),this._registerDismissListener(),this.listenTo(c,"postForms:dismissListener:suspend",function(){this._toggleDismissListener(!1)}),this.listenTo(c,"postForms:dismissListener:resume",function(){this._toggleDismissListener(!0)})},_toggleDismissListener:function(e){this.stopListening(c,"postForms:close"),e&&this._registerDismissListener()},_registerDismissListener:function(){this.listenTo(c,"postForms:close",this.dismissPostForm)},createInlineContainer:function(e){return!!e&&new S({el:e.parent(),originalContent:e,transitionBackground:!0})},fetchAndCreatePostFormComponent:function(e){n.isEmpty(this.PostFormComponent)?v(n.bind(function(t){this.PostFormComponent=t,this._createPostForm(e)},this)):this._createPostForm(e)},_createPostFormNew:function(e){this.fetchAndCreatePostFormComponent(e)},_createPostFormEdit:function(e){e.postEl&&(e.containerView=this.createInlineContainer(e.postEl),e.postFormType=g.inline),this.fetchAndCreatePostFormComponent(e);var t=new RegExp(/\/blog\/\w+\/review/);if(this.baseRoute&&this.baseRoute.match(t)){var i={loggingData:{post_id:e.editId,blog_name:e.channelId,page:"EditPost"}};c.trigger("Kraken:EditPost",i)}},_createPostFormReblog:function(e){this.fetchAndCreatePostFormComponent(e)},_createPostForm:function(e){if(this.postForm)return this.destroyPostForm(e).then(n.bind(function(){return this._createPostForm(e)},this));c.trigger("postForms:opening"),e=n.extend({fastCompose:!1,supportImageSearch:this.supportImageSearch,minFullWidthSize:this.minFullWidthSize,updateURL:this.updateURL,glass:!0,postFormType:g.modal},e),n.defaults(e,{containerView:e.postFormType===g.inline?this.postButtonsContainer:null}),this.glass=e.glass,e.post||(e.post=this._createPostModel(e)),e.url||(e.url=this._postFormUrl(e.post)),e.containerView===this.postButtonsContainer&&this.postButtons.setPostType(e.post.get("type")),this._updateData();var t=e.postFormType===g.modal,i=["supportImageSearch","minFullWidthSize","post"];"photo"===e.post.get("type")&&i.push("showPhotoBooth");var a=this.postForm=new this.PostFormComponent(n.extend(n.pick(e,i),{isModal:t,popoverContainer:t?this.modal.$el:m,redirectTo:this.redirectTo,reblogActionContext:this.reblogActionContext,fastCompose:e.fastCompose})),l=this.postFormContainer=e.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=n.once(n.bind(function(){return e.glass?this.glassView.show():o.resolve()},this)),p=r([function(){return c.trigger("Header:hide"),o.join(l.prepare(d),a.whenRendered(!0))},function(){return a.disable(),l.attach(d)},function(){return e.updateURL&&h.history.navigate(e.url,{replace:!0}),function(){var e=u.rect(),i=e.windowScrollTop,o=e.windowHeight,r=a.getRect(),h=r.offsetHeight,d=l.$el.offset().top,p=d+h,g=20,f=s("[prima-component=header]").height()||0,_=h+2*gh&&(m=i),this.previousScrollPosition=!t&&i,this.scrollHelper.scrollToPosition(m,v,b),this.listenTo(c,"Photoset:dragScroll",function(e,t){n.isNumber(t)||(t=50);var i=u.rect().windowScrollTop+e;this.scrollHelper.scrollToPosition(i,t,b)}),this.listenTo(c,"Photoset:scrollToRow",function(e,t,i){n.isNumber(i)||(i=50),e+=0,this.scrollHelper.checkScrollBounds(!1,{keepInside:!0,contentPadding:70,contentRect:{offsetTop:e,offsetHeight:t}})})}.call(this),l.showPostForm(d)},function(){return d()},function(){a.enable()}],this).then(n.bind(function(){return c.trigger("postForms:opened"),m.addClass("postforms-open"),a},this),n.bind(function(){this.destroyPostForm()},this));return e.postFormType===g.inline&&p.then(n.bind(function(){this.scrollHelper.start({el:l.$el})},this)),p.catch(function(e){e instanceof Error&&n.defer(function(){throw e})}),p},_postFormStateChanged:function(e){if(this.postForm){var t=this.postForm.initialPostState,i=this.postForm.post;return i.deepHasChanged(t)}return!1},dismissPostForm:function(){this.postForm&&!this.postForm.isEnabled()||(this._postFormStateChanged()?this._buildDismissPrompt():this.destroyPostForm())},_buildDismissPrompt:function(){var e=_("Discard this post?");this.postForm&&this.postForm.post&&"edit"===this.postForm.post.get("mode")&&(e=_("Discard edits to this post?"));var t={text:e,text_ok:_("Discard"),text_cancel:_("Nevermind"),keycommand_maintain:!0};b.confirm(t,n.bind(function(){this.destroyPostForm(),c.trigger("postForms:dismissListener:resume")},this),function(){n.defer(function(){c.trigger("postForms:dismissListener:resume")})}),c.trigger("postForms:dismissListener:suspend")},destroyPostForm:function(e,t){e=n.extend({updateURL:this.updateURL,url:this.baseRoute,glass:this.glass},e),this.scrollHelper.stop();var i=this.postForm,s=this.postFormContainer,a=!!i.fastCompose;this.postForm=null,this.postFormContainer=null,this.stopListening(i),this.stopListening(c,"Photoset:dragScroll");var l=n.once(n.bind(function(){return e.glass?this.glassView.hide():o.resolve()},this)),u=i&&!!i.postForm.get("saved"),d=i&&i.post&&i.post.get("state"),p={didSave:u,newState:u?d:null};c.trigger("postForms:closing",p);var g=r([function(){u&&this.saveHook.preExecute(t)},function(){i&&i.disable()},function(){if(function(){if(this.previousScrollPosition!==!1){var e=this.previousScrollPosition,t=400;this.scrollHelper.scrollToPosition(e,t)}}.call(this),s)return s.hidePostForm(l).then(function(){s.teardown()})},function(){if(i&&i.remove(),e.updateURL){var t=h.history.root||"",n=e.url?e.url.replace(new RegExp("^"+t),""):"";h.history.navigate(n,{replace:!0})}},function(){return l()},function(){u&&t&&(this.saveHook.$inlinePostEl=s.$el,this.saveHook.execute(t,{fastCompose:a}))}],this).then(function(){return c.trigger("postForms:closed",p),c.trigger("Header:show"),m.removeClass("postforms-open"),i});return g.catch(function(e){e instanceof Error&&n.defer(function(){throw e})}),g},pauseScrollHelper:function(){this.scrollHelper&&this.scrollHelper.pause()},resumeScrollHelper:function(){this.scrollHelper&&this.scrollHelper.resume()},_createPostModel:function(e){"string"==typeof e&&(e={postType:e});var t=n.extend({tumblelog:e.channelId||this.currentChannel||this.user.getChannel().get("name"),editorType:this.user.get("defaultEditorType"),contextData:{baseRoute:this.baseRoute,contextPage:e.contextPage}},n.pick(e,"tags","sourceUrl","loggingData"));return e.reblogId?n.defaults(t,{lookupData:{reblog_id:e.reblogId,reblog_key:e.reblogKey,reblog_blog_name:e.reblogBlogName||"",carousel_index:e.carousel_index},mode:"reblog",pt:e.pt,reblogSource:e.reblogSource}):e.editId?n.defaults(t,{lookupData:{post_id:e.editId,channel_id:e.channelId||this.redirectChannel},mode:"edit"}):n.defaults(t,{type:e.postType||e.type||"text",mode:"new"}),new w(t)},_postFormUrl:function(e){if(e){if(e.has("lookupData")){var t=e.get("lookupData");return t.reblog_id?this._reblogPostUrl(t.reblog_id,t.reblog_key):t.post_id?this._editPostUrl(t.post_id):this._newPostUrl(e.get("type"))}return e.has("reblog_id")?this._reblogPostUrl(e.get("reblog_id"),e.get("reblog_key")):e.has("id")?this._editPostUrl(e.get("id")):this._newPostUrl(e.get("type"))}return this._newPostUrl("text")},_newPostUrl:function(e){var t=this.baseRoute!==f?this.baseRoute:"";return t+"/new/"+e},_editPostUrl:function(e){return"/edit/"+e},_reblogPostUrl:function(e,t){return"/reblog/"+e+"/"+t},render:function(){return this.glassView.render().$el.appendTo("body"),this.modal.render().$el.appendTo("body"),this},updateBaseRoute:function(e){var t;e?this.baseRoute=e:(t=h&&h.history?h.history.location.pathname:f,this.baseRoute=t)}},{containerType:function(e){return g[e]}});a.applyTo(E.prototype),e.exports=E},function(e,t,i){"use strict";function n(e,t){t=t||"Exposer";var i=window;s.each(e,function(e,n){if(s.has(i,n))throw new Error('"'+n+'" already exists');o.log(t,"%s.%s",i,n),s.set(i,n,e)})}var s=i(3),o=i(132);e.exports=n},function(e,t,i){"use strict";var n=i(3),s=i(239),o=function(e,t){e=n.map(e,function(e){return n.bind(e,this)},t||this);var i=Array.prototype.slice.call(arguments,1);return i[0]=e,s.apply(null,i)};e.exports=o},function(e,t,i){var n;/** @license MIT License (c) copyright 2011-2013 original author or authors */ !function(s){n=function(e){var t=i(192),n=t.Promise.all,s=Array.prototype.slice;return function(e){function i(e){return o.push(e),o}var o=[];return n(s.call(arguments,1)).then(function(n){return t.reduce(e,function(e,s){return t(s.apply(void 0,n),i)},o)})}}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))}(i(196))},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(187),r=new o({defaults:{whenEvent:function(e,t){return 1===arguments.length&&(t=e,e=this),s.promise(n.bind(function(i,n){this.listenToOnce(e,t,function(){i.call(null,arguments)})},this))}}});e.exports=r},function(e,t){"use strict";var i=1,n=function(e){return e*i};n.get=function(){return i},n.set=function(e){i=e},e.exports=n},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(235).animate,r=i(241),a=i(215),l=i(7),c=i(181),u=i(136),h=i(132),d=s("html"),p=a.extend({defaults:{keepInside:!1,scrollSpeedMs:250,triggerPadding:-50,contentPadding:20,debounceMs:200},start:function(e){return this._running&&this.stop(),this._running=!0,e&&!n.isPlainObject(e)&&(e={el:e}),this.options=e=n.extend({},this.defaults,e),this.$el=s(e.el),this.updateContentRect(),this.listenTo(u,"DOMEventor:flatscroll",this.checkScrollBounds),this},stop:function(){return this._running=!1,this._scrollTop=!1,this._ignoreScroll=!0,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 e=this.$el.offset();return this.contentRect.offsetTop=e.top,this.contentRect.offsetLeft=e.left,this.contentRect.offsetHeight=this.$el.outerHeight(),this.contentRect.offsetWidth=this.$el.outerWidth(),this.lastContentRect||(this.lastContentRect=n.clone(this.contentRect)),this.contentRect},calculateScrollTop:function(e,t,i,n){return n?e:t-i},checkScrollBounds:function(e,t){if(!this._ignoreScroll){t=t?n.extend({},this.defaults,this.options,t):this.options,e||(e=c.rect());var i,s,o=t.contentRect||this.updateContentRect(),r=t.triggerPadding||0,a=t.contentPadding||0,l=o.offsetHeight,u=o.offsetTop,h=u+l,d=e.windowHeight,p=Math.max(0,e.windowScrollTop),g=p+d;return t.keepInside?(i=p-u,s=h-g):(i=p-h,s=u-g),s>r?(this._scrollTop=this.calculateScrollTop(u-a,h+a,d,l+2*a>d),this.enforceScrollBounds(t),!0):i>r?(this._scrollTop=this.calculateScrollTop(u-a,h+a,d,t.bottom||l+2*a=o?o:n.find(s,function(t){return t>=e})},l=function(e,t){var i=function(t){return t=null==t?r:a(t),(e||"").replace(/^(.*_)?(\d+)(\D.*)?$/,"$1"+t+"$3")};return i.toString=function(){return this()},null!=t?i(t):i};e.exports=l},function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=i(3),o=i(185),r=i(237),a=i(252),l=i(253),c=i(255),u=i(263),h=i(264),d=i(267),p=i(268),g=i(269),f=i(271),_=i(272),m=i(254),v=i(265),b=i(266),y=i(129),w=o.extend({mixins:[a],typeDelegateMap:{text:l,photo:c,quote:u,link:h,chat:d,audio:p,video:g,note:f},_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:{carouselDisplay:!1,postDate:String(),customUrl:String(),sourceUrl: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,enableCTA:!1,tspSkipLightbox:!0,ctaTextCode:"0",enableRedirectUrls:!1,redirectUrlPrimary:String(),redirectUrlIOS:String(),redirectUrlAndroid:String()},shortUrlLength:29,typeAttributes:{},editorField:!1,resetPreserveFields:[],resetAttributes:[],allowAnswerFields:[],_syntheticAttributes:{pseudoState:function(){var e=this.get("state"),t=this.get("publish_on");return"published"===e&&1===parseInt(this.get("is_private"),10)&&(e="private"),"queued"===e?s.isEmpty(t)?"queued":"scheduled":e},formattedSourceUrl:function(){var e,t=this.get("sourceUrl");return s.isEmpty(t)?"":(e=v.addProtocolIfMissing(t,"https:"),b.isUrl(e)?e:t)},formattedRedirectUrlPrimary:function(){var e,t=this.get("redirectUrlPrimary");return s.isEmpty(t)?"":(e=v.addProtocolIfMissing(t,"https:"),b.isUrl(e)?e:t)}},initialize:function(e,t){s.has(e,"tags")||this.set("tags",[]),this._assignPostTypeFunctionality()},_assignPostTypeFunctionality:function(){var e=this.get("type"),t=s.bind(function(e){return e in this.typeDelegateMap&&this.typeDelegateMap[e].prototype},this);e?(this.delegateObject(t(e)),this.afterDelegate()):this.listenToOnce(this,"change:type",function(e,i){this.delegateObject(t(i)),this.afterDelegate()})},afterDelegate:function(){s.defaults(this.attributes,this.typeAttributes)},_normalizeType:function(e,t){var i={regular:"text",conversation:"chat"};return t===!1&&(i=s.invert(i)),e in i?i[e]:e},get:function(e){return(this._syntheticAttributes[e]||o.prototype.get).apply(this,arguments)},getHtmlStripped:function(e,t,i){return"undefined"!=typeof t||(t=!0),"undefined"!=typeof i||(i=" "),s.trim(m.stripHtml(this.get(e)||"",t,i))},fetch:function(e){var t={data:e};return o.prototype.fetch.call(this,t)},parse:function(e,t){if(t.parse===!1)return this.attributes;var i=e.post,n=t.data,o={},r=i.id?"edit":"reblog";o.type=this._normalizeType(i.type,!0),o.can_reblog_as=s.map(i.can_reblog_as,s.bind(function(e){return this._normalizeType(e,!0)},this)),this.set("type",o.type),s.forEach(this.genericFieldMap,function(e,t){o[e]=i[t]});var a=["one","two","three","state","publish_on","tags","type","can_reblog_as"];return s.extend(o,s.omit(i,a),{createdPost:!!e.created_post,postTumblelog:e.post_tumblelog||{},postContextPage:e.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&&s.extend(o,s.pick(n,["reblog_id","reblog_key"])),"state"in i&&(o.state=this._extractState(i)),i.from_app&&1===s.parseInt(i.format)||(o.editorType=this._FORMAT_CODE_TO_EDITOR_TYPE[s.parseInt(i.format||0)]),o.editorType||(o.editorType=this.get("editorType")||this._FORMAT_CODE_TO_EDITOR_TYPE[0]),s.has(i,"custom_tweet")&&(o.customTweet=i.custom_tweet),s.extend(o,{sourceUrl:o.source_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},s.mapValues(s.pick(o,["html_mode","members_only","carousel_display","owner_flagged_nsfw"]),_)),s.has(i,"ads_cta_text_code")&&null!==i.ads_cta_text_code&&(o.enableCTA=!0,o.ctaTextCode=i.ads_cta_text_code||"0"),s.has(i,"redirect_url_primary")&&null!==i.redirect_url_primary&&(o.enableRedirectUrls=!0,o.redirectUrlPrimary=i.redirect_url_primary||"",o.redirectUrlIOS=i.redirect_url_ios||"",o.redirectUrlAndroid=i.redirect_url_android||""),"edit"!==r||"queued"!==o.state||s.isEmpty(i.publish_on)||(o.state="scheduled",o.publish_on=i.publish_on),this.parseForType(o,i)},parseForType:function(e,t){return e},sync:function(e,t,i){var n={create:"/svc/post/update",read:"/svc/post/fetch",update:"/svc/post/update"};return s.defaults(i||(i={}),{emulateHTTP:!0,forServer:!0,url:n[e]}),i.parse="read"===e,o.prototype.sync.call(this,e,t,i)},toJSON:function(e){return e=s.defaults(e||{},{forServer:!1}),e.forServer?this.serializeForServer(e):o.prototype.toJSON.call(this,e)},serializeForServer:function(){var e=this,t=e.attributes,i={channel_id:t.tumblelog,post_id:t["post-id"],"post[date]":t.postDate,"post[one]":this.getAttributeFromGeneric("one"),"post[publish_on]":t.publish_on,"post[slug]":t.customUrl,"post[tags]":t.tags.join(),"post[two]":this.getAttributeFromGeneric("two"),"post[three]":this.getAttributeFromGeneric("three"),thumbnail:this.getAttributeFromGeneric("thumbnail"),editor_type:t.editorType,send_to_twitter:t.send_to_twitter,custom_tweet:t.customTweet,loggingData:t.loggingData,carousel_display:t.carouselDisplay,members_only:t.members_only,owner_flagged_nsfw:t.owner_flagged_nsfw,content_stats:t.contentStats,carousel_index:t.carousel_index,can_be_liked:t.canBeLiked,can_be_reblogged:t.canBeReblogged,enable_cta:t.enableCTA,tsp_skip_lightbox:t.tspSkipLightbox,cta_text_code:t.ctaTextCode,enable_redirect_urls:t.enableRedirectUrls,redirect_url_primary:e.get("formattedRedirectUrlPrimary"),redirect_url_ios:t.redirectUrlIOS,redirect_url_android:t.redirectUrlAndroid};"edit"===t.mode&&(i.edit_post_id=t["post-id"]),i["post[source_url]"]=e.get("formattedSourceUrl"),i["post[state]"]=e._VALID_STATES[t.state],i["post[type]"]=this._normalizeType(t.type,!1);var n={reblog:t.is_reblog,reblog_key:t.reblog_key,reblog_post_id:t.reblog_id,pt:t.pt||window.name,remove_reblog_tree:t.remove_reblog_tree,reblog_source:t.reblogSource};s.extend(i,s.pick(n,function(e){return!s.isUndefined(e)})),this.getAttributeFromGeneric("thumbnail")&&(i.thumbnail_pre_upload="1");var o=this.getContextPage();return s.extend(i,{context_id:t.tumblelog,context_page:o,context_bundle:y.get("Context/name"),"is_rich_text[one]":"0","is_rich_text[two]":"0","is_rich_text[three]":"0"}),this.editorField&&(i["is_rich_text["+this.editorField+"]"]="1"),t.reblogActionContext&&(i.reblog_source=t.reblogActionContext),t.shareData&&s.isObject(t.shareData)&&(t.shareData.canonicalUrl=i["post[source_url]"],i.share_data=t.shareData),i},validate:function(e,t){var i="errors"in t?t.errors:[];if(e.state&&(s.has(this._VALID_STATES,e.state)||i.push('Invalid "state" value')),e.hasLoadingInlineImages&&i.push("There are still pending images."),s.each(this.defaults,function(t,s){("undefined"==typeof t?"undefined":n(t))!==n(e[s])&&i.push('Invalid "'+s+'" type. Expected '+("undefined"==typeof t?"undefined":n(t))+", got "+n(e[s])+".")}),i.length)return i},_extractState:function(e){var t=this._STATE_CODE_TO_TEXT[e.state];return 1===parseInt(e.is_private,10)&&(t="private"),t},findBlogChannelByName:function(e){if(this.attributes.tumblelog&&this.attributes.tumblelog.collection&&"findWhere"in this.attributes.tumblelog.collection)return this.attributes.tumblelog.collection.findWhere({name_or_id:e})},getPreservedData:function(){return this.resetPreserveFields.some(s.bind(function(e){return this.get(e)&&this.get(e).length>0},this))},softReset:function(){s.forEach(this.resetAttributes,function(e){s.has(this.typeAttributes,e)?this.set(e,this.typeAttributes[e]):s.has(this.defaults,e)?this.set(e,this.defaults[e]):this.unset(e)},this)},getLookupData:function(){if("reblog"===this.get("mode"))return{reblog_id:this.get("reblog_id"),reblog_key:this.get("reblog_key"),post_type:this.get("type")}},getContextPage:function(){var e=this.attributes,t="dashboard";return e.contextData&&(e.contextData.contextPage?t=e.contextData.contextPage:"baseRoute"in e.contextData&&(t=e.contextData.baseRoute.split("/").pop())),t},getAttributeFromGeneric:function(e){return this.get(this.genericFieldMap[e])},getTweetText:function(){var e=this.get("customTweet");return s.isString(e)||(e=this.generateTweetText(280-this.shortUrlLength-1),e?e+=" [URL]":e="[URL]"),e},getTweetTextLength:function(e){s.isString(e)||(e=this.getTweetText()),e=s.trim(e).replace(/([^\s])\[URL\]/gi,"$1 [URL]").replace(/\[URL\]([^\s])/gi,"[URL] $1");var t=e.length;return t+=(this.shortUrlLength-5)*(e.match(/\[URL\]/gi)||"").length},generateTweetText:function(e){return""},canEditMedia:function(){return!this.get("is_reblog")},isReblog:function(){return!!this.get("is_reblog")},allowsTypeSwitch:function(e){return!1},canPreview:function(){return this.isValid()},deepHasChanged:function(e){var t=this.toJSON(),i=this.get("mode"),n=s.keys(e),o=s.keys(t);if(s.isEqual(e,t))return!1;if("new"!==i)return!0;var r=s.difference(o,n),a=s.reduce(r,function(e,i){var n=t[i],o=s.isUndefined(n)||s.isNull(n)?0:n.length;return e+o},0);return a>0||(e=s.omit(e,r),t=s.omit(t,r),!s.isEqual(e,t))}});r({"Tumblr.Prima.PostForms.Post":w}),e.exports=w},function(e,t,i){"use strict";var n=i(3),s=i(187),o=new s({delegateObject:function(e){var t={},i={};e&&(n.each(e,function(e,n){"undefined"!=typeof e&&("function"==typeof e?t[n]=e:i[n]=e)},this),s.onto(this,t),n.extend(this,i))}});e.exports=o},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(6).sprintf,r=i(254).truncateLongStrings;n.prototype.genericFieldMap={one:"title",two:"body"},n.prototype.editorField="two",n.prototype.typeAttributes={title:"",body:""},n.prototype.allowAnswerFields=["title","body"],n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("title"),n=this.getHtmlStripped("body");n=n.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var s;return s=i&&n?o("%s - %s",i,n):i||n||"",r(s,t)},n.prototype.validate=function(e,t,i){var n=[],o=!s.isUndefined(t.reblog_tree)&&t.reblog_tree!==!1&&""!==t.reblog_tree;return(!t.body||t.body.length<1)&&(!t.title||t.title.length<1)&&(o||n.push("Post body empty.")),e.call(this,t,{errors:n})},e.exports=n},function(e,t,i){"use strict";var n=i(3),s={normalizeSpace:function(e){return e.trim().replace(" "," ").replace(/\s\s+/," ")},stripScripts:function(e){return e.replace(new RegExp("]*>([\\S\\s]*?)","img"),"")},stripTags:function(e){return e.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")},truncateLongStrings:function(e,t,i){return n.isString(e)||(e=""),i||(i="…"),e.length<=t?e:n.trunc(e,t-i.length,i)},stripHtml:function(e,t,i){if(!e)return"";"undefined"==typeof t&&(t=!0);var s=e;"string"==typeof i&&(s=n.trim(s.replace(/()/gi,"$1"+i).replace(/(<\/(?:p|figure|h[1-6])\s*>)/gi,"$1"+i)));try{var o=document.implementation.createHTMLDocument("");o.body.innerHTML=this.stripScripts(s),s=o.body.textContent||o.body.innerText||"",s=s.trim()}catch(e){s=this.stripScripts(this.stripTags(s)).trim()}return t&&(s=this.normalizeSpace(s)),s}};e.exports=s},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(256),r=i(254).truncateLongStrings;n.prototype.genericFieldMap={two:"caption",three:"linkthrough"},n.prototype.editorField="two",n.prototype.typeAttributes={caption:"",layout:"",linkthrough:"",photos:[]},n.prototype.allowAnswerFields=["caption"],n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),r(i,t)},n.prototype.MAX_IMAGES=10,n.prototype.resetPreserveFields=["caption","tags"],n.prototype.afterDelegate=function(e){e.apply(this,s.rest(arguments)),this.photos=new o(this.attributes.photos,{parse:!0}),this.on("change:photos",function(e,t){this.photos.reset(t,{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")})},n.prototype.parseForType=function(e,t,i){return t.layout=i.photoset_layout,delete t.photoset_layout,t},n.prototype.serializeForServer=function(e){var t=this,i=e.apply(this,s.rest(arguments));return s.forEach(this.photos.toJSON(),function(e){i["images["+e.id+"]"]=e.uploadUrl,i["caption["+e.id+"]"]=(e.caption||"").substr(0,200),i["photo_redirect_url_primary["+e.id+"]"]=e.primaryUrl||"",i["photo_redirect_url_ios["+e.id+"]"]=e.iosUrl||"",i["photo_redirect_url_android["+e.id+"]"]=e.androidUrl||"",e.photoRaw&&(i.photo_raw=e.photoRaw,i.is_selfie_gif=e.isSelfieGif,i.is_selfie=e.isSelfie)}),i["post[carousel_display]"]=t.get("carouselDisplay"),i["post[redirect_url_primary]"]=t.get("redirectUrlPrimary"),i["post[photoset_layout]"]=t.get("layout"),i["post[photoset_order]"]=this.photos.pluck("id").join(","),i},n.prototype.canAddPhotos=function(e){return this.photos.length");t.attr("src",e.objectUrl||e.base64),a.load(e.objectUrl||e.base64).then(n.bind(function(i){var n=c.drawScaledAndRotated(t,i.width,i.height,e.rotation,e.mirrored,u);return this.readUrl(n.toDataURL(e.file.type),"photo:readFile")},this))},this),n.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(e){return o(e,0)},toJSON:function(){var e=r.prototype.toJSON.apply(this,arguments);return e.displayUrl=this.getDisplayUrl(),e.uploadUrl=this.getUploadUrl(),e}});e.exports=h},function(e,t,i){"use strict";var n=i(3),s=function e(t,i){return null==i?i=5:n.isNumber(i)||(i=0),n.transform(t,function(t,s,o){i&&n.isObject(s)&&(s=e(s,i-1)),t[n.camelCase(o)]=s})};e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(215),r=o.extend({constructor:function(e){null!=e&&this.load(e)},load:function(e,t){if(this.src=e,!e)return s.reject("No URL to load");var i=this,o=s.promise(function(s,o){var r=new Image;r.src=e,i._img=r;var a;if(r.onload=function(){s(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(t){var l=function(){return!(!r.naturalWidth&&!r.naturalHeight)&&("function"==typeof r.onload&&r.onload(),!0)};l()||(n.isNumber(t)||(t=100),a=setInterval(l,t))}});return this.promise=o=o.then(n.bind(this._onLoad,this),n.bind(this._onError,this)),o},_onLoad:function(e){return this._img===e?(this.width=e.naturalWidth,this.height=e.naturalHeight,this.src=e.src,this.loaded=!0,s.resolve({width:this.width,height:this.height,src:this.src})):this.promise},_onError:function(e){return this._img===e?(this.width=null,this.height=null,this.src=e.src,this.loaded=!1,s.reject(this.src+" failed to load")):this.promise}},{load:function(e,t){var i=new r(e,t);return i.promise}});e.exports=r},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1])||arguments[1];if(this.file=e,!e)return r.reject("No file to read");if(!l)return r.reject("FileReader is not supported");e.type.match(/image\/(jpg|jpeg)/i)||(i=!1);var n=void 0;return n=i&&"readAsBinaryString"in FileReader.prototype?this.readBinaryString(e).then(function(i){try{var n=new a.JpegFile(i.binary,e.name);i.rotation=function(e){switch(e){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}}(n.tiff.Orientation.value),i.mirrored=function(e){switch(e){case 2:return!0;case 4:return!0;case 5:return!0;case 7:return!0;default:return!1}}(n.tiff.Orientation.value)}catch(e){}return t.readDataUrl(e).then(function(e){return o.extend(i,e)})}):this.readDataUrl(e),this.promise=n,n}},{key:"readDataUrl",value:function(e){var t=new FileReader;return"readAsDataURL"in t?r.promise(function(i,n){t.onload=function(e){var n=e.target.result;i(n),t.onload=null,t.onerror=null},t.onerror=function(){n(),t.onload=null,t.onerror=null},t.readAsDataURL(e)}).then(o.bind(this._onLoadDataUrl,this),o.bind(this._onError,this)):r.reject("FileReader.readAsDataURL is not supported")}},{key:"_onLoadDataUrl",value:function(e){var t={base64:e,file:this.file};return c&&(t.objectUrl=c(this.file),u.push(t.objectUrl)),r.resolve(t)}},{key:"readBinaryString",value:function(e){var t=new FileReader;return"readAsBinaryString"in t?r.promise(function(i,n){t.onload=function(e){var n=e.target.result;i(n),t.onload=null,t.onerror=null},t.onerror=function(){n(),t.onload=null,t.onerror=null},t.readAsBinaryString(e)}).then(o.bind(this._onLoadBinaryString,this),o.bind(this._onError,this)):r.reject("FileReader.readAsBinaryString is not supported")}},{key:"_onLoadBinaryString",value:function(e){return r.resolve({binary:e,file:this.file})}},{key:"_onError",value:function(e){return r.reject("Failed to read file")}}],[{key:"read",value:function(t,i){var n=new e(t,i);return n.promise}},{key:"canReadFiles",value:function(){return l}}]),e}();e.exports=h},function(e,t,i){"use strict";var n=function(){},s=e.exports={};s.stringIsClean=function(e){for(var t=0;t=i;r?s++:s--)o<<=8,o+=t.charCodeAt(s);return o},s.parseSnum=function(e,t,i,n){var s,o,r,a=">"===e;for(void 0===i&&(i=0),void 0===n&&(n=t.length-i),s=a?i:i+n-1;a?s=i;a?s++:s--)void 0===r&&(r=128===(128&t.charCodeAt(s))),o<<=8,o+=r?255&~t.charCodeAt(s):t.charCodeAt(s);return r&&(o+=1,o*=-1),o},s.Rational=function(e,t){return this.num=e,this.den=t||1,this},s.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},s.Rational.prototype.asFloat=function(){return this.num/this.den},s.MetaGroup=function(e,t){return this.fieldName=e,this.description=t,this.metaProps={},this},s.MetaGroup.prototype._addProperty=function(e,t,i){var n=new s.MetaProp(e,t,i);this[n.fieldName]=n,this.metaProps[n.fieldName]=n},s.MetaGroup.prototype.toString=function(){return"[MetaGroup "+this.description+"]"},s.MetaProp=function(e,t,i){return this.fieldName=e,this.description=t,this.value=i,this},s.MetaProp.prototype.toString=function(){return""+this.value},s.JpegFile=function(e,t){var i=this._SOS;this.metaGroups={},this._binary_data=e,this.filename=t;var n,o,r,a,l,c,u,h=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(h+=2;h",this._binary_data,h,2),h+=l;h",this._binary_data,t,1)),this.general._addProperty("pixelHeight","Pixel Height",s.parseNum(">",this._binary_data,t+1,2)),this.general._addProperty("pixelWidth","Pixel Width",s.parseNum(">",this._binary_data,t+3,2)),this.general._addProperty("type","Type",this._markers[e][2])},s.JpegFile.prototype._JFIF_IDENT="JFIF\0",s.JpegFile.prototype._JFXX_IDENT="JFXX\0",s.JpegFile.prototype._EXIF_IDENT="Exif\0",s.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]},s.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"]},s.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"]},s.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"]},s.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]},s.JpegFile.prototype._addMetaGroup=function(e,t){var i=new s.MetaGroup(e,t);return this[i.fieldName]=i,this.metaGroups[i.fieldName]=i,i},s.JpegFile.prototype._parseIfd=function(e,t,i,o,r,a,l){var c,u,h,d,p,g,f,_,m,v,b,y=s.parseNum(e,t,i+o,2);b=this._addMetaGroup(a,l);for(var w=0;w",this._binary_data,t+8,2)),this.jfif._addProperty("Ydensity","Y Density",s.parseNum(">",this._binary_data,t+10,2)),this.jfif._addProperty("Xthumbnail","X Thumbnail",s.parseNum(">",this._binary_data,t+12,1)),this.jfif._addProperty("Ythumbnail","Y Thumbnail",s.parseNum(">",this._binary_data,t+13,1))},s.JpegFile.prototype._app0Handler=function(e,t){var i=this._binary_data.slice(t,t+5);i==this._JFIF_IDENT?this._jfifHandler(e,t):i==this._JFXX_IDENT},s.JpegFile.prototype._app1Handler=function(e,t){var i=this._binary_data.slice(t,t+5);i==this._EXIF_IDENT&&this._exifHandler(e,t+6)},s.JpegFile.prototype._exifHandler=function(e,t){if(void 0!==this.exif)throw new Error("Multiple JFIF segments found");var i,n,o,r=this._binary_data.slice(t,t+2);if("II"===r)i="<";else{if("MM"!==r)throw new Error("Malformed TIFF meta-data. Unknown endianess: "+r);i=">"}if(n=s.parseNum(i,this._binary_data,t+2,2),42!==n)throw new Error("Malformed TIFF meta-data. Bad magic: "+n);if(o=s.parseNum(i,this._binary_data,t+4,4),this._parseIfd(i,this._binary_data,t,o,this._tifftags,"tiff","TIFF"),this.tiff.ExifIfdPointer&&this._parseIfd(i,this._binary_data,t,this.tiff.ExifIfdPointer.value,this._exiftags,"exif","Exif"),this.tiff.GPSInfoIfdPointer){if(this._parseIfd(i,this._binary_data,t,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(e,t,i){"use strict";var n=i(8),s=i(3),o=function(e,t,i){if(0===i)return 0;var n=null==i?t:t/i;return 2===arguments.length?Math.round(e*n):void 0},r=function(e,t,i){if(0===i)return 0;var n=null==i?t:t/i;return Math.round(e/n)},a=function(e,t,i,n){var s=e,a=t,l=e/t,c=i/n;return(e>i||t>n)&&(l>c?(s=i,a=r(s,l)):(a=n,s=o(a,l))),{width:s,height:a}},l=function(e,t,i,n,s,a){null!=s||(s=.5),null!=a||(a=.5);var l=0,c=0,u=e,h=t,d=e/t,p=i/n;return d>p?(u=o(t,p),l=Math.round(s*(e-u))):da&&(t=r(a,i,t),i=a):a&&t>a&&(i=r(a,t,i),t=a);var u=document.createElement("canvas");c?(u.width=i,u.height=t):(u.width=t,u.height=i);var h=u.getContext("2d");return h.save(),h.translate(.5*u.width,.5*u.height),h.rotate(s*Math.PI/180),o&&h.scale(-1,1),h.drawImage(e,-.5*t,-.5*i,t,i),h.restore(),u},p={widthForHeight:o,heightForWidth:r,maxSize:a,cropBox:l,createCanvasForEl:c,drawElToCanvas:h,drawScaledAndRotated:d,drawPixelatedImages:u};e.exports=p},function(e,t,i){"use strict";function n(){}var s=i(6).sprintf,o=i(254).truncateLongStrings;n.prototype.genericFieldMap={one:"quote",two:"source"},n.prototype.typeAttributes={quote:"",source:""},n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("quote"),n=this.getHtmlStripped("source");n=n.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var r;return r=n&&i.length+(n.length>1?7:6)<=t?r=s("“%s” - %s",i,n):i?s("“%s”",o(i,t-2)):n,o(r,t)},n.prototype.editorField="two",n.prototype.validate=function(e,t,i){var n=[];return(!t.quote||t.quote.length<1)&&n.push("No quote."),e.call(this,t,{errors:n})},e.exports=n},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(6).sprintf,r=i(265),a=i(254).truncateLongStrings,l=i(266);n.prototype.genericFieldMap={one:"title",two:"url",three:"caption",thumbnail:"thumbnail",excerpt:"excerpt",author:"author"},n.prototype.typeAttributes={title:"",url:"",caption:"",excerpt:"",author:""},n.prototype.allowAnswerFields=["caption"],n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("title"),n=this.getHtmlStripped("url"),s=this.getHtmlStripped("caption");s=s.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var l;return l=i&&s?o("%s - %s",i,s):i||s||r.parseUrl(n).host||"",a(l,t)},n.prototype.editorField="three",n.prototype.typeAttributes={title:"",url:"",excerpt:"",author:""},n.prototype.resetPreserveFields=["caption","tags"],n.prototype.resetAttributes=["title","url","thumbnail","excerpt","author"],n.prototype.softReset=function(e){e.apply(this,s.rest(arguments)),s.isEmpty(this.get("thumbnail"))||"new"===this.get("mode")||this.set("remove_thumbnail",1)},n.prototype.serializeForServer=function(e){var t=e.apply(this,s.rest(arguments));return this.get("remove_thumbnail")&&(t.remove_thumbnail=this.get("remove_thumbnail")),s.extend(t,{author:this.getAttributeFromGeneric("author"),excerpt:this.getAttributeFromGeneric("excerpt")}),t},n.prototype.validate=function(e,t,i){var n=[];return t.loading&&n.push("Loading OpenGraph data."),(!t.url||t.url.length<1)&&n.push("No url."),l.isUrl(t.url)||n.push("Not a valid URL"),e.call(this,t,{errors:n})},e.exports=n},function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=i(3),o={aElement:document.createElement("a"),acceptedProtocols:["http:","https:","tumblr:","mailto:"],_setUrl:function(e){return this.aElement.setAttribute("href",e),this.aElement.setAttribute("href",this.aElement.href),this.aElement.href},parseUrl:function(e){if(!s.startsWith(e,"http"))throw new URIError("Missing protocol in URL to be parsed. Must be http or https");return this._setUrl(e),{url:e,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(e){try{e.indexOf("://")===-1&&(e="https://"+e);var t=this.parseUrl(e),i=!1;if(s.endsWith(t.host,"tumblr.com")?i=t.host.match(/([a-zA-Z0-9-_]+)\.tumblr\.com/i):s.endsWith(t.host,"tumblr.net")?i=t.host.match(/(?:^|\/\/)(?:([\w\-\_]+)\.)(?:[\w\-\_]+\.)*tumblr\.net/i):s.endsWith(t.host,"t.dev")&&(i=t.host.match(/([a-zA-Z0-9-_]+)\.t\.dev/i)),i){var n=i[1];if("www"===n)return!1;var o={tumblelog_name:n},r=t.path.match(/post\/([0-9]+)/i);return r&&(o.post_id=r[1]),o}return!1}catch(e){return!1}},isTumblelogUrl:function(e){return this.parseTumblelogUrl(e)!==!1},parseTumblelogShortUrl:function(e){try{e.indexOf("://")===-1&&(e="https://"+e);var t=this.parseUrl(e);return"tmblr.co"===t.host&&(s.startsWith(t.path,"/m")?{mentionKey:t.path.match(/^\/m([^\/]+)/)[0]}:!!s.startsWith(t.path,"/Z")&&{postTinyUrlHash:t.path.match(/^\/Z([^\/]+)/)[0]})}catch(e){return!1}},isTumblelogShortUrl:function(e){return this.parseTumblelogShortUrl(e)!==!1},isTumblrMediaUrl:function(e){return!!e&&(e.indexOf("://")===-1&&(e="https://"+e),!!e.match(/^https?:\/\/(\d+\.)media\.tumblr\.com\//i))},hasAllowedProtocol:function(e){this._setUrl(e);var t=this.aElement.protocol;if(":"===t&&(t=location.protocol),this.acceptedProtocols.indexOf(t)===-1)throw new Error("Unsupported protocol detected in URL: "+e);return!0},isAbsoluteUrl:function(e){var t=new RegExp("^(?:[a-z]+:)?//","i");return!!t.test(e||"")},getParameter:function(e){var t=new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)"),i=t.exec(location.search)||[null,""],n=i[1].replace(/\+/g,"%20"),s=decodeURIComponent(n);return s||null},httpBuildQuery:function(e,t){var i=[];for(var s in e)if(e.hasOwnProperty(s)){var o=t?t+"["+s+"]":s,r=e[s];if(!r)continue;i.push("object"===("undefined"==typeof r?"undefined":n(r))?this.httpBuildQuery(r,o):encodeURIComponent(o)+"="+encodeURIComponent(r))}return i.join("&")},buildUrl:function(e,t){var i=this.httpBuildQuery(t);return e+(s.isEmpty(i)?"":"?"+i)},getQueryStringHash:function(e){var t={};return e.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(e,i,n,s){t[i]=s}),t},isProtocolRelative:function(e){var t=new RegExp("^//[^/]","i");return t.test(e||"")},getExtension:function(e){var t,i;return this.isProtocolRelative(e)&&(e=this.addProtocolIfMissing(e,"https:")),s.startsWith(e,"http")&&(i=this.parseUrl(e),s.isEmpty(i.path)||(t=i.path)),t||(t=e),s.last(t.split("."))},addProtocolIfMissing:function(e,t){if(s.any(this.acceptedProtocols,function(t){return s.startsWith(e,t)}))return e;if(this.acceptedProtocols.indexOf(t)===-1)throw new Error("Attempting to add an unsupported protocol: "+t);return(this.isProtocolRelative(e)?t:t+"//")+e}};e.exports=o},function(e,t){"use strict";var i={isUrl:function(e){var t="%[0-9a-fA-F]{2}",i="(http|https):\\/\\/",n='([a-zA-Z0-9$\\-_.+!*"(),;:&=]|'+t+")+@",s="(25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])",o="("+s+"(\\."+s+"){3})",r="a-zA-Z0-9\\-\\_\\~",a="\\u00C0-\\u9FFF",l="(["+r+a+"]+\\.)+([a-zA-Z]{2,})",c="[0-9]+",u="("+o+"|localhost|"+l+")(:"+c+")?",h=r+a+".:\\[\\]@!$&'()*+,;=",d="(["+h+"]|"+t+")*",p=d+"(\\/"+d+")*",g="\\?(["+h+"/?]|"+t+")*",f="\\#(["+h+"/?]|"+t+")*",_=new RegExp("^"+i+"("+n+")?"+u+"(\\/?("+p+")?("+g+")?("+f+")?)?$");return _.test(e)===!0},isImageUrl:function(e){var t=i.isUrl(e),n=/.+[.](jpg|jpeg|png|gif)([?]|$)/.test(e)===!0;return t&&n}};e.exports=i},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(6).sprintf,r=i(254).truncateLongStrings;n.prototype.genericFieldMap={one:"title",two:"chat"},n.prototype.typeAttributes={title:"",chat:""},n.prototype.generateTweetText=function(e,t){var i,n=this.getHtmlStripped("title"),s=this.getHtmlStripped("chat");return i=n&&s?o("%s - %s",n,s):n||s||"",r(i,t)},n.prototype.validate=function(e,t,i){var n=[];return(!t.chat||t.chat.length<1)&&n.push("No chat."),e.call(this,t,{errors:n})},n.prototype.serializeForServer=function(e){var t=this,i=e.apply(this,s.rest(arguments));return i["post[two]"]=t.get("chat").replace(/\u00A0/gm," "),i},e.exports=n},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(130),r=i(254).truncateLongStrings;n.prototype.genericFieldMap={two:"caption",three:"url"},n.prototype.editorField="two",n.prototype.allowsTypeSwitch=function(){return"new"===this.get("mode")},n.prototype.typeAttributes={service:!1,preuploadUrl:"",trackTitle:"",trackArtist:"",trackAlbum:"",preuploadAlbumArt:!1,albumArt:"",caption:"",confirmTos:!1},n.prototype.allowAnswerFields=["caption"],n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),r(i,t)},n.prototype.resetPreserveFields=["caption","tags"],n.prototype.resetAttributes=["service","url","preuploadUrl","trackTitle","trackArtist","trackAlbum","confirmTos","preuploadAlbumArt","albumArt","copyrightFallback"],n.prototype.parseForType=function(e,t,i){i.service&&"direct"!==i.service||(t.url=i.audio_url),delete t.audio_url,t.albumArt=i.audio_artwork,delete t.audio_artwork;var n=i.id3_tags||{};return delete t.id3_tags,t.trackTitle=n.Title||"",t.trackArtist=n.Artist||"",t.trackAlbum=n.Album||"",t},n.prototype.serializeForServer=function(e){var t=e.apply(this,s.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")&&s.isEmpty(this.get("albumArt")),copyright_fallback:this.get("copyrightFallback")};return s.extend(t,s.pick(i,function(e){return!s.isUndefined(e)})),s.isEmpty(t.preuploaded_url)||(t["post[three]"]=null),t},n.prototype.validate=function(e,t,i){var n=[];return s.isEmpty(t.url)?n.push(o("Please choose an audio source before continuing.")):t.preuploadUrl?t.confirmTos||n.push(o("You must agree that you have permission to share this file.")):s.isEmpty(t.url)&&n.push(o("Please choose an audio source before continuing.")),e.call(this,t,{errors:n})},e.exports=n},function(e,t,i){"use strict";function n(){}var s=i(3),o=i(130),r=i(270),a=i(258),l=i(254).truncateLongStrings;n.prototype.genericFieldMap={one:"embedCode",two:"caption"},n.prototype.allowAnswerFields=["caption"],n.prototype.editorField="two",n.prototype.resetPreserveFields=["caption","tags"],n.prototype.resetAttributes=["preuploadUrl","preuploadKey","embedCode","confirmTos","copyrightFallback"],n.prototype.typeAttributes={caption:"",confirmTos:!1},n.prototype.generateTweetText=function(e,t){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),l(i,t)},n.prototype.validate=function(e,t,i){var n=[];return t.embedCode?0===t.embedCode.length&&n.push("No embed specified."):t.preuploadUrl?t.confirmTos||n.push(o("You must agree that you have permission to share this file.")):t.video?0===t.video.embed_code.length&&n.push("Direct embed missing."):n.push("No video specified."),e.call(this,t,{errors:n})},n.prototype.canPreview=function(){return!this.get("preuploadKey")&&this.isValid()},n.prototype.serializeForServer=function(e){var t=e.apply(this,s.rest(arguments)),i=s.omit({preuploaded_url:this.get("preuploadUrl"),preuploaded_ch:this.get("preuploadKey"),confirm_tos:this.get("confirmTos"),copyright_fallback:this.get("copyrightFallback")},s.isUndefined);return s.extend(t,i),t=r(t,{embedCode:"embed_code"})},n.prototype.getEmbedData=function(e){var t=!1;return this.has("video")?(t=a(this.get("video")),t={isNativeVideo:!0,embedRenderContext:"inline",width:t.dimensions.width,height:t.dimensions.height,previewIframe:t.previewIframe,embedCode:t.embedCode}):this.has("video_embed")&&(t=a(this.get("video_embed"))),t},e.exports=n},function(e,t,i){"use strict";function n(e,t){return o.zipObject(e,o.map(e,t))}function s(e,t){return o.isFunction(t)&&(t=n(o.keys(e),t)),o.transform(e,function(e,i,n){e[o.result(t,n)||n]=i},{})}var o=i(3);s.createKeyMap=n,e.exports=s},function(e,t,i){"use strict";function n(){}var s=(i(3),i(254).truncateLongStrings);n.prototype.genericFieldMap={one:"ask",two:"answer",three:"caption"},n.prototype.editorField="three",n.prototype.typeAttributes={ask:"",answer:"",caption:""},n.prototype.generateTweetText=function(e,t){return s(this.getHtmlStripped("ask"),t)},n.prototype.validate=function(e,t,i){var n=[];return t.ask||n.push("Post question empty."),e.call(this,t,{errors:n})},e.exports=n},function(e,t,i){"use strict";var n=i(3),s=function(e){if(n.isString(e)){if(e=e.toLowerCase(),"true"===e||"1"===e||"on"===e)return!0;if("false"===e||""===e||"off"===e)return!1;if(e=n.parseInt(e),n.isNaN(e))return!0}return!!e};e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(274),r=i(192),a=s.extend({model:o,_listenToUploadModel:function(e){this.listenTo(e,"change",this._onUploadModelChange)},_stopListeningToUploadModel:function(e){this.stopListening(e)},_onUploadModelChange:function(e){n.has(e.changed,"complete")&&this.trigger("complete",this,e),n.has(e.changed,"error")&&e.get("error")&&this.trigger("error",this,e),n.has(e.changed,"complete")&&this.allComplete()&&this.trigger("allComplete",this)},add:function(e){return n.isArray(e)?n.forEach(e,this._listenToUploadModel,this):this._listenToUploadModel(e),s.prototype.add.apply(this,arguments)},remove:function(e){return n.isArray(e)?n.forEach(e,this._stopListeningToUploadModel,this):this._stopListeningToUploadModel(e),s.prototype.remove.apply(this,arguments)},removeIncomplete:function(e){var t=this.where({uploading:!1,complete:!1});return this.remove(t,e)},removeFailed:function(e){var t=this.filter(function(e){return e.get("error")});return this.remove(t,e)},allComplete:function(){return!!this.length&&this.every(function(e){return e.get("complete")})},anyUploading:function(){return this.length>0&&this.any(function(e){return e.get("uploading")})},getProgress:function(){var e=0,t=0;return this.forEach(function(i){i.get("error")&&(e+=i.get("bytesLoaded")||0,t+=i.get("bytesTotal")||0)}),t?e/t:0},promise:function e(){if(this.allComplete())return r.resolve(this);var e=r.promise(n.bind(function(e,t){var i,s;i=n.bind(function(){this.stopListening(this,"uploads:allComplete",i),this.stopListening(this,"uploads:error",s),e.apply(this,arguments)},this),s=n.bind(function(){this.stopListening(this,"uploads:allComplete",i),this.stopListening(this,"uploads:error",s),t.apply(this,arguments)},this),this.listenToOnce(this,"uploads:allComplete",i),this.listenToOnce(this,"uploads:error",s)},this));return e}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(185),o=s.extend({defaults:{url:"",file:null,error:!1,uploading:!1,complete:!1,bytesLoaded:0,bytesTotal:0},initialize:function(e,t){this.options=n.extend({},t),this.options.jqXHR&&this.setUploadRequest(this.options.jqXHR)},setUploadRequest:function(e){return this.jqXHR=e,e.then(function(){}),e},_uploadDone:function(){this.set({error:!1,uploading:!1,complete:!0})},_uploadFail:function(){this.set({error:!0,uploading:!1,complete:!1})},cancelUpload:function(){var e;return this.jqXHR&&(e=this.jqXHR.abort(),this.jqXHR=null),e},getProgress:function(){return this.get("bytesTotal")?this.get("bytesLoaded")/this.get("bytesTotal"):0}});e.exports=o},,function(e,t,i){"use strict";var n=i(3),s=i(187),o=new s({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(e,t){if(1===arguments.length)if("string"==typeof e){if(t=e,e=this.subViews[t],!e)return this}else t=e.$el.data("subview")||"";var i=this.$('[data-subview="'+t+'"]');return i.length>1&&(i=i.first()),e&&i.length&&(i.replaceWith(e.$el),e.$el.attr("data-subview",t)),this},attachSubViews:function(e){return n.forEach(this.subViews,this.attachSubView,this),this},teardownSubViews:function(){return n.forEach(this.subViews,function(e,t){e&&n.isFunction(e.teardown)&&e.teardown(),this.subViews[t]=null},this),this.subViews={},this},renderSubViews:function(){return n.forEach(this.subViews,function(e){e&&n.isFunction(e.render)&&e.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(e){this._initialized=!1,this._rendering=!1,this._rendered=!1,this._removed=!1,this.subViews={};var t=e.apply(this,n.rest(arguments));return this._initialized=!0,t},teardown:function(e){var t=n.rest(arguments);n.isFunction(this.beforeTeardown)&&this.beforeTeardown.apply(this,t);var i=e.apply(this,t);return n.isFunction(this.afterTeardown)&&this.afterTeardown.apply(this,t),this._rendered=!1,i},render:function(e){var t=n.rest(arguments);this._rendering=!0,n.isFunction(this.beforeRender)&&this.beforeRender.apply(this,t);var i=e.apply(this,t);return n.isFunction(this.afterRender)&&this.afterRender.apply(this,t),this._rendering=!1,this._rendered=!0,this.trigger("rendered"),i}},after:{remove:function(){this._removed=!0,this.subViews=null}}});e.exports=o},function(e,t,i){"use strict";function n(e){return s.trim(e)}var s=i(3),o=i(187),r=function(e,t){return e=n(e),t&&s.isFunction(this.$$)&&this.$$.cache.delete(e),e},a=function(e){if(this.$$)return e=n(e),this.$(e)},l=function(e){this.$$&&(e=n(e),this.$$.cache.delete(e))},c=function(e){if(this.$$)return e=n(e),this.$$.cache.delete(e),this.$(e)},u=function(){this.$$&&(this.$$.cache=new s.memoize.Cache)},h=function(e){return"[data-js-"+e+"]"},d=function(e){return function(){var e=s.memoize(s.bind(a,this),s.bind(r,this));e.update=s.bind(c,this),e.remove=s.bind(l,this),e.empty=s.bind(u,this);var t=function(t,i){return e(h(t),i)};return t.update=function(t){e.update(h(t))},t.remove=function(t){e.remove(h(t))},this.$$=e,this.js$=t,this.$$initialize=s.noop,e}.call(e)},p=new o({defaults:{$$cacheKeys:{},$$cacheSelectors:function(e){return"undefined"==typeof e&&(e=this.$$cacheKeys),s.forEach(e,function(e){this.$$.update(e)},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(){s.isFunction(this.$$.empty)&&this.$$.empty()},remove:function(){s.isFunction(this.$$.empty)&&this.$$.empty()},render:function(){s.isFunction(this.$$cacheSelectors)&&this.$$cacheSelectors()}}});e.exports=p},,,,,,function(e,t,i){"use strict";function n(e){return o.noop}var s=i(8),o=i(3),r=(i(6).sprintf,i(187)),a=i(136),l=!1,c=s("body"),u=s(window),h=i(284),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 h(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 e=this.pinnedRect(),t={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,n=this._popoverBase.pinnedSide,s={ visibility:"visible"},r={},a=this.$el.width(),l=null,c=null,u=null,h=null;this.debug("reposition: pinnedSide=%s, shift=%O, pinnedRect=%O",n,i,e),this._popoverBase.isFixedPosition&&(s.position="fixed"),"top"===n||"bottom"===n?(o.extend(s,{left:e.left+Math.floor(e.width/2)+i.x}),r={top:e.top+t.scrollTop-i.y,bottom:e.top+t.scrollTop+e.height+i.y,left:e.left+t.scrollLeft-i.x,right:e.left+t.scrollLeft+e.width+i.x},r.center=(r.right-r.left)/2,l=t.realTop+r.top-this.$el.height(),c=t.realTop+r.bottom+this.$el.height(),"top"===n&&this._crossesViewportEdge("top",l)&&!this._crossesViewportEdge("bottom",c)&&(n="bottom"),"bottom"===n&&this._crossesViewportEdge("bottom",c)&&!this._crossesViewportEdge("top",l)&&(n="top"),"bottom"===n?o.extend(s,{top:r.bottom,transform:"translateX(-50%)"}):"top"===n&&o.extend(s,{top:r.top,right:"",transform:"translateX(-50%) translateY(-100%)"}),u=t.realLeft+(r.center+r.left)-a/2,h=t.realLeft+(r.center+r.left)+a/2,this._crossesViewportEdge("left",u)&&!this._crossesViewportEdge("right",h)&&o.extend(s,{left:this._popoverBase.minDistanceFromContainer+"px",transform:"top"===n?"translateX(0) translateY(-100%)":"translateX(0)"}),!this._crossesViewportEdge("left",u)&&this._crossesViewportEdge("right",h)&&o.extend(s,{left:"auto",right:this._popoverBase.minDistanceFromContainer+"px",transform:"top"===n?"translateX(0) translateY(-100%)":"translateX(0)"})):"left"===n||"right"===n?(o.extend(s,{top:e.top-i.y}),r={left:e.left+t.scrollLeft-i.x,right:e.left+t.scrollLeft+e.width+i.x},u=t.realLeft+r.left-this.$el.width(),h=t.realLeft+r.right+this.$el.width(),"left"===n&&this._crossesViewportEdge("left",u)&&!this._crossesViewportEdge("right",h)&&(n="right"),"right"===n&&this._crossesViewportEdge("right",h)&&!this._crossesViewportEdge("left",u)&&(n="left"),"left"===n?o.extend(s,{left:r.left,transform:"translateX(-100%) translateY(-50%)"}):"right"===n&&o.extend(s,{left:r.right,transform:"translateY(-50%)"})):o.extend(s,{top:e.top-i.y,left:e.left+i.x,transform:""}),o.extend(s,{transform:s.transform}),this.$el.css(s),this.debug("reposition: ad-hoc css %O",s),this.$el.removeClass("top bottom left right").addClass(n)},_crossesViewportEdge:function(e,t){var i=s(window),n={top:i.scrollTop(),left:i.scrollLeft(),right:i.scrollLeft()+i.width(),bottom:i.scrollTop()+i.height()};return n=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]",e,n[e],t),"top"===e?n.top>t:"bottom"===e?n.bottomt:"right"===e?n.right x: {Number}, y: {Number}");return this._popoverBase.shift.x=e.x,this._popoverBase.shift.y=e.y,this},getShift:function(){return this._popoverBase.shift},_initializeDebugger:function(){this.debug=l?n(this):o.noop},defaults:{pinnedRect:function(){var e,t,i=this.$container.offset();e=this.$pinned.offset(),t=e,this._popoverBase.isFixedPosition&&(this.isContainerBody?e.top-=u.scrollTop():e.top-=this.$container.scrollTop());var n={};return n.height=this.$pinned.outerHeight(),n.width=this.$pinned.outerWidth(),n.top=Math.round(e.top-i.top),n.left=Math.round(t.left-i.left),n.bottom=Math.round(n.top+n.height),n.right=Math.round(n.left+n.width),this.debug("pinnedRect calculation: container %O, pinned %O, containerOffset %O, pinnedOffset %O",this.$container,this.$pinned,i,t),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",n.height,n.width,n.top,n.left,n.bottom,n.right),n},teardown:o.noop},after:{initialize:function(e){var t={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(e||{},o.keys(t)),t),this._initializeDebugger(),this.setPinnedTarget(e.pinnedTarget||null),this.setPopoverContainer(e.popoverContainer||c),this._popoverBase.autoTeardown&&this.listenTo(this,"rendered",this.setupAutoTeardown)},render:function(){this.$el.addClass(this._popoverBase.className),this.$el.appendTo(this.$container);var e=this.$el.children().first(),t=e.width();e.width(t-t%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")}}});e.exports=d},function(e,t,i){"use strict";function n(e,t){this.options=s.extend({preventInteraction:!1,ignoreSelectors:[]},t),this._onClick=s.bind(this._onClick,this,e),document.addEventListener("click",this._onClick,!0)}var s=i(3),o=i(8),r=i(7);n.prototype._isForcedInsideTarget=function(e){return!s.isEmpty(this.options.ignoreSelectors)&&!s.isEmpty(e.closest(this.options.ignoreSelectors.join(",")))},n.prototype._onClick=function(e,t){var i=o(t.target);e===t.target||o.contains(e,t.target)||this._isForcedInsideTarget(i)?this.trigger("click:inside",t):(this.trigger("click:outside"),this.options.preventInteraction&&(t.preventDefault(),t.stopPropagation()))},n.prototype.remove=function(){return document.removeEventListener("click",this._onClick,!0),this.off(),this},s.extend(n.prototype,r.Events),e.exports=n},,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(219),r=i(136),a=i(293),l=i(276),c=i(277),u=i(230),h=i(312),d=o.extend({defaults:{placeholder:"",name:"",syncWithModel:!0,forceSingleLine:!1,smartQuotesEnabled:!1},events:{},mixins:[u,l,c],template:h,initialize:function(e){this.set(e),this.onChange=e.onChange||n.noop,this.onClientEvent=e.onClientEvent||n.noop,this.pasteHook=e.pasteHook||n.noop,this.smartQuotesEnabled=e.smartQuotesEnabled,this.disableEdit=e.disableEdit||!1;var t=this.get("name");t&&this.get("syncWithModel")&&this.$el.attr("data-name",t)},_initializeEditor:function(e,t){var i={placeholder:t,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(e,i),this.disableEdit&&this.disable()},_composeOnChange:function(){var e=[this.onChange],t=this;return this.get("syncWithModel")&&e.unshift(this.updateModelFromEditor),function(i){n.each(e,function(e){e.call(t,i)})}},_composeOnClientEvent:function(){var e=this.onClientEvent,t=this;return function(i){r.trigger("plainTextEditor:onClientEvent",i,t.editor),e.call(this,i)}},render:function(){this.$el.html(this.template({ariaLabel:this.get("ariaLabel")}));var e=this.js$("plainTextEditor").get(0);if(this._initializeEditor(e,this.get("placeholder")),this.get("syncWithModel")){var t=this._modelValue().length>0;t&&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(e){return"undefined"!=typeof e||(e=!0),this.editor?this.editor.getData(e):null},setEditorValue:function(e){this.editor&&this.editor.setData(e)},updateModelFromEditor:function(){if(!this.editor)return!1;var e=this.get("name"),t=this.getEditorValue();""!==t?s(this.editor.element).addClass("has-text"):s(this.editor.element).removeClass("has-text"),this.model.get(e)!==t&&this.model.set(e,t)},updateEditorFromModel:function(){var e=this.getEditorValue(),t=this._modelValue();t.trim()&&t.trim()!==e.trim()&&this.setEditorValue(t)},_modelValue:function(){return this.model.get(this.get("name"))||""},focus:function(e){this.editor&&this.editor.focus(e)},blur:function(){this.editor&&this.editor.element.blur()},setCursorToEnd:function(){this.editor&&n.isFunction(this.editor.setCursorToEnd)&&this.editor.setCursorToEnd()},enable:function(){s(this.editor.element).attr("contenteditable",!0)},disable:function(){s(this.editor.element).removeAttr("contenteditable")}});e.exports=d},function(e,t,i){var n=i(3),s=i(294);e.exports=n.extend(s,{RichTextEditor:i(295),PlainTextEditor:i(311),SelectionContext:i(305),SelectionPersistence:i(299),Utils:i(298),HumanKeys:i(310)})},function(e,t){var i={debugMode:!1};e.exports=i},function(e,t,i){var n=i(3),s=i(8),o=i(296).animate,r=i(297),a=i(302),l=i(303),c=i(299),u=i(305),h=i(306),d=i(298),p=i(307),g=i(308),f=i(309),_=i(310),m=(window.URL||window.webkitURL||window.mozURL||window.msURL||{}).createObjectURL,v=i(301),b=function(){function e(e,t){return n.mapValues(e,function(e,t){return t.match(/^on[A-Z]/)&&n.isFunction(e)?n.bind(e,this):e},t)}function t(){U.call(this,de);var e=s("
",{"data-js":"editor-wrapper",class:"editor-wrapper"}).css("position","relative"),t=s("
",{"data-js":"editor-slot",class:"editor-slot"}).css("position","relative");s(this.element).wrap(e).wrap(t),t=s(this.element).parent(),this.wrapper=t.parent().get(0),this.placeholderElement=s("
",{"data-js":"editor-placeholder",class:"editor-placeholder"}).css("position","absolute"),this.placeholderElement.on("click",n.bind(function(e){this.focus()},this)),t.append(this.contextualControls.element),t.append(this.linkControl.element),t.append(this.placeholderElement),t.append(this.inlineControls.element),$.call(this),this.controlBar=s("
",{"data-js":"control-bar",class:"control-bar disabled"});var o=s("
",{class:"static-controls control"});this.controlBar.append(o),this.controlBar.append(this.staticControls.element);var r=this;o.on("mousedown",function(e){e.preventDefault(),e.stopPropagation();var t=u.getNodeList();r.staticControls.setActives(n.pluck(t,"nodeName"));var i=s(this).position();return r.staticControls.isShown?r.staticControls.hide():r.staticControls.open(i.left+s(this).width()/2,0),r.contextualControls.hide(),r.linkControl.close(),!1}),this.config.showStaticControls&&s(this.wrapper).append(this.controlBar),i.call(this),T.call(this)}function i(){var e=this,t=function(){var t=e.inlineControls.isTrayOpen||e.contextualControls.isShown||e.staticControls.isShown||e.linkControl.isShown;return t};s(this.element).on("input keydown keyup keypress mousedown mouseup",function(t){e.controlBar.removeClass("disabled"),e.config.onClientEvent.call(e,t)});var i=function(){O.call(this),this.onChange()};s(this.element).on("keydown",function(i){if(i.keyCode===ye.shift)e.keyModifiers.shift=!0;else if(n.contains([ye.metaLeft,ye.metaRight],i.keyCode))e.keyModifiers.meta=!0;else{if(i.keyCode===ye.esc)return void(t()&&(e.contextualControls.hide(),e.staticControls.hide(),e.inlineControls.isTrayOpen&&e.inlineControls.toggleTrayWithIntent(!1),i.stopPropagation()));i.keyCode===ye.backspace?(S.call(e,i),G.call(e)):i.keyCode===ye.enter&&(C.call(e,i),w.call(e,i),d.browser.safari&&i.shiftKey&&(i.preventDefault(),y.call(e)))}var s=n.contains(n.values(n.omit(ye,"enter")),i.keyCode);!b.call(e)||s||e.keyModifiers.meta||(e.keyModifiers.meta=!1,i.preventDefault()),F.call(e,i),O.call(e,i)}),s(this.element).on("keyup",function(t){t.keyCode===ye.shift?e.keyModifiers.shift=!1:n.contains([ye.metaLeft,ye.metaRight],t.keyCode)?e.keyModifiers.meta=!1:t.keyCode===ye.enter?G.call(e):t.keyCode!==ye.backspace&&t.keyCode!==ye.delete||(R.call(e),n.defer(function(){x.call(e)}));var s=!1;t.keyCode===ye.right&&!t.shiftKey&&e.inlineControls&&(s=e.inlineControls.isShown),t.keyCode===ye.esc||s||i.call(e)}),s(this.element).on("input",function(){i.call(e)});var o=!1;s(this.element).on("mouseup",function(){o=!1,O.call(e)}),s(this.element).on("mousedown",function(e){o=!0}),document.addEventListener("mousedown",function(t){var i=function(){o=!1,k.call(e),e.controlBar.addClass("disabled")};e.wrapper===t.target||s.contains(e.wrapper,t.target)||e.config.documentMousedownHook(t,i)||i()},!0),document.addEventListener("mouseup",function(t){o&&(O.call(e),o=!1)},!0),s(this.element).on("focus",function(){if(e.controlBar.removeClass("disabled"),!W.call(e)){var t=s(e.element).children(ge.join());if(t.length){var i=t.first().get(0);c.setToStart(i)}}n.defer(function(){e.onChange()})}),s(this.element).on("blur",function(i){var s=function(i){if(!t()){var s=u.getSelection();s&&u.isInContext(s,e.element)&&s.removeAllRanges(),O.call(e,function(){e.onChange(),n.isFunction(i)&&i()})}};e.config.blurHook(i,s)||n.defer(s)}),s(this.element).on("paste",function(t){var i=(t.originalEvent||t).clipboardData;i&&(e.config.pasteHook(i,e.keyModifiers.shift)||B.call(e,i),V.call(e),t.preventDefault())}),s(this.element).on("cut",function(t){e.contextualControls.hide(),e.staticControls.hide(),e.linkControl.close(),n.defer(function(){x.call(e),V.call(e),e.onChange()})})}function b(){return!!this.config.characterLimit&&this.element.innerText.length>this.config.characterLimit}function y(){for(var e=W.call(this),t=n.contains(_e,e.nodeName)?"\n":"
",i=u.isCursorAtEnd(e)&&!u.isCursorAtStart(e)?1:0,s=0;s0});t||(U.call(this,""),G.call(this),$.call(this))}}function S(e){var t=u.getSelection();if(t.isCollapsed){var i=W.call(this);if(i&&!(c.saveSelection(i).start>0)){var n=s(i).prev().get(0);n&&ce.call(this,n)&&(s(n).remove(),e.preventDefault())}}}function T(){var e=this,t=s(e.element).offset().top,i=null,o="dragstart dragenter dragleave dragover dragend drop",r=!1,a=function(e){var t=e.dataTransfer.types&&n.some(e.dataTransfer.types,function(e){return"Files"===e});return t},l=function(e){return"false"===s(e.target||e.srcElement).attr("contenteditable")},c=function(t,i,s){t.length&&(e.onChange(),n.each(t,function(t){e.config.onFileAdded.call(e,t,i,s)}),O.call(e))},u=function(e,t){return en+.66*o;return{element:i,top:n,bottom:n+o,height:o,isAfter:r}},d=function(){s(e.element).find(".over-top, .over-bottom").each(function(){s(this).removeClass("over-top").removeClass("over-bottom"),""===s(this).attr("class").trim()&&s(this).removeAttr("class")})},p=function(n){var o=null,r=n.pageY-t,a=s(e.element).children();i&&r>i.top&&u(r,i)||(a.each(function(){var e=h(r,this);if(u(r,e)&&(n.target||n.srcElement)!==this)return o=e,!1}),o||(o=h(r,a.last().get(0)),o.isAfter=!0),o&&i&&i.element===o.element&&i.isAfter===o.isAfter||(d(),i=o))};s(e.element).unbind(o),s(e.element).on("dragleave",function(e){d()}),s(e.element).on("dragover",function(e){return r?(n.debounce(p,100)(e.originalEvent),i&&(s(i.element).addClass(i.isAfter?"over-bottom":"over-top"),a(e.originalEvent)&&e.stopPropagation()),void e.preventDefault()):(e.preventDefault(),void e.stopPropagation())}),s(e.element).on("dragenter",function(e){e.preventDefault(),a(e.originalEvent)&&(r="file")}),s(e.element).on("dragstart",function(t){if(k.call(e),l(t.originalEvent)){r="media";var i=t.originalEvent.target||t.originalEvent.srcElement,o=t.originalEvent.dataTransfer;if(o){o.effectAllowed="move",o.dropEffect="move";try{var a=s(i).find("img").attr("src")||"";a.match(/^\s*data:/)&&(a=""),o.setData("text/uri-list",a),o.setData("text/plain",a)}catch(e){}}n.defer(function(){s(i).addClass("dragging")})}}),s(e.element).on("drop",function(e){d(),a(e.originalEvent)&&c(e.originalEvent.dataTransfer.files,i.element,i.isAfter?1:-1),e.stopPropagation(),e.preventDefault()}),s(e.element).on("dragend",function(t){if(l(t.originalEvent)){d();var n=t.originalEvent.target||t.originalEvent.srcElement,o=s(n).data("origHeight"),a=n;if(i&&a!==i.element){var c=s(n).remove();i.isAfter?s(i.element).after(c):s(i.element).before(c),oe.call(e,c)}s(a).animate({height:o},200,function(){s(a).removeClass("dragging")}),e.onChange(),O.call(e)}r=!1})}function E(e,t,i){var n=s(this.element),o=c.saveSelection(this.element);n.find(i).wrap("<"+t+">"),n.find(i).contents().unwrap(),c.restoreSelection(o),window.document.execCommand(e),n.find(t).wrap("<"+i+">"),n.find(t).contents().unwrap(),c.restoreSelection(o)}function P(e,t,i){var o=this,r=function(){window.document.execCommand(e),o.config.flattenBlocks&&N.call(o)},a=function(){var e=c.saveSelection(o.element),t=200,n=240;!i||i.isAnimating||e.selection.isCollapsed||setTimeout(function(){s(o.linkControl.linkEditInput).focus();var r=function(i,n){var r=i-s(o.wrapper).offset().left,a=n-s(o.wrapper).offset().top;o.linkControl.size(t),o.linkControl.show(r,a),o.linkControl.createLink(e)};i.closeWithShim(i.element.find(".link").get(0),t,n,r),e.selection.removeAllRanges(),o.blur(!0)},30)},l=function(e){var t=c.saveSelection(o.element),i=u.getRootElements();switch(n.each(fe,function(e){var t=u.getNodesByNames(i,[e]);t.length&&I.call(o,"formatBlock",e)}),M.call(o),e.toLowerCase()){case"blockquote":i=u.getRootElements();var r=[],a=[];i=n.each(i,function(e){n.contains(ve,e.nodeName.toUpperCase())?a.push(e):(r.push(a),a=[])}),a.length&&r.push(a),n.each(r,function(t){s(t).wrapAll(document.createElement(e))});break;case"pre":window.document.execCommand("formatBlock",!1,"<"+e+">"),A.call(this);break;default:window.document.execCommand("formatBlock",!1,"<"+e+">")}c.restoreSelection(t)},h=function(){var e=o.contextualControls.controls,t=o.contextualControls.getActiveStates();n.each(t,function(t,i){var n=e[i];t&&I.call(o,n.command,n.el)}),window.document.execCommand("removeFormat")};switch(e){case"formatBlock":l(t);break;case"createLink":a();break;case"insertOrderedList":r();break;case"insertUnorderedList":r();break;case"removeFormat":h();break;case"insertHTML":E.call(this,"underline","U",t);break;default:window.document.execCommand(e)}O.call(this),R.call(this),o.onChange()}function I(e,t){var i=this;switch(e){case"formatBlock":var o=c.saveSelection(this.element);M.call(i),n.each(u.getRootElements(),function(e){i.dataFilter.unBlock(e),"pre"===e.nodeName.toLowerCase()&&(e.innerHTML=e.innerHTML.replace("\n","
"));var t=e.nodeName.toUpperCase();if(n.contains(fe,t)){var o=s(e).contents();s(o).wrapAll("

"),s(e.firstChild).unwrap()}}),c.restoreSelection(o);break;case"insertOrderedList":M.call(this);break;case"insertUnorderedList":M.call(this);break;case"createLink":window.document.execCommand("unlink");break;case"insertHTML":E.call(this,"underline","U",t);break;default:window.document.execCommand(e)}R.call(this),O.call(this),this.onChange()}function F(e){var t=function(){var e=u.getNodeByNames(["UL","OL"]);return!!e};e.keyCode===ye.tab&&t()&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?(P.call(this,"outdent"),t()||P.call(this,"formatBlock","p")):P.call(this,"indent"))}function A(){var e=u.getNodeByNames(_e);e&&s(e).find("br").replaceWith("\n")}function M(){var e=u.getNodeByNames(me);if(e){do window.document.execCommand("outdent");while(u.getNodeByNames(me));u.getNodeByNames(["H2"])||window.document.execCommand("formatBlock",!1,"

"),this.dataFilter.blockifyInlineNodes(this.element)}}function N(){var e=c.saveSelection(this.element),t=u.getNodeList(null,!0);this.dataFilter.unwrapParentBlocks(t),c.restoreSelection(e)}function R(){var e=c.saveSelection(this.element),t=u.getNodeList(),i=this.dataFilter.scrubSpansAndBadAttrs(t);i&&e.end>e.start&&c.restoreSelection(e)}function O(e){var t=this;setTimeout(function(){var i=u.getSelection();return i?(i.isCollapsed?D.call(t,i):j.call(t,i),ie.call(t),K.call(t),t.config.onSelection.call(t,i),u.isInContext(i,t.element)&&(t.lastSelection=c.saveSelection(t.element)),V.call(t),$.call(t),void(n.isFunction(e)&&e())):(ie.call(t),void(n.isFunction(e)&&e()))},20)}function j(e){if(u.isInContext(e,this.element)){var t=u.getContextCoordinates(s(this.element).parent().parent()),i=u.getNodeList(e);this.contextualControls.setActives(n.pluck(i,"nodeName")),this.staticControls.setActives(n.pluck(i,"nodeName")),this.linkControl.close(),this.inlineControls.close(),""!==e.toString().trim()&&t&&!this.staticControls.isShown&&this.contextualControls.open(t.x,t.y)}}function D(e){this.contextualControls.hide();var t=u.getNodeList(e),i=n.find(t,function(e){return"A"===e.nodeName});if(this.linkControl.isValidLink(i)){var o=u.getContextCoordinates(s(this.element).parent().parent(),i);this.linkControl.showOptions(i),this.linkControl.showOverTarget(o.x,o.y)}else this.linkControl.close();this.staticControls.setActives(n.pluck(t,"nodeName"))}function V(){var e=u.getSelection(),t=e&&e.isCollapsed;if(!t||!u.isInContext(e,this.element))return void this.inlineControls.close();var i=W.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 n=d.calcTextWidth(this.placeholderElement,this.config.placeholder);this.inlineControls.open(i,n)}else this.inlineControls.close()}function $(){var e=this.isEmpty()?this.config.placeholder:"",t=s(this.placeholderElement);t.html(e);var i=t.outerHeight();i&&s(this.element).css("min-height",Math.max(parseInt(t.css("min-height"),10)||0,i))}function L(e){var t=this.element.innerText.length,i=this.config.characterLimit;if(t+e.length>=i){var n=i-t,s=n>0?n:0;e=e.slice(0,s)}return e}function B(e){var t="";if(e.items&&e.items.length){var i=n.find(e.items,function(e){return/image\/\w+/.test(e.type)});if(i){var o=i.getAsFile();if(o)return void this.config.onFileAdded.call(this,o)}}n.contains(e.types,"text/html")?t=e.getData("text/html"):(t=e.getData("text/plain"),t=this.dataFilter.filterPlaintext(t,!0)),t=t.replace(new RegExp("","g"),"
"),t=t.replace(/\u00a0/g," "),t=this.dataFilter.filterHTML(t),t=this.dataFilter.convertToBrowserSpaces(t),this.config.characterLimit&&(t=L.call(this,t));var r=document.createElement("div");r.innerHTML=t,this.dataFilter.flattenBlocksDown(r,!0),s(r).find(be.join()).remove();var a=n.some(r.children,function(e){return n.contains(ge,e.nodeName)});if(a){var l=u.getSelection(),c=l.getRangeAt(0);c.deleteContents();var h=W.call(this);if(""===s(h).text().trim()){var d=s(h).index(),p=s(h).parent(),g=d+r.children.length-1;s(h).replaceWith(r.children);var f=s(p).children().eq(g).get(0);c.selectNodeContents(f),c.collapse(!1),l.removeAllRanges(),l.addRange(c)}else this.dataFilter.inlinify(r),H.call(this,r.innerHTML)}else H.call(this,r.innerHTML);this.onChange()}function U(e){s(this.element).html(e)}function z(){return s(this.element).html().trim()}function H(e){if(!e)return void v.warn("Cannot insert empty data");var t=u.getSelection();if(!t||!t.focusNode)return void v.warn("Cannot insert without the editor having a cursor or selection");var i=t.getRangeAt(0);i.deleteContents(),e=this.dataFilter.convertToBrowserSpaces(e);var n=document.createElement("div");n.innerHTML=e;for(var s,o=n.lastChild,r=document.createDocumentFragment();s=n.firstChild;)r.appendChild(s);i.insertNode(r),i.setStartAfter(o),i.collapse(!1),t.removeAllRanges(),t.addRange(i)}function q(){var e=W.call(this);if(!e){var t=s(this.element).children(ge.join());if(!t.length)return null;e=t.last().get(0)}return e}function W(){var e=u.getSelection()||this.lastSelection;return u.getNodeByNames(ge,!0,e)}function G(){var e=q.call(this);if(e){if("div"===e.nodeName.toLowerCase())try{window.document.execCommand("formatBlock",!1,"

")}catch(e){}}else U.call(this,de),this.setCursorToStart()}function K(){var e=s(this.element).children(ve.join()).last().get(0);e||s(this.element).append(de)}function Q(e,t,i,o,r){var a=this,l=function(e){var l,c,u,h,d=n.uniqueId(),p=0===e.lastIndexOf("data:",0)?"file":e;a.mediaTracker[d]={originalSource:p,file:t},c=s("",{src:e}),l=c.get(0),h=s("

"),u=h.get(0),c.attr(a.config.imgKeyAttr,d),h.append(c),ee.call(a,u,i,o,r),X.call(a,l,function(i){J.call(a,l,i),a.config.onAsyncImageAdded.call(a,d,e,t,i||{})}),a.onChange()};if(!e&&t)if(m)l(m(t));else{var c=new FileReader;c.onload=function(e){l(e.target.result)},c.readAsDataURL(t)}else{if("string"!=typeof e)return void a.config.onAsyncImageFailed.call(a);l(e)}}function J(e,t){var i,o={},r=this.config,a=s(e).parent("figure").get(0),l={toImg:e,toImgParent:a};r.addImgAttrs&&(i=n.reduce(l,function(e,t,i){return r.addImgAttrs!==!0&&r.addImgAttrs[i]!==!0||e.push(t),e},[])),n.isEmpty(i)||!r.imgSizeAttrs||n.isEmpty(t)||(r.imgSizeAttrs.height&&(o[r.imgSizeAttrs.height]=t.height),r.imgSizeAttrs.height&&(o[r.imgSizeAttrs.width]=t.width),s(i).attr(o))}function X(e,t){var i=function(e){var i={width:e.naturalWidth,height:e.naturalHeight};n.isFunction(t)&&t.call(this,i)};e.complete?i.call(this,e):s(e).one({"load.getImageAttributes":n.bind(n.partial(i,e),this),error:n.bind(function(){s(e).off(".getImageAttributes"),t.call(this,null)},this)})}function Y(e){return s(this.element).find("img["+this.config.imgKeyAttr+'="'+e+'"]').get(0)}function Z(e,t,i){var o=Y.call(this,e);n.isEmpty(i)||o&&J.call(this,o,i),t&&(s(o).attr("src",t),this.mediaTracker[e].updatedSource=t)}function ee(e,t,i,n){var o;t=t||q.call(this),o=this.dataFilter.isEmptyElement(t.outerHTML,!0)?0:u.isCursorAtStart(t)?-1:1,i="number"==typeof i?i:o;var r=s(e).get(0),a=se.call(this,r);oe.call(this,a),i<0?s(t).before(a):i>0?s(t).after(a):0===i&&s(t).replaceWith(a),k.call(this);var l=s(a).nextAll(ve.join()).get(0);l||(l=s(de).get(0),s(a).after(l)),n||(this.focus(!0),c.setToStart(l)),te.call(this,a,!1,O)}function te(e,t,i){var r=this;t=t||!1,i=i||n.noop;var a=s(e),l=a.find("figure"),c=a.find(".media-button"),u=200;return a.length&&l.length?(t&&c.length&&c.hide(),o(l,{opacity:t?0:[1,0],translateY:t?-25:[0,-25]},{duration:.9*u,easing:"easeOutQuad",complete:function(){l.removeAttr("style")}}),void o(e,t?"slideUp":"slideDown",{duration:u,easing:"easeOutQuart",begin:function(){a.css("pointer-events","none")},complete:function(){a.css("pointer-events",""),i.call(r,e)}})):void i.call(r)}function ie(){var e=this,t=W.call(this);s(t).removeClass(e.config.fakeClass),s(e.element).children("p").each(function(i,n){t!==n&&e.dataFilter.isEmptyElement(n)&&(0===i&&ce.call(e,s(n).next().get(0))||s(n).is(":last-child")&&ce.call(e,s(n).prev().get(0))?ne.call(e,n):ce.call(e,s(n).prev().get(0))&&ce.call(e,s(n).next().get(0))?ne.call(e,n):s(n).hasClass(e.config.fakeClass)&&s(n).remove()),void 0!==s(n).attr("class")&&""===s(n).attr("class").trim()&&s(n).removeAttr("class")}),s(this.element).children("."+this.config.mediaHolderClass).each(function(t,i){var n=s(this).next().get(0);n&&!ce.call(e,n)||s(this).after(ne.call(e));var o=s(this).prev().get(0);o||s(this).before(ne.call(e))})}function ne(e){return e=e||s(de).get(0),s(e).addClass(this.config.fakeClass),e}function se(e){var t=s(e),i=s("
",{class:this.config.mediaHolderClass,contentEditable:!1,draggable:!0});t.wrap(i),i=t.parent(),n.isFunction(this.config.mediaHolderCallback)&&this.config.mediaHolderCallback(this,e,t,i);var o=s(this.config.mediaKillerMarkup);o.addClass("media-killer"),i.append(o);var r=!i.hasClass("media-holder-draggable");if(r){var a=s(this.config.mediaMoverMarkup);a.addClass("media-mover"),i.append(a)}return i}function oe(e){var t=this,i=e?s(e):s(this.element).find('[contenteditable="false"]'),n=this.config.mediaHolderEvents;i.each(function(e,i){var o=s(i),r=null;o.off("keydown").on("keydown",function(e){n.keydown.call(null,e,o),e.isPropagationStopped()||(e.keyCode!==ye.delete&&e.keyCode!==ye.backspace||o.remove(),e.preventDefault(),e.stopPropagation())}),o.off("keyup").on("keyup",function(e){n.keyup.call(null,e,o)}),o.on("mousedown",function(e){r=e.originalEvent.target,n.mousedown.call(null,e,o,r)}),o.on("mouseup",function(e){n.mouseup.call(null,e,o,r);var i=s(r);i.hasClass("media-killer")&&r===e.target&&te.call(t,o,!0,function(){o.remove(),x.call(t),O.call(t),t.onChange()})}),o.on("mouseenter",function(e){s(e.currentTarget).addClass("show-controls"),n.mouseenter.call(null,e,o,r)}),o.on("mouseleave",function(e){s(e.currentTarget).removeClass("show-controls"),n.mouseleave.call(null,e,o,r)}),o.on("dragstart",function(e){var t=s(r);t.hasClass("media-killer")&&(e.preventDefault(),e.stopPropagation()),o.hasClass("media-holder-draggable")||t.hasClass("media-mover")||(e.preventDefault(),e.stopPropagation()),n.dragstart.call(null,e,o,r)})})}function re(e){n.each(s(e).find("."+this.config.mediaHolderClass),function(e){s(e).find(".media-killer, .media-mover").remove();var t=s(e).children().first();t.length?s(t).unwrap():(s(e).contents().wrap("
"),s(e).children().first().unwrap().contents().unwrap())})}function ae(e){var t=this,i=s(e).find("."+this.config.fakeClass+", ."+this.config.fakeClass+"-intent");n.each(i,function(e){t.dataFilter.isEmptyElement(e)&&s(e).remove()})}function le(){var e=this;n.each(s(this.element).find(be.join()),function(t){var i=u.getParentNodes(t),s=n.some(i,function(e){return n.contains(be,e.nodeName)});ue.call(e,t)||s||se.call(e,t)})}function ce(e){return s(e).hasClass(this.config.mediaHolderClass)}function ue(e){var t=s(e).closest("[class="+this.config.mediaHolderClass+"]");return t.length?t.get(0):null}function he(e,t,i){var o,r;return t=!!n.isBoolean(t)&&t,e=e||q.call(this),o=s(e)[t?"prev":"next"](),!i&&o.length>0&&this.dataFilter.isEmptyElement(o)?(c.setToStart(o.get(0)),o):(r=s(de).get(0),s(e)[t?"before":"after"](r),c.setToStart(r),r)}var de="


",pe="

",ge=["P","FIGURE","H2","BLOCKQUOTE","UL","OL","DIV","PRE"],fe=["H2","BLOCKQUOTE","PRE"],_e=["PRE"],me=["UL","OL"],ve=["P","H2","BLOCKQUOTE","UL","OL","PRE"],be=["IMG","IFRAME","FIGURE","HR"],ye={shift:16,enter:13,esc:27,backspace:8,delete:46,tab:9,right:39,metaLeft:91,metaRight:93,leftArrow:37,rightArrow:38,upArrow:39,downArrow:40},we=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 _,this.keyComboEvents=o.keyComboEvents||new f({element:this.element,humanKeys:this.humanKeys});var d=n.template("<%= title %> (<%= shortcut %>)"),m=n.bind(function(e,t){return d({title:e,shortcut:this.humanKeys.pretty(t)})},this);this.config={labels:{}, placeholder:!1,characterLimit:null,onChange:n.noop,onSelection:function(e){},onAsyncImageAdded:function(e,t,i,n){},onAsyncImageFailed:function(){v.warn("Unknown source type for inserting an image.")},onFileAdded:function(e,t,i){},onClientEvent:function(e){},flattenBlocks:!0,smartQuotes:{enabled:!1,config:{}},runIFrameSanitization:!1,mediaHolderClass:"media-holder",mediaHolderCallback:function(e,t,i,s){i.is("hr, img, figure")&&n.isEmpty(i.find("iframe"))&&s.addClass("media-holder-draggable"),s.addClass("media-holder-"+i.prop("tagName").toLowerCase())},mediaHolderEvents:{keydown:n.noop,keyup:n.noop,mousedown:n.noop,mouseup:n.noop,mouseenter:n.noop,mouseleave:n.noop,click:n.noop,dragstart:n.noop},imgKeyAttr:"data-img-key",imgSizeAttrs:{width:"data-orig-width",height:"data-orig-height"},addImgAttrs:{toImg:!1,toImgParent:!1},fakeClass:"fake",mediaKillerMarkup:"
×
",mediaMoverMarkup:"
",pasteHook:function(e,t){return!1},blurHook:function(e){return!1},documentMousedownHook:function(e){return!1},filterForSetData:function(e){return e},filterForGetData:function(e){return e},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(e){e.element.show()},animateHideControls:function(e){e.element.hide()},linkConfig:{bypassClasses:[],labels:o.labels,onChange:function(){this.onChange.call(this)},onDismiss:function(){this.lastSelection&&(c.restoreSelection(this.lastSelection),O.call(this))}},inlineControlsConfig:{openTray:h.prototype.openTray,closeTray:h.prototype.closeTray,onTrayOpened:function(e){},onTrayClosed:function(e){},keyboardEvents:this.keyComboEvents},formattingControlsConfig:{controls:{bold:{el:"b",className:"bold",command:"bold",type:"inline",title:m("Bold","meta+b"),keyboard:"meta+b"},italic:{el:"i",className:"italic",command:"italic",type:"inline",title:m("Italic","meta+i"),keyboard:"meta+i"},headline:{el:"h2",className:"headline",command:"formatBlock",type:"block",title:m("Headline","meta+shift+2"),keyboard:"meta+shift+2"},link:{el:"a",className:"link",command:"createLink",type:"inline",title:m("Link","meta+k"),keyboard:"meta+k"},strikethrough:{el:"strike",className:"strikethrough",command:"strikethrough",type:"inline",title:m("Strikethrough","meta+shift+6"),keyboard:"meta+shift+6"},orderedList:{el:"ol",className:"ordered-list",command:"insertOrderedList",type:"list",title:m("Ordered List","meta+shift+7"),keyboard:"meta+shift+7"},unorderedList:{el:"ul",className:"unordered-list",command:"insertUnorderedList",type:"list",title:m("Unordered List","meta+shift+8"),keyboard:"meta+shift+8"},blockquote:{el:"blockquote",className:"quote",command:"formatBlock",type:"block",title:m("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(e){n.isFunction(this.animateShowControls)?this.animateShowControls.call(this,e):e.element.show()},onHide:function(e){n.isFunction(this.animateHideControls)?this.animateHideControls.call(this,e):e.element.hide()},onAction:function(e){var t=u.getNodeList();e.setActives(t)}},showStaticControls:!0},n.merge(this.config,o||{}),this.applyCommand=n.bind(P,this),this.inverseCommand=n.bind(I,this),this.animateShowControls=n.bind(this.config.animateShowControls,this),this.animateHideControls=n.bind(this.config.animateHideControls,this),this.onChange=function(e){var t=z.call(this);this.previousRawData!==t&&($.call(this),this.config.onChange.call(this),this.previousRawData=t)};var b=e(this.config.linkConfig,this);this.linkControl=new r(b);var y=e(this.config.inlineControlsConfig,this);this.inlineControls=new h(y);var w=e(n.defaults({keyboardEvents:this.keyComboEvents},this.config.formattingControlsConfig),this);this.contextualControls=new a(this.applyCommand,this.inverseCommand,w);var C=this.config.formattingControlsConfig.onShow,k=this.config.formattingControlsConfig.onHide,x=e(n.defaults({onShow:function(e){C.apply(this,arguments),e.listener=e.listener||function(t){var i=u.getNodeList();e.setActives(i),document.removeEventListener("mousedown",e.listener,!1)},document.addEventListener("mousedown",e.listener)},onHide:function(e){k.apply(this,arguments),document.removeEventListener("mousedown",e.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,meta:!1},this.undoManager=new p(this,n.bind(function(){for(var e in this.mediaTracker){var t=this.mediaTracker[e].updatedSource;if(t){var i=Y.call(this,e);s(i).attr("src",t)}}V.call(this)},this)),this.config.smartQuotes.enabled&&(this.smartQuoter=new g(this,this.config.smartQuotes.config)),this.mediaTracker={},t.call(this)};return we.prototype.getData=function(e,t){var i=this,o=z.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,re.call(this,r),ae.call(this,r),t||s(r).find("["+i.config.imgKeyAttr+"]").removeAttr(i.config.imgKeyAttr),e)for(var a=function(e){var t=s(r).children(":"+e+"-child").get(0);return t&&i.dataFilter.isEmptyElement(t,!0)?t:null},l=function(){return n.compact([a("first"),a("last")])};l().length;)n.forEach(l(),function(e){s(e).remove()});return r.innerHTML},we.prototype.setData=function(e,t,i){t&&(e=this.config.filterForSetData.call(this,e),e=this.dataFilter.filterHTML(e)),this.config.runIFrameSanitization&&(e=this.dataFilter.sanitizeIFrames(e)),U.call(this,e),i?this.dataFilter.flattenBlocksDown(this.element):this.dataFilter.blockifyInlineNodes(this.element),G.call(this),le.call(this),oe.call(this),K.call(this),this.onChange()},we.prototype.insertData=function(e,t,i){t&&(e=this.dataFilter.filterHTML(e)),H.call(this,e),i&&this.dataFilter.flattenBlocksDown(u.getNearestElement()),this.onChange()},we.prototype.blur=function(e){return e||k.call(this),s(this.element).blur()},we.prototype.focus=function(e){var t=s(this.element).focus();return e||this.setCursorToEnd(),t},we.prototype.hasFocus=function(){return s(this.element).is(":focus")},we.prototype.setPlaceholder=function(e){this.config.placeholder=e,$.call(this)},we.prototype.insertMedia=function(e,t,i,n){t&&(e=this.dataFilter.filterHTML(e)),ee.call(this,e,i,n),this.onChange()},we.prototype.addControl=function(e){var t=s(this.wrapper).find("[data-js=control-bar]");t.append(e)},we.prototype.isEmpty=function(){var e=z.call(this);return""===e||"
"===e||e===de||e===pe},we.prototype.getCurrentElement=function(){return u.getNearestElement()},we.prototype.getAsyncImage=function(e){return Y.call(this,e)},we.prototype.insertAsyncImage=function(e,t,i,n,s){Q.call(this,e,t,i,n,s),this.onChange()},we.prototype.updateAsyncImage=function(e,t,i){Z.call(this,e,t,i),this.onChange("updateAsyncImage")},we.prototype.setCursorToStart=function(e,t){var i=s(this.element);e=e&&i.find(e).first().get(0)||i.children().first().get(0),e&&c.setToStart(e),t||O.call(this)},we.prototype.setCursorToEnd=function(e,t){var i=s(this.element);e=e&&i.find(e).last().get(0)||i.children().last().get(0),e&&c.setToEnd(e),t||O.call(this)},we.prototype.insertNewParagraphAfter=function(e,t){return he.call(this,e,!1,t)},we.prototype.insertNewParagraphBefore=function(e,t){return he.call(this,e,!0,t)},we.prototype.isEmptyElement=function(e){return e=e||q.call(this),this.dataFilter.isEmptyElement(e)},we.prototype.hasSelection=function(e){return e=e||q.call(this),u.hasSelection(e)},we.prototype.isCursorAtEnd=function(e){return e=e||q.call(this),u.isCursorAtEnd(e)},we.prototype.isCursorAtStart=function(e){return e=e||q.call(this),u.isCursorAtStart(e)},we.prototype.teardown=function(){this.undoManager.teardown(),this.keyComboEvents.off()},we}();e.exports=b},function(e,t){/*! VelocityJS.org (1.4.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ /*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ !function(e){"use strict";function t(e){var t=e.length,n=i.type(e);return"function"!==n&&!i.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}if(!e.jQuery){var i=function(e,t){return new i.fn.init(e,t)};i.isWindow=function(e){return e&&e===e.window},i.type=function(e){return e?"object"==typeof e||"function"==typeof e?s[r.call(e)]||"object":typeof e:e+""},i.isArray=Array.isArray||function(e){return"array"===i.type(e)},i.isPlainObject=function(e){var t;if(!e||"object"!==i.type(e)||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!o.call(e,"constructor")&&!o.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(t in e);return void 0===t||o.call(e,t)},i.each=function(e,i,n){var s,o=0,r=e.length,a=t(e);if(n){if(a)for(;o0?s=r:i=r;while(Math.abs(o)>m&&++a=_?u(t,a):0===l?a:d(t,i,i+y)}function g(){x=!0,e===i&&n===s||h()}var f=4,_=.001,m=1e-7,v=10,b=11,y=1/(b-1),w="Float32Array"in t;if(4!==arguments.length)return!1;for(var C=0;C<4;++C)if("number"!=typeof arguments[C]||isNaN(arguments[C])||!isFinite(arguments[C]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var k=w?new Float32Array(b):new Array(b),x=!1,S=function(t){return x||g(),e===i&&n===s?t:0===t?0:1===t?1:l(p(t),i,s)};S.getControlPoints=function(){return[{x:e,y:i},{x:n,y:s}]};var T="generateBezier("+[e,i,n,s]+")";return S.toString=function(){return T},S}function h(e,t){var i=e;return b.isString(e)?k.Easings[e]||(i=!1):i=b.isArray(e)&&1===e.length?c.apply(null,e):b.isArray(e)&&2===e.length?x.apply(null,e.concat([t])):!(!b.isArray(e)||4!==e.length)&&u.apply(null,e),i===!1&&(i=k.Easings[k.defaults.easing]?k.defaults.easing:C),i}function d(e){if(e){var t=k.timestamp&&e!==!0?e:m.now(),i=k.State.calls.length;i>1e4&&(k.State.calls=s(k.State.calls),i=k.State.calls.length);for(var o=0;o4;e--){var t=i.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e}return n}(),_=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var i,n=(new Date).getTime();return i=Math.max(0,16-(n-e)),e=n+i,setTimeout(function(){t(n+i)},i)}}(),m=function(){var e=t.performance||{};if(!Object.prototype.hasOwnProperty.call(e,"now")){var i=e.timing&&e.timing.domComplete?e.timing.domComplete:(new Date).getTime();e.now=function(){return(new Date).getTime()-i}}return e}(),v=function(){var e=Array.prototype.slice;try{e.call(i.documentElement)}catch(t){e=function(){for(var e=this.length,t=[];--e>0;)t[e]=this[e];return t}}return e}(),b={isNumber:function(e){return"number"==typeof e},isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isWrapped:function(e){return e&&b.isNumber(e.length)&&!b.isString(e)&&!b.isFunction(e)&&!b.isNode(e)&&(0===e.length||b.isNode(e[0]))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}},y=!1;if(e.fn&&e.fn.jquery?(g=e,y=!0):g=t.Velocity.Utilities,f<=8&&!y)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(f<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var w=400,C="swing",k={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:i.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:g,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:w,easing:C,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(e){g.data(e,"velocity",{isSVG:b.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:4,patch:3},debug:!1,timestamp:!0,pauseAll:function(e){var t=(new Date).getTime();g.each(k.State.calls,function(t,i){if(i){if(e!==n&&(i[2].queue!==e||i[2].queue===!1))return!0;i[5]={resume:!1}}}),g.each(k.State.delayedElements,function(e,i){i&&a(i,t)})},resumeAll:function(e){var t=(new Date).getTime();g.each(k.State.calls,function(t,i){if(i){if(e!==n&&(i[2].queue!==e||i[2].queue===!1))return!0;i[5]&&(i[5].resume=!0)}}),g.each(k.State.delayedElements,function(e,i){i&&l(i,t)})}};t.pageYOffset!==n?(k.State.scrollAnchor=t,k.State.scrollPropertyLeft="pageXOffset",k.State.scrollPropertyTop="pageYOffset"):(k.State.scrollAnchor=i.documentElement||i.body.parentNode||i.body,k.State.scrollPropertyLeft="scrollLeft",k.State.scrollPropertyTop="scrollTop");var x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,i,n){var s={x:t.x+n.dx*i,v:t.v+n.dv*i,tension:t.tension,friction:t.friction};return{dx:s.v,dv:e(s)}}function i(i,n){var s={dx:i.v,dv:e(i)},o=t(i,.5*n,s),r=t(i,.5*n,o),a=t(i,n,r),l=1/6*(s.dx+2*(o.dx+r.dx)+a.dx),c=1/6*(s.dv+2*(o.dv+r.dv)+a.dv);return i.x=i.x+l*n,i.v=i.v+c*n,i}return function e(t,n,s){var o,r,a,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,h=1e-4,d=.016;for(t=parseFloat(t)||500,n=parseFloat(n)||20,s=s||null,l.tension=t,l.friction=n,o=null!==s,o?(u=e(t,n),r=u/s*d):r=d;;)if(a=i(a||l,r),c.push(1+a.x),u+=16,!(Math.abs(a.x)>h&&Math.abs(a.v)>h))break;return o?function(e){return c[e*(c.length-1)|0]}:u}}();k.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},g.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){k.Easings[t[0]]=u.apply(null,t[1])});var S=k.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=0?i:""},fixColors:function(e){return e.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,function(e,t,i){return S.Lists.colorNames.hasOwnProperty(i)?(t?t:"rgba(")+S.Lists.colorNames[i]+(t?"":",1)"):t+i})},cleanRootPropertyValue:function(e,t){return S.RegEx.valueUnwrap.test(t)&&(t=t.match(S.RegEx.valueUnwrap)[1]),S.Values.isCSSNullValue(t)&&(t=S.Hooks.templates[e][1]),t},extractValue:function(e,t){var i=S.Hooks.registered[e];if(i){var n=i[0],s=i[1];return t=S.Hooks.cleanRootPropertyValue(n,t),t.toString().match(S.RegEx.valueSplit)[s]}return t},injectValue:function(e,t,i){var n=S.Hooks.registered[e];if(n){var s,o,r=n[0],a=n[1];return i=S.Hooks.cleanRootPropertyValue(r,i),s=i.toString().match(S.RegEx.valueSplit),s[a]=t,o=s.join(" ")}return i}},Normalizations:{registered:{clip:function(e,t,i){switch(e){case"name":return"clip";case"extract":var n;return S.RegEx.wrappedValueAlreadyExtracted.test(i)?n=i:(n=i.toString().match(S.RegEx.valueUnwrap),n=n?n[1].replace(/,(\s+)?/g," "):i),n;case"inject":return"rect("+i+")"}},blur:function(e,t,i){switch(e){case"name":return k.State.isFirefox?"filter":"-webkit-filter";case"extract":var n=parseFloat(i);if(!n&&0!==n){var s=i.toString().match(/blur\(([0-9]+[A-z]+)\)/i);n=s?s[1]:0}return n;case"inject":return parseFloat(i)?"blur("+i+")":"none"}},opacity:function(e,t,i){if(f<=8)switch(e){case"name":return"filter";case"extract":var n=i.toString().match(/alpha\(opacity=(.*)\)/i);return i=n?n[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(i)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(i),10)+")"}else switch(e){case"name":return"opacity";case"extract":return i;case"inject":return i}}},register:function(){function e(e,t,i){var n="border-box"===S.getPropertyValue(t,"boxSizing").toString().toLowerCase();if(n===(i||!1)){var s,o,r=0,a="width"===e?["Left","Right"]:["Top","Bottom"],l=["padding"+a[0],"padding"+a[1],"border"+a[0]+"Width","border"+a[1]+"Width"];for(s=0;s9)||k.State.isGingerbread||(S.Lists.transformsBase=S.Lists.transformsBase.concat(S.Lists.transforms3D));for(var i=0;i8)&&3===o.split(" ").length&&(o+=" 1"),o;case"inject":return/^rgb/.test(s)?s:(f<=8?4===s.split(" ").length&&(s=s.split(/\s+/).slice(0,3).join(" ")):3===s.split(" ").length&&(s+=" 1"),(f<=8?"rgb":"rgba")+"("+s.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}}();S.Normalizations.registered.innerWidth=t("width",!0),S.Normalizations.registered.innerHeight=t("height",!0),S.Normalizations.registered.outerWidth=t("width"),S.Normalizations.registered.outerHeight=t("height")}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||k.State.isAndroid&&!k.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(k.State.prefixMatches[e])return[k.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],i=0,n=t.length;i=2&&console.log("Get "+i+": "+l),l},setPropertyValue:function(e,i,n,s,o){var a=i;if("scroll"===i)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?t.scrollTo(n,o.alternateValue):t.scrollTo(o.alternateValue,n);else if(S.Normalizations.registered[i]&&"transform"===S.Normalizations.registered[i]("name",e))S.Normalizations.registered[i]("inject",e,n),a="transform",n=r(e).transformCache[i];else{if(S.Hooks.registered[i]){var l=i,c=S.Hooks.getRoot(i);s=s||S.getPropertyValue(e,c),n=S.Hooks.injectValue(l,n,s),i=c}if(S.Normalizations.registered[i]&&(n=S.Normalizations.registered[i]("inject",e,n),i=S.Normalizations.registered[i]("name",e)),a=S.Names.prefixCheck(i)[0],f<=8)try{e.style[a]=n}catch(e){k.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else{var u=r(e);u&&u.isSVG&&S.Names.SVGAttribute(i)?e.setAttribute(i,n):e.style[a]=n}k.debug>=2&&console.log("Set "+i+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(e){var t="",i=r(e);if((f||k.State.isAndroid&&!k.State.isChrome)&&i&&i.isSVG){var n=function(t){return parseFloat(S.getPropertyValue(e,t))},s={translate:[n("translateX"),n("translateY")],skewX:[n("skewX")],skewY:[n("skewY")],scale:1!==n("scale")?[n("scale"),n("scale")]:[n("scaleX"),n("scaleY")],rotate:[n("rotateZ"),0,0]};g.each(r(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),s[e]&&(t+=e+"("+s[e].join(" ")+") ",delete s[e])})}else{var o,a;g.each(r(e).transformCache,function(i){return o=r(e).transformCache[i],"transformPerspective"===i?(a=o,!0):(9===f&&"rotateZ"===i&&(i="rotate"),void(t+=i+o+" "))}),a&&(t="perspective"+a+" "+t)}S.setPropertyValue(e,"transform",t)}};S.Hooks.register(),S.Normalizations.register(),k.hook=function(e,t,i){var s;return e=o(e),g.each(e,function(e,o){if(r(o)===n&&k.init(o),i===n)s===n&&(s=S.getPropertyValue(o,t));else{var a=S.setPropertyValue(o,t,i);"transform"===a[0]&&k.CSS.flushTransformCache(o),s=a}}),s};var T=function(){function e(){return u?x.promise||null:f}function s(e,s){function o(o){var u,p;if(l.begin&&0===P)try{l.begin.call(m,m)}catch(e){setTimeout(function(){throw e},1)}if("scroll"===A){var f,_,w,C=/^x$/i.test(l.axis)?"Left":"Top",T=parseFloat(l.offset)||0;l.container?b.isWrapped(l.container)||b.isNode(l.container)?(l.container=l.container[0]||l.container,f=l.container["scroll"+C],w=f+g(e).position()[C.toLowerCase()]+T):l.container=null:(f=k.State.scrollAnchor[k.State["scrollProperty"+C]],_=k.State.scrollAnchor[k.State["scrollProperty"+("Left"===C?"Top":"Left")]],w=g(e).offset()[C.toLowerCase()]+T),c={scroll:{rootPropertyValue:!1,startValue:f,currentValue:f,endValue:w,unitType:"",easing:l.easing,scrollData:{container:l.container,direction:C,alternateValue:_}},element:e},k.debug&&console.log("tweensContainer (scroll): ",c.scroll,e)}else if("reverse"===A){if(u=r(e),!u)return;if(!u.tweensContainer)return void g.dequeue(e,l.queue);"none"===u.opts.display&&(u.opts.display="auto"),"hidden"===u.opts.visibility&&(u.opts.visibility="visible"),u.opts.loop=!1,u.opts.begin=null,u.opts.complete=null,y.easing||delete l.easing,y.duration||delete l.duration,l=g.extend({},u.opts,l),p=g.extend(!0,{},u?u.tweensContainer:null);for(var I in p)if(p.hasOwnProperty(I)&&"element"!==I){var F=p[I].startValue;p[I].startValue=p[I].currentValue=p[I].endValue,p[I].endValue=F,b.isEmptyObject(y)||(p[I].easing=l.easing),k.debug&&console.log("reverse tweensContainer ("+I+"): "+JSON.stringify(p[I]),e)}c=p}else if("start"===A){u=r(e),u&&u.tweensContainer&&u.isAnimating===!0&&(p=u.tweensContainer);var M=function(t,i){var n,o,r;return b.isFunction(t)&&(t=t.call(e,s,E)),b.isArray(t)?(n=t[0],!b.isArray(t[1])&&/^[\d-]/.test(t[1])||b.isFunction(t[1])||S.RegEx.isHex.test(t[1])?r=t[1]:b.isString(t[1])&&!S.RegEx.isHex.test(t[1])&&k.Easings[t[1]]||b.isArray(t[1])?(o=i?t[1]:h(t[1],l.duration),r=t[2]):r=t[1]||t[2]):n=t,i||(o=o||l.easing),b.isFunction(n)&&(n=n.call(e,s,E)),b.isFunction(r)&&(r=r.call(e,s,E)),[n||0,o,r]},N=function(s,o){var r,h=S.Hooks.getRoot(s),d=!1,f=o[0],_=o[1],m=o[2];if(!(u&&u.isSVG||"tween"===h||S.Names.prefixCheck(h)[1]!==!1||S.Normalizations.registered[h]!==n))return void(k.debug&&console.log("Skipping ["+h+"] due to a lack of browser support.")); (l.display!==n&&null!==l.display&&"none"!==l.display||l.visibility!==n&&"hidden"!==l.visibility)&&/opacity|filter/.test(s)&&!m&&0!==f&&(m=0),l._cacheValues&&p&&p[s]?(m===n&&(m=p[s].endValue+p[s].unitType),d=u.rootPropertyValueCache[h]):S.Hooks.registered[s]?m===n?(d=S.getPropertyValue(e,h),m=S.getPropertyValue(e,s,d)):d=S.Hooks.templates[h][1]:m===n&&(m=S.getPropertyValue(e,s));var v,y,w,C=!1,x=function(e,t){var i,n;return n=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return i=e,""}),i||(i=S.Values.getUnitType(e)),[n,i]};if(m!==f&&b.isString(m)&&b.isString(f)){r="";var T=0,E=0,P=[],I=[],F=0,A=0,M=0;for(m=S.Hooks.fixColors(m),f=S.Hooks.fixColors(f);T=4&&"("===N?F++:(F&&F<5||F>=4&&")"===N&&--F<5)&&(F=0),0===A&&"r"===N||1===A&&"g"===N||2===A&&"b"===N||3===A&&"a"===N||A>=3&&"("===N?(3===A&&"a"===N&&(M=1),A++):M&&","===N?++M>3&&(A=M=0):(M&&A<(M?5:4)||A>=(M?4:3)&&")"===N&&--A<(M?5:4))&&(A=M=0)}}T===m.length&&E===f.length||(k.debug&&console.error('Trying to pattern match mis-matched strings ["'+f+'", "'+m+'"]'),r=n),r&&(P.length?(k.debug&&console.log('Pattern found "'+r+'" -> ',P,I,"["+m+","+f+"]"),m=P,f=I,y=w=""):r=n)}r||(v=x(s,m),m=v[0],w=v[1],v=x(s,f),f=v[0].replace(/^([+-\/*])=/,function(e,t){return C=t,""}),y=v[1],m=parseFloat(m)||0,f=parseFloat(f)||0,"%"===y&&(/^(fontSize|lineHeight)$/.test(s)?(f/=100,y="em"):/^scale/.test(s)?(f/=100,y=""):/(Red|Green|Blue)$/i.test(s)&&(f=f/100*255,y="")));var H=function(){var n={myParent:e.parentNode||i.body,position:S.getPropertyValue(e,"position"),fontSize:S.getPropertyValue(e,"fontSize")},s=n.position===D.lastPosition&&n.myParent===D.lastParent,o=n.fontSize===D.lastFontSize;D.lastParent=n.myParent,D.lastPosition=n.position,D.lastFontSize=n.fontSize;var r=100,a={};if(o&&s)a.emToPx=D.lastEmToPx,a.percentToPxWidth=D.lastPercentToPxWidth,a.percentToPxHeight=D.lastPercentToPxHeight;else{var l=u&&u.isSVG?i.createElementNS("http://www.w3.org/2000/svg","rect"):i.createElement("div");k.init(l),n.myParent.appendChild(l),g.each(["overflow","overflowX","overflowY"],function(e,t){k.CSS.setPropertyValue(l,t,"hidden")}),k.CSS.setPropertyValue(l,"position",n.position),k.CSS.setPropertyValue(l,"fontSize",n.fontSize),k.CSS.setPropertyValue(l,"boxSizing","content-box"),g.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){k.CSS.setPropertyValue(l,t,r+"%")}),k.CSS.setPropertyValue(l,"paddingLeft",r+"em"),a.percentToPxWidth=D.lastPercentToPxWidth=(parseFloat(S.getPropertyValue(l,"width",null,!0))||1)/r,a.percentToPxHeight=D.lastPercentToPxHeight=(parseFloat(S.getPropertyValue(l,"height",null,!0))||1)/r,a.emToPx=D.lastEmToPx=(parseFloat(S.getPropertyValue(l,"paddingLeft"))||1)/r,n.myParent.removeChild(l)}return null===D.remToPx&&(D.remToPx=parseFloat(S.getPropertyValue(i.body,"fontSize"))||16),null===D.vwToPx&&(D.vwToPx=parseFloat(t.innerWidth)/100,D.vhToPx=parseFloat(t.innerHeight)/100),a.remToPx=D.remToPx,a.vwToPx=D.vwToPx,a.vhToPx=D.vhToPx,k.debug>=1&&console.log("Unit ratios: "+JSON.stringify(a),e),a};if(/[\/*]/.test(C))y=w;else if(w!==y&&0!==m)if(0===f)y=w;else{a=a||H();var q=/margin|padding|left|right|width|text|word|letter/i.test(s)||/X$/.test(s)||"x"===s?"x":"y";switch(w){case"%":m*="x"===q?a.percentToPxWidth:a.percentToPxHeight;break;case"px":break;default:m*=a[w+"ToPx"]}switch(y){case"%":m*=1/("x"===q?a.percentToPxWidth:a.percentToPxHeight);break;case"px":break;default:m*=1/a[y+"ToPx"]}}switch(C){case"+":f=m+f;break;case"-":f=m-f;break;case"*":f*=m;break;case"/":f=m/f}c[s]={rootPropertyValue:d,startValue:m,currentValue:m,endValue:f,unitType:y,easing:_},r&&(c[s].pattern=r),k.debug&&console.log("tweensContainer ("+s+"): "+JSON.stringify(c[s]),e)};for(var R in v)if(v.hasOwnProperty(R)){var O=S.Names.camelCase(R),j=M(v[R]);if(S.Lists.colors.indexOf(O)>=0){var $=j[0],L=j[1],B=j[2];if(S.RegEx.isHex.test($)){for(var U=["Red","Green","Blue"],z=S.Values.hexToRgb($),H=B?S.Values.hexToRgb(B):n,q=0;q",{class:"link-bubbles"}).css({position:"absolute",top:0,left:0}),this.linkUrl=s("
",{class:"url"}),this.linkEditInput=s("",{type:"text",placeholder:"http://"}),this.linkEditDone=s("
",{class:"done"}).text(this.actionNames.done),this.linkUrl.hide(),this.linkUrl.append(this.linkEditInput).append(this.linkEditDone),t.call(this),this.element.append(this.linkUrl),this.hide()}function t(){var e=this,t=s("
",{class:"options"}),n={edit:function(){i.call(this)},remove:function(){var e=window.getSelection(),t=document.createRange();t.selectNodeContents(this.linkElement),e.removeAllRanges(),e.addRange(t),window.document.execCommand("unlink",!1,null),e.removeAllRanges(),this.onChange(),this.hide()},open:function(){var e=s(this.linkElement).attr("href");e.indexOf("://")===-1&&(e="http://"+e),window.open(e,"_blank")}};for(var o in n){var r=s("
",{class:o}).text(this.actionNames[o]);s(r).on("click",function(t){return function(){t.call(e)}}(n[o])),t.append(r)}t.hide(),s(this.element).append(t)}function i(){this.linkElement||c.error("Cannot edit link without a valid linkElement");var e=this.linkElement;u.call(this,function(t){s(e).attr("href",t)},s(e).attr("href"))}function u(e,t){t&&(this.linkEditInput.val(t),this.linkUrl.addClass("modified"));var i=this,n=function(){var t=s(i.linkEditInput).val().trim();e(t),i.onChange(),i.close()};s(this.linkEditInput).on("keydown",function(e){i.linkUrl.addClass("modified"),e.keyCode===d.enter?(e.preventDefault(),n()):e.keyCode===d.esc&&(i.close(),i.onDismiss(),e.stopPropagation())}),s(this.linkEditInput).on("keyup",function(e){e.keyCode!==d.esc&&e.keyCode!==d.enter&&h.call(i)}),s(this.linkEditInput).on("paste",function(e){i.linkUrl.addClass("modified"),h.call(i)}),this.linkEditDone.on("click",function(e){e.preventDefault(),n()}),this.element.find(".options").hide(),this.linkUrl.show(),this.show(),h.call(this),s(this.linkEditInput).focus()}function h(){var e=s(this.linkEditInput).val(),t=s(this.linkEditDone).outerWidth(),i=s(this.linkUrl).outerWidth()-s(this.linkUrl).width(),n=r.calcTextWidth(s(this.linkEditInput).get(0),e),a=r.calcTextWidth(s(this.linkEditInput).get(0),"A"),l=n+t+i+a,c=lthis.maxWidth?this.maxWidth:c;var u=s(this.element),h=c-u.width();if(0!==h){var d=Math.floor(h/2);o(u,{width:c,left:"-="+d},{duration:40,easing:"ease"})}}var d={shift:16,enter:13,esc:27,delete:8,tab:9},p=function(t){this.onChange="onChange"in t&&n.isFunction(t.onChange)?t.onChange:n.noop,this.onDismiss=t.onDismiss||n.noop,this.bypassClasses="bypassClasses"in t&&n.isArray(t.bypassClasses)?t.bypassClasses:[],this.maxWidth="maxWidth"in t&&n.isNumber(t.maxWidth)?t.maxWidth:600,this.minWidth="minWidth"in t&&n.isNumber(t.minWidth)?t.minWidth:200,this.linkElement=null,this.labels=n.extend({},{Edit:"Edit",Remove:"Remove",Open:"Open",Done:"Done"},t.labels),this.actionNames={edit:this.labels.Edit,remove:this.labels.Remove,open:this.labels.Open,done:this.labels.Done},e.call(this),l.call(this)};return n.assign(p.prototype,l.prototype),p.prototype.createLink=function(e){u.call(this,function(t){a.restoreSelection(e),window.document.execCommand("createLink",!1,t);var i=window.getSelection(),n=i.getRangeAt(0);n.collapse(!1),i.removeAllRanges(),i.addRange(n)})},p.prototype.showOptions=function(e){this.linkElement=e,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(e){return!!e&&!n.some(this.bypassClasses,function(t){return s(e).hasClass(t)})},p}();e.exports=u},function(e,t,i){var n=i(3),s=i(8),o=function(){var e=function(){};return e.calcTextWidth=function(e,t){var i=["font-style","font-weight","font-size","font-family"],o=n.reduce(i,function(t,i){return t+" "+s(e).css(i)},"").trim(),r=document.createElement("canvas"),a=r.getContext("2d");a.font=o;var l=a.measureText(t);return Math.round(l.width)},e.browser=function(){var e=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(trident)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},t=e(navigator.userAgent),i={};return t.browser&&(i[t.browser]=!0,i.version=t.version),i.trident&&(i.msie=!0),i.chrome?i.webkit=!0:i.webkit&&(i.safari=!0),i}(),e}();e.exports=o},function(e,t){var i=function(){return{saveSelection:function(e,t){if(t=t||window.getSelection(),!t||!t.rangeCount)return null;for(var i,n,s,o=t.getRangeAt(0),r=0,a=[e];!s&&(i=a.pop());){if(i.nodeType===i.TEXT_NODE)i===o.startContainer?(r+=o.startOffset,s=!0):r+=i.length;else{var l=i.childNodes.length;if("false"!==i.getAttribute("contenteditable"))for(;l--;)a.push(i.childNodes[l])}n=i}return{container:e,endContainer:o.endContainer,start:r,end:r+o.toString().length,selection:t,anchorNode:t.anchorNode}},restoreSelection:function(e){if(e){var t=0,i=document.createRange();i.setStart(e.container,0),i.collapse(!0);for(var n,s,o=[e.container],r=!1,a=!1;!a&&(n=o.pop());){if(n.nodeType===n.TEXT_NODE){var l=t+n.length;!r&&e.start>=t&&e.start=t&&e.end<=l&&(i.setEnd(n,e.end-t),a=!0),t=l}else{var c=n.childNodes.length;if("false"!==n.getAttribute("contenteditable"))for(;c--;)o.push(n.childNodes[c])}s=n}if(!a){var u=e.end-t;try{i.setEnd(e.endContainer,u)}catch(e){}}var h=window.getSelection();h.removeAllRanges();try{h.addRange(i)}catch(e){}}},setToStart:function(e){if(e){var t=document.createRange();t.setStart(e,0),t.setEnd(e,0),t.collapse(!0);var i=window.getSelection();i.removeAllRanges();try{i.addRange(t)}catch(e){}}},setToEnd:function(e){for(var t=[e],i=null,n=e,s=0;i=t.pop();)if(3===i.nodeType)n=i,s=i.length;else for(var o=i.childNodes.length;o--;)t.push(i.childNodes[o]);var r=document.createRange();r.setStart(n,s),r.setEnd(n,s),r.collapse(!0);var a=window.getSelection();a.removeAllRanges();try{a.addRange(r)}catch(e){}}}}();e.exports=i},function(e,t,i){var n=i(301),s=function(){function e(e,t){"number"==typeof e&&"number"==typeof t&&this.element.css({left:e+"px",top:t+"px"})}function t(){var e=this.element.get(0).getBoundingClientRect().left;e<0&&this.element.css("left","+="+-1*e+"px");var t=this.element.get(0).getBoundingClientRect().top;t<0&&this.element.css("top","+="+-1*t+"px")}var i=function(e){return this.element?(e=e||{},this.onShow=e.onShow||function(e){e.element.show()},this.onHide=e.onHide||function(e){e.element.hide()},this.isShown=!1,void this.element.hide()):(n.error("ControlBase requires an element"),null)};return i.prototype.hide=function(){this.isShown&&(this.isShown=!1,this.onHide(this))},i.prototype.showOverTarget=function(e,i){var n=e-this.element.width()/2,s=i-this.element.height()-10;this.show(n,s),t.call(this)},i.prototype.show=function(t,i){e.call(this,t,i),this.isShown||(this.isShown=!0,this.onShow(this))},i.prototype.size=function(e,t){e&&"number"==typeof e&&this.element.width(e),t&&"number"==typeof t&&this.element.width(t)},i}();e.exports=s},function(e,t,i){var n=i(3),s=i(294),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(e){return function(){return s.debugMode?window.console[e].bind(window.console).apply(this,arguments):n.noop}},a={};n.each(o,function(e){a[e]=r(e)}),e.exports=a},function(e,t,i){var n=i(3),s=i(8),o=i(296),r=o.animate,a=i(300),l=function(){function e(){var e=this,t=n.reduce(this.controlsOrder,function(e,t){return n.has(this.controls,t)&&e.push(this.template(n.extend({name:t},this.controls[t]))),e},[],this);this.element=s("
",{class:"bubbles"}).css({position:"absolute",top:0,left:0}).html(t),this.buttons=s(this.element).find("[data-command]"),this.hide(),this.buttons.on("mousedown",function(e){e.preventDefault()}),this.buttons.on("mouseup",function(t){t.preventDefault(),l.call(e,this)})}function t(){n.each(this.controls,function(e,t){n.has(e,"keyboard")&&this.keyboardEvents.on(e.keyboard,n.partial(o.bind(this),t)),n.has(e,"keyboardInverse")&&this.keyboardEvents.on(e.keyboardInverse,n.partial(i.bind(this),t))},this)}function i(e){n.has(this.controls,e)&&d[e]&&o.call(this,e)}function o(e){var t,i,s,o;n.has(this.controls,e)&&(t=d[e],i=this.controls[e],s=i.command,o=i.el,t&&this.inverseCommand&&"function"==typeof this.inverseCommand?this.inverseCommand(s,o,this):this.applyCommand&&"function"==typeof this.applyCommand&&this.applyCommand(s,o,this),this.onAction(this))}function l(e){o.call(this,s(e).attr("data-name"))}function c(){this.buttons.removeClass("active"),this.buttons.filter(function(){return d[s(this).attr("data-name")]}).addClass("active")}function u(e,t){var i=!1;return s.each(e,function(e,n){if(n===t||"undefined"!=typeof n.nodeName&&n.nodeName===t)return i=!0,!1}),i}var h='
 
',d={},p=function(i,s,o){o=o||{},this.applyCommand=i,this.inverseCommand=s,this.template=n.template(o.template||h),this.controls=o.controls||{},this.controlsOrder=o.controlsOrder||n.keys(this.controls),this.onAction=o.onAction||n.noop,this.keyboardEvents=o.keyboardEvents,e.call(this),this.keyboardEvents&&t.call(this),a.call(this,o)};return n.assign(p.prototype,a.prototype),p.prototype.setActives=function(e){d=n.reduce(this.controls,function(t,i,n){var s=i.command,o=(i.el||"").toUpperCase(),r=u(e,o),a=!1;try{a=document.queryCommandEnabled(s)&&document.queryCommandState(s)}catch(e){a=!1}return t[n]=a||r,t},{},this),c.call(this)},p.prototype.open=function(e,t){if(!this.isShown){var i=s(this.element).children("[data-command]"),n=s(this.element).find(".shim");s(this.element).css({width:"auto"}),n.remove(),i.removeAttr("style")}this.showOverTarget(e,t)},p.prototype.closeWithShim=function(e,t,i,o){var a=s(this.element),l=s(e),c=s('
 
').get(0),u=n.has(r,"Promise");i=u?i:200;var h=a.width();a.css("width",h+t);var d=l.position().left,p=h/2-(d+t/2);l.before(c).hide();var g=s(c).offset().left+p,f=s(c).offset().top;this.isAnimating=!0,n.forEach(this.buttons,function(e,t){r(e,"stop"),r(e,{opacity:0},{duration:.5*i})}),r(a,{left:"+="+p},{easing:"ease",duration:i});var _=r(c,{width:t},{easing:"ease",duration:i}),m=n.bind(function(){n.isFunction(o)&&o.call(this,g,f),this.isAnimating=!1,this.hide()},this);u?_.then(m):n.delay(m,i)},p.prototype.getActiveStates=function(){return d},p}();e.exports=l},function(e,t,i){var n=i(3),s=i(8),o=i(304),r=function(){function e(e){e.normalize();for(var t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1);t.nextNode();){var i=t.currentNode,n=s(i).parent().is(e);n&&""!==i.nodeValue.trim()&&s(i).wrap("

")}}function t(t){e(t),s(t).children().each(function(){var e=s(this).get(0),t=e.nodeName===_,i=e.nodeName===m;v(e)||b(e)||t||i||s(this).wrap("

")})}function i(e){return n.filter(s(e).find("*").toArray(),function(e){return v(e)||w(e)})}function r(e,o){e.normalize(),o||t(e);var r=i(e);!r.length&&o||(o&&(t(e),r=i(e)),s(e).empty(),n.each(r,function(t){var i=n.some(s(t).children().toArray(),function(e){return v(e)});(w(t)||!h(t)&&!i)&&s(e).append(t)}))}function a(e){if(!w(e)){var t=s(e).children(g.join()).toArray(),i=!1;n.each(t,function(e){i||(s(e).unwrap(),i=!0),a(e)})}}function l(e,t){var o=i(e);n.each(o,function(e){s(e).find("li").contents().unwrap(),t&&(s(e).find("br:last-child").remove(),s(e).append("
")),s(e).contents().unwrap()})}function c(e){var i=C(e);i.shift();for(var n=i.shift();n&&!s(n).is("[contentEditable]");){var o=n.parentNode;s(n).contents().unwrap(),t(o),n=i.shift()}}function u(e){if(e&&e.length){for(var t=e.shift(),i=!1,o=["style","dir"];t;){var r=s(t).find("span").toArray();"SPAN"===t.nodeName&&r.push(t),r.length&&(i=!0),s(r).contents().unwrap(),n.each(o,function(e){s(t).removeAttr(e),s(t).find("["+e+"]").removeAttr(e)}),t=e.shift()}return i}}function h(e,t){var i=s(e).text();t&&(i=i.replace(/\n|\r/gm,"").trim());var n=e&&e.nodeName===m;return""===i&&!b(e)&&!y(e)&&!n}function d(e){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body}function p(e){var t=document.implementation.createHTMLDocument("");return t.body.appendChild(e.cloneNode(!0)),t.body}var g=["P","FIGURE","H2","BLOCKQUOTE","UL","OL","PRE"],f=["FIGURE","IFRAME","IMG","HR"],_="DIV",m="HR",v=function(e){return n.contains(g,e.nodeName)},b=function(e){return e&&n.contains(f,e.nodeName)},y=function(e){return s(e).find(f.join()).length},w=function(e){return"false"===s(e).attr("contenteditable")},C=function(e){return n.filter(e,function(e){return n.contains(g,e.nodeName)})},k=function(e){this.sanitizeConfig=e};return k.prototype.flattenBlocksDown=function(e,t){r(e,t)},k.prototype.unBlock=function(e){a(e)},k.prototype.unwrapParentBlocks=function(e){c(e)},k.prototype.scrubSpansAndBadAttrs=function(e,t){return u(e,t)},k.prototype.blockifyInlineNodes=function(e){t(e)},k.prototype.inlinify=function(e,t){l(e,t)},k.prototype.getBlockNodes=function(e){return i(e)},k.prototype.isEmptyElement=function(e,t){return h(e,t)},k.prototype.filterHTML=function(e){var t=d(e),i=new o(this.sanitizeConfig),n=i.clean_node(t),s=p(n),r=s.innerHTML,a=r.replace(/[<]p[>][ ]*[<]\/p[>]/g,"");return a},k.prototype.filterPlaintext=function(e,t){var i=n.escape(e);return i=i.replace(/\r\n/g,"\n"),i=i.replace(/\r/g,"\n"),t&&(i=i.replace(/\n([ ]*\n)+/g,"

")),i=i.replace(/\n/g,"
"),t&&(i="

"+i+"

"),i},k.prototype.convertToBrowserSpaces=function(e){return e.replace(/[ ]{2}/g,"  ").replace(/[ ]$/," ")},k.prototype.sanitizeIFrames=function(e){var t=d(e);return s(t).find("iframe").each(function(){s(this).attr("data-original-src",s(this).attr("src")),s(this).attr("src","javascript:''")}),t.innerHTML},k.prototype.unSanitizeIFrames=function(e){var t=d(e);return s(t).find("iframe[data-original-src]").each(function(){s(this).attr("src",s(this).attr("data-original-src")),s(this).removeAttr("data-original-src")}),t.innerHTML},k}();e.exports=r},function(e,t){function i(){var e,t;for(t=arguments[0]||{},this.config={},this.config.elements=t.elements?t.elements:[],this.config.attributes=t.attributes?t.attributes:{},this.config.attributes[i.ALL]=this.config.attributes[i.ALL]?this.config.attributes[i.ALL]:[],this.config.allow_comments=!!t.allow_comments&&t.allow_comments,this.allowed_elements={},this.config.protocols=t.protocols?t.protocols:{},this.config.classnames=t.classnames?t.classnames:{},this.config.add_attributes=t.add_attributes?t.add_attributes:{},this.dom=t.dom?t.dom:document,e=0;e0;)this.current_element.removeChild(this.current_element.firstChild);l.appendChild(this.current_element)}if(!this.config.remove_all_contents&&!this.config.remove_element_contents[c])for(r=0;r0},isEditorNode:function(e){return s(e).is('[contentEditable="true"]')},hasSelection:function(){var e=i.getSelection();return e&&!e.isCollapsed},rangeFromElement:function(e){var t,n,s=i.getSelection();return!(!s||!s.isCollapsed)&&(n=s.getRangeAt(0),t=n.cloneRange(),t.selectNodeContents(e),t.setEnd(n.startContainer,n.startOffset),t)},isCursorAtEnd:function(e,t){var i=this.rangeFromElement(e);if(!i)return!1;var n=i.toString(),s=e.textContent;return t&&(n=n.trim(),s=s.trim()),n.length===s.length},isCursorAtStart:function(e){var t=this.rangeFromElement(e);return!!t&&(0===t.startOffset&&0===t.endOffset)}};return i}();e.exports=o},function(e,t,i){var n=i(3),s=i(8),o=i(300),r=function(){function e(){this.element=s("
",{class:"inline-controls"}).css({position:"absolute",top:0,left:0}),this.opener=s("
",{class:"opener"}),this.isTrayOpen=!1;var e=this;this.opener.on("mousedown",function(i){return i.preventDefault(),i.stopPropagation(),t.call(e,null,!0),!1}),this.tray=s("
",{class:"tray"}),this.element.append(this.opener),this.element.append(this.tray),this.hide()}function t(e,t){"boolean"!=typeof e&&(e=!this.isTrayOpen),e?(this.openTray.call(this,this.tray),this.isTrayOpen=!0,this.onTrayOpened.call(this,t)):(this.closeTray.call(this,this.tray),this.isTrayOpen=!1,this.onTrayClosed.call(this,t)),s(this.opener).toggleClass("open",this.isTrayOpen),t?s(this.opener).toggleClass("closed",!this.isTrayOpen):s(this.opener).removeClass("closed")}var i=function(t){t=t||{},this.openTray=t.openTray||this.openTray,this.closeTray=t.closeTray||this.closeTray,this.onTrayOpened=t.onTrayOpened||function(e){},this.onTrayClosed=t.onTrayClosed||function(e){},this.customOffset=t.customOffset||n.noop,this.keyboardEvents=t.keyboardEvents,e.call(this),o.call(this,t)};n.assign(i.prototype,o.prototype);var r=n.memoize(function(e,t){var i;return n.isFunction(t)?i=t.call():n.isObject(t)&&(i=t),n.pick(n.defaults(n.isObject(i)?i:{},{x:e.x||e,y:e.y||0}),["x","y"])});return i.prototype.addToTray=function(e,t){var i;t=t||{},this.tray.append(e),i=t.keyboard,this.keyboardEvents&&i&&this.keyboardEvents.on(i.shortcut,i.callback,i.context)},i.prototype.openTray=function(e){e.show()},i.prototype.closeTray=function(e){e.hide()},i.prototype.open=function(e,i){if(e){i=r(i||0,this.customOffset||0);var n=s(e).position(),o=parseInt(s(e).css("margin-top"),10)||0;t.call(this,!1),this.show(n.left+i.x,n.top+i.y+o)}},i.prototype.close=function(){t.call(this,!1),this.hide()},i.prototype.toggleTrayWithIntent=function(e){t.call(this,e,!0)},i}();e.exports=r},function(e,t,i){var n=i(3),s=i(8),o=i(299),r=function(){function e(){var e=this,n=function(e){return/Mac/.test(navigator.platform)?e.metaKey:e.ctrlKey};s(this.editor.element).on("keydown.undoManager",function(s){if(s.keyCode===u.z&&n(s)&&!s.altKey)return s.shiftKey?i.call(e):t.call(e),s.preventDefault(),!1})}function t(){if(l.call(this),this.undoStates.length){var e=this.undoStates.pop();c.call(this,e),this.redoStates.push(this.currState),r.call(this)}}function i(){if(this.redoStates.length){var e=this.redoStates.pop();c.call(this,e),this.undoStates.push(this.currState),r.call(this)}}function r(){this.currState=a.call(this)}function a(){var e={data:this.editor.getData(!0,!0),selection:o.saveSelection(this.editor.element)};return e}function l(){var e=a.call(this);return this.currState?void(e.data!==this.currState.data&&(this.undoStates.push(this.currState),this.currState=e)):void(this.currState=e)}function c(e){if(this.isRestoring=!0,this.editor.setData(e.data,!0),e.selection)o.restoreSelection(e.selection);else{var t=window.getSelection();t.removeAllRanges()}this.afterRestore()}var u={command:91,control:17,shift:16,z:90},h=500,d=function(t,i){this.editor=t,this.modifierKeyCode=!1,this.isShift=!1,this.currState=null,this.undoStates=[],this.redoStates=[],this.afterRestore=i||function(){},this.isRestoring=!1;var s=this,o=n.debounce(function(){s.isTorndown||l.call(s)},h);this.defaultOnChange=t.onChange,t.onChange=function(e){if(s.isRestoring)s.isRestoring=!1;else{if("updateAsyncImage"===e)return;s.currState?o():l.call(s)}s.defaultOnChange.call(this)},e.call(this)};return d.prototype.undo=function(){t.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,s(this.editor.element).off(".undoManager")},d}();e.exports=r},function(e,t,i){var n=i(3),s=i(8),o=i(305),r=i(299),a=i(298),l=function(){function e(){var e=this;s(this.editor.element).on("keypress",function(n){var s=!1;if(34===n.charCode)s=i.call(e);else{if(39!==n.charCode)return;s=t.call(e)}s&&n.preventDefault()})}function t(){var e=this.config.singleQuotes;return l.call(this,e.open,e.close,e.prime)}function i(){var e=this.config.doubleQuotes;return l.call(this,e.open,e.close,e.prime)}function l(e,t,i){var a=o.getSelection();if(!a.isCollapsed)return!1;var l=a.anchorNode;l.normalize();var c=r.saveSelection(l),u=l.textContent,h=u.slice(0,c.start),d=h.charAt(h.length-1),p=l.lastChild&&"BR"===l.lastChild.nodeName?l.lastChild:null,g=n.any(this.config.openingMatches,function(e){return e.test(d)})||p,f="";f=!d||g?e:/\d/.test(d)?i:t;var _=document.createTextNode(f),m=a.getRangeAt(0);return m.deleteContents(),m.insertNode(_),p&&p.previousSibling&&"BR"===p.previousSibling.nodeName&&s(p).remove(),m.setEndAfter(_),m.collapse(!1),a.removeAllRanges(),a.addRange(m),!0}var c=function(t,i){return a.browser.msie?null:(this.editor=t,this.config={openingMatches:[/\s/,/\u200B/,/[=]/],singleQuotes:{open:"‘",close:"’",prime:"′"},doubleQuotes:{open:"“",close:"”",prime:"″"}},n.extend(this.config,i||{}),void e.call(this))};return c}();e.exports=l},function(e,t,i){var n=i(3),s=i(8),o=i(310),r=function(){function e(){s(this.element).on("keydown.keycombos",i.bind(this)),this.listening=!0}function t(){s(this.element).off("keydown.keycombos"),this.listening=!1}function i(e){var t=this.humanKeys.translate(e);t&&a.call(this,t)&&(r.call(this,t,e),e.preventDefault(),e.stopImmediatePropagation())}function r(e,t){n.each(c.call(this,e),function(i){n.has(i,"callback")&&n.has(i,"context")&&i.callback.call(i.context,t,e)})}function a(e){return c.call(this,e).length>0}function l(e,t){var i=c.call(this,e);return n.filter(i,{callback:t}).length>0}function c(e){return n.has(this.subscribers,e)?this.subscribers[e]:[]}function u(t,i,s){if(!l.call(this,t,i))return n.has(this.subscribers,t)||(this.subscribers[t]=[]),this.subscribers[t].push({callback:i,context:s}),this.listening||e.call(this),this}function h(){this.subscribers={},t.call(this)}function d(e,i){return e?n.has(this.subscribers,e)?(i&&(this.subscribers[e]=n.reject(this.subscribers[e],{callback:i})),i&&0!==this.subscribers[e].length||delete this.subscribers[e],0===n.values(this.subscribers).length&&t.call(this),this):this:(h.call(this),this)}var p=function(e){e=e||{},this.debounceRate=e.debounceRate||100,this.element=e.element||document,this.humanKeys=e.humanKeys||new o,this.subscribers={},this.listening=!1};return p.prototype.on=function(e,t,i){n.each((e||"").split(" "),function(e){u.call(this,this.humanKeys.normalize(e),t,i)},this)},p.prototype.off=function(e,t){e?n.each(e.split(" "),function(e){d.call(this,this.humanKeys.normalize(e),t)},this):d.call(this,null,t)},p}();e.exports=r},function(e,t,i){var n=i(3),s=function(){function e(){return navigator.platform.match(/^Win/i)?"Win":navigator.platform.match(/^Mac/i)?"Mac":navigator.platform.match(/^Linux/i)?"Linux":navigator.platform}function t(){return n.extend({},this.prettyMapping,this.platformPrettyMapping[e.call(this)])}function i(){return this.platformModifiers[e.call(this)]||{}}function s(){var t=e.call(this);return n.has(this.platformPrettySeperators,t)?this.platformPrettySeperators[t]:this.seperator}function o(e){return this.specialKeys[e.keyCode]||String.fromCharCode(e.keyCode)}function r(e){return n.filter(this.modifiers,function(t){return e[t+"Key"]})}function a(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}var l=["ctrl","meta","alt","shift"],c="+",u={37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN",187:"PLUS",61:"PLUS",188:"COMMA",189:"MINUS",173:"MINUS",190:"DOT",32:"SPACE"},h={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:""},f=function(e){e=e||{},this.modifiers=e.modifiers||l,this.separator=e.separator||c,this.specialKeys=e.specialKeys||u,this.prettyMapping=e.prettyMapping||h,this.platformModifiers=e.platformsModififiers||d,this.platformPrettyMapping=e.platformPrettyModifiers||p,this.platformPrettySeperators=e.platformPrettySeperators||g};return f.prototype.translate=function(e){var t=r.call(this,e);return 0===t.length?null:t.concat(o.call(this,e)).join(this.separator)},f.prototype.normalize=function(e){var t=e.split(this.separator),s=i.call(this),o="";return n.each(this.modifiers,function(e){var i=n.indexOf(t,e.toLowerCase()),r=s[e]||e;i>=0&&(o+=r+this.separator,t.splice(i,1))},this),o+t.join(this.separator).toUpperCase()},f.prototype.pretty=function(e){var i=this.normalize(e),o=t.call(this),r=s.call(this);return n.map(i.split(this.separator),function(e){return o[e]||a(e)},this).join(r)},f}();e.exports=s},function(e,t,i){var n=i(3),s=i(8),o=i(303),r=i(299),a=i(305),l=i(307),c=i(308),u=i(309),h=i(301),d=function(){function e(){f.call(this,x);var e=s("
",{"data-js":"editor-wrapper",class:"editor-wrapper"}).css("position","relative"),i=s("
",{"data-js":"editor-slot",class:"editor-slot"}).css("position","relative");s(this.element).wrap(e).wrap(i),this.placeholderElement=s("
",{"data-js":"editor-placeholder",class:"editor-placeholder"}).css("position","absolute"),i=s(this.element).parent(),i.append(this.placeholderElement),d.call(this),t.call(this)}function t(){var e=this,t=function(){y.call(this),i.call(this),this.onChange()};s(this.element).on("input keydown keyup keypress mousedown mouseup",function(t){e.config.onClientEvent.call(e,t)}),s(this.element).on("keydown",function(t){if(t.keyCode===E.shift)e.keyModifiers.shift=!0;else if(t.keyCode===E.backspace)k.call(e);else if(t.keyCode===E.enter)return e.config.forceSingleLine||t.metaKey||v.call(e,this,!1),void t.preventDefault();n.defer(function(){e.onChange(t)})}),s(this.element).on("keyup",function(i){i.keyCode===E.shift?e.keyModifiers.shift=!1:i.keyCode===E.enter?k.call(e):i.keyCode!==E.backspace&&i.keyCode!==E.delete||n.defer(function(){k.call(e)}),t.call(e)}),s(this.element).on("input",function(i){t.call(e)}),s(this.element).on("blur",function(t){e.onChange()});var o=!1;s(this.element).on("mouseup",function(){o=!1,i.call(e)}),s(this.element).on("mousedown",function(e){o=!0}),s(this.element).on("mouseleave",function(){o&&i.call(e)}),s(this.element).on("paste",function(t){var i=(t.originalEvent||t).clipboardData;e.config.pasteHook(i,e.keyModifiers.shift)||p.call(e,i,t),t.preventDefault()}),s(this.element).on("drop",function(e){e.stopPropagation(),e.preventDefault()}),this.placeholderElement.on("click",function(){e.isEmpty()&&s(e.element).focus()}),s(this.element).on("focus",function(){n.defer(function(){e.onChange()})})}function i(){var e=this;setTimeout(function(){var t=a.getSelection();e.config.onSelection.call(e,t)},200)}function d(){var e=this.isEmpty()?this.config.placeholder:"",t=s(this.placeholderElement);t.html(e);var i=t.outerHeight();i&&s(this.element).css("min-height",Math.max(parseInt(t.css("min-height"),10)||0,i))}function p(e,t){var i="";if(n.contains(e.types,"text/plain"))i=e.getData("text/plain"),i=this.dataFilter.filterPlaintext(i),m.call(this,i);else{if(!n.contains(e.types,"text/html"))return;i=e.getData("text/html"),i=this.dataFilter.filterHTML(i);var s=i.replace(//gi,"\n").replace(/(<[p|div])/gi,"\n$1"),o=document.implementation.createHTMLDocument("");o.body.innerHTML=s;var r=o.body,a=r.textContent||r.innerText||"",l=a.split("\n").join("
");m.call(this,l)}if(this.config.forceSingleLine){var c=_.call(this).replace(//g," ");f.call(this,c)}this.onChange(t)}function g(){s(this.element).contents().filter(function(){return 3===this.nodeType}).wrap("")}function f(e){s(this.element).html(e)}function _(){return s(this.element).html().trim()}function m(e){if(e=e.replace(/[<]br\s?\/?[>]$/,""),e=this.dataFilter.convertToBrowserSpaces(e),!e)return void h.warn("Cannot insert empty data");var t=a.getSelection();if(!t||!t.focusNode)return void h.warn("Cannot insert without the editor having a cursor or selection");var i=t.getRangeAt(0);i.deleteContents();var n=i.createContextualFragment(e);i.insertNode(n),t.removeAllRanges(),i.collapse(!1),t.addRange(i)}function v(e,t){t||e.lastChild&&"br"===e.lastChild.nodeName.toLowerCase()||e.appendChild(document.createElement("br"));var i=a.getSelection();if(i){var n=i.getRangeAt(0),s=document.createElement("br");n.deleteContents(),n.insertNode(s),n.setStartAfter(s),n.setEndAfter(s),n.collapse(!1),i.removeAllRanges(),i.addRange(n)}}function b(e){s(e).contents().each(function(e,t){t.nodeType===Node.TEXT_NODE?t.textContent=t.textContent.replace(T,""):t.nodeType===Node.ELEMENT_NODE&&b(t)})}function y(){if(!this.isEmpty()){var e=w.call(this);if(e&&e.nodeType===Node.ELEMENT_NODE){var t=e.textContent||e.innerText||"",i=t.match(T);if(i){var n=r.saveSelection(e);n.start-=(t.substr(0,n.start).match(T)||"").length||0,n.end-=(t.substr(0,n.end).match(T)||"").length||0,b(e),r.restoreSelection(n)}}}}function w(){var e=C.call(this);if(!e){var t=s(this.element).children();if(!t.length)return null;e=t.last().get(0)}return e}function C(e){return e||(e=!a.getSelection()&&this.lastSelection?a.getParentNodes(this.lastSelection.anchorNode):a.getNodeList()),n.find(e.reverse(),function(e){return e.nodeType===Node.ELEMENT_NODE})}function k(){this.isEmpty()&&(f.call(this,x),this.setCursorToEnd())}var x="",S="",T=/\u200B/g,E={shift:16,enter:13,esc:27,backspace:8,delete:46,tab:9,right:39},P=function(t,i){if(!t)throw new Error("A valid element parameter is required to initalize the editor");this.element=t,this.keyComboEvents=i.keyComboEvents||new u({element:this.element}),this.keyComboEvents.on("meta+b meta+i meta+k meta+u",n.noop),this.config={placeholder:!1,onChange:function(){},onSelection:function(e){},onClientEvent:function(e){},pasteHook:function(e,t){return!1},filterForSetData:function(e){return e},filterForGetData:function(e){return e},filterRules:{elements:["p","br","div"],attributes:{},remove_contents:["style","noscript","script","meta"],protocols:{}},forceSingleLine:!1,smartQuotes:{enabled:!1,config:{}}},n.extend(this.config,i||{}),this.dataFilter=new o(this.config.filterRules),this.onChange=function(){this.previousRawData!==_.call(this)&&(g.call(this),d.call(this),this.config.onChange.apply(this,arguments),this.previousRawData=_.call(this))},this.keyModifiers={shift:!1},this.undoManager=new l(this),this.config.smartQuotes.enabled&&(this.smartQuoter=new c(this)),e.call(this)};return P.prototype.getData=function(e){var t=_.call(this);t=this.config.filterForGetData.call(this,t);var i=t.replace(//gi,"\n").replace(/(<[p|div])/gi,"\n$1").replace(T,""),n=document.createElement("div");n.innerHTML=i;var s=n.textContent||n.innerText||"",o=e?s.trim():s;return o},P.prototype.setData=function(e){e=this.config.filterForSetData.call(this,e),e=this.dataFilter.filterPlaintext(e),f.call(this,e),k.call(this),this.onChange()},P.prototype.setHTML=function(e){f.call(this,e),this.onChange()},P.prototype.getHTML=function(){return _.call(this)},P.prototype.insertData=function(e,t){t&&(e=this.dataFilter.filterHTML(e)),m.call(this,e),this.onChange()},P.prototype.blur=function(){return s(this.element).blur()},P.prototype.focus=function(e){var t=s(this.element).focus();return e||this.setCursorToEnd(),t},P.prototype.hasFocus=function(){return s(this.element).is(":focus")},P.prototype.setPlaceholder=function(e){this.config.placeholder=e,d.call(this)},P.prototype.isEmpty=function(){var e=this.getData(!1);if(""===e||"\n"===e||"\r\n"===e)return!0;var t=_.call(this);return t===x||t===S||""===t},P.prototype.getCurrentElement=function(){return a.getNearestElement()},P.prototype.setCursorToStart=function(e){var t=s(this.element);e=e&&t.find(e).first().get(0)||t.children().first().get(0),e&&r.setToStart(e)},P.prototype.setCursorToEnd=function(e){var t=s(this.element);e=e&&t.find(e).last().get(0)||t.children().last().get(0),e&&r.setToEnd(e)},P.prototype.teardown=function(){this.undoManager.teardown(),this.keyComboEvents.off()},P}();e.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;with(obj)__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},,,,function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(219),r=i(235),a=o.extend({initialize:function(e){this.el=e.el||null,this.itemSelector=e.itemSelector||".item",this.dropInParent=e.dropInParent||!1,this.transparentPlaceholder=e.transparentPlaceholder,this.beforeDragStart=e.beforeDragStart||n.noop,this.afterDragEnd=e.afterDragEnd||n.noop,this.scrollable=e.scrollable||!1,this.$items=this.$(this.itemSelector),this.isAnimating=!1,this.disableAnimation=e.disableAnimation||!1,this.disableAnimation&&(this.calculateDropTarget=n.throttle(this.calculateDropTarget,500)),this.$currentlyDraggedItem=null,this.$placeholder=null,this.placeholderElement=null,this.renderedPlaceholder=!1,this.reloadItems()},itemEvents:function(e){e||(e=this.itemSelector);var t={};return t["dragstart "+e]="setPlaceholder",t["dragenter "+e]="calculateDropTarget",t["dragend "+e]="resetPlaceholder",this.dropInParent?(t.dragover="cancelEvent",t.drop="dropItemAndResetPlaceholder"):(t["dragover "+e]="cancelEvent",t["drop "+e]="dropItem"),t},setPlaceholder:function(e){this.renderedPlaceholder=!1,e.originalEvent.dataTransfer.effectAllowed="move";try{e.originalEvent.dataTransfer.setData("text/html","")}catch(e){}if(this.$currentlyDraggedItem=s(e.currentTarget),this.$currentlyDraggedItem){if(this.$placeholder=this.$currentlyDraggedItem.clone().addClass("sortable-placeholder"),this.transparentPlaceholder&&this.$placeholder.addClass("transparent-placeholder"),!this.disableAnimation){var t=this.$currentlyDraggedItem.outerWidth();this.$placeholder.data("item-width",t).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,n.throttle(function(e){var t=.2,i=window.innerHeight,n=e.originalEvent.clientY/i,s=this.getBoundingClientRect();n1-t&&window.scrollBy(0,200*(t+n-1)),e.preventDefault()},50)),this.$currentlyDraggedItem.one("dragend",n.bind(function(){this.$el.off(["dragenter."+this.cid,"dragover."+this.cid].join(" "))},this)))}},calculateDropTarget:function(e){if(this.$currentlyDraggedItem&&!this.isAnimating){e.preventDefault(),this.renderedPlaceholder=!0;var t=e.currentTarget,i=s(t);if(t===this.placeholderElement)return!1;this.$currentlyDraggedItem.hide();var n,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||(n=s("").css({width:l,display:"inline-block"}),this.$placeholder.after(n),a&&this.$placeholder.css({width:0,padding:0})),r
';return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(219),r=i(136),a=i(342),l=i(276),c=i(283),u=i(343),h=i(344),d=i(347),p=i(348),g=o.extend({className:"popover--post-share-popover",mixins:[l,c,p],template:u,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(e){e.preventDefault(),r.trigger("dashboard-share:embed"),this._showEmbedCode()},__emailTriggerClick:function(e){e.preventDefault(),r.trigger("dashboard-share:email"),this._toggleEmailForm()},__shareFacebookClick:function(e){e.preventDefault(),r.trigger("dashboard-share:facebook"),this._shareFacebook()},__sharePinterestClick:function(e){e.preventDefault(),r.trigger("dashboard-share:pinterest"),this._sharePinterest()},__shareRedditClick:function(e){e.preventDefault(),r.trigger("dashboard-share:reddit"),this._shareReddit()},__shareTwitterClick:function(e){e.preventDefault(),r.trigger("dashboard-share:twitter"),this._shareTwitter()},__sharePermalinkClick:function(){this.resetAndHide()},__flagPostClick:function(e){e.preventDefault(),this.onClickOutside(),r.trigger("abuseform:open",{mode:"post",post:this.model}),r.trigger("Kraken:abuseform:open",{mode:"post"})},__cancelClick:function(e){e.preventDefault(),this._cancelOrClose()},__emailFormInput:function(){var e=g.validateEmail(this.$emailAddress.val());this.$submitButton.attr("disabled",!e)},__shareTwitterInput:function(e){e.preventDefault();var t=g.validateTwitter(this.$shareMessage.val(),this.$characterCount);this.$submitButton.attr("disabled",!t)},__replyToChange:function(e){var t=n(e.currentTarget).is(":checked");a.set("share_popover_reply_to",t,31536e3)},__submitKeydown:function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey||e.altKey)&&(e.preventDefault(),e.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 e=n("[data-id="+this.options.popoverData.post_id+"]").data("json");if(e&&e.pt){var t=new d(e),i=this.loggingData({userAction:"share"});i&&i.modelData&&(i.modelData=t.toJSON()),r.trigger("useraction:explore_click:share",{model:t,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 e=this.tinyUrl||this.url||this.model.get("url");window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(e),"twitter-share-dialog","width=626,height=258");var t=this._getGenericShareData();this.model.shareTwitter(t),this.resetAndHide()},_shareFacebook:function(){!this.options.forceSocialFallback&&this.hasFacebook?this.model.facebookStatus().done(s.bind(this._shareFacebookSuccess,this)).fail(s.bind(this._shareFacebookFallback,this)):this._shareFacebookFallback()},_shareFacebookSuccess:function(e){e?(this.$serviceCancel.show(),this.$submitButton.html(this.$submitButton.data("label")),this.$shareForm.data("type","facebook"),this.$shareLabel.text(e),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 e=this.url||this.model.get("url");window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(e),"facebook-share-dialog","width=626,height=436");var t=this._getGenericShareData();this.model.shareFacebook(t),this.resetAndHide()},_sharePinterest:function(){var e=this.model.get("pinterest_share_window");window.open(e.url,e.name,e.dimensions);var t=this._getGenericShareData();this.model.sharePinterest(t),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 e=this._getGenericShareData();this.model.shareReddit(e),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 e=this._getGenericShareData();this.model.shareEmail(e);var t="mailto:?body="+this.url;if(this.model.get("embed_key")){var i=window.open();i.document.write(''),i.document.close()}else window.location.href=t;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 e=this.$shareForm.find(".embed_code_text");e.length&&(e.click(function(){e.select()}),setTimeout(function(){e.trigger("click")},100))},_fadeoutPopover:function(){setTimeout(s.bind(function(){this.$el.fadeOut(150,s.bind(this.resetAndHide,this))},this),1250)},_cancelOrClose:function(){var e=this.$emailAddress.val()||"";"email"===this.$shareForm.data("type")&&e.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(e){this.options=s.extend({},this.defaults,e),this.model=new h(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 e=this.$shareForm.serializeArray();switch(this.$shareForm.data("type")){case"facebook":this.model.shareFacebook(e);break;case"twitter":this.model.shareTwitter(e);break;default:this.model.shareEmail(e)}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 e=document.createElement("input");return"placeholder"in e},validateEmail:function(e){var t=/\S+@\S+\.\S+/;return t.test(e)},validateTwitter:function(e,t){var i=e.match(/\[URL\]/gi),n=i?24*i.length:0,s=280-e.length-n,o=!(!t||!t.length)&&t;return o&&(o.removeClass("character-limit").html(s),s<10&&o.addClass("character-limit")),!(s<0||280===s)}});e.exports=g},function(e,t,i){"use strict";function n(e){return new RegExp(e+"=([^;]+)").test(decodeURIComponent(document.cookie))}function s(e){var t=decodeURIComponent(document.cookie).match(new RegExp(e+"=([^;]+)"));return t&&t.length>1?t[1]:null}function o(e,t,i,n){"object"===("undefined"==typeof t?"undefined":c(t))&&(t=JSON.stringify(t));var s=encodeURIComponent(e)+"="+encodeURIComponent(t);if(u.isPlainObject(i)&&(n=i,i=!!n&&n.expires),n=u.extend({expires:i},h,n),n.expires instanceof Date)s+=";expires="+n.expires.toGMTString();else if("number"==typeof n.expires){var o=new Date;o.setTime(o.getTime()+1e3*n.expires),s+=";expires="+o.toGMTString()}if(n.path&&(s+=";path="+encodeURI(n.path)),(n.secure||n.sameSite&&"none"===n.sameSite.toLowerCase())&&(s+=";secure"),n.domain&&(s+=";domain="+encodeURI(n.domain)),n.sameSite){var r=n.sameSite.toLowerCase();"none"!==r&&"lax"!==r&&"strict"!==r||(s+=";samesite="+r)}document.cookie=s}function r(e){o(e,"",-1)}function a(e,t){var i=s(e);try{i=JSON.parse(i)}catch(e){return i}return t?u.get(i,t):i}function l(e,t,i,n){var s;u.isPlainObject(t)?(n=i,s=t):(s=a(e)||{},u.isPlainObject(s)||(s={}),u.set(s,t,i)),o(e,JSON.stringify(s),n)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=i(3),h={path:"/",secure:!1,domain:""},d={has:n,get:s,set:o,unset:r,getHash:a,setHash:l};e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
",is_private||(__p+='
'+__e(__("Sent!"))+"
"),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(185),r=i(129),a=i(345),l=o.extend({url:function(){return"/svc/post/share/"+this.get("tumblelog_name")+"/"+this.get("post_id")},parse:function(e){return!s.isUndefined(e)&&s.has(e,"response")?s.result(e.response,"share_popover_data")||{}:{}},hostname:function(){var e=r.get("Context/hosts");return s.isEmpty(e)?"https://www.tumblr.com":e.www_host},defaults:{abuse_url:"",embed_code:"",embed_did:"",form_key:n("#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(e){this.get("embed_code")||this.set("embed_code",new a(this.toJSON()).getCode())},shareEmail:function(e){return this.get("tumblelog_share")?this.share("/svc/email_tumblelog",e):this.share("/svc/share/email",e)},shareTwitter:function(e){if(!this.get("tumblelog_share"))return this.share("/svc/share/twitter",e)},shareFacebook:function(e){if(!this.get("tumblelog_share"))return this.share("/svc/share/facebook",e)},sharePinterest:function(e){return this.share("/svc/share/pinterest",e)},shareReddit:function(e){return this.share("/svc/share/reddit",e)},facebookStatus:function(){return n.ajax({url:this.hostname()+"/svc/facebook_status",type:"post",data:{form_key:this.get("form_key")}})},share:function(e,t){return t=t||[],t.push({name:"form_key",value:this.get("form_key")}),n.ajax({url:this.hostname()+e,type:"post",data:t,success:s.bind(function(){this.trigger("success")},this),error:s.bind(function(){this.trigger("error")},this)}),this}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(214),o=i(346),r=i(129),a=s.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(e){this.options=n.extend({},this.defaults,e);var t=r.get("Context/hosts");t&&(t.embed_host&&(this.options.embed_host=t.embed_host),t.secure_assets_host&&(this.options.secure_assets_host=t.secure_assets_host)),this.template=o},getCode:function(){return this.template(this.options)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+="undefined"!=typeof language&&"undefined"!=typeof width?'
'+__e(post_url)+"
":"undefined"!=typeof language?'
'+__e(post_url)+"
":"undefined"!=typeof width?'
'+__e(post_url)+"
":'
'+__e(post_url)+"
",__p+=' ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(185),r=i(136),a=i(191),l=i(213),c=i(345),u=i(130),h=i(182),d=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",subscription:"/svc/blog/:tumblelog/posts/:post_id/subscription"},initialize:function(e){this._createPostTumblelogModel("tumblelog",this.get("tumblelog-data")),this._createPostTumblelogModel("parentTumblelog",this.get("tumblelog-parent-data")),this._createPostTumblelogModel("rootTumblelog",this.get("tumblelog-root-data")),this.listenTo(this,"like:success",this.logClientLike)},logClientLike:function(){r.trigger("ads:client_like",{loggingData:{userAction:"client_like",postData:this.attributes}})},_createPostTumblelogModel:function(e,t){e=e||"tumblelog",t=t||!1;var i=!1;t&&t.name&&(i=new a(n(t).omit(n.isUndefined).omit(n.isNull).value())),this[e]=i},_setTumblelog:function(){this.tumblelog=new a(n({name:this.get("tumblelog"),ignoring:!1,sponsor:this.get("sponsored"),following:this.get("following"),mention_key:this.get("tumblelog_mention_key")}).omit(n.isUndefined).omit(n.isNull).value())},_setReblogTumblelog:function(){var e=this.get("reblog_source");e&&e.name&&(this.reblogTumblelog=new a(n({name:e.name,ignoring:!1,following:e.following}).omit(n.isUndefined).omit(n.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(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"POST";i.init&&i.init();var r=s.ajax({data:t,type:o,url:e,withFormKey:!0});return r.done(n.bind(function(e){i[200]&&i[200].call(this,e)},this)),r.fail(n.bind(function(e){i[e.status]&&i[e.status].call(this,e.status)},this)),r.always(n.bind(function(){i.always&&i.always()},this)),r},_xhrSuccess:function(e){this.trigger(e+":success")},_xhrFailure:function(e){l.alert(u("Sorry, we seem to be having technical trouble. Please try again later.")),this.trigger(e+":failure")},_xhrForbidden:function(e){this.trigger(e+":forbidden")},_setCarouselIndex:function(e){return this.get("is_carousel")?n.extend(e,{offset:this.get("carousel_index")}):e},save:function(e,t,i,s){if(i||(i={}),this.endpoints[e]){var o={200:n.bind(this._xhrSuccess,this,e),401:n.bind(this._xhrFailure,this,e),404:n.bind(this._xhrFailure,this,e),403:n.bind(this._xhrForbidden,this,e),500:n.bind(this._xhrFailure,this,e)},r=this.endpoints[e];return r.indexOf(":")>-1&&(r=this.replaceEndPointVariables(r)),this._xhrRequest(r,t,n.defaults(i,o),s)}throw new Error("Missing endpoint url for "+e)},replaceEndPointVariables:function(e){return e.replace(":tumblelog",this.get("tumblelog")).replace(":post_id",this.get("id"))},like:function(e){if(this.get("liked")===!1){this.set("liked",!0);var t=this.likePayload(e,this.getLikeSource("like"));this.save("like",{data:t})}this.trigger("like:set",this),r.trigger("post:like:set",this.get("id"),this,e)},unlike:function(){if(this.get("liked")===!0){this.set("liked",!1);var e=this.likePayload("mouse",this.getLikeSource("unlike"));this.save("unlike",{data:e})}this.trigger("unlike:set",this),r.trigger("post:unlike:set",this.get("id"))},toggleLike:function(){this.get("liked")?this.unlike():this.like()},getLikeSource:function(e){e=e||"like";var t="LIKE_";switch(e){case"unlike":t="UNLIKE_";break;case"reply":t="REPLY_";break;case"ignore":t="IGNORE_"}var i=location.pathname;return i.match(/^\/dashboard\/iframe/)?t+"SOURCE_IFRAME":i.match(/^\/dashboard/)?t+"SOURCE_DASHBOARD":i.match(/^\/tagged/)?t+"SOURCE_TAG_PAGE":i.match(/^\/likes/)?t+"SOURCE_LIKES_PAGE":i.match(/^\/inbox/)?t+"SOURCE_INBOX":i.match(/^\/search/)?t+"SOURCE_SEARCH_RESULTS_PAGE":i.match(/^\/explore/)?t+"SOURCE_DISCOVER":i.match(/^\/tv/)?t+"SOURCE_TV":i.match(/^\/indash_blog\/peepr/)?t+this.getPeeprSource():t+"SOURCE_UNKNOWN"},getPeeprSource:function(){if(window.parent&&window.parent.location){var e=window.parent.location.pathname;if(e.match(/search/))return"SOURCE_SEARCH_PEEPR"}return"SOURCE_PEEPR"},getEmbedCode:function(e,t){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")};e&&(i.language=e),t&&(i.width=t);var n=new c(i);return n.getCode()},likePayload:function(e,t){e=e||"mouse",t=t||"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"),tumblelog_name:this.get("tumblelog-name"),method:e,source:t};return this._setCarouselIndex(i)},reblog:function(e){e=n.extend({},e,{reblogId:this.get("id"),reblogKey:this.get("reblog_key"),reblogBlogName:this.get("reblog_name"),pt:this.get("pt")}),r.trigger("postForms:reblog",e)},fastReblog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h().attributes.fastqueue_web_lab;this.trigger("fastreblog:success",e),r.trigger("post:fastreblog:set",{model:this});var t={reblog_key:this.get("reblog_key"),reblog_post_id:this.get("id"),queue:e,pt:this.get("pt"),tumblelog:this.get("tumblelog")};t=this._setCarouselIndex(t);var i={200:n.bind(function(t){this.set("reblogged",!0),this.trigger("fastreblog:ajax:success",t.response);var i={model:this.clone(),toastOptions:{type:e?"queue":"selfReblog",avatar:t.response.post_tumblelog.avatar,fromTumblelogName:t.response.post_tumblelog.name_or_id}};r.trigger("post:fastReblog:showtoast",i)},this)};this.save("reblog",t,i)},reply:function(e){var t=this,i={reply_text:e,post_id:this.get("id"),tumblelog:this.get("tumblelog"),tumblelog_key:this.get("tumblelog-key")||this.get("tumblelog_key"),source:this.getLikeSource("reply")},n={200:function(){t.trigger("replied"),t._setSubscriptionStatus(!0)}};return this.save("reply",{data:i},n)},destroy:function(e){var t={post_id:this.get("id"),channel_id:this.get("tumblelog")};this.save("destroy",t,e)},publish:function(){var e=this.save("publish",{id:this.get("id")});e.fail(n.bind(function(e){this.trigger("publish:failure",s.parseJSON(e.responseText))},this))},promote:function(e){var t={tag:e,post_id:this.get("id"),reblog_key:this.get("reblog_key"),tumblelog_name:this.get("tumblelog")};return this.save("promote",t)},unpromote:function(e){var t={tag_id:e,post_id:this.get("id"),reblog_key:this.get("reblog_key"),tumblelog_name:this.get("tumblelog")};return this.save("unpromote",t)},queue:function(){var e={id:this.get("id"),queue:"queue"};this.save("queue",e)},removeSource:function(){var e={post_id:this.get("id"),tumblelog_id:this.get("tumblelog")};return this.save("remove_source",e)},approve:function(e){var t={id:this.get("id"),queue:e};return this.save("approve",t)},deny:function(){return this.save("deny",{pid:this.get("id")})},answer:function(e){var t={post_id:this.get("id"),tumblelog:this.get("tumblelog"),key:this.get("tumblelog-key"),answer_text:e};return this.save("answer",t)},embedFocus:function(){this.trigger("embed:focus",this)},updateReblogControl:function(e){this.trigger("reblog:success",e)},dismiss:function(){this.trigger("dismiss",this)},_setSubscriptionStatus:function(e){"boolean"!=typeof e&&(e=!this.get("isSubscribed")),this.set("isSubscribed",e)},_toggleSubscription:function(e){var t=this,i=this.get("isSubscribed")?"DELETE":"POST";return this.save("subscription",{},{200:function(){t._setSubscriptionStatus(!t.get("isSubscribed"))}},i)}});e.exports=d},function(e,t,i){"use strict";var n=i(3),s=i(187),o=new s({loggingData:function e(t){var e={};return!n.isEmpty(this.model)&&n.isFunction(this.model.toJSON)&&(e.modelData=this.model.toJSON()),n.isObject(t)&&(e=n.extend(e,t)),e}});e.exports=o},,,,,function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(192),r=i(354),a=2e3,l=i(215),a=2e3,c=function(e,t,i){this.name="EmbedError",this.message=e,this.input=t,this.data=i,this.stack=(new Error).stack};c.prototype=new Error;var u=l.extend({constructor:function(e){this.setEmbedRegexes(e||[])},setEmbedRegexes:function(e){this.regexes=e,this.services=n.unique(n.values(e))},isValidEmbedService:function(e){return n.any(this.regexes,function(t,i){return new RegExp(i,"mi").test(e)})},isValidEmbedServiceName:function(e){return n.contains(this.services,e)},getUrlFromEmbedCode:function(e){var t=s(r.nodeFromString(e)),i=t.find("iframe[src], embed[src], script[src]").first(),n=t.find("object[data]").first();return i.attr("src")||n.attr("data")||!1},fetchEmbedData:function(e,t,i){var r=s.ajax({url:"/svc/post/get_video_data",type:"POST",withFormKey:!0,data:JSON.stringify({embed_url:e,embed_width:t})});return o(r).then(n.bind(function(s){if(n.isEmpty(s)||"false"===s||!n.isPlainObject(s))throw new c("Invalid embed response",e,s);if(s.thumbnail||i)return s;var r=n.bind(this.fetchEmbedData,this,e,t,!0);return o.promise(function(e,t){n.delay(function(){r().then(function(e){return e},function(){return s})},a)})},this)).catch(function(e){return o.reject(e)})},parseEmbedData:function(e,t){if(!n.isString(e))throw"The input is invalid. Expected a string";var i=n.trim(e);if(this.isValidEmbedService(i))return this.fetchEmbedData(i,t);var s=this.getUrlFromEmbedCode(i);return n.isEmpty(s)?o.reject(new c("Invalid embed code",e)):o.resolve({unsupported:!0,thumbnail:!1,embed_render_context:"blank",url:s,preview_iframe:"",embed_code:e})}});e.exports=new u},function(e,t,i){"use strict";function n(e){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body}function s(e){var t=document.implementation.createHTMLDocument("");return t.body.appendChild(e.cloneNode(!0)),t.body}function o(e){return s(e).innerHTML}function r(e){var t,i=document.implementation.createHTMLDocument("");return i.body.innerHTML=e,t=i.body.textContent||i.body.innerText||"",t=t.trim()}e.exports={nodeFromString:n,wrapNode:s,outerHTML:o,stripTags:r}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(214),r=i(136),a=i(428),l=[],c=o.extend({name:"CrtControl",maxLoopTime:10,playerSelector:"[data-crt-video]",peeprOpen:!1,initialize:function(e){e=e||{},this.listenTo(r,"CrtControl:newPlayer",this.playerFactory,this),this.listenTo(r,"DOMEventor:flatscroll",n.throttle(this.onScroll,500),this),this.listenTo(r,"peepr:close",this.onPeeprClose,this),this.listenTo(r,"peepr:open",this.onPeeprOpen,this)},onPeeprOpen:function(){this.peeprOpen=!0},onPeeprClose:function(){this.peeprOpen=!1},findPlayers:function(e){var t=s(this.playerSelector);t.length&&this.playerFactory(t,e)},playerFactory:function(e,t){n.defer(n.bind(function(){n.each(e,function(e){this.newPlayer(e,t)},this)},this))},newPlayer:function(e,t){if(e.player)return e.player;var i=new a(e,t);return l.push(i),i.render(),this.bindPlayerEvents(i),r.trigger("CrtControl:playerCreated",i,t),i},bindPlayerEvents:function(e){this.listenTo(e,"ready",this.onPlayerReady),this.listenTo(e,"teardown",this.onPlayerTeardown)},onPlayerReady:function(){this.playInViewport()},onPlayerTeardown:function(e){if(e=n.where(l,{_id:e._id}),e.length){var t=n.indexOf(l,e[0]);t>-1&&(e=l.splice(t,1))}},onScroll:function(){this.playInViewport()},pauseAutoplaying:function(){n.each(l,function(e){e.get("autoplay")&&e.get("loaded")&&e.pause()})},getInViewport:function(){var e=this;return n.filter(l,function(t){return!(!t.watcher||e.peeprOpen&&!t.get("isInPeepr"))&&(t.watcher.isFullyInViewport&&t.$el.is(":visible"))})},playInViewport:function(){var e=this.getInViewport();if(e.length){var t=e[0];t.get("paused")&&t.get("autoplay")&&(this.pauseAutoplaying(),t.play())}}});e.exports=new c},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(138),r=i(429),a=i(215),l=i(230),c=i(180),u=i(136),h=i(430),d=i(431),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:0,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(e,t){this._id=n.uniqueId("crtplayer"),this.initialize(e,t)},initialize:function(e,t){t||(t={}),n.isObject(t.attributes)&&this.set(t.attributes),this.video=e,this.$video=s(this.video);var i=this.$video.data("crt-options")||{};this.$video.removeAttr("data-crt-options"),this.vjsOptions=n.defaults({crt:this,crtOptions:i},t.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(n.bind(this.ready,this))},this),this},ready:function(e){this.player=e,this.player.muted(this.get("muted")),this.el=e.player_.el(),this.$el=s(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(n.get(this.vjsOptions,"crtOptions.autoheight")),this.setFullscreenControl(!h.prop("requestFullscreen")),this.shouldForceHD()&&this.player.src({src:this.vjsOptions.crtOptions.hdUrl,type:"video/mp4"}),this.get("watch")&&this.setupWatcher()},_bindEvents:function(){this.listenTo(u,"peepr:open",this.pause),this.listenTo(u,"post:form:show",this.pause),this.listenTo(u,"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",n.bind(this.onLoadedMetadata,this)),this.player.on("durationchange",n.bind(this.onUpdateDuration,this)),this.player.on("play",n.bind(this.onPlay,this)),this.player.on("pause",n.bind(this.onPause,this)),this.player.on("ended",n.bind(this.onEnded,this)),this.player.on("fullscreenchange",n.bind(this.onFullscreenChange,this)),this.player.on("error",n.bind(this.onError,this))},setupWatcher:function(){this.watcher=o.create(this.el,-100),this.watcher.fullyEnterViewport(n.bind(function(){this.trigger("fullyEnterViewport")},this)),this.watcher.partiallyExitViewport(n.bind(function(){this.trigger("partiallyExitViewport")},this)),this.watcher.exitViewport(n.bind(function(){this.trigger("exitViewport"),this.shouldAutoplay()&&this.pause()},this))},onClickPlayer:function(e){s(e.target).closest(".vjs-mute-control").length||s(e.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(n.bind(this.pollTimeUpdate,this),150))},shouldAutoplay:function(){return!(!this.get("autoplay")||c.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(e){e||(e={}),this.player.paused()&&(this.player.play(),e.skipLog||(e.type="userPlay",this.player.trigger(e)))},pause:function(e){e||(e={}),this.player.paused()||(this.player.pause(),e.skipLog||this.player.trigger("pause"))},onPlay:function(){this.set("paused",!1),this.pollTimeUpdate()},onPause:function(){this.set("paused",!0)},onUpdateDuration:function(e){this.set("duration",this.player.duration())},onLoadedMetadata:function(e){var t=this.shouldAutoplay();this.setMutedState(t),this.setAutoplayState(t),t&&this.$el.on("click.crtAutoPlay touchend.crtAutoPlay",n.bind(this.onClickPlayer,this)),u.trigger("CrtPlayer:ready",this),this.trigger("playerReady",this),this.trigger("ready",this),this.set("loaded",!0)},onEnded:function(e){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(e){this.set("paused",!0),this.set("loop",!1),this.set("autoplay",!1),this.trigger("error",e)},onChangeAutoplay:function(e,t,i){this.setAutoplayState(t,i)},onChangeAutoheight:function(e,t){this.setAutoheightState(t)},onChangeDuration:function(e,t){this.setLoopState(!0)},onChangeLoop:function(e,t){this.setLoopState(t)},onChangeMuted:function(e,t){this.player.muted(t)},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(e){n.isEmpty(e.embedID)||this.playerID===e.embedID&&this.player.trigger("CRTPlayer:updateDimensions")},setLoopState:function(e){n.isUndefined(e)&&(e=this.get("loop")),this.set("loop",e),"undefined"!=typeof this.get("duration")&&this.get("duration")<=this.get("minLoopDuration")&&this.set("loop",!1)},setMutedState:function(e){n.isUndefined(e)&&(e=this.get("muted")),this.set("muted",e)},setAutoplayState:function(e){n.isUndefined(e)&&(e=this.get("autoplay")),this.set("autoplay",e),this.toggleAttrClass("autoplay",e),!e&&this.get("duration")&&this.setLoopState(!0)},setAutoheightState:function(e){(n.isUndefined(e)||n.isNull(e))&&(e=this.get("autoheight")),this.set("autoheight",e),this.toggleAttrClass("autoheight",e)},setFullscreenControl:function(e){n.isUndefined(e)&&(e=this.get("hideFullscreen")),this.set("hideFullscreen",e),this.toggleAttrClass("hideFullscreen",e)},onTimeUpdate:function(){var e=.3,t=this.get("_position"),i=this.player.currentTime(),n=Math.abs(t-i);ni&&(n=i),this.updateChildren({hoverX:n,hoverTime:o,hoverPercent:r})},onMouseOut:function(e){this.$el.addClass("auto-hide")},onMouseEnter:function(e){this.$el.removeClass("auto-hide")},dispose:function(){n.each(this.children,function(e){n.result(e,"dispose")}),o.prototype.dispose.apply(this,arguments)}});e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(432),r=o.getComponent("Component"),a=o.extend(r,{constructor:function(e,t){this.options=t||{},this.player=e,this.$player=s(this.player.el()),this._selectorCache(),this.player.on("dispose",n.bind(this.dispose,this)),this.player.ready(n.bind(function(){this.initialize.apply(this,arguments)},this))},_selectorCache:function(){this.$$=n.memoize(function(e){return this.$player.find(e)},n.identity),this.$$.remove=n.bind(function(e){this.$$.cache.delete(e)},this),this.$$.clear=n.bind(function(){this.$$.cache=new n.memoize.Cache},this)},initialize:function(){},dispose:function(){this.$$.clear(),this.$player.off()}});e.exports=a},function(e,t,i){"use strict";var n=i(8),s=i(432),o=i(435),r=s.extend(o,{seeking:!1,render:function(){return this.$el=n('
'),this},update:function(e){e||(e={}),this.$time_el=this.$time_el||this.$el.find(".vjs-hover-handle-time");var t=e.hoverX||0,i=e.hoverTime||"0:00",n=s.formatTime(i);this.$time_el.html(n),this.$el.css("left",t+"px")}});e.exports=r},function(e,t,i){"use strict";var n=i(8),s=i(432),o=i(435),r=s.extend(o,{render:function(){return this.$el=n('
'),this},update:function(e){e||(e={});var t=e.hoverX||0,i=e.hoverTime||"0:00",n=s.formatTime(i);this.$el.html(n),this.$el.css("left",t+"px")}});e.exports=r},function(e,t,i){"use strict";var n=i(8),s=i(432),o=i(435),r=s.extend(o,{filmstrip_thumbnail_count:10,render:function(){var e=this.player.options_.crtOptions.filmstrip,t=e.url,i=.5*e.width,s=.5*e.height,o=6;return this.$el=n('
'),this.$thumbnail=n('
'),this.$el.css({transform:"translateX(-50%)",width:i+o+"px",height:s+o+"px"}),this.$thumbnail.css({width:i+"px",height:s+"px","background-image":"url("+t+")","background-size":i*this.filmstrip_thumbnail_count+"px "+s+"px"}),this.$el.append(this.$thumbnail),this},update:function(e){e||(e={});var t=e.hoverX||0;this.$el.css("left",t+"px");var i=isNaN(e.hoverPercent)?0:100*e.hoverPercent,n=100/(this.filmstrip_thumbnail_count-1),s=Math.floor(i/this.filmstrip_thumbnail_count)*n;this.$thumbnail.css("background-position",s+"% 0%")}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(432),o=i(435),r=s.extend(o,{elSelector:".vjs-progress-holder",lastPlayPosition:0,currentPlayPosition:0,lastWaitedTime:0,buffering:!1,polling:!1,interval:100,initialize:function(e,t){this.player.on("play",n.bind(this.startPolling,this)),this.player.on("ended",n.bind(this.stopPolling,this)),this.player.on("pause",n.bind(this.stopPolling,this)),this.player.one("dispose",n.bind(this.stopPolling,this))},checkBuffering:function(){this.currentPlayPosition=this.player.currentTime();var e=1/this.interval;if(!this.buffering&&this.currentPlayPositionthis.lastPlayPosition+e&&!this.player.paused()){var t=n.now()-this.lastWaitedTime;this.$player.trigger("stopwaiting",{timeWaited:t}),this.buffering=!1}this.lastPlayPosition=this.currentPlayPosition},tick:function(){this.polling&&(this.checkBuffering(),n.delay(n.bind(this.tick,this),this.interval))},startPolling:function(e){this.polling||(this.polling=!0,this.tick())},stopPolling:function(e){this.polling=!1}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(432),r=i(136),a=i(180),l=i(435),c=o.extend(l,{videoConversionLogged:!1,loggingInProgress:!1,startSeekTime:null,loadStartTime:0,triggerElement:s(),initialize:function(e,t){this.player.crt.on("playerReady",n.bind(function(){this.setPlayerData(),this.bindEvents(),this.cacheUnloadData(),this.playerData.duration=this.player.duration(),this.player.options_.crtOptions["hls-service"]&&(n.isFinite(this.playerData.duration)?this.playerData.type="replay":this.playerData.type="live")},this)),this.$doc=s(document)},setPlayerData:function(){var e=this.player.crt.$post.data("json");if(this.playerData={postData:e,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 e)this.playerData.post_id=e["post-id"],this.playerData.root_post_id=e.root_id,this.playerData.blog_uuid=e.tumblelog;else{var t=this.player.options_.crtOptions;"undefined"!=typeof t["iframe-post-data"]&&(this.playerData.post_id=t["iframe-post-data"].post_id,this.playerData.blog_uuid=t["iframe-post-data"].blog);var i=t["hls-service"];i&&(this.playerData.type="live",this.playerData.vendor=i)}},bindEvents:function(){this.$player.on("mousedown touchstart",n.bind(this.setTriggerElement,this)),this.player.on("userPlay",n.bind(this.onUserPlay,this)),this.player.on("play",n.bind(this.onVJSPlay,this)),this.player.on("pause",n.bind(this.onVJSPause,this)),this.player.on("loop",n.bind(this.onLooped,this)),this.player.on("end",n.bind(this.onVideoEnded,this)),this.player.on("restart",n.bind(this.onRestart,this)),this.player.on("muteClicked",n.bind(this.onMuteClicked,this)),this.player.on("fullscreenchange",n.bind(this.onFullscreenChange,this)),this.player.on("error",n.bind(this.onError,this)),this.player.on("seeking",n.bind(this.onSeeking,this)),this.player.on("resolutionchange",n.bind(this.onResolutionChange,this)),this.player.on("timeupdate",n.bind(this.onTimeUpdate,this)),this.$player.on("stopwaiting",n.bind(this.onStopWaiting,this)),this.player.on("firstplay",n.bind(this.onLoadStart,this)),this.player.on("loadeddata",n.bind(this.onLoadedData,this))},triggerEvent:function(e,t){t=this._buildLoggingData(t),r.trigger("VideoPlayer:"+e,{loggingData:t})},_buildLoggingData:function(e){return e=n.extend({},this.playerData,e),e.time_elapsed=this.player.crt.getElapsed(),e.position=this.player.crt.getPosition(),e},setTriggerElement:function(e){this.triggerElement=s(e.target)},onLogComplete:function(){this.triggerElement=s()},cacheUnloadData:function(){this.triggerEvent("cacheUnload")},onError:function(e){var t=this.player.error(),i="MEDIA_ERR_CUSTOM";if(t){switch(t.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:t.code,name:i})}},onUserPlay:function(e){this.onPlay(!0,e)},onVJSPlay:function(e){this.onPlay(!1,e)},onPlay:function(e,t){if(e||0!==this.triggerElement.closest(".vjs-big-play-button").length||0!==this.triggerElement.closest(".vjs-play-control").length){var i=this.player.crt.get("autoplay"),n={};t.onDock&&(n.onDock=!0),this.logConversion({name:"CONVERSION_ACTION_HTML5_VIDEO",extra:{player:this.player.techName,player_version:2}}),this.triggerEvent(i?"auto_play":"play",n),this.onLogComplete()}},onVJSPause:function(){this.onPause(!1)},onPause:function(e){(e||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(e){var t=n.pick(e,["start","end"]);this.triggerEvent("restart",t)},onFullscreenChange:function(){var e=this.player.isFullscreen();this.triggerEvent("fullscreen",{fullscreen:e}),this.player.crt.set("isFullscreen",e),this.onLogComplete()},onMuteClicked:function(){var e=this.player.muted()?"mute":"unmute";this.triggerEvent(e),this.player.crt.set("muted","mute"===e),this.onLogComplete()},onSeeking:function(){if(0!==this.triggerElement.closest(".vjs-progress-control").length){this.startSeekTime||(this.startSeekTime=this.player.crt.getStartSeekJumpPosition());var e={start:this.startSeekTime};this.triggerEvent("scrub_start",e),this.$doc.one("mouseup.crtEvents touchend.crtEvents",n.bind(this.onSeeked,this))}},onSeeked:function(){if(this.startSeekTime){var e={start:this.startSeekTime,end:this.player.currentTime()};this.triggerEvent("scrub_stop",e),this.startSeekTime=null}},onTimeUpdate:function(){this.triggerEvent("timeupdate")},onResolutionChange:function(e){var t=n.pick(e,"resolution");this.triggerEvent("resolutionchange",t)},onStopWaiting:function(e,t){!t.timeWaited||t.timeWaited<2e3||this.triggerEvent("waiting",t)},onLoadStart:function(){this.loadStartTime=n.now()},onLoadedData:function(){var e=n.now()-this.loadStartTime;this.triggerEvent("initialLoad",{loadTime:e})},logConversion:function(e){if(!this.videoConversionLogged&&a.bool("is_logged_in")&&!this.loggingInProgress){this.loggingInProgress=!0;var t=s.ajax({url:"/svc/log/conversion",type:"POST",contentType:"application/x-www-form-urlencoded",withFormKey:!0,data:"log="+JSON.stringify(e)});t.done(n.bind(this.onConversionSuccess,this)),t.fail(n.bind(this.onConversionFail,this))}},onConversionSuccess:function(){this.videoConversionLogged=!0,this.loggingInProgress=!1},onConversionFail:function(){this.loggingInProgress=!1}});e.exports=c},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(432),r=i(220).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:''},{"aria-label":"play video"})},handleClick:function(){this.$el=this.$el||n(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,s.bind(function(e){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()}});e.exports=l},function(e,t,i){"use strict";var n=i(432),s=i(443),o=n.getComponent("MuteToggle"),r=n.getComponent("ClickableComponent"),a=n.extend(o,{constructor:function(e,t){o.prototype.constructor.call(this,e,t),this.addListeners(e)},addListeners:function(e){this.on("click",this.onMuteClick)},onMuteClick:function(){this.player_.trigger("muteClicked")},createEl:function(){var e="vjs-mute-control vjs-control";return this.player_.options_.muted&&(e+=" vjs-vol-0"),r.prototype.createEl.call(this,"div",{className:e,innerHTML:s()},{})},update:function(){var e=this.player_.volume(),t=3;0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),this.controlText(this.player_.muted()?"Unmute":"Mute");for(var i=0;i<4;i++)n.removeClass(this.el_,"vjs-vol-"+i);n.addClass(this.el_,"vjs-vol-"+t)}});e.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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(432),s=i(3),o=n.getComponent("SeekBar"),r=n.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=s.bind(this.detectDuration,this),this.player().on("loadedmetadata",this.boundDetectDuration)},handleMouseMove:function(e){o.prototype.handleMouseMove.apply(this,arguments),this.update()},detectDuration:function(){s.isFinite(this.player().duration())||null==this.el_||this.dispose()},update:function(){if(this.el_){var e=this.getPercent();isNaN(e)&&(e=0);var t=(100*e).toFixed(2)+"%";this.handle.style.left=t,this.bar.el().style.width=t}},dispose:function(){this.player().off("loadedmetadata",this.boundDetectDuration),o.prototype.dispose.apply(this,arguments)}});e.exports=r},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(432),r=o.getComponent("Component"),a=o.extend(r,{isHidden:!0,constructor:function(e,t){r.call(this,e,t),e.ready(s.bind(this.onReady,this))},onReady:function(){this.$player=n(this.player().el_),this.$el=n(this.el()),this.$loader=this.$el.find(".Knight-Rider-loader");var e=s.bind(this.hideLoader,this),t=s.bind(this.showLoader,this);this.player().on("waiting",t),this.player().on("canplay",e),this.player().on("canplaythrough",e),this.player().on("playing",e),this.player().on("seeking",t),this.player().on("seeked",e),this.player().on("ended",e),this.player().on("resolutionchange",t)},createEl:function(){return r.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",innerHTML:'
'},{"aria-label":"loading"})},hideLoader:function(e){return this.isHidden?this:(this.$loader.removeClass("animate"),this.$player.removeClass("vjs-loading"),this.isHidden=!0,this)},showLoader:function(e){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}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(432),o=s.getComponent("Component"),r=s.extend(o,{sdURL:null,hdURL:null,forceHD:null,isUsingSD:!0,timeIntervalBinding:null,constructor:function(e,t){o.prototype.constructor.call(this,e,t),this.addListeners(e)},addListeners:function(e){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 e=o.prototype.createEl.call(this,"div",{className:"vjs-hd-toggle vjs-sd vjs-menu-button vjs-control",innerHTML:"HD"},{});return e},currentSource:function(){return this.player_.currentSrc()},toggleSrc:function(){var e;this.isUsingSD?(this.sdURL=this.currentSource(),e=this.hdURL,s.removeClass(this.el_,"vjs-sd"),s.addClass(this.el_,"vjs-hd")):(e=this.sdURL,s.removeClass(this.el_,"vjs-hd"),s.addClass(this.el_,"vjs-sd")),this.isUsingSD=!this.isUsingSD,this.player_.src({src:e,type:"video/mp4"})},toggleHDState:function(){var e=this.player_.currentTime(),t=this.player_.paused(),i=this.player_.muted();this.player_.addClass("vjs-quality-toggling"),this.player_.trigger({type:"resolutionchange",resolution:this.isUsingSD?"hd":"sd"}),n.delay(n.bind(function(){this.player_.pause(),this.toggleSrc(),this.player_.ready(function(){this.player_.one("loadedmetadata",n.bind(function(){this.player_.currentTime(e)},this)),this.timeIntervalBinding=n.bind(function(){this.player_.currentTime()-e>.1&&(this.player_.removeClass("vjs-quality-toggling"),this.player_.off("timeupdate",this.timeIntervalBinding),t&&(this.player_.pause(),this.player_.muted(i)))},this),this.player_.on("timeupdate",this.timeIntervalBinding),n.defer(n.bind(function(){this.player_.load(),i===!1&&t===!0&&this.player_.muted(!0),this.player_.play()},this))})},this),300)}});e.exports=r},function(e,t,i){"use strict";var n=i(432),s=i(3),o=n.getComponent("DurationDisplay"),r=n.extend(o,{constructor:function(){o.prototype.constructor.apply(this,arguments),this.boundDetectDuration=s.bind(this.detectDuration,this),this.player().on("loadedmetadata",this.boundDetectDuration)},detectDuration:function(){s.isFinite(this.player().duration())||null==this.el_||this.dispose()},dispose:function(){this.player().off("loadedmetadata",this.boundDetectDuration),o.prototype.dispose.apply(this,arguments)}});e.exports=r},,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(283),r=i(462),a=s.extend({className:"popover--gif-search",mixins:[o],defaults:{query:null},initialize:function(e){this.gifSearch=new r(n.pick(e,"collection","query","imageWidth","loadFullImageBeforeSelect","selectedImageUrl","resultLimit","loggingContext")),this.listenTo(this,"change:query",function(e,t){this.gifSearch.setQuery(t)}),this.listenTo(this.gifSearch,"all",this.trigger)},render:function(){this.gifSearch.render().$el.appendTo(this.$el)},teardown:function(){return n.result(this.gifSearch,"remove"),this.$el.remove(),this}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(136),r=i(214),a=i(463),l=i(495),c=function(){};c.extend=s.Model.extend,n.extend(c.prototype,s.Events);var u=new c,h=r.extend({name:"ImageSearch",selector:"body",defaults:{resultLimit:200,imageWidth:250,loadFullImageBeforeSelect:!1,query:null,selectedImageUrl:null,loggingContext:null},initialize:function(e){e=e||{},n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"collection")),n.isEmpty(this.collection)&&(this.collection=new l),this.view=new a(n.extend({eventBus:u,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(u,"image:select",function(e,t){this.logGifSearchEvent("select",t),this.trigger("selectImage",e.toJSON(),this.getQuery())}),this.listenTo(u,"image:impression",function(e){this.logGifSearchEvent("impression",e)}),this.listenTo(u,"gifsearch:resultChange",function(e){this.logGifSearchResultChange("search",e)}),this.listenTo(this.view,"dismiss",function(){this.trigger("dismiss")})},render:function(){return this.view.render(),this.trigger("append"),this.view},setQuery:function(e){this.view.setQuery(e)},getQuery:function(){return this.view.getQuery()},getCurrentResults:function(){return this.view.get("currentResults")},logGifSearchEvent:function(e,t){var i={popularSearch:t.model.get("popularSearchTag")?t.model.get("popularSearchTag"):null,query:this.getQuery()?this.getQuery():null,resultsIndex:this.getCurrentResults().indexOf(t.model),top:Math.round(t.$el.position().top),left:Math.round(t.$el.position().left),postBlog:t.model.get("postBlog"),postId:t.model.get("postId"),context:this.get("loggingContext")};o.trigger("gifsearch:"+e,{loggingData:i})},logGifSearchResultChange:function(e,t){var i=this.getQuery();if(i){var n={query:i,context:this.get("loggingContext")};o.trigger("gifsearch:"+e,{loggingData:n})}}});e.exports=h},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(464),a=i(232),l=i(468),c=i(470),u=i(486),h=i(489),d=i(494),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(e){return{eventBus:e.eventBus,keyboardManager:e.keyboardManager,keyboardNamespace:"gifsearch:input"}}},searchResults:{constructor:c,options:function(e){return{imageWidth:e.get("imageWidth"),selectedImageUrl:e.get("selectedImageUrl"),loadFullImageBeforeSelect:e.get("loadFullImageBeforeSelect"),eventBus:e.eventBus,keyboardManager:e.keyboardManager,keyboardNamespace:"gifsearch:results"}}},searchMessage:{constructor:u,options:function(e){return{eventBus:e.eventBus}}}},defaults:{imageWidth:null,loadFullImageBeforeSelect:!0,resultLimit:200,selectedImageUrl:"",query:null,loggingContext:null,focusIndex:0,tabbingView:null},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection")),this.keyboardManager=new r({allowMultipleActiveViews:!0}),this.noResults=[s("Nothing turned up. Bummer."),s("Looked around but didn't see anything about that."),s("Sadly, nothing."),s("Tragically, nothing."),s("Welcome to the void. There is nothing here."),s("We found nothing. Here it isn't."),s("Couldn't find that. Please, don't be upset. Please."),s("Sincerely, we found nothing."),s("Maybe try a similar search but use different words? Dunno.")],this.listenTo(this,"change:query",this._onChangeQuery),this.listenTo(this.eventBus,"image:tag",function(e,t){this.set("query",e),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(e){this.setQuery(e)}),this.loader=new h({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),n.isString(this.get("query"))&&(this._onChangeQuery(this,this.get("query")),this.searchInput.setValue(this.get("query"))),n.defer(n.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!(n.isEmpty(this.get("currentResults"))||n.isEmpty(this.get("currentResults").models))},dismiss:function(){this.trigger("dismiss")},_onKeyPressTab:function(e){e.preventDefault(),this._moveFocusDown()},_onKeyPressShiftTab:function(e){e.preventDefault(),this._moveFocusUp()},_moveFocusUp:function(){var e=this.get("tabbingView");e&&e.set("isFocused",!1),this.set("focusIndex",Math.max(0,this.get("focusIndex")-1))},_moveFocusDown:function(){var e=this._focusViews||[];this.set("focusIndex",Math.min(e.length-1,this.get("focusIndex")+1))},_onChangeFocusView:function(e){var t=this._focusViews,i=n.indexOf(t,e);this.set("tabbingView",n.contains(this._tabbableViews,e)?e:null),this.set("focusIndex",i)},_onChangeFocusIndex:function(e,t){var i=n.get(this._focusViews,t);this.set("tabbingView",n.contains(this._tabbableViews,i)?i:null),n.result(i,"focus")},_onChangeQuery:function(e,t){n.isString(t)&&(this.rendered&&this.loader.set("loading",!0),this.currentQuery&&this.currentQuery.reject(),this.searchResults.cancelPreloads(),this.searchResults.cancelFullImageLoads(),this.currentQuery=this.collection.fetchGifs(t,this.get("resultLimit"),this.get("loggingContext")),this.currentQuery.promise.then(n.bind(function(e){if(this.set("currentResults",e.media),this.rendered){this.loader.set("loading",!1);var t=e.get("message");t&&(t.header||t.body)?this.searchMessage.setMessage(t.header,t.body,this.hasResults()):(this.searchResults.setCollection(this.get("currentResults")),this.hasResults()?this.searchMessage.hide():this.searchMessage.setMessage("",n.sample(this.noResults),!1))}this.currentQuery=null},this)))},setQuery:function(e){this.set("query",e)},getQuery:function(){return this.get("query")}});e.exports=p},function(e,t,i){"use strict";var n=i(3),s=i(465),o=s.extend({name:"MessagingKeyboardManager",addKeyboardAccess:function(e){return!!n.isFunction(n.get(e,"soloKeys"))&&(e.enableKeys(),e.soloKeys(!0),!0)},removeKeyboardAccess:function(e){return!!n.isFunction(n.get(e,"unSoloKeys"))&&(e.disableKeys(),e.unSoloKeys(),!0)}});e.exports=o},function(e,t,i){"use strict";var n=i(3),s=i(214),o=i(466),r=s.extend({name:"BaseKeyboardManager",defaults:{isDebugEnabled:!1,keepInactiveItems:!0,allowMultipleActiveViews:!1},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.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:n.noop,removeKeyboardAccess:n.noop,add:function(e,t){return!(!e||!t)&&(!this.collection.get(e)&&(this.get("keepInactiveItems")||this.get("allowMultipleActiveViews")||this.collection.remove(this.collection.models),this.collection.unshift({namespace:e,view:t}),this._adjustActiveStates(),!0))},remove:function(e){var t=this.collection.getByNamespace(e);return!n.isEmpty(t)&&(this.collection.remove(t),this._adjustActiveStates(),!0)},toggle:function(e,t,i){return i?this.add(e,t):this.remove(e)},_onAddItem:function(e){return this.addKeyboardAccess(e.get("view"))},_onRemoveItem:function(e){return this.removeKeyboardAccess(e.get("view"))},_adjustActiveStates:function(){var e,t;0!==this.collection.length&&(e=this.collection.first(),t=this.collection.rest(),e&&e.set("isActive",!0),this.get("allowMultipleActiveViews")||n.each(t,function(e){e.set("isActive",!1)},this))},_onItemActiveChange:function(e,t){return t?this.addKeyboardAccess(e.get("view")):this.removeKeyboardAccess(e.get("view"))}});e.exports=r},function(e,t,i){"use strict";var n=i(190),s=i(467),o=n.extend({model:s,getByNamespace:function(e){return this.filter(function(t){return this._isNamespaceMatch(e,t.get("namespace"))},this)},_isNamespaceMatch:function(e,t){return e===t||0===t.indexOf(e+":")}});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({idAttribute:"namespace",defaults:{namespace:null,view:null,isActive:!0}});e.exports=s},function(e,t,i){"use strict";var n=i(226),s=i(232),o=i(277),r=i(469),a=i(130),l=i(3),c=i(292),u=n.extend({className:"gif-search-input",template:r,mixins:[s,o],defaults:{isFocused:!1},events:{"focus [data-js-plainTextEditor]":"_onFocus","blur [data-js-plainTextEditor]":"_onBlur"},subviews:{textEditor:{constructor:c,options:function(e){return{forceSingleLine:!0,placeholder:a("Find a GIF"),syncWithModel:!1,onChange:l.debounce(l.bind(e._onUserChangeInput,e),250) }}}},initialize:function(e){e=l.extend({},e),l.extend(this,l.pick(e,"eventBus","keyboardManager","keyboardNamespace"))},afterRender:function(){this.listenTo(this,"change:isFocused",this._onChangeIsFocused)},_onChangeIsFocused:function(e,t){t?(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(e){this.textEditor.setEditorValue(e)}});e.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="";with(obj)__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.prototype,r=i(471),a=i(232),l=i(472),c=i(473),u=i(475),h=i(235),d=h.animate,p=h.hook,g=i(192),f=i(485),_=function(e){var t=Math.round(e.position().top),i=Math.round(t+e.height());return{top:t,bottom:i}},m=function(e,t){return!(t.bottome.bottom)},v=function(e,t){return t.bottom>=e.bottom&&t.top<=e.top},b=function(e){return{top:Math.round(e.scrollTop()),bottom:Math.round(e.scrollTop()+e.height())}},y=function(e,t){return Math.floor(t.position().top/e.height())},w=function(e){return Math.floor(e.scrollTop()/e.outerHeight(!0))},C=function(e){return Math.ceil(e.get(0).scrollHeight/e.height())},k=s.extend({className:"gif-search-results",template:l,mixins:[a,r],keycommands:{"keydown:down":"_onKeyPressDown","keydown:up":"_onKeyPressUp","keydown:enter":"_onKeyPressEnter"},subviews:{searchResults:{constructor:c,options:function(e){return{eventBus:e.eventBus,imageWidth:e.get("imageWidth"),onSelect:n.bind(e._onSubviewSelect,e),onClear:n.bind(e._onSubviewClear,e),loadFullImageBeforeSelect:e.get("loadFullImageBeforeSelect")}},collection:function(e){return e.collection}}},defaults:{renderBatchSize:50,renderBatchDelay:5,selectedImageUrl:"",imageWidth:null,loadFullImageBeforeSelect:!0,enablePreloading:!0,isPreloading:!1,preloadPollInterval:1e3,selectedView:null,isFocused:!1},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection","keyboardManager","keyboardNamespace")),this.keyboardViewName="searchResults"},setCollection:function(e){this.collection&&this.stopListening(this.collection),this.collection=e,this.eventBus.trigger("gifsearch:resultChange",this.collection),this.rendered&&this.render()},populatePreloadQueue:function(){this._preloadQueue=n.range(C(this.$el)),this.sortPreloadQueue()},sortPreloadQueue:function(){var e;n.isEmpty(this._preloadQueue)||(e=w(this.$el),this._preloadQueue=n.sortBy(this._preloadQueue,function(t){return Math.abs(e-t)+(t0&&(o=setTimeout(a,i)),e.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=n.debounce(n.bind(this._setIsFocused,this),0),n.defer(n.bind(function(){if(this.rendered){this._deferredRenders||(this._deferredRenders=[]);var e=n.delay(n.bind(this.resetMasonry,this),this.get("renderBatchDelay")*this._deferredRenders.length);this._deferredRenders.push(e),this.scrollbar?this.scrollbar.update():this.scrollbar=new f(this.$el)}},this)))},removeSubviews:function(){return n.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 e=this.getSubviewsInBounds();this.hideViews(e),this.$el.css("visibility",""),this.animateShowViews(e)},getViewBounds:function(e){return n.result(this._elementPositionCache,e.cid)?this._elementPositionCache[e.cid]:_(e.$el)},getSubviewsInBounds:function(e){return e=e||b(this.$el),n.filter(this.searchResults,function(t){return m(this.getViewBounds(t),e)},this)},setupMasonary:function(){this.masonry?this.masonry.reload():this.masonry=new u(this.$(".results-scroller").get(0),{transitionDuration:0,isFitWidth:!0,gutter:10},this)},setupElementCaches:function(){var e=this.$el;this._pageIndexCache={},this._elementPositionCache={},n.each(this.searchResults,function(t){var i=y(e,t.$el);n.isArray(this._pageIndexCache[i])||(this._pageIndexCache[i]=[]),this._pageIndexCache[i].push(t),this._elementPositionCache[t.cid]=_(t.$el)},this)},getViewsAtPageIndex:function(e){return this._pageIndexCache[e]||[]},setupVirtualization:function(){var e=n.bind(function(){this.rendered&&(this.sortPreloadQueue(),this.virtualizeSubviews())},this),t=n.debounce(e,250);this.$el.off(".image-search-virtualization").on("scroll.image-search-virtualization",t),this.virtualizeSubviews()},setSelectedImage:function(){var e,t;if(this.get("selectedImageUrl")&&(t=n.find(this.searchResults,function(e,t){return e.model.get("mediaUrl")===this.get("selectedImageUrl")},this))){if(t.set("isPreselected",!0),e=t.$el.offset().top-this.$el.offset().top,0===e)return;e-=(this.$el.height()-t.$el.height())/2,this.$el.scrollTop(e)}},cancelPreloads:function(){this.stopPreloadPoller(),this.clearPreloadQueue()},cancelFullImageLoads:function(){this.eventBus.trigger("image:full:cancelLoad")},preloadSubviews:function(e,t){return g.all(n.map(e,function(e){return e.loadImage()}))},_virtualizeSubviews:function(e,t,i){n.forEach(this.searchResults,function(s,o){if(s&&s.$el){var r=this.getViewBounds(s);m(r,e)?n.isFunction(t)&&t.call(this,s,v(r,e)):n.isFunction(i)&&i.call(this,s)}},this)},virtualizeSubviews:function(){var e=this.$el,t={top:e.scrollTop(),bottom:e.scrollTop()+e.height()};this._virtualizeSubviews(t,function(e,t){e.set({isVirtualized:!1}),t&&e.get("isImpressionLogged")===!1&&(this.eventBus.trigger("image:impression",e),e.set("isImpressionLogged",!0))},function(e){e.set({isVirtualized:!0})})},beforeRemove:function(){this.$el.off(),this.cancelPreloads(),this.cancelFullImageLoads(),this.keyboardManager.remove(this.keyboardNamespace),this.scrollbar&&this.scrollbar.destroy()},_setIsFocused:function(e){this.rendered&&this.set("isFocused",e)},_onChangeSelectedView:function(e,t){var i=this.previous("selectedView");i&&i.setSelected(!1),t&&t.setSelected(!0)},_onChangeIsFocused:function(e,t){t?(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(e){this.get("isFocused")||this._setIsFocused(!0),this.setSelectedIndex(this.keyboardViewName,n.indexOf(this.searchResults,e)),this.set("selectedView",this.getSelectedView(this.keyboardViewName))},_onSubviewClear:function(){this.set("selectedView",null),this.deselect(this.keyboardViewName)},focus:function(){var e=this.get("selectedView"),t=!n.isEmpty(e);this._setIsFocused(!0),t?this.setSelectedIndex(this.keyboardViewName,n.indexOf(this.searchResults,e)):this.set("selectedView",this.selectFirst(this.keyboardViewName))},isLastViewSelected:function(){return this.isLastSelected(this.keyboardViewName)},isFirstViewSelected:function(){return this.isFirstSelected(this.keyboardViewName)},_onKeyPressDown:function(e){var t;e.preventDefault(),t=this.isLastViewSelected()?this.selectFirst(this.keyboardViewName):this.selectNext(this.keyboardViewName),this.set("selectedView",t)},_onKeyPressUp:function(e){var t;e.preventDefault(),t=this.isFirstViewSelected()?this.selectLast(this.keyboardViewName):this.selectPrevious(this.keyboardViewName),this.set("selectedView",t)},_onKeyPressEnter:function(e){var t=this.get("selectedView");e.preventDefault(),t&&t.select(e)}});e.exports=k},function(e,t,i){"use strict";var n=i(3),s=i(187),o=new s({defaults:{hasSelection:function(e){return this._validateParams(e)?n.has(this._selectedIndexes,e):null},getSelectedIndex:function(e){return this._validateParams(e)?n.get(this._selectedIndexes,e,0):null},deselect:function(e){this._validateParams(e)&&this.hasSelection(e)&&delete this._selectedIndexes[e]},resetSelected:function(e){this._validateParams(e)&&this.setSelectedIndex(e,0)},setSelectedIndex:function(e,t){var i;return this._validateParams(e)?(i=n.get(this,e,[]),t=Math.max(0,Math.min(t,i.length-1)),n.set(this._selectedIndexes,e,t),t):null},getSelectedView:function(e){var t;return this._validateParams(e)?(t=n.get(this,e,[]),n.get(t,this.getSelectedIndex(e))):null},isFirstSelected:function(e){return this._validateParams(e)?0===this.getSelectedIndex(e):null},isLastSelected:function(e){var t;return this._validateParams(e)?(t=n.get(this,e,[]),this.getSelectedIndex(e)===t.length-1):null},selectFirst:function(e){var t;if(!this._validateParams(e))return null;t=n.get(this,e,[]);var i=this.setSelectedIndex(e,0);return n.get(t,i)},selectLast:function(e){var t;if(!this._validateParams(e))return null;t=n.get(this,e,[]);var i=this.setSelectedIndex(e,t.length-1);return n.get(t,i)},selectNext:function(e){var t,i;return this._validateParams(e)?this.hasSelection(e)?(t=n.get(this,e,[]),i=this._increaseSelectedIndex(e),n.get(t,i)):this.selectFirst(e):null},selectPrevious:function(e){var t,i;return this._validateParams(e)?(t=n.get(this,e,[]),i=this._decreaseSelectedIndex(e),n.get(t,i)):null},_validateParams:function(e){return!!e},_increaseSelectedIndex:function(e){return this._validateParams(e)?this.setSelectedIndex(e,this.getSelectedIndex(e)+1):null},_decreaseSelectedIndex:function(e){return this._validateParams(e)?this.setSelectedIndex(e,this.getSelectedIndex(e)-1):null}},before:{initialize:function(){this._selectedIndexes={}}}});e.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 __t,__p="";with(obj)__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(474),a=i(259),l=i(277),c=i(331),u=i(192),h=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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","onSelect","onClear")),this._loadDefer=u.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 e=this.model.toJSON(),t=e.popularSearchTag?[e.popularSearchTag]:e.postTags,i=this.get("skipTags"),s=this.get("containerWidth"),o=Math.round(this.model.get("height")*(s/this.model.get("width")));return t=n.reject(t,function(e){return n.contains(i,e.toLowerCase())}),n.extend(e,{tags:t.slice(0,3),width:s,height:o}),this.get("imageWidth")&&n.extend(e,{mediaUrl:e.mediaUrl.replace(/_\d+\./,"_"+this.get("imageWidth")+".")}),e},loadImage:function(){var e=this.js$("img"),t=e.attr("data-img-src");return this.get("isLoaded")||(e.attr("src",t),a.load(t,100).then(n.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(e){e.preventDefault(),n.isFunction(this.onSelect)&&this.onSelect(this,this.model);var t=this.model.get("mediaUrl"),i=this.js$("img").attr("src"),s=function(){this.$el.addClass("gif-search-result--selected"),this.eventBus.trigger("image:select",this.model,this)};this.get("loadFullImageBeforeSelect")&&t!==i?this._loadFullImage(t,s):s.call(this)},select:function(e){this._onClickSelect(e)},_loadFullImage:function(e,t){this.eventBus.trigger("image:full:cancelLoad"),this.set("loadingFullImage",!0),this.eventBus.trigger("image:full:loading"),this.loader=new c({variation:"centered small",loading:!0}),this.$el.addClass("loading-full").append(this.loader.render().$el),a.load(e).then(n.bind(function(){this.get("loadingFullImage")&&n.isFunction(t)&&t.call(this)},this)).finally(n.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(e){var t=s(e.target).attr("data-js-tag");this.eventBus.trigger("image:tag",t,this.model),e.preventDefault(),e.stopPropagation()},_onChangeIsPreselected:function(e,t){this.$el.toggleClass("gif-search-result--preselected",t)},_onChangeIsVirtualized:function(e,t){this.$el.toggleClass("off",t),t&&this.get("unloadImageOnVirtualize")?this.unloadImage():t||this.loadImage()},_onChangeHasStillImage:function(e,t){this._removeStillCanvas(),t&&this._prepareCreateStillCanvas()},_onChangeIsSelectable:function(e,t){this.$el.toggleClass("gif-search-result--selectable",t)},_onChangeIsLoaded:function(e,t){this.$el.toggleClass("loaded",t)},_createStillCanvas:function(){if(this.rendered){var e,t=this.js$("img"),i=t.parent(),n=parseInt(t.width(),10),o=parseInt(t.height(),10),r=s("").attr({width:n,height:o});this.$("canvas").remove(),i.append(r),e=r.get(0).getContext("2d"),e.drawImage(t.get(0),0,0,n,o),this.$el.addClass("show-still")}},_prepareCreateStillCanvas:function(){this.getLoadPromise().then(n.bind(this._createStillCanvas,this)).catch(n.noop)},_removeStillCanvas:function(){this.$("canvas").remove(),this.$el.removeClass("show-still")},setSelected:function(e){this.rendered&&this.set("isSelected",e)},_onChangeIsSelected:function(e,t){this.$el.toggleClass("selected",t),this.$el.focus()},_onMouseEnter:function(e){n.isFunction(this.onSelect)&&this.onSelect(this)},_onMouseLeave:function(e){n.isFunction(this.onClear)&&this.onClear(this)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
";return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(429),r=i(136),a=i(219),l=i(230),c=a.extend({mixins:[l],tplScrollbarWrapper:'
',tplScrollbarTrackVertical:'
',tplScrollbarTrackHorizontal:'
',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(e){var t=this._getElementFromOptions(e);return null===t?null:(this.container=t,this.$container=s(t),n.extend(e,{el:this._getWrappedElement(t)}),a.prototype.constructor.call(this,e))},initialize:function(e){this.$window=s(window),this._onScrollStopDebounced=n.debounce(n.bind(this._onScrollStop,this),150),this._onResizeDebounced=n.debounce(n.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 e,t,i;this.destroyed||(e=this._isScrollableVertical(),t=this._isScrollableHorizontal(),i=e||t,this.set({isScrollableVertical:e,isScrollableHorizontal:t,isScrollable:i}),this._updateScrollConstants(),e&&(this._updateVerticalThumbHeight(),this._positionVerticalThumb()),t&&(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(e){var t;return t=e instanceof s?e.get(0):e instanceof window.Element?e:n.get(e,"el",null)},_getWrappedElement:function(e){var t=e instanceof s?e:s(e),i=s(this.tplScrollbarWrapper);return t.wrap(i),i=t.parent(),i.get(0)},_unwrapContainer:function(){this.$container.unwrap()},_appendVerticalTrack:function(){var e=s(this.tplScrollbarTrackVertical);this.$verticalTrack=e,this.$verticalThumb=e.find("[data-js-thumb-vertical]"),this.$el.append(e)},_removeVerticalTrack:function(){var e=this.getVerticalTrack();e&&(e.remove(),delete this.$verticalTrack,delete this.$verticalThumb)},_appendHorizontalTrack:function(){var e=s(this.tplScrollbarTrackHorizontal);this.$horizontalTrack=e,this.$horizontalThumb=e.find("[data-js-thumb-horizontal]"),this.$el.append(e)},_removeHorizontalTrack:function(){var e=this.getHorizontalTrack(!0);e&&(e.remove(),delete this.$horizontalTrack,delete this.$horizontalThumb)},_onChangeIsScrollable:function(e,t){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"),t),t&&(this.$container.on("scroll",n.bind(this._onScroll,this)),i||this.$container.on("wheel.txScroll",n.bind(this._stealScroll,this))))},_onChangeIsScrollableVertical:function(e,t){this.destroyed||(this.$container.toggleClass(this.get("containerClassVertical"),t),t?this._appendVerticalTrack():this._removeVerticalTrack())},_onChangeIsScrollableHorizontal:function(e,t){this.destroyed||(this.$container.toggleClass(this.get("containerClassHorizontal"),t),t?this._appendHorizontalTrack():this._removeHorizontalTrack())},_updateScrollConstants:function(){var e=this.getVerticalTrack(),t=this.getHorizontalTrack(),i=this.getVerticalThumb(),n=this.getHorizontalThumb();this.currentScrollTop=this.$container.scrollTop(),this.currentScrollLeft=this.$container.scrollLeft(),this.get("isScrollableVertical")&&e&&i&&(this.percentageDifferenceVertical=(this.container.scrollHeight-this.$container.height())/(e.height()-i.height())),this.get("isScrollableHorizontal")&&t&&n&&(this.percentageDifferenceHorizontal=(this.container.scrollWidth-this.$container.width())/(t.width()-n.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(e,t){return e.pageY-t.offset().top},_getScrollLeft:function(e,t){return e.pageX-t.offset().left},_onVerticalThumbMousedown:function(e){var t=this.getVerticalTrack();e.preventDefault(),t&&(t.addClass(this.get("trackActiveClass")),this.$window.on("mousemove.txScroll",n.bind(this._onVerticalThumbMousemove,this)),this.$window.on("mouseup.txScroll",n.bind(this._onVerticalThumbMouseup,this)),this.mouseDownOriginalOffsetY=this._getScrollTop(e,t),this._updateScrollConstants())},_onHorizontalThumbMousedown:function(e){var t=this.getHorizontalTrack();e.preventDefault(),t&&(t.addClass(this.get("trackActiveClass")),this.$window.on("mousemove.txScroll",n.bind(this._onHorizontalThumbMousemove,this)),this.$window.on("mouseup.txScroll",n.bind(this._onHorizontalThumbMouseup,this)),this.mouseDownOriginalOffsetX=this._getScrollLeft(e,t),this._updateScrollConstants())},_onVerticalThumbMousemove:function(e){var t,i=this.getVerticalTrack();i&&o.read(function(){this.destroyed||(t=this._getScrollTop(e,i)-this.mouseDownOriginalOffsetY,o.write(function(){this.destroyed||this.$container.scrollTop(this.currentScrollTop+t*this.percentageDifferenceVertical)},this))},this)},_onVerticalThumbMouseup:function(e){var t=this.getVerticalTrack();e.preventDefault(),t&&t.removeClass(this.get("trackActiveClass")),this.$window.off(".txScroll")},_onHorizontalThumbMousemove:function(e){var t,i=this.getHorizontalTrack();i&&o.read(function(){this.destroyed||(t=this._getScrollLeft(e,i)-this.mouseDownOriginalOffsetX,o.write(function(){this.destroyed||this.$container.scrollLeft(this.currentScrollLeft+t*this.percentageDifferenceHorizontal)},this))},this)},_onHorizontalThumbMouseup:function(e){var t=this.getHorizontalTrack();e.preventDefault(),t&&t.removeClass(this.get("trackActiveClass")),this.$window.off(".txScroll")},_updateVerticalThumbHeight:function(){var e,t=this.getVerticalThumb(),i=this.getVerticalTrack();i&&t&&(e=this.$container.height()/this.container.scrollHeight,t.height(i.height()*e))},_updateHorizontalThumbWidth:function(){var e,t=this.getHorizontalThumb(),i=this.getHorizontalTrack();i&&t&&(e=this.$container.width()/this.container.scrollWidth,t.width(i.width()*e))},_positionVerticalThumb:function(){var e,t,i,n=this.getVerticalTrack(),s=this.getVerticalThumb();!this.destroyed&&n&&s&&(i=this.container.scrollTop,e=i/(this.container.scrollHeight-this.$container.height()),t=n.height()-s.height(),o.write(function(){this.destroyed||(s.css("transform","translate3d(0, "+t*e+"px, 0)"),this.trigger("scroll:vertical",i,e),this.trigger("scroll",i,e),e>this.get("infiniteScrollPercent")&&this.trigger("infinitescroll",i,e))},this))},_positionHorizontalThumb:function(){var e,t,i,n=this.getHorizontalTrack(),s=this.getHorizontalThumb();!this.destroyed&&n&&s&&(i=this.container.scrollLeft,e=i/(this.container.scrollWidth-this.$container.width()),t=n.width()-s.width(),o.write(function(){this.destroyed||(s.css("transform","translate3d("+t*e+"px, 0, 0)"),this.trigger("scroll:horizontal",i,e))},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(n.bind(this._positionVerticalThumb,this)),this.get("isScrollableHorizontal")&&o.read(n.bind(this._positionHorizontalThumb,this))},_onScrollStop:function(){this.destroyed||(this.trigger("scrollstop"),this.set("isScrolling",!1),this.$el.removeClass(this.get("scrollingClass")))},_stealScroll:function(e){var t=e.currentTarget,i=e.originalEvent.deltaX,n=e.originalEvent.deltaY,o=Math.abs(i)>0,r=Math.abs(n)>0;this.get("isScrollableHorizontal")&&o&&(i<0&&t.scrollLeft<=0&&e.preventDefault(),i>0&&t.scrollLeft>=t.scrollWidth-s(t).width()-this._getAddedScrollbarWidth()&&e.preventDefault()),this.get("isScrollableVertical")&&r&&(n<0&&t.scrollTop<=0&&e.preventDefault(),n>0&&t.scrollTop>=t.scrollHeight-s(t).height()-this._getAddedScrollbarHeight()&&e.preventDefault())}});e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(487),o=i(226),r=i(488),a=o.extend({className:"gif-search-message",template:r,defaults:{header:"",body:"",hasResults:!1},events:{"click [data-js-showResults]":"_onClickShowResults"},initialize:function(e){n.extend(this,n.pick(e,"eventBus"))},_onClickShowResults:function(){this.eventBus.trigger("showHiddenResults")},_filterMessageHtml:function(e,t){t.find("script, link").remove(),t.find("a[onerror]").removeAttr("onerror")},getTemplateData:function(){var e=o.prototype.getTemplateData.apply(this,arguments);return e.body=s(e.body||"",this._filterMessageHtml),e},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(e,t,i){n.isString(t)||(t=e,e=""),n.isBoolean(i)||(i=this.get("hasResults")),this.set({header:e,body:t,hasResults:i}),t||e?this.show():this.hide()},show:function(){this.$el.removeClass("gif-search-message--hidden")},hide:function(){this.$el.addClass("gif-search-message--hidden")}});e.exports=a},function(e,t,i){"use strict";function n(e,t){var i=r.nodeFromString(e),n=o(i);return s.isFunction(t)&&(t=s.rest(arguments)),s.each(t,function(e){e(i,n)}),n.html()}var s=i(3),o=i(8),r=i(354);e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
',header&&(__p+='

'+(null==(__t=header)?"":__t)+"

"),__p+='
'+(null==(__t=body)?"":__t)+"
",hasResults&&(__p+='

'+__e(__("View results anyway"))+"

"),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(490);e.exports=n},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(491),r=i(493),a=s.extend({className:"loader-container",template:r,defaults:{type:"",classModifiers:"",loading:!1},initialize:function(e){this.options=n.extend({},this.defaults,e),this.$container=e.$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(e,t){this.subviews.loaderType.toggleLoading(t)},attach:function(){this.render(),this.$el.attr("data-subview=loader"),this.$container.find("[data-subview=loader]").replaceWith(this.$el)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(492),r=s.extend({className:"loader-bar",template:o,defaults:{classModifiers:"",loading:!1},initialize:function(e){this.options=n.extend({},this.defaults,e),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(e){this.currentBar=0,this.counter=0,e===!0?(clearTimeout(this.timeout),this.$el.addClass("loading"),this.$bars.addClass("animating"),this.startAnimating()):(this.$el.removeClass("loading"),this.stopAnimating(),this.timeout=setTimeout(n.bind(function(){ this.$bars.removeClass("animating")},this),300))},showBar:function(e){this.$bars.eq(e).addClass("active")},hideBar:function(e){this.$bars.eq(e).removeClass("active")},loop:function(){var e=this.$bars.eq(this.currentBar);e.remove(),this.$el.append(e),this.currentBar+=1,this.currentBar>=this.$bars.length&&(this.currentBar=0),this.counter++},startAnimating:function(){this.stopAnimating(),this.loop(),this.interval=setInterval(n.bind(function(){this.loop()},this),300)},stopAnimating:function(){clearInterval(this.interval)},beforeRemove:function(){clearInterval(this.interval),clearTimeout(this.timeout)}});e.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+='
';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+='
';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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(190),r=i(496),a=3e5,l=o.extend({model:r,resultCountForQuery:function(e){e=(e||"").toLowerCase().trim();var t=this.get(e);return t?t.media.length:0},fetchGifs:function(e,t,i,o){var l,c=s.defer();e=(e||"").toLowerCase().trim();var u=this.get(e);return u||(u=new r({query:e,limit:t,loggingContext:i}),this.add(u)),!o&&n.now()-u.get("ts")t.maxUploadSize&&(l.trigger("postform-interaction:upload-limit-hit",{loggingData:{fileSize:e.size,fileType:e.type,maxSize:t.maxUploadSize}}),i.push({type:"filesize",message:s(t.message.filesize,t.maxUploadSize)})),t.uploadPattern&&e.type&&!t.uploadPattern.test(e.type)&&i.push({type:"filetype",message:t.message.filetype[t.mediaType]||t.message.filetype.default}),i},upload:function(e){this.add({files:[e]})},cancel:function(){var e;return this.jqXHR?(e=this.jqXHR.abort(),this.jqXHR=null):e=a.reject(this.options.message.cancel),e},_forMatchingFiles:function(e,t){var i=n.rest(arguments);this.collection.forEach(function(s){if(n.contains(e,s.get("file"))){var o=n.clone(i);o[0]=s,t.apply(this,o)}},this)},promise:function(){return this.collection.promise()},_fileUploadWrap:{defaults:{change:function(e,t,i){this._fileUpload.options.replaceFileInput&&this.setElement(e)},add:function(e,t,i){var s=i.files[0],o=this.validateFile(s),r={},a={};if(!n.isEmpty(o)){r.error=n.pluck(o,"message"),r.file=s;var l={errorType:"validation",messages:o,file:s};this.collection.trigger("invalid",this.collection,new this.collection.model(r)),this.trigger("error",l),a.silent=!0}return this._createUploadModelForFile(s,r,a),n.isEmpty(o)},send:function(e,t,i){return!0}},before:{},after:{done:function(e,t,i){var s,o=n.get(i,"result.meta.status"),r=n.get(i,"result.response"),a=n.get(i,"result.errors");if(200!==o||n.isEmpty(r)){var l=function(){return r&&r.msg?r.msg:n.isArray(a)?n.isEmpty(a)?c("Woops :("):a:a.join(" ")}();s={error:l,uploading:!1}}else n.isArray(r)&&(r=r[0]),s=n.extend({complete:!0,uploading:!1},r);this._forMatchingFiles(i.files,function(e,t){e.set(t)},s)},fail:function(e,t,i){var s;s="abort"===i.errorThrown?{uploading:!1}:{error:this.options.message.error,uploading:!1},s.responseJSON=n.get(i,"jqXHR.responseJSON"),this._forMatchingFiles(i.files,function(e,t){e.set(t)},s)},progress:function(e,t,i){this._forMatchingFiles(i.files,function(e,t){e.set(t)},{bytesLoaded:i.loaded,bytesTotal:i.total})}},around:{add:function(e,t,i,s){var o=e.apply(this,n.rest(arguments));return o!==!1&&!i.isDefaultPrevented()&&((s.autoUpload||s.autoUpload!==!1&&this._fileUpload.options.autoUpload)&&s.process().done(n.bind(function(){this.jqXHR=s.submit()},this)),o)},send:function(e,t,i,s){s.withFormKey=!0;var o=e.apply(this,n.rest(arguments));if(o){this._forMatchingFiles(s.files,function(e,t){e.set(t)},{uploading:!0});var r={files:s.files};this.collection.trigger("send",this.collection,r),this.trigger("send",r)}return o}}}});e.exports=f},function(e,t,i){"use strict";var n=function(e,t){return t||(t=this),function(){var i=Array.prototype.slice.call(arguments);return i.unshift(this),e.apply(t,i)}};e.exports=n},,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";function n(){return o||(o=new r),o}function s(){return!!o}var o,r=i(545);e.exports={getInstance:n,hasInstance:s}},function(e,t,i){"use strict";function n(e,t){e instanceof o&&(e=e.get(0)),t instanceof o&&(t=t.get(0)),e&&t&&s.forEach(u,function(i){e.hasAttribute(i)&&t.setAttribute(i,e.getAttribute(i))})}var s=i(3),o=i(8),r=i(214),a=r.prototype,l=i(546),c=i(546).LivePhoto,u=["width","height","data-pin-url","data-pin-description"],h=r.extend({name:"LivePhotos",autoAppend:!0,initialize:function(){this.instances=[]},create:function(e){var t=e instanceof o?e:o(e);if(t.length){var i=t.closest("a, [data-lightbox]");if(i.length){var s,r;i.on("mousedown.livephoto touchstart.livephoto",function(){s=!1,i.prop("livePhotoSneezeguard",!0),r=setTimeout(function(){i.prop("livePhotoSneezeguard",!1),s=!0},750)}),i.on("click.livephoto",function(e){clearTimeout(r),s&&e.preventDefault()})}var a=new c(t.get(0));return this.instances.push(a),n(t,a.img),a}return null},remove:function(){return l.cleanup(),a.remove.call(this)},append:function(){return l.addStyles(),a.append.call(this)}});e.exports=h},function(e,t,i){!function(t,i){e.exports=i()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return e[n].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){function n(e,t){if(u){d&&s(),"object"==typeof e&&"[object Object]"===e.toString()&&(t=e,e=t.elements,delete t.elements),e||(e="img[data-live-photo]"),"string"==typeof e&&(e=document.querySelectorAll(e)),e instanceof HTMLElement&&(e=[e]);var i=[];return Array.prototype.forEach.call(e,function(e){if("string"==typeof e&&(e=document.querySelector(e)),e){var n=new l(e,t);i.push(n)}}),i}}function s(){c.use(),h++}function o(){d=!1}function r(){for(;h>0;)c.unuse(),h--}function a(e,t){return n(e,t)}var l=i(1),c=i(4),u=!0,h=0,d=!0;a.initialize=n,a.addStyles=s,a.noStyles=o,a.cleanup=r,a.LivePhoto=l,e.exports=a},function(e,t,i){function n(e,t,i,n){var s=document.createElement("video");return s.src=e+(i?"#"+i:""),s.controls=!1,s.muted=n||!1,s.preload="auto",t&&(s.className=t),c(s,!n),s}function s(e,t){if(e.paused){var i=e.muted,n=e.currentTime,s=function(){e.removeEventListener("loadedmetadata",s),e.currentTime=n,t&&t(e)};e.muted=!0,e.play(),e.pause(),e.muted=i,e.duration>=0?s():e.addEventListener("loadedmetadata",s)}}function o(e,t,i){var s=document.createElement("div");s.className="live-photo",s.setAttribute("data-live-photo","");var o=document.createElement("img");o.className="live-photo-keyframe",o.src=e;var r=n(t,"live-photo-postroll",i,!0),a=n(t,"live-photo-video"),l=document.createElement("i");return l.className="live-photo-icon",s.appendChild(o),s.appendChild(r),s.appendChild(a),s.appendChild(l),{container:s,img:o,postroll:r,video:a,icon:l}}function r(){var e=["mousedown"];return u&&e.push("touchstart"),e}function a(){var e=["mouseup","mouseout"];return u&&e.push("touchend"),e}function l(e,t,i,n){if(!(this instanceof l))return new l(e,t,i,n);var s,r;if(e instanceof HTMLElement&&(n=t,r=e,t=r.getAttribute("data-live-photo"),i=parseFloat(r.getAttribute("data-live-photo-still-image-time")),e=r.src),n||(n={}),this.postrollMs=n.postrollMs||375,this.deactivateMs=n.deactivateMs||500,this.previewMs=n.previewMs||500,this.stillImageTime=i||NaN,!e&&!n.noErrors)throw new Error("LivePhoto Error: Missing keyframeUrl");if(!t&&!n.noErrors)throw new Error("LivePhoto Error: Missing videoUrl");s=o(e,t,i),r&&(r.parentNode.insertBefore(s.container,r),r.parentNode.removeChild(r)),this.container=s.container,this.img=s.img,this.video=s.video,this.postroll=s.postroll,this.icon=s.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,n.useEventHandlers!==!1&&this._addEventHandlers(n.playEvents,n.stopEvents)}var c=i(2),u="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints;l.prototype={_addEventHandlers:function(e,t){var i=this.container,n=!1,o=this.play.bind(this),l=this.video,c=this.postroll,u=function(e){if(e.preventDefault(),n)o();else{var t=!1,i=!1;s(l,function(){t=!0,i&&o()}),s(c,function(){i=!0,t&&o()}),n=!0}};e&&e!==!1||(e=r),"function"==typeof e&&(e=e(this)),"string"==typeof e&&(e=e.split(/[,\s]+/)),e.forEach(function(e){e&&i.addEventListener(e,u)});var h=this.stop.bind(this),d=function(e){e.preventDefault(),h()};t&&t!==!1||(t=a),"function"==typeof t&&(t=t(this)),"string"==typeof t&&(t=t.split(/[,\s]+/)),t.forEach(function(e){e&&i.addEventListener(e,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(e){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(e){this.duration=e,("number"!=typeof this.stillImageTime||isNaN(this.stillImageTime))&&(this.stillImageTime=.5*e),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))}},e.exports=l},function(e,t,i){/*! npm.im/iphone-inline-video */ "use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function s(e){function t(s){i=requestAnimationFrame(t),e(s-(n||s)),n=s}var i,n;this.start=function(){i||t(0)},this.stop=function(){cancelAnimationFrame(i),i=null,n=0}}function o(e,t,i,n){function s(t){Boolean(e[i])===Boolean(n)&&t.stopImmediatePropagation(),delete e[i]}return e.addEventListener(t,s,!1),s}function r(e,t,i,n){function s(){return i[t]}function o(e){i[t]=e}n&&o(e[t]),Object.defineProperty(e,t,{get:s,set:o})}function a(e,t,i){i.addEventListener(t,function(){return e.dispatchEvent(new Event(t))})}function l(e,t){Promise.resolve().then(function(){e.dispatchEvent(new Event(t))})}function c(e){var t=new Audio;return a(e,"play",t),a(e,"playing",t),a(e,"pause",t),t.crossOrigin=e.crossOrigin,t.src=e.src||e.currentSrc||"data:",t}function u(e,t,i){(v||0)+200=e.video.duration}function d(e){var t=this;t.video.readyState>=t.video.HAVE_FUTURE_DATA?(t.hasAudio||(t.driver.currentTime=t.video.currentTime+e*t.video.playbackRate/1e3,t.video.loop&&h(t)&&(t.driver.currentTime=0)),u(t.video,t.driver.currentTime)):t.video.networkState!==t.video.NETWORK_IDLE||t.video.buffered.length||t.video.load(),t.video.ended&&(delete t.video[C],t.video.pause(!0))}function p(){var e=this,t=e[w];return e.webkitDisplayingFullscreen?void e[k]():("data:"!==t.driver.src&&t.driver.src!==e.src&&(u(e,0,!0),t.driver.src=e.src),void(e.paused&&(t.paused=!1,e.buffered.length||e.load(),t.driver.play(),t.updater.start(),t.hasAudio||(l(e,"play"),t.video.readyState>=t.video.HAVE_ENOUGH_DATA&&l(e,"playing")))))}function g(e){var t=this,i=t[w];i.driver.pause(),i.updater.stop(),t.webkitDisplayingFullscreen&&t[x](),i.paused&&!e||(i.paused=!0,i.hasAudio||l(t,"pause"),t.ended&&(t[C]=!0,l(t,"ended")))}function f(e,t){var i=e[w]={};i.paused=!0,i.hasAudio=t,i.video=e,i.updater=new s(d.bind(i)),t?i.driver=c(e):(e.addEventListener("canplay",function(){e.paused||l(e,"playing")}),i.driver={src:e.src||e.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,h(i)&&u(e,0)},get ended(){return h(i)}}),e.addEventListener("emptied",function(){var t=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==e.src&&(u(e,0,!0),i.driver.src=e.src,t?i.driver.play():i.updater.stop())},!1),e.addEventListener("webkitbeginfullscreen",function(){e.paused?t&&!i.driver.buffered.length&&i.driver.load():(e.pause(),e[k]())}),t&&(e.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=e.currentTime}),e.addEventListener("seeking",function(){S.indexOf(100*e.currentTime|0)<0&&(i.driver.currentTime=e.currentTime)}))}function _(e){var t=e[w];e[k]=e.play,e[x]=e.pause,e.play=p,e.pause=g,r(e,"paused",t.driver),r(e,"muted",t.driver,!0),r(e,"playbackRate",t.driver,!0),r(e,"ended",t.driver),r(e,"loop",t.driver,!0),o(e,"seeking"),o(e,"seeked"),o(e,"timeupdate",C,!1),o(e,"ended",C,!1)}function m(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!0),i&&!y||e[w]||(f(e,t),_(e),e.classList.add("IIV"),!t&&e.autoplay&&e.play(),"MacIntel"!==navigator.platform&&"Windows"!==navigator.platform||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var v,b=n(i(3)),y=/iPhone|iPod/i.test(navigator.userAgent)&&void 0===document.head.style.grid,w=b(),C=b(),k=b("nativeplay"),x=b("nativepause"),S=[],T=0;m.isWhitelisted=y,e.exports=m},function(e,t){"use strict";var i="undefined"==typeof Symbol?function(e){return"@"+(e||"@")+Math.random()}:Symbol;e.exports=i},function(e,t,i){var n,s=0,o=i(5);"string"==typeof o&&(o=[[e.id,o,""]]),t.use=t.ref=function(){return s++||(t.locals=o.locals,n=i(7)(o,{})),t},t.unuse=t.unref=function(){--s||(n(),n=null)}},function(e,t,i){t=e.exports=i(6)(),t.push([e.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(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t=0&&b.splice(t,1)}function a(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function l(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function c(e,t){var i,n,s;if(t.singleton){var o=v++;i=m||(m=a(t)),n=u.bind(null,i,o,!1),s=u.bind(null,i,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=l(t),n=d.bind(null,i),s=function(){r(i),i.href&&URL.revokeObjectURL(i.href)}):(i=a(t),n=h.bind(null,i),s=function(){r(i)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else s()}}function u(e,t,i,n){var s=i?"":n.css;if(e.styleSheet)e.styleSheet.cssText=y(t,s);else{var o=document.createTextNode(s),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o)}}function h(e,t){var i=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}function d(e,t){var i=t.css,n=t.sourceMap;n&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var s=new Blob([i],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(s),o&&URL.revokeObjectURL(o)}var p={},g=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},f=g(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),_=g(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,v=0,b=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=f()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=s(e);return n(i,t),function(e){for(var o=[],r=0;r
'+__e(artist)+'
'+__e(noId3)+'
',albumArt&&(__p+='
'+__e(track)+'
');return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(3),s=i(235).animate,o=i(219),r=i(241),a=i(276),l=i(277),c=i(230),u=o.extend({className:"post-forms-glass",mixins:[a,l,c],initialize:function(e){this.options=e=n.extend({active:!1,visible:!1},e),this.set({active:!!e.active,visible:!!e.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(e){return this.set("active",!(null!=e&&!e)),this.attributes.visible&&this._showing?this._showing:(this.attributes.visible=!0,this._show())},hide:function(e){return this.set("active",!(null==e&&!e)),!this.attributes.visible&&this._hiding?this._hiding:(this.attributes.visible=!1,this._hide())},_show:function(){var e=this._showing=s(this.$el,{opacity:1},{duration:r(150),display:"block"});return e},_hide:function(){var e=this._hiding=s(this.$el,{opacity:0},{duration:r(150),display:this.get("active")?"block":"none"});return e},_changeActive:function(e,t){t?this.$el.addClass(this.className+"_active active"):(this.$el.removeClass(this.className+"_active active"),!this._changing||n.has(this.changed,"visible")||this.get("visible")||this.$el.css("display","none"))},_changeVisible:function(e,t){t?(this.$el.addClass(this.className+"_visible visible"),this._show()):(this.$el.removeClass(this.className+"_visible visible"),this._hide())},render:function(){return this}});e.exports=u},function(e,t,i){"use strict";var n=i(8),s=i(235).animate,o=i(219),r=i(241),a=i(276),l=i(277),c=i(230),u=i(620),h=o.extend({className:"post-forms-modal",mixins:[a,l,c],template:u,initialize:function(e){this.set("visible",e&&e.visible),this.get("visible")?this.$el.css({opacity:1,display:"block"}):this.$el.css({opacity:0,display:"none"}),this.$body=n("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(e){return this.subViews.content&&(this.stopListening(this.subViews.content),this.subViews.content.remove()),this.subViews.content=e,this.listenTo(e,"prepared",this._onSubViewPrepare),this.listenTo(e,"torndown",this._onSubViewTeardown),this.isRendered()&&this.attachSubView("content"),this},_onSubViewPrepare:function(e){this.show()},_onSubViewTeardown:function(e){this.hide()},_show:function(){this._disableBodyScroll(),this.$el.css("display","block");var e=s(this.$el,{opacity:1},{duration:r(100),display:"block"});return e},_hide:function(){this._enableBodyScroll();var e=s(this.$el,{opacity:0},{duration:r(100),display:"none"});return e},_toggleVisible:function(e,t){t?(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}});e.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="";with(obj)__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(235).animate,r=i(238),a=i(241),l=i(240),c=i(219),u=(i(132),i(276)),h=i(277),d=i(230),p=i(622),g=i(623),f=i(625),_=c.extend({mixins:[u,h,d,l],template:f,defaultOptions:{animateDuringPrepare:!0,animateHeightWithContent:!1,startHeight:null,useLoader:!0,loaderDelay:250,transitionBackground:!1},defaults:{minHeight:!1,pretransition:!1,midtransition:!1},initialize:function(e){e instanceof c&&(e={postForm:e}),this.options=e=n.extend({},this.defaultOptions,e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),e.postForm&&this.setPostForm(e.postForm),this.listenTo(this,"change:minHeight",this._onChangeMinHeight),this.listenTo(this,"change:pretransition",this._onChangePretransition),this.listenTo(this,"change:midtransition",this._onChangeMidtransition)},_onChangeMinHeight:function(e,t){o(this.$el,"stop"),t||n.isNumber(t)?o(this.$el,{"min-height":t},{duration:a(Math.min(Math.max(250,t),750))}):(t=n.parseInt(this.$el.css("min-height"),10)||0,o(this.$el,{"min-height":[0,t]},{duration:a(Math.min(Math.max(250,t),750))}).then(n.bind(function(){this.$el.css("min-height","")},this)))},_onChangePretransition:function(e,t){t?this.$el.addClass("post-form-container-pretransition"):this.$el.removeClass("post-form-container-pretransition")},_onChangeMidtransition:function(e,t){t?this.$el.addClass("post-form-container-transition"):this.$el.removeClass("post-form-container-transition")},setPostFormComponent:function(e){if(this._postFormComponent!==e)return this._postFormComponent&&this.stopListening(this._postFormComponent),this._postFormComponent=e,this.postForm=e.postForm,this},prepare:function(e){return this.isRendered()||this.render(),this.trigger("prepared",this),this.loadingDelay=n.delay(n.bind(function(){this.loader&&this.options.useLoader&&this.loader.set("loading",!0)},this),this.options.loadingDelay),this.options.animateDuringPrepare&&(this._hideOriginalContent=this.hideOriginalContent(e).then(n.bind(function(){return this._hideOriginalContent=!1,this},this))),s.resolve(this)},attach:function(e){return this.loader&&(clearTimeout(this.loadingDelay),this.loader.set("loading",!1)),this.set("pretransition",!0),this.postForm.forceHidden(),this.attachSubView(this.postForm,"postForm"),s.resolve(this)},hideOriginalContent:function(e){var t=this.options.startHeight||this.originalContent.measureHeight(),i=this.postForm.measureHeight();return t||this.options.originalContent||(t=i),r([function(){null!=t&&this.$el.css("height",t),this.set("midtransition",!0),this.originalContent.set("enabled",!1)},function(){return s.join(e(),this.originalContent.animateHide(a(100)))}],this)},showPostForm:function(e){var t=this.options.startHeight||this.originalContent.measureHeight(),i=this.postForm.measureHeight();return t||this.options.originalContent||(t=i),r([function(){if(!this.options.animateHeightWithContent&&!this.originalContent.get("hidden"))return this._hideOriginalContent||this.hideOriginalContent(e)},function(){var n=[];return this.options.animateHeightWithContent&&!this.originalContent.get("hidden")&&n.push(this._hideOriginalContent||this.hideOriginalContent(e)),null==i||null==t||(i===t?this.$el.height(i):n.push(o(this.$el,{height:[i,t]},{duration:a(150),easing:[.4,1.3,.7,1]}))),s.all(n)},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(e){var t=this.postForm.measureHeight(),i=this.originalContent.measureHeight();return i||this.options.originalContent||(i=t),r([function(){this.$el.css("height",t),this.set("midtransition",!0)},function(){return this.postForm.animateHide(a(100))},function(){if(this.set("pretransition",!0),null==i||null==t);else{if(i!==t)return o(this.$el,{height:[i,t]},{duration:a(100),easing:[0,0,.6,1]});this.$el.height(i)}},function(){return s.join(e(),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()}});e.exports=_},function(e,t,i){"use strict";var n=i(3),s=i(235).animate,o=i(219),r=i(276),a=i(230),l=o.extend({defaults:{hidden:!1,enabled:!0},mixins:[r,a],initialize:function(e){this.set("hasContent",e&&e.el),this.originalCSS=this._getCSS(["opacity"]),this.listenTo(this,"change:enabled",this._onChangeEnabled),this.listenTo(this,"change:hidden",this._onChangeHidden)},_getCSS:function(e){var t={};return n.forEach(e,function(e){t[e]=this.$el.css(e)},this),t},_onChangeEnabled:function(e,t){this.$el.toggleClass("no-pointer-events",!t)},_onChangeHidden:function(e,t){this.$el.toggleClass("collapse",t)},measureHeight:function(){if(!this.get("hasContent"))return null;var e=this.get("hidden");this.set("hidden",!1);var t=this.$el.outerHeight();return this.set("hidden",e),t},animateShow:function(e,t){return e||(e=0),t||(t=0),s(this.$el,{opacity:1},{duration:e,delay:t,begin:n.bind(function(){this.set("hidden",!1)},this)})},animateHide:function(e,t){return e||(e=0),t||(t=0),s(this.$el,{opacity:0},{duration:e,delay:t}).then(n.bind(function(){this.set("hidden",!0)},this))},render:function(){return this},teardown:function(){return this.$el.css(this.originalCSS),this}});e.exports=l},function(e,t,i){"use strict";var n=i(219),s=i(276),o=i(277),r=i(230),a=i(624),l=n.extend({className:"post-forms-loader",mixins:[s,o,r],template:a,initialize:function(e){this.listenTo(this,"change:loading",this._onChangeLoading),this.set("loading",e&&e.loading)},_onChangeLoading:function(e,t){this.isRendered()&&(t?(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}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__j=Array.prototype.join;with(obj)__p+='
'),__p+=" ",originalContent&&(__p+='
'),__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(235).animate,r=i(622),a=i(277),l=i(230),c=i(136),u=i(246),h=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(e){this.postType=e},animateShow:function(e,t){return e||(e=0),t||(t=0),this.$el.css({display:"block",opacity:1}),function(i){var n=this.js$(i),r=n.children("i"),a=n.children(".new_post_label_text"),l=this.$(".new_post_label").not(n),c=l.children("i"),u=l.children(".new_post_label_text"),h=[o(c,{scale:1,translateY:[0,10],opacity:1},{duration:e,delay:t}),o(u,{translateY:[0,10],opacity:1},{duration:e,delay:t})];return n.length&&r.length&&h.push(o(r,{scale:[1,1.5],translateY:[0,0],opacity:1},{duration:e,delay:t}),o(a,{translateY:[0,0],opacity:1},{duration:e,delay:t})),s.all(h)}.call(this,this.postType)},animateHide:function(e,t){e||(e=0),t||(t=0),function(i){var n=this.js$(i),r=n.children("i"),a=n.children(".new_post_label_text"),l=this.$(".new_post_label").not(n),c=l.children("i"),u=l.children(".new_post_label_text"),h=[o(c,{scale:[1,1],translateY:[10,0],opacity:0},{duration:e,delay:t}),o(u,{translateY:[10,0],opacity:0},{duration:e,delay:t})];return n.length&&r.length&&h.push(o(r,{scale:[1.5,1],translateY:[0,0],opacity:0},{duration:e,delay:.5*e+t}),o(a,{translateY:[0,0],opacity:0},{duration:e,delay:t})),s.all(h)}.call(this,this.postType).then(n.bind(function(){this.$el.css({display:"none",opacity:0})},this))},_onClickNewPost:function(e){if(e.stopPropagation(),e.preventDefault(),this.get("enabled")){var t=e.currentTarget.getAttribute("data-post-endpoint")||e.currentTarget.getAttribute("data-post-type");c.trigger("postForms:open",{postType:t,postFormType:u.inline})}}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
',_.forEach(icons,function(e,t){__p+='
'+__e(e.label)+"
"}),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(226),s=i(129),o=i(3),r=i(8),a=n.extend({events:{mouseleave:"onMouseLeave",mouseenter:"onMouseEnter"},defaults:{totalImages:1,changeOnHover:!0,image:!1,shouldAnimate:!1},initialize:function(e){this.assetsHost=s.get("Context/hosts/assets_host"),this.isRetina=window.devicePixelRatio&&window.devicePixelRatio>1,this.$imageContainer=this.$(".preload-container"),this.animations=o.get(e,"data.animations",[]);var t=Array.isArray(this.animations)&&this.animations.length>0;this.set("shouldAnimate",t),t&&(this.set("totalImages",this.animations.length),this.generateImageIds(),this.get("image")||(this.applyRandomImage(),this.addImageToContainer()),this.setBackgroundImage(this.get("image")),this.listenTo(this,"change:image",function(e,t){this.addImageToContainer(),this.setBackgroundImage(t)}))},generateImageIds:function(){ this.imageIds=o.shuffle(o.range(1,this.get("totalImages")+1))},onMouseEnter:function(e){var t=this;if(this.get("shouldAnimate")){var i=this.getCurrentImageObject();i.get(0)&&i.get(0).complete?this.$el.addClass("opacity-switch"):i.on("load",function(){t.$el.is(":hover")&&t.get("image")===i.data("imgId")&&t.onMouseEnter()})}},onMouseLeave:function(e){var t=this;this.get("shouldAnimate")&&(this.$el.removeClass("opacity-switch"),this.get("changeOnHover")&&setTimeout(function(){t.applyRandomImage()},200))},addImageToContainer:function(){if(!this.getCurrentImageObject().get(0)){var e=this.get("image");if(e>this.animations.length)return;var t=this.animations[e-1],i=this.isRetina?1:0;if(!Array.isArray(t)||i>t.length)return;var n=t[i];n&&r('Tumblr').attr("src",n).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(e){this.$imageContainer.css("background-image","url("+this.getCurrentImageObject().attr("src")+")")}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(136),r=i(182),a=i(630),l=s.extend({events:{click:"openPopover"},updateBadge:function(e){e>0&&this.$(".tab_notice_value").text(e>99?"99+":e),this.$(".tab_notice").toggleClass("tab-notice--active",e>0)},initialize:function(){this.popover=null,this.user=r(),this.updateBadge(this.user.getUnreadCount()),this.popoverOptions={container:this.$el,viewOptions:{}}},openPopover:function(e){if(e.preventDefault(),this.popover)this.popover.show();else{var t=this.$el.closest(".l-header-container");t.length&&(this.popoverOptions.viewOptions.isFixedPosition="fixed"===t.css("position")),a(n.bind(function(e){this.popover=new e(this.popoverOptions).render()},this))}var i={loggingData:{source:"app-header"}};o.trigger("Kraken:AccountClick",i)}});e.exports=l},function(e,t,i){"use strict";var n=i(248),s=i(631),o=new s("account-popover"),r=function(e){o.start(),i.e(2,function(t){try{e(i(632))}catch(e){n(e,"account-popover")}finally{o.end()}})};e.exports=r},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;i0&&this.$(".tab_notice_value").text(e>99?"99+":e),this.$(".tab_notice").toggleClass("tab-notice--active",e>0)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(180),r=i(214),a=i(136),l=i(182),c=i(212),u=i(213),h=i(191),d=i(641),p=i(642),g=i(643),f=i(646),_=i(647),m=i(650),v=i(657),b=i(464),y=i(673),w=i(674),C=i(679),k=i(680),x=i(713),S=i(769),T=i(670),E=i(658),P=i(770),I=i(771),F=i(705),A=i(495),M=new f,N={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",INBOX_OPEN:"messaging:inbox:open"},R=r.extend({name:"Messaging",defaults:{resetPollingTypingDebounceRate:3e4},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"inboxAnchorEl","inboxPopoverOptions")),this.eventBus=M,this.user=l(),this.channels=this._getChannelsEnabledForMessagingAsCollection(),this.activeWindow=new d,this.inboxCollection=new P,this.currentBlogModel=new S({channel:this._getInitiallySelectedChannel()}),this.favoritesCollection=new F,this.emptyInboxCollection=new F,this.unreadManager=new _({channels:this.channels}),this.inboxBadge=new C({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 A,this.windowManager=new m({eventBus:this.eventBus,user:this.user,channels:this.channels,currentBlogModel:this.currentBlogModel,keyboardManager:this.keyboardManager,persistenceManager:this.windowPersistenceManager,inboxConfig:{constructor:k,options:{favoritesCollection:this.favoritesCollection,emptyInboxCollection:this.emptyInboxCollection,appendFavoritesToInboxLimit:this.getAppendFavoritesToInboxLimit(),isAutoFetch:!1,isNewEmptyInboxEnabled:this.isNewEmptyInboxEnabled()},popoverOptions:n.extend({autoTeardown:!0,pinnedSide:"bottom",isFixedPosition:!0,pinnedTarget:this.inboxAnchorEl},this.inboxPopoverOptions)},conversationConfig:{constructor:x,options:{isAutoFetch:!1,collection:this.searchImageQueries,imageUploadMaxBytes:this.getImageUploadMaxBytes(),canModifySafeMode:this.getCanModifySafeMode(),isSafeModeEnabled:o.bool("safe_mode")&&this.user.get("safe_mode"),isProjectXEnabled:!0}}}),this._onConversationMessageInputThrottled=n.throttle(this._onConversationMessageInput,this.get("resetPollingTypingDebounceRate"),{leading:!0,trailing:!1}),this.listenTo(a,N.CONVERSATION_OPEN_TUMBLELOGS,this._onEventBusOpenConversationUsingTumblelogModels),this.listenTo(a,N.CONVERSATION_OPEN_MODEL,this._onEventBusOpenConversationUsingModel),this.listenTo(a,N.CONVERSATION_OPEN_ID,this._onEventBusOpenConversationUsingIdAndParticipant),this.listenTo(a,N.CONVERSATION_OPEN_NAME,this._onEventBusOpenConversationUsingBlogName),this.listenTo(a,N.INBOX_OPEN,this._onEventBusOpenInboxFromRoute),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(this.eventBus,this.eventBus.NEW_EMPTY_INBOX_SUGGESTION_CLICK,this._onEmptyInboxSuggestionClick),this.listenTo(this.eventBus,this.eventBus.OLD_EMPTY_INBOX_SUGGESTION_CLICK,this._onEmptyInboxSuggestionClick),this.listenTo(this.eventBus,this.eventBus.NEW_EMPTY_INBOX_NEW_MESSAGE_CLICK,this._onEmptyInboxNewMessageClick),this.listenTo(this.eventBus,this.eventBus.OLD_EMPTY_INBOX_NEW_MESSAGE_CLICK,this._onEmptyInboxNewMessageClick),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",n.debounce(n.bind(this._onChannelsUnreadMessageCountChange,this),0)),this.messagingPoller=new g({channels:this.channels,user:this.user,callback:n.bind(this._onPollUpdate,this),frequency:this.getPollingFrequencyInbox()}),this._onWindowManagerChange(this.windowManager)},render:function(){return this.inboxAnchorEl&&this.inboxAnchorEl.on("click.messaging",n.bind(this._onClickInboxAnchor,this)),this.windowManager.loadConversationsState(),this},openInboxPopover:function(){this.inboxPopover||(this.inboxPopover=this.windowManager.addInbox(this.inboxCollection))},openConversationPopover:function e(t,i){var e;return n.isEmpty(t.get("participantUuid"))&&t.set("participantUuid",this.getCurrentBlogId()),e=this.windowManager.getConversationPopover(t),this.windowManager.removeInbox(this.inboxCollection),e?void e.refresh(t):void this.windowManager.addConversation(t,{context:i})},fetchInbox:function(){var e=this.getCurrentBlogId();if(this._pendingInboxRequest&&this._pendingInboxBlog){if(e===this._pendingInboxBlog)return;this._pendingInboxRequest.abort()}this._pendingInboxBlog=e,this._pendingInboxRequest=this.inboxCollection.fetchInbox(e).always(n.bind(function(){this._pendingInboxRequest=null,this._pendingInboxBlog=null},this)).done(n.bind(function(){this.messagingLogger.logInboxOpened(this.inboxCollection.size())},this))},getCurrentChannel:function(){return this.currentBlogModel.getChannel()},getCurrentBlogId:function(){return this.currentBlogModel.getId()},getPollingFrequencyInbox:function(){return n.get(this.data,"polling_frequency_inbox")},getCanModifySafeMode:function(){return n.get(this.data,"can_modify_safe_mode")},getPollingFrequencyConversation:function(){return n.get(this.data,"polling_frequency_conversation")},getAppendFavoritesToInboxLimit:function(){return n.get(this.data,"append_favorites_to_inbox_limit")},isDesktopNotificationEnabled:function(){return n.get(this.data,"is_desktop_notifications_enabled",!1)},isNewEmptyInboxEnabled:function(){return n.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 n.get(this.data,"messaging_notification_icon","")},getImageUploadMaxBytes:function(){return n.get(this.data,"image_upload_max_bytes",10485760)},_onWindowManagerInboxAdded:function(e,t){this.fetchInbox()},_onWindowManagerInboxRemoved:function(e,t){delete this.inboxPopover,this.messagingLogger.logInboxClosed()},_onWindowManagerConversationAdded:function(e,t,i){var s=n.get(i,"isFromPersistence",!1);t.isMinimized()||(t.fetch().always(n.bind(function(){s||this.messagingLogger.logConversationOpened(e,n.get(i,"context"))},this)),t.focus())},_onWindowManagerConversationRemoved:function(e,t,i){this.messagingLogger.logConversationClosed(e,n.get(i,"context"))},_onWindowManagerConversationsLoaded:function(e,t){0===e.length&&0===t.length||this.messagingLogger.logConversationWindowsLoaded(e,t)},_onWindowManagerConversationMinimized:function(e,t){this.messagingLogger.logConversationMinimized(e)},_onWindowManagerConversationUnminimized:function(e,t){this.messagingLogger.logConversationUnminimized(e)},_getChannelsEnabledForMessagingAsCollection:function(){return new I(n.invoke(this.user.getChannelsEnabledForMessaging(),"toJSON"))},_getInitiallySelectedChannel:function(){return this.channels.get(this.user.getCurrentMessagingChannelUuid())||n.first(this.channels.models)},_onClickInboxAnchor:function(e){e.preventDefault(),this.openInboxPopover()},_onEventBusOpenConversationUsingIdAndParticipant:function(e,t,i){this._openConversationUsingIdAndParticipant(e,t,i)},_onEventBusOpenConversationUsingTumblelogModels:function(e,t){this._openConversationUsingTumblelogModels(e,t)},_onEventBusOpenConversationUsingModel:function(e,t){this.openConversationPopover(e,t)},_onEventBusOpenConversationUsingBlogName:function(e,t){this._openConversationFromBlogName(e,t)},_onEventBusOpenInboxFromRoute:function(){this.openInboxPopover()},_onOpenConversationUsingConversationModel:function(e,t){this.openConversationPopover(e,t)},_openConversationUsingIdAndParticipant:function(e,t,i){var s=new E({id:e,participantUuid:t});s.fetchConversation().then(n.bind(function(){this.openConversationPopover(s,i)},this))},_openConversationUsingTumblelogModels:function(e,t){var i=n.map(e,function(e){return new T(e.toJSON(),{parse:!0})});this._onOpenConversationUsingParticipantModels(i,t)},_onOpenConversationUsingParticipantModels:function(e,t){var i=new T(this.getCurrentChannel().toJSON()),s=n.find(e,function(e){return e.get("name")===i.get("name")});if(n.isEmpty(s)){var o=new E({participants:[i].concat(e),participantUuid:this.getCurrentBlogId()});this.openConversationPopover(o,t)}},_onPollUpdate:function(e){e=n.get(e,"unread_messages"),n.get(e,"error")!==!0&&this.unreadManager.setData(e)},_onConversationClickBlog:function(e){var t=n.get(e,"url"),i=n.get(e,"blogName"),s=n.get(e,"postId"),o=n.get(e,"searchTagTerm"),r=n.get(e,"originalEvent"),l=n.get(e,"otherParticipant"),c=!!l&&l.get("seconds_since_last_activity")!==-1;r&&r.preventDefault(),a.trigger("peepr-open-request",{url:t,tumblelog_name:i,post_id:s,searchTagTerm:o}),this.messagingLogger.logPeeprOpen(t,i,s,o,c)},_onConversationClickMessagingBlog:function(e){var t=n.get(e,"blogName"),i=n.get(e,"originalEvent");i&&i.preventDefault(),this._openConversationFromBlogName(t,"conversation-permalink"),this.messagingLogger.logMessagingPermalinkOpen(t)},_onDesktopNotificationDisplayed:function(e){this.messagingLogger.logNotification(e)},_onDesktopNotificationPermissionChange:function(e){e?this.messagingLogger.logNotificationPermissionGranted():this.messagingLogger.logNotificationPermissionDenied()},_onConversationMarkAsSpam:function(e,t){var i;e&&t&&(i=s("%1$s will be blocked and reported. And any trace of this conversation will disappear from your inbox.",t.get("name")),u.confirm(i,n.bind(function(){this.messagingLogger.logConversationSpamIntent(e),this._removeConversation(e),e.markAsSpam().then(n.bind(function(){this.messagingLogger.logConversationSpamSuccess(e)},this)).fail(n.bind(function(){this.messagingLogger.logConversationSpamFail(e)},this))},this),null,s("Mark it spam"),s("Nevermind")))},_onConversationImagePreviewAdd:function(e,t){this.messagingLogger.logImagePreviewAdd(e,t)},_onConversationImagePreviewDismiss:function(e,t){this.messagingLogger.logImagePreviewDismiss(e,t)},_onConversationImagePreviewEdit:function(e,t){this.messagingLogger.logImagePreviewEdit(e,t)},_onConversationImageLightbox:function(e){var t=n.get(e,"lightBoxImageData"),i=n.get(e,"lightBoxIndex",0);a.trigger("lightbox-open-request",t,i)},_onConversationComposePluginClick:function(e,t){this.messagingLogger.logComposePluginClick(e,t)},_onBlock:function(e,t){n.isEmpty(e)||c.confirmBlock(e).then(n.bind(function(){c.block(e).then(n.bind(function(){this._onBlockSuccess(e,t)},this))},this))},_onBlockSuccess:function(e,t){n.isEmpty(e)||(t&&this._removeConversation(t),a.trigger("blocks:block_added",{loggingData:{from:"messaging"}}),this.messagingLogger.logBlock(e))},_removeConversation:function(e){this.windowManager.removeConversation(e),this.inboxCollection.remove(e)},_copyCollectionData:function(e,t){t.reset(e.models),t.setNextLink(e.getNextLink())},_onCurrentBlogModelChange:function(){var e=this.currentBlogModel.getPrevChannel(),t=this.currentBlogModel.getChannel();e&&this._copyCollectionData(this.inboxCollection,e.get("conversations")),t&&(this._copyCollectionData(t.get("conversations"),this.inboxCollection),this.user.setCurrentMessagingChannelUuid(t.get("uuid"))),this.fetchInbox()},_onConversationDelete:function(e){u.confirm(s("Permanently delete this conversation?"),n.bind(function(){this.messagingLogger.logConversationDeleted(e),e.destroy(),this.windowManager.removeConversation(e),this.inboxCollection.remove(e.get("id"))},this),null,s("Delete"),s("Nevermind"))},_onConversationFetching:function(e){this.unreadManager.setConversationModelCount(e,0)},_onUnreadManagerChannelChange:function(e,t){var i=this.getCurrentChannel(),s=n.sum(t);this.windowManager.isInboxOpen()&&i===e&&this.fetchInbox(),e.set("unread_messages_count_sum",s)},_onUnreadManagerConversationChange:function(e,t,i){this._generateBrowserNotification(e,t,i),this._setConversationUnreadCount(e,t,i)},_onChannelsUnreadMessageCountChange:function(e,t){var i=e.previous("unread_messages_count_sum");t>i&&this._playSoundName("notification-sound")},_playConversationSounds:function(){this._playSoundName("receive-sound")},_playSoundName:function(e){this.user.isSoundsEnabled()&&this.notificationSoundManager.playSoundName(e)},_setConversationUnreadCount:function(e,t,i){var n=this.windowManager.getConversationModelByIdAndParticipant(e,i.get("uuid"));n&&n.set("unreadCount",t)},_generateBrowserNotification:function(e,t,i){var n,s=!1;t<=0||(this.activeWindow.isActive&&this.windowManager.get("isConversationOpen")?(n=this.windowManager.getConversationModelByIdAndParticipant(e,i.get("uuid")),n&&this.windowManager.isConversationMinimized(n)&&(s=!0)):s=!0,s&&this.messagingNotifier.notifyOnUnread(e,i))},_showErrorMessage:function(e){u.alert(e)},_onWindowManagerChange:function(e){var t,i,n=e.isInboxOpen(),s=e.isConversationOpen(),o=n||s;return this.user.isVerifiedEmail()&&o?(s?(t=this.getPollingFrequencyConversation(),i=this.getBackoffRatesConversation()):(t=this.getPollingFrequencyInbox(),i=this.getBackoffRatesInbox()),this.messagingPoller.setFrequency(t),this.messagingPoller.setBackoffRates(i),void this.messagingPoller.start()):void this.messagingPoller.stop()},_onConversationMessagesSendRequested:function(){this._playSoundName("send-sound")},_onConversationMessageSent:function(e,t){this.messagingLogger.logMessageSent(e,t)},_onConversationMessageFailed:function(e,t){this.messagingLogger.logMessageFailed(e,t)},_onConversationMessageInput:function(e,t){this.messagingPoller.resetPollingFrequency(),this.messagingPoller.poll()},_openConversationFromBlogName:function(e,t){var i=new h({name:e});return i.fetch_popover_data().then(n.bind(function(){return n.isEmpty(i.get("uuid"))?void this._showErrorMessage(s("Could not load conversation.")):i.get("can_receive_messages")?void this._openConversationUsingTumblelogModels([i],t):void this._showErrorMessage(s("This Tumblr can't receive messages."))},this))},_onEventBusLogout:function(){this.windowPersistenceManager.clear()},_onEmptyInboxNewMessageClick:function(e){this.messagingLogger.logInboxEmptyNewMessageClick(this.currentBlogModel.getChannel().get("name"),e)},_onEmptyInboxSuggestionClick:function(e,t,i){this.messagingLogger.logEmptySuggestionClick(this.currentBlogModel.getChannel().get("name"),e.get("name"),t,i)}});e.exports=R},function(e,t,i){"use strict";var n=i(3),s=function(){window.onfocus=n.bind(this.onFocus,this),window.onblur=n.bind(this.onBlur,this)};s.prototype.onFocus=function(e){this.isActive=!0},s.prototype.onBlur=function(e){this.isActive=!1},s.prototype.isActive=!0;var o,r=function(){return null==o&&(o=new s),o};e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(180),o=i(214),r=i(136),a=o.extend({name:"MessagingLogger",defaults:{isDebugEnabled:!1,platform:"web"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},logInboxOpened:function(e){var t={conversationCount:e,status_indicator_enabled:s.bool("status_indicator")};this._logIt("inbox:open",t)},logInboxClosed:function(){this._logIt("inbox:closed")},logConversationOpened:function(e,t){this._logIt("conversation:open",{conversationId:e.get("id"),context:t,status_indicator_enabled:s.bool("status_indicator"),status_indicator:e.getOtherParticipant().get("seconds_since_last_activity")!==-1?"greendot":"none"})},logConversationClosed:function(e,t){this._logIt("conversation:closed",{conversationId:e.get("id"),context:t})},logConversationDeleted:function(e){this._logIt("conversation:deleted",{conversationId:e.get("id")})},logConversationStarted:function(e,t){this._logIt("conversation:started",{context:t})},logMessageSent:function(e,t){!n.isEmpty(t)&&t.isNew()&&this.logConversationStarted(t),this._logIt("message:sent",this._getMessageLoggingData(e,t))},logMessageFailed:function(e,t){this._logIt("message:failure",this._getMessageLoggingData(e,t))},logFollow:function(e){this._logIt("conversation:follow",{blogName:e})},logBlock:function(e){this._logIt("block",{blockingBlog:e.currentTumblelog,blockedBlog:e.blockedTumblelog})},logNotification:function(e){this._logIt("notification:display",{conversationId:e})},logNotificationPermissionGranted:function(){this._logIt("notification:permission:granted")},logNotificationPermissionDenied:function(){this._logIt("notification:permission:denied")},logConversationWindowsLoaded:function(e,t){this._logIt("conversation:windows:loaded",{numOpen:e.length,numMinimized:t.length})},logConversationMinimized:function(e){this._logIt("conversation:minimized",{conversationId:e.get("id")})},logConversationUnminimized:function(e){this._logIt("conversation:unminimized",{conversationId:e.get("id")})},logConversationSpamIntent:function(e){this._logIt("conversation:spam:intent",{conversationId:e.get("id")})},logConversationSpamSuccess:function(e){this._logIt("conversation:spam:success",{conversationId:e.get("id")})},logConversationSpamFail:function(e){this._logIt("conversation:spam:fail",{conversationId:e.get("id")})},logImagePreviewAdd:function(e,t){this._logImagePreviewAction("add",e,t)},logImagePreviewDismiss:function(e,t){this._logImagePreviewAction("dismiss",e,t)},logImagePreviewEdit:function(e,t){this._logImagePreviewAction("edit",e,t)},logComposePluginClick:function(e,t){var i,s=t.getName();n.isEmpty(s)||(i=s+":intent",this._logIt(i,{conversationId:e.get("id")}))},logPeeprOpen:function(e,t,i,o,r){var a={url:e,blogName:t,status_indicator_enabled:s.bool("status_indicator"),status_indicator:r?"greendot":"none"};n.isEmpty(i)||n.extend(a,{postId:i}),n.isEmpty(o)||n.extend(a,{searchTagTerm:o}),this._logIt("peepr:open",a),this._logIt("Kraken:peepr:open",a)},logMessagingPermalinkOpen:function(e){var t={blogName:e};this._logIt("conversation-permalink:open",t)},logInboxEmptyNewMessageClick:function(e,t){var i={blogName:e},n=t?"new:inbox:empty:new-message:button:click":"old:inbox:empty:new-message:button:click";this._logIt(n,i)},logEmptySuggestionClick:function(e,t,i,n){var s={sendingBlog:e,receivingBlog:t,context:i},o=n?"new:inbox:empty:suggestion":"old:inbox:empty:suggestion";this._logIt(o,s)},_logImagePreviewAction:function(e,t,i){var s,o,r,a=i.get("context");n.isEmpty(a)||(s=i.get("loggingData"),o=a+":"+e,r=n.extend({},s,{conversationId:t.get("id")}),this._logIt(o,r))},_getMessageLoggingData:function(e,t){var i,s,o,r,a,l,c,u,h;return n.isEmpty(e)?null:(l=e.isPost(),i=l?0:(e.getMessage()||"").length,s=e.get("type"),o=e.get("context"),a=e.get("loggingData"),h=e.get("creationUserAction"),r=n.extend({},a,{conversationId:t?t.get("id"):null,messageLength:i,messageType:s}),n.isEmpty(h)||n.extend(r,{creationUserAction:h}),l&&(c=e.get("post").toJSON(),u=n.get(c,"blog.uuid")||n.get(c,"blog"),n.extend(r,{postBlogUuid:u,postId:n.get(c,"id")})),n.isEmpty(o)||n.extend(r,{context:o}),r)},_logIt:function(e,t){t=t||{},n.extend(t,{platform:this.get("platform")}),r.trigger("Kraken:Messaging:"+e,{loggingData:t})}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(644),o=i(645),r=s.extend({name:"MessagingPoller",defaults:n.defaults({url:o,frequency:15e3},s.prototype.defaults),initialize:function(e){return e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"channels","user")),this._requestData={unread_messages:!0},s.prototype.initialize.apply(this,arguments)},getRequestData:function(){return this._requestData},hasResponseChanged:function(e){return!n.isEmpty(n.get(e,"unread_messages"))}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(214),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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"callback")),this.currentErrorCount=0,this.currentUnchangedCount=0},start:function(e){this.set("isPolling",!0),e?this.scheduleNextPoll():this.poll()},stop:function(){this.set("isPolling",!1),this.cancel()},cancel:function(){this.cancelCurrent(),this.cancelNext()},cancelCurrent:function(){this._currentRequest&&(n.result(this._currentRequest,"abort"),this._currentRequest=null)},cancelNext:function(){this._nextPollToken&&(clearTimeout(this._nextPollToken),this._nextPollToken=null)},beforeRemove:function(){this.stop()},setFrequency:function(e){this.set("frequency",e),this.resetPollingFrequency()},setBackoffRates:function(e){this.set("backoffRates",e),this.resetPollingFrequency()},resetPollingFrequency:function(){this.currentUnchangedCount=0,this.set("hasPolled",!1)},poll:function(){this.cancel(),this._lastPollTime=(new Date).getTime();var e=this.makeRequest.call(this);return e.done(n.bind(this._onRequestSuccess,this)).fail(n.bind(this._onRequestFail,this)).always(n.bind(this._onRequestAlways,this)),this._currentRequest=e,e},getRequestData:function(){return{}},hasResponseChanged:function(){return!0},resetErrorCount:function(){this.currentErrorCount=0,this.start()},parse:function(e){return e},getBackoffRate:function(){var e,t=this.get("backoffRates");return n.isEmpty(t)||!n.isArray(t)||0===this.currentUnchangedCount?1:(e=Math.min(this.currentUnchangedCount,t.length)-1,Math.max(1,n.get(t,e,1)))},getPollingFrequency:function(){return this.get("frequency")*this.getBackoffRate()},makeRequest:function(){var e=this.getRequestData(),t={url:this.get("url"),type:this.get("requestType"),dataType:this.get("dataType"),cache:this.get("cache"),data:e};return s.ajax(t)},scheduleNextPoll:function(){var e=this.getPollingFrequency();return this.set("hasPolled",!0),!!this.get("isPolling")&&void(!n.isFinite(e)||e<=0||(this.currentErrorCount<=this.get("stopAfterNumErrors")?(this.cancelNext(),this._nextPollToken=setTimeout(n.bind(this.poll,this),e)):this.stop()))},_onRequestSuccess:function(e){this.currentErrorCount=0,e=this.parse(e),this.callback&&this.callback(e,this._lastPollTime),this.hasResponseChanged(e)||!this.get("hasPolled")?this.currentUnchangedCount=0:this.currentUnchangedCount++},_onRequestFail:function(){this.currentErrorCount++},_onRequestAlways:function(){this.scheduleNextPoll()}});e.exports=r},function(e,t){"use strict";var i="/svc/user/counts";e.exports=i},function(e,t,i){"use strict";var n=i(7),s=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",NEW_EMPTY_INBOX_SUGGESTION_CLICK:"new:inbox:suggestion:click",NEW_EMPTY_INBOX_NEW_MESSAGE_CLICK:"new:inbox:new-message:click",OLD_EMPTY_INBOX_SUGGESTION_CLICK:"old:inbox:suggestion:click",OLD_EMPTY_INBOX_NEW_MESSAGE_CLICK:"old:inbox:new-message:click"},r=function(){};r.extend=n.Model.extend,s.extend(r.prototype,n.Events),s.extend(r.prototype,o),e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(214),o=i(648),r=s.extend({name:"MessagingUnreadManager",defaults:{dataChannelKey:"mention_key",overridesExpirationInMs:500},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"channels"));var t=this.channels.map(function(e){return{channelId:e.get("uuid")}});this.unreadCollection=new o(t),this.unreadCollectionOverrides=new o(t),this.listenTo(this.unreadCollection,"change:data",this._onUnreadCollectionChange)},setData:function(e){this._pruneOverrides(),this._updateUnreadCollection(e),this.unreadData=e},setConversationModelCount:function(e,t){var i,n=e.get("id"),s=e.get("participantUuid"),o=this.unreadCollectionOverrides.findWhere({channelId:s});o&&(i=o.get("data")||{},i[n]=t,o.set({data:i,updateDate:new Date}),this._updateUnreadCollection(this.unreadData))},_getOverridesData:function(){var e=this.get("dataChannelKey");return this.unreadCollectionOverrides.reduce(function(t,i){ var s=i.get("data"),o=this.channels.get(i.get("channelId")),r=o.get(e);return n.isEmpty(s)||(t[r]=s),t},{},this)},_pruneOverrides:function(){var e=new Date,t=this.get("overridesExpirationInMs");this.unreadCollectionOverrides.each(function(i){var s=i.get("updateDate");n.isDate(s)&&e-s>t&&i.set({updateDate:null,data:null})})},_updateUnreadCollection:function(e,t){var i=this._getOverridesData();this.unreadCollection.each(function(t){var s=this.channels.get(t.get("channelId")),o=s.get(this.get("dataChannelKey")),r=n.get(e,o),a=n.get(i,o);n.isEmpty(a)||(r=n.merge({},r,a)),t.set("data",r)},this)},_onUnreadCollectionChange:function(e){var t,i=e.get("data")||null,s=e.previous("data")||null,o=this.channels.get(e.get("channelId"));this.trigger("change:channel",o,i),n.each(i,function(e,i){t=n.get(s,i),t!==e&&this.trigger("change:conversation",i,e,o)},this)}});e.exports=r},function(e,t,i){"use strict";var n=i(190),s=i(649),o=n.extend({model:s});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({idAttribute:"channelId",defaults:{channelId:null,data:null}});e.exports=s},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(192),r=i(214),a=i(651),l=i(652),c=i(654),u=i(655),h=i(656),d=r.extend({name:"MessagingWindowManager",defaults:{isInboxOpen:!1,isConversationOpen:!1,inboxAnimationSpeed:100,conversationAnimationSpeed:250,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(e){e=s.extend({},e),s.extend(this.attributes,s.pick(e,s.keys(this.defaults))),s.extend(this,s.pick(e,"eventBus","user","channels","currentBlogModel","keyboardManager","inboxConfig","conversationConfig","persistenceManager")),this.openConversations=new l,this.minimizedConversations=new l,this.onlineStatusModel=new c,this.onlineStatusModel.on("sync",this._setParticipantOnlineStatuses,this),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.persistenceManager&&this.listenTo(this.persistenceManager,"sync",this._onPersistenceManagerSync)},remove:function(e){this.isInboxOpen()&&this.removeInbox(),this.isConversationOpen()&&this.removeConversations(e)},saveConversationsState:function(e,t){this.persistenceManager&&!this.get("isSyncing")&&this.persistenceManager.save(e.pluck("model"),t)},loadConversationsState:function(){var e,t;this.persistenceManager&&(t=this.persistenceManager.load(this.get("persistenceKeyMinimized")),e=this.persistenceManager.load(this.get("persistenceKeyOpen")),t.then(s.bind(function(e){var t=this;this._addLoadedConversationModels(e,this.minimizedConversations,{isMinimized:!0}),e.length&&setTimeout(function(){t._getOnlineStatusOfParticipants(e)},1e3),this.trigger("conversations:loaded:minimized",e)},this)),e.then(s.bind(function(e){this._addLoadedConversationModels(e,this.openConversations),this.trigger("conversations:loaded:open",e)},this)),o.join(e,t).spread(s.bind(function(e,t){this.trigger("conversations:loaded",e,t)},this)))},_addLoadedConversationModels:function(e,t,i){s.each(e,function(e,n){s.delay(s.bind(function(){this._addLoadedConversationModel(e,t,i)},this),n)},this)},_getOnlineStatusOfParticipants:function(e){this.otherParticipants=e.map(function(e){return e.getOtherParticipant()}),this.onlineStatusModel.fetch({data:{participantIds:this.otherParticipants.map(function(e){return e.get("uuid")})}})},_setParticipantOnlineStatuses:function(e){var t=this;e=e.toJSON(),s.forIn(e,function(e,i){var n=s.find(t.otherParticipants,function(e){return e.get("name")===i});n.set("seconds_since_last_activity",e)}),delete this.otherParticipants},_addLoadedConversationModel:function(e,t,i){var n={skipAnimationOnRender:!0},s=this._createConversationPopover(e,n,i),o={isFromPersistence:!0,context:"persistence"};return t.add({model:e,popover:s,options:o},o)},addInbox:function(e,t){var i=this.get("inboxAnimationSpeed");return this.isInboxOpen()?this.inboxPopover:(this.inboxCollection=e,this.inboxPopover=this._createInboxPopover(e),this.trigger("inbox:adding",e,this.inboxPopover,t),i>0?setTimeout(s.bind(function(){this._afterInboxOpened(t)},this),i):this._afterInboxOpened(t),this.listenToOnce(this.inboxPopover,"close",function(){this._onInboxClose(t)}),this.set("isInboxOpen",!0),this.inboxPopover)},removeInbox:function(e){e||(e=this.inboxCollection),e===this.inboxCollection&&this.inboxPopover&&this.inboxPopover.teardown()},isInboxOpen:function(){return this.get("isInboxOpen")},addConversation:function(e,t){var i,n=this.get("isMultipleOpenWindowsEnabled");return n||this.minimizeConversations(!0),i=this._createConversationPopover(e),e.set("lastOpenedDateTs",(new Date).getTime()),this.openConversations.add({model:e,popover:i,options:t}),i},removeConversation:function(e,t){var i=this._getWindowModel(e);this.openConversations.remove(i,{skipAnimation:t})},isConversationMinimized:function(e){var t,i=this.getConversationPopover(e);return!!i&&(t=i.getView(),t&&t.isMinimized())},removeConversations:function(e){this.openConversations.remove(this.openConversations.models,{skipAnimation:e})},isConversationOpen:function(){return this.get("isConversationOpen")},getConversationPopover:function(e){var t=this._getWindowModel(e);return t?t.getPopover():null},getConversationModelByIdAndParticipant:function(e,t){return this.openConversations.getByIdAndParticipant(e,t)||this.minimizedConversations.getByIdAndParticipant(e,t)},minimizeConversations:function(e){var t=s.clone(this.openConversations.models);s.each(t,function(t){t.getView().minimize(e)})},_createConversationPopover:function(e,t,i){var n,o=s.result(this.conversationConfig,"options"),r=s.get(this.conversationConfig,"constructor"),a=s.get(this.conversationConfig,"popoverOptions"),l=s.bind(function(t){return s.extend({},o,{eventBus:this.eventBus,user:this.user,channels:this.channels,model:e,popoverContainer:t.el,keyboardManager:this.keyboardManager},i)},this);return a=s.extend({},a,{viewConstructor:r,viewOptions:l},t),this.conversationsPopoversContainer||this._createConversationsPopoversContainer(),n=new u(a),n.render(),this._removeTimer&&clearTimeout(this._removeTimer),n},_createInboxPopover:function(e){var t,i=s.result(this.inboxConfig,"options"),n=s.get(this.inboxConfig,"constructor"),o=s.result(this.inboxConfig,"popoverOptions"),r=s.bind(function(t){return s.extend({},i,{eventBus:this.eventBus,collection:e,user:this.user,channels:this.channels,currentBlogModel:this.currentBlogModel,keyboardManager:this.keyboardManager,popoverContainer:t.el})},this);return o=s.extend({},o,{viewConstructor:n,animationSpeed:this.get("inboxAnimationSpeed"),viewOptions:r}),t=new a(o),t.render(),t},_removeConversationPopover:function(e,t){var i=this.get("conversationAnimationSpeed");t||i<=0?e.remove():e.teardown(),this._checkRemoveConversationPopoversContainer(t)},_checkRemoveConversationPopoversContainer:function(e){var t=this.get("conversationAnimationSpeed"),i=function(){var e=this.openConversations.length>0,t=this.minimizedConversations.length>0;e||t||this._removeConversationPopoversContainer()};this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),e||t<=0?i.call(this):this._removeTimer=setTimeout(s.bind(function(){i.call(this),this._removeTimer=null},this),t)},_focusNextConversationWindow:function(e){return this._incrementFocusConversationWindow(e,1)},_focusPreviousConversationWindow:function(e){return this._incrementFocusConversationWindow(e,-1)},_incrementFocusConversationWindow:function(e,t){var i,n,o,r,a,l=[];return l.push.apply(l,this.openConversations.models),l.push.apply(l,this.minimizedConversations.models),a=l.length,!(a<2)&&(i=s.indexOf(l,e),n=i+=t,!(n>=a||n<0)&&(o=s.get(l,n),!s.isEmpty(o)&&(r=o.getPopover(),r.focus(),!0)))},_callAfterDelay:function(e,t){t>0?setTimeout(s.bind(e,this),t):e.call(this)},_onConversationAdd:function(e,t,i){var n=s.get(i,"isMoving",!1);n||this._afterConversationWindowModelAdded(e,i)},_onConversationRemove:function(e,t,i){var n=s.get(i,"skipAnimation",!1),o=s.get(i,"isMoving",!1);o||this._afterConversationWindowModelRemoved(e,n)},_onPersistenceManagerSync:function(e,t){this._syncFlushData||(this._syncFlushData={}),s.set(this._syncFlushData,e,t),this._syncFlushTimer||(this._syncFlushTimer=setTimeout(s.bind(function(){this._flushSync(this._syncFlushData),delete this._syncFlushTimer,delete this._syncFlushData},this),50))},_flushSync:function(e){var t=s.get(e,this.get("persistenceKeyOpen"),[]),i=s.get(e,this.get("persistenceKeyMinimized"),[]),n=this.openConversations.pluck("model"),o=this.minimizedConversations.pluck("model"),r=this._getConversationLookupCache(t),a=this._getConversationLookupCache(i),l=this._getConversationLookupCache(n),c=this._getConversationLookupCache(o),u=[],h=[],d=[],p=[];this.set("isSyncing",!0),s.each(l,s.bind(function(e,t){s.has(r,t)||(s.has(a,t)?h.push(e):u.push(e))},this)),d=s.reduce(c,s.bind(function(e,t,i){return!s.has(a,i)&&s.has(r,i)&&e.push(t),e},this),[]),p=s.reduce(r,s.bind(function(e,t,i){return s.has(l,i)||s.has(c,i)||e.push(t),e},this),[]),s.each(h,s.bind(function(e){var t=this.openConversations.getByConversationModel(e);t.getView().minimize(!0)},this)),s.each(d,s.bind(function(e){var t=this.minimizedConversations.getByConversationModel(e);t.getView().unminimize(!0)},this)),s.each(u,s.bind(function(e){this.removeConversation(e,!0)},this)),s.each(p,s.bind(function(e){this.addConversation(e)},this)),this.set("isSyncing",!1)},_getConversationLookupCacheKey:function(e){var t=[e.getParticipantId()].concat(e.getParticipantsIds());return t.join(":")},_getConversationLookupCache:function(e){return s.mapKeys(e,this._getConversationLookupCacheKey)},_insertElementAtIndex:function(e,t,i){var n=t.children();0===n.length||0===i?t.prepend(e):i>=n.length?t.append(e):e.insertBefore(s.get(n,i))},_onConversationWindowTab:function(e,t){this._focusNextConversationWindow(e)&&t.preventDefault()},_onConversationWindowShiftTab:function(e,t){this._focusPreviousConversationWindow(e)&&t.preventDefault()},_onMinimizedConversationsCollectionChange:function(e,t,i){s.get(i,"isFromPersistence")||this.saveConversationsState(this.minimizedConversations,this.get("persistenceKeyMinimized"))},_onOpenConversationsCollectionChange:function(e,t,i){s.get(i,"isFromPersistence")||this.saveConversationsState(this.openConversations,this.get("persistenceKeyOpen"))},_onConversationsCollectionChange:function(){var e=this.openConversations.length>0||this.minimizedConversations.length>0;this.set("isConversationOpen",e),this._addBodyClasses(),this._addContainerClasses()},_addBodyClasses:function(){var e=n("body");e.toggleClass(this.get("bodyClassConversationsHasOpen"),this.openConversations.length>0),e.toggleClass(this.get("bodyClassConversationsHasMinimized"),this.minimizedConversations.length>0)},_addContainerClasses:function(){var e=this.conversationsPopoversContainer;e&&(e.toggleClass(this.get("containerClassConversationsHasOpen"),this.openConversations.length>0),e.toggleClass(this.get("containerClassConversationsHasMinimized"),this.minimizedConversations.length>0))},_onInboxClose:function(e){var t=this.get("inboxAnimationSpeed");this.trigger("inbox:removing",this.inboxCollection,this.inboxPopover,e),this.set("isInboxOpen",!1),t>0?setTimeout(s.bind(function(){this._afterInboxClosed(e)},this),t):this._afterInboxClosed(e)},_onChangeConversationMinimized:function(e,t){var i=t?this.openConversations:this.minimizedConversations,n=t?this.minimizedConversations:this.openConversations,s=i.getByConversationModel(e),o=t?"conversation:minimized":"conversation:unminimized",r={isMoving:!0};t||this.get("isMultipleOpenWindowsEnabled")||this.minimizeConversations(!0),i.remove(s,r),n.add(s,r),this.trigger(o,s.getConversation(),s.getPopover())},_afterInboxOpened:function(e){this.trigger("inbox:added",this.inboxCollection,this.inboxPopover,e)},_afterInboxClosed:function(e){this.trigger("inbox:removed",this.inboxCollection,this.inboxPopover,e),this.inboxPopover=null,this.inboxCollection=null},_createConversationsPopoversContainer:function(){return this.conversationsPopoversContainer?this.conversationsPopoversContainer:(this.conversationsPopoversContainer=n("
").addClass(this.get("conversationPopoversContainerClass")),this.openConversationsContainer=new h({collection:this.openConversations,className:[this.get("containerClass"),this.get("openConversationsContainerClass")].join(" ")}).render(),this.minimizedConversationsContainer=new h({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),n("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(e){return this.openConversations.getByConversationModel(e)||this.minimizedConversations.getByConversationModel(e)},_addConversationWindowEvents:function(e){var t=e.getView();this.listenTo(t,"keydown:tab",function(t){this._onConversationWindowTab(e,t)}),this.listenTo(t,"keydown:shift+tab",function(t){this._onConversationWindowShiftTab(e,t)}),this.listenToOnce(t,"close",function(){this.removeConversation(e.getConversation())}),this.listenTo(t,"change:isMinimized",function(t,i){this._onChangeConversationMinimized(e.getConversation(),i)})},_afterConversationWindowModelAdded:function(e){var t=e.getConversation(),i=e.getPopover(),n=e.getOptions(),s=this.get("conversationAnimationSpeed"),o=function(){this.trigger("conversation:added",t,i,n)};this.trigger("conversation:adding",t,i,n),this._addConversationWindowEvents(e),this._callAfterDelay(o,s)},_afterConversationWindowModelRemoved:function(e,t){var i=this.get("conversationAnimationSpeed"),n=e.getView(),o=e.getPopover(),r=e.getConversation(),a=e.getOptions(),l=function(){this.trigger("conversation:removed",r,o,a)};this.stopListening(o),this.stopListening(n),this._removeConversationPopover(o,t),this.trigger("conversation:removing",r,o,a),t||i<=0?l.call(this):setTimeout(s.bind(l,this),i)}});e.exports=d},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(283),a=o.extend({className:"popover--inbox-popover",mixins:[r],defaults:{animationSpeed:100},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"viewOptions","viewConstructor"))},render:function(){return this.$wrapper=s("
").addClass("popover-inner").appendTo(this.$el),this.$wrapper.addClass("hide-popover"),this.$pinned.addClass("active"),this._createView(this.viewOptions),n.defer(n.bind(function(){this.$wrapper.removeClass("hide-popover")},this)),this},teardown:function(){var e=this.get("animationSpeed");return this.$wrapper.addClass("hide-popover"),this.$pinned.removeClass("active"),e>0?setTimeout(n.bind(this._afterHide,this),this.get("animationSpeed")):this._afterHide(),this},getView:function(){return this.inboxView},_createView:function(e){e=n.isFunction(e)?e.call(this,this):e,this.inboxView&&this.inboxView.remove(),this.inboxView=new this.viewConstructor(e),this.$wrapper.html(this.inboxView.render().$el)},_afterHide:function(){this.inboxView&&this.inboxView.remove(),this.$el.remove()}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(653),r=s.extend({model:o,comparator:function(e){return e.getConversation().get("lastOpenedDateTs")},getByIdAndParticipant:function(e,t){var i=this.find(function(i){var n=i.getConversation();return n.get("id")===e&&n.get("participantUuid")===t});return i?i.getConversation():null},getByConversationModel:function(e){return this.find(function(t){var i=t.getConversation();return!n.isEmpty(i)&&i.isSameConversation(e)})}});e.exports=r},function(e,t,i){"use strict";var n=i(185),s=n.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 e=this.getPopover();return e?e.getView():null}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(185),o=s.extend({url:"/svc/onlinestatus",parse:function(e){return n.result(e,"response")||{}}});e.exports=o},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.extend({className:"popover--conversation-popover",defaults:{animationSpeed:250,skipAnimationOnRender:!1,skipAnimationOnRemove:!1},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"viewOptions","viewConstructor")),n.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 e=this.get("animationSpeed");return!this.get("skipAnimationOnRemove")&&e>=0?(this.$el.addClass("hide-popover"),setTimeout(n.bind(this.remove,this),e)):this.remove(),this},beforeRemove:function(){this.conversationView&&this.conversationView.remove()},getView:function(){return this.conversationView},poll:function(){var e=this.getView();if(e)return e.poll()},refresh:function(e){var t=this.getView();if(t)return t.refresh(e)},fetch:function(){var e=this.getView();if(e)return e.fetch()},focus:function(){var e=this.getView();if(e)return e.focus()},isMinimized:function(){var e=this.getView();if(e)return e.isMinimized()},_animateIn:function(){this.$el.addClass("hide-popover"),n.defer(n.bind(function(){this.rendered&&this.$el.removeClass("hide-popover")},this))}});e.exports=o},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(226),r=i(485),a=o.extend({defaults:{isScrollEnabled:!1,isAdjustToBrowserHeightEnabled:!1},initialize:function(e){e=s.extend({},e),s.extend(this.attributes,s.pick(e,s.keys(this.defaults))),s.extend(this,s.pick(e,"collection"))},render:function(){return this.get("isScrollEnabled")?(this.$rootContainer=n("
").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&&s.defer(s.bind(this._updateScroll,this)),this},remove:function(){this.scrollBar&&(this.stopListening(this.scrollBar),this.scrollBar.remove())},_renderAllPopovers:function(){var e=this.$rootContainer;this.rendered&&(e.empty(),this.collection.each(s.bind(function(t){var i=t.getPopover();this.rendered&&i&&e.append(i.$el)},this)))},_updateScroll:function(){this.rendered&&this.scrollBar&&(this.get("isAdjustToBrowserHeightEnabled")&&this._updateScrollHeight(),this.scrollBar.update())},_updateScrollHeight:function(){var e,t,i=89;this.scrollBar&&this.rendered&&(e=n(window).height(),t=this.$rootContainer.get(0).scrollHeight,this.$el.height(Math.min(e-i,t)),this.$rootContainer.scrollTop(t))},_onCollectionAdd:function(e,t,i){var n=e.getPopover(),o=n.$el,r=t.indexOf(e),a=this.$rootContainer,l=a.children();this.rendered&&(0===l.length||0===r?a.prepend(o):r>=l.length?a.append(o):o.insertBefore(s.get(l,r)),this.scrollBar&&this._updateScroll())},_onCollectionRemove:function(e,t,i){this.scrollBar&&s.defer(s.bind(this._updateScroll,this))},_onCollectionReset:function(e,t){this._renderAllPopovers()},_onScrollResize:function(){this._updateScrollHeight()}});e.exports=a},function(e,t,i){"use strict";var n=i(8),s=i(192),o=i(3),r=i(214),a=i(658),l=r.extend({name:"MessagingWindowPersistence",defaults:{storageKeyPrefix:"messaging",isSyncEnabled:!1},initialize:function(e){e=o.extend({},e),o.extend(this.attributes,o.pick(e,o.keys(this.defaults))),o.extend(this,o.pick(e,"user")),this.get("isSyncEnabled")&&this._addSyncListeners()},save:function(e,t){var i,n=s.defer(),r=this._getStorageKey(t);return i=o.map(e,this._getObjectFromModel),this._saveLocalStorage(r,i),n.resolve(),n.promise},load:function(e){var t=s.defer(),i=this._getStorageKey(e),n=this._loadLocalStorage(i),r=o.map(n,this._getModelFromObject);return t.resolve(r||[]),t.promise},clear:function(){var e,t=window.localStorage;if(t){e=this._getStorageKey();try{o.each(o.keys(t),function(i){o.startsWith(i,e+":")&&t.removeItem(i)})}catch(e){this._triggerError(e)}}},remove:function(){this.get("isSyncEnabled")&&this._removeSyncListeners()},_addSyncListeners:function(){n(window).on("storage.messaging-window-persistence",o.bind(this._onStorageChange,this))},_removeSyncListeners:function(){n(window).off(".messaging-window-persistence")},_onStorageChange:function(e){var t,i,n=o.get(e,"originalEvent.key"),s=o.get(e,"originalEvent.newValue"),r=this._getStorageKey(),a=n.substring(r.length+1);if(!o.isEmpty(n)&&!o.isEmpty(a)&&o.startsWith(n,r)&&!o.isEmpty(s))try{t=JSON.parse(s),i=o.map(t,this._getModelFromObject),this.trigger("sync",a,i),this.trigger("sync:"+a,i)}catch(e){this._triggerError(e)}},_getStorageKey:function(e){var t=[this.get("storageKeyPrefix"),this.user.get("name"),e];return o.compact(t).join(":")},_saveLocalStorage:function(e,t){if(window.localStorage)try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){this._triggerError(e)}},_loadLocalStorage:function(e){var t;if(!window.localStorage)return[];try{return t=window.localStorage.getItem(e),o.isEmpty(t)?[]:JSON.parse(t)}catch(e){return this._triggerError(e),[]}},_getObjectFromModel:function(e){var t=["uuid","url","name","avatar_url","theme"],i=e.get("participants").map(function(e){return e.pick(t)});return{id:e.get("id"),participantUuid:e.get("participantUuid"),participants:i,lastOpenedDateTs:e.get("lastOpenedDateTs")}},_getModelFromObject:function(e){return new a(e)},_triggerError:function(e){this.trigger("error",e)}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(659),r=i(660),a=i(185),l=i(661),c=i(667),u=i(669),h=a.extend({url:"/svc/conversations/messages",mixins:[o,r],relations:{messages:c,participants:u},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(e){return this.flushQueue(this.sendMessage,e)},canRetryFetch:function(e){return n.isFinite(e)&&!n.contains(this.fetchNoRetryOnErrorCodes,e)},markAsRead:function(){var e=(new Date).getTime();this.set({last_read_ts:parseInt(e/1e3,10),unreadCount:0})},parse:function(e,t){var i=n.get(e,"response")||e;return n.get(t,"isFetchInbox")&&n.extend(i,this.pick("is_possible_spam","is_blurred_images")),i},destroy:function(e){var t={conversation_id:this.get("id"),participant:this.get("participantUuid")};return e=n.extend({},e,{url:this.url+"?"+s.param(t)}),a.prototype.destroy.call(this,e)},markAsSpam:function(e){e=e||"inline";var t={conversation_id:this.get("id"),participant:this.get("participantUuid"),context:e,type:"spam"};return s.ajax({url:"/svc/conversations/flag",method:"POST",withFormKey:!0,data:t})},fetchConversation:function(e){var t=new s.Deferred,i=function(){t.resolve.apply(this,arguments)},o=function(){t.reject.apply(this,arguments)};return this.fetch(this._getFullFetchOptions(e)).then(n.bind(i,this)).fail(n.bind(function(e,t){var s=n.get(e,"status");this.isNew()&&n.contains(this.fetchNonErrorCodes,s)?i.call(this,{},t):o.apply(this,arguments)},this)),t},poll:function(e,t){var i;return this.isNew()?(new s.Deferred).reject():(i={participant:this.get("participantUuid"),conversation_id:this.get("id")},t&&n.extend(i,{limit:t}),this.get("messages").poll({isPolling:!0,data:i}))},getConversationDataForMessage:function(){var e={participant:this.get("participantUuid")};return this.isNew()?n.extend(e,{participants:this.getParticipantsIds()}):n.extend(e,{conversation_id:this.get("id")}),e},addMessage:function(e,t){return t=t||{},e.set(this.getConversationDataForMessage()),this.get("messages").add(e),e},sendMessage:function(e,t){return t=t||{},e.set(this.getConversationDataForMessage()),e.save(null,t).then(n.bind(function(e){var i=this.parse(e,t);this.isNew()?this.set(n.omit(i,"messages")):this.set(n.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 e=this.get("participants").getWithout([this.getParticipantId()]);return n.first(e)},getInboxMessage:function(){var e=this.get("messages").where({isError:!1});return n.last(e)},isSameConversation:function(e){var t=e.getParticipantId(),i=e.getParticipantsIds(),s=this.getParticipantId(),o=this.getParticipantsIds();return s===t&&n.union(o,i).length===o.length},unblurImages:function(){this.set("is_blurred_images",!1);var e={conversation_id:this.get("id"),participant:this.get("participantUuid"),type:"unblur"};s.ajax({url:"/svc/conversations/flag",method:"POST",withFormKey:!0,data:e})},shouldBlurImageMessage:function(e){return!(!this.get("is_blurred_images")||!e.isImage())&&e.get("participant")!==this.getParticipantId()},_getFullFetchOptions:function(e){var t=this.isNew()?this._getDataForFetchByParticipants():this._getDataForFetchById();return t=n.extend({},t,{participant:this.get("participantUuid")}),n.extend({},e,{isFetching:!0,cache:!1,reset:!0,data:t})},_getDataForFetchById:function(e){return{conversation_id:this.get("id")}},_getDataForFetchByParticipants:function(e){return{participants:this.getParticipantsIds()}}},{createPostMessage:function(e,t,i){return i=n.extend({},i,{type:l.POST,post:{blog:t,id:e,is_nsfw:n.get(i,"is_nsfw",!1)}}),new l(n.omit(i,"is_nsfw"))},createTextMessage:function(e,t){return t=n.extend({},t,{type:l.TEXT,message:e,content:{text:e}}),new l(t)},createImagePostMessage:function(e,t,i,n,s,o){var r=h.createPostMessage(e,t,o),a=r.getPost();return a.setType("photo"),a.addThumbnail(i,n,s),r},createImageMessage:function(e,t,i,s,o){return o=n.extend({},o,{type:l.IMAGE,file:t,image:{original_size:{width:i,height:s,url:e}}}),new l(o)},createStickerMessage:function(e,t,i,s){return s=n.extend({},s,{type:l.STICKER,sticker_id:e,sticker:{url:t,original_size_url:i}}),new l(s)}});e.exports=h},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(187),r=new o({defaults:{relationKeys:function(){return n.keys(this.relations)},getRelations:function(){return n.pick(this.attributes,this.relationKeys())}},before:{initialize:function(e,t){this._bootstrapRelations(e,t)}},extend:{_isModelOrCollection:function(e){return e instanceof s.Collection||e instanceof s.Model},_bootstrapRelations:function(e,t){this._isBootstrapped||(n.forEach(this.relations,function(i,s){var o=this.attributes[s];!n.isEmpty(o)&&o instanceof i||(this.attributes[s]=new i(e[s],t))},this),this._isBootstrapped=!0)}},around:{set:function(e,t,i,o){var r,a,l,c,u,h,d=this.attributes,p=this.relationKeys(),g=!this._isBootstrapped;return n.isObject(t)?(r=t,o=i):(r={})[t]=i,o=o||{},u=n.result(o,"relationalSetOptions")||{},this._bootstrapRelations(r,o),a=n.pick(r,p),n.isEmpty(a)?e.apply(this,n.rest(arguments)):(h=n.isEmpty(this.relationsOrder)?n.keys(a):this.relationsOrder,g||n.forEach(h,function(e){r[e]&&(c=a[e],l=d[e],this._isModelOrCollection(l)&&(o.unset?l instanceof s.Collection?l.reset():l instanceof s.Model&&l.clear():(this._isModelOrCollection(c)&&(c=c.toJSON()),o.reset&&l instanceof s.Collection?l.reset(c,n.extend({},o,u[e])):l.set(c,n.extend({},o,u[e])))))},this),e.call(this,n.omit(r,p),o))},toJSON:function(e){var t=e.apply(this,n.rest(arguments))||{};for(var i in this.relations)this.relations.hasOwnProperty(i)&&(t[i]=n.result(t[i],"toJSON")||t[i]);return t}}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(187),r=new o({extend:{getQueue:function(){return this.queue||(this.queue=[]),this.queue},getQueueItems:function(){return n.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(e,t){var i=this.getQueue();return e=this._getItemsAsArray(e),i.push.apply(i,this._constructItemWrappers(e,t)),i},prependToQueue:function(e,t){var i=this.getQueue();return e=this._getItemsAsArray(e),i.unshift.apply(i,this._constructItemWrappers(e,t)),i},removeFromQueue:function(e){return e=this._getItemsAsArray(e),this.queue=n.reduce(this.getQueue(),function(t,i){var s=n.get(i,"item");return n.contains(e,s)?t:(t.push(i),t)},[]),this.queue},flushQueue:function(e,t){var i,o=this.getQueue();return this._isFlushingQueue?this._flushQueueDeferred:n.isFunction(e)?(this._isFlushingQueue=!0,this._flushQueueDeferred=new s.Deferred,i=function(){var s,r,a;if(this._isFlushingQueue){if(0===o.length)return this._isFlushingQueue=!1,void this._onQueueSuccess(t);s=o.shift(),r=n.get(s,"item"),a=n.get(s,"options"),this._onQueueItemStart(r,a,t),e.call(this,r,a,t).then(n.bind(function(){this._onQueueItemSuccess(r,a,t),i.call(this)},this)).fail(n.bind(function(){this._isFlushingQueue=!1,this._onQueueItemFail(r,a,t)},this))}},i.call(this),this._flushQueueDeferred):(new s.Deferred).reject()},abortFlush:function(){this._isFlushingQueue&&(this._isFlushingQueue=!1,this._flushQueueDeferred.reject())},_getItemsAsArray:function(e){return n.isArray(e)||(e=[e]),e},_constructItemWrappers:function(e,t){return n.map(e,function(e){return{item:e,options:t}})},_onQueueItemStart:function(e,t,i){this._flushQueueDeferred.notify(e,!1,t,i,this.getQueueItems())},_onQueueItemSuccess:function(e,t,i){this._flushQueueDeferred.notify(e,!0,t,i,this.getQueueItems())},_onQueueItemFail:function(e,t,i){this._flushQueueDeferred.reject(e,t,i,this.getQueueItems())},_onQueueSuccess:function(e){this._flushQueueDeferred.resolve(e)}}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(185),r=i(523),a=i(659),l=i(662),c=i(663),u=i(664),h={TEXT:"TEXT",POST:"POSTREF",IMAGE:"IMAGE",STICKER:"STICKER"},d=o.extend({ mixins:[a],relations:{content:l,post:c,image:u},idAttribute:"ts",defaults:{conversation_id:null,type:h.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(e,t){var i=n.get(e,"response.messages.data.0")||e,s=n.get(i,"images");return n.isArray(s)&&n.extend(i,{image:n.first(s)}),i},save:function(e,t){var i,a,l,c,u;return t=n.extend({validate:!0,parse:!0},t),e=e||{},e&&this.set(e),a=this.toJSON(),l=n.pick(a,this.persistedFields),c=this._getServerLoggingContext(),n.isEmpty(c)?delete l.context:n.extend(l,{context:c}),n.extend(t,{data:l,emulateJSON:!0}),this.isImage()?(u=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([u]),i=this.uploader.getCurrentRequest(),i?i.then(n.bind(function(e){t.parse&&(e=this.parse(e,t)),this.set(e,t)},this)):(i=new s.Deferred,i.reject())):i=o.prototype.save.call(this,e,t),this.set({isPending:!0,isQueued:!1}),i.then(n.bind(function(){this.set("isError",!1)},this)).fail(n.bind(function(e){this.set({isError:!0,canRetry:this._canRetryOnErrorCode(n.get(e,"status"))})},this)).always(n.bind(function(){this.set("isPending",!1)},this)),i},getActionMarkup:function(e,t,i){return t=t||"",i=i||"",this.isText()?n.isEmpty(e)?null:t+n.escape(e)+i:this.isPost()?this.getPost().getActionMarkup(e,t,i):this.isImage()?this.getImage().getActionMarkup(e,t,i):null},getPost:function(){return this.get("post")},getImage:function(){return this.get("image")},getTimestamp:function(){var e=this.get("ts");return e?parseInt(e,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")===h.TEXT},isPost:function(){return this.get("type")===h.POST},isImage:function(){return this.get("type")===h.IMAGE},isDisabledPost:function(){return this.isPost()&&this.get("post").isDisabled()},isPending:function(){return this.get("isPending")},canRetry:function(){return this.get("canRetry")},_canRetryOnErrorCode:function(e){return n.isFinite(e)&&!n.contains(this.saveNoRetryOnErrorCodes,e)},_getServerLoggingContext:function(){var e=this.get("context");return!n.isEmpty(e)&&(e=n.first(e.split(":")),n.contains(this.validSendMessageContexts,e))?e:null}},h);e.exports=d},function(e,t,i){"use strict";var n=i(185),s=n.extend({defaults:{text:null,formatting:[]}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(185),r=i(265),a=o.extend({defaults:{type:null,summary:null,state:null,photos:[],is_nsfw:!1},setType:function(e){var t=["photo","link","quote","audio","video","chat"];n.contains(t,e)&&this.set("type",e)},getMessage:function(){return"gif"===this.getType()?null:this.get("summary")},getActionMarkup:function(e,t,i){var o,r,a,l,c;return t=t||"",i=i||"",e=n.escape(e),r=!n.isEmpty(e),l=r?s("%1$s%2$s%3$s sent a post that's no longer available",t,e,i):s("sent a post that's no longer available"),this.isDisabled()?l:(o=this.getType(),a=r?s("%1$s%2$s%3$s sent a post",t,e,i):s("sent a post"),c=r?{photo:s("%1$s%2$s%3$s sent a photo post",t,e,i),photoset:s("%1$s%2$s%3$s sent a photoset",t,e,i),gif:s("%1$s%2$s%3$s sent a GIF",t,e,i),link:s("%1$s%2$s%3$s sent a link",t,e,i),quote:s("%1$s%2$s%3$s sent a quote",t,e,i),audio:s("%1$s%2$s%3$s sent an audio post",t,e,i),video:s("%1$s%2$s%3$s sent a video",t,e,i),chat:s("%1$s%2$s%3$s sent a chat",t,e,i)}:{photo:s("sent a photo post"),photoset:s("sent a photoset"),gif:s("sent a GIF"),link:s("sent a link"),quote:s("sent a quote"),audio:s("sent an audio post"),video:s("sent a video"),chat:s("sent a chat")},n.has(c,o)?n.get(c,o):a)},getType:function(){var e;if("photo"===this.get("type")){if(this._isThumbnailGIF())return"gif";if(e=this.get("photos")||[],e.length>1)return"photoset"}return this.get("type")},getThumbnail:function(e){var t,i=this._getClientThumbnail();return n.isEmpty(i)?(t=this._getPostThumbnail(e),n.isEmpty(t)?null:t):i},hasThumbnail:function(e){return!n.isEmpty(this.getThumbnail(e))},getScaledDimensionsForWidth:function(e,t){var i;return n.has(e,"width")&&n.has(e,"height")?(i=Math.round(n.get(e,"height")/(n.get(e,"width")/t)),{width:t,height:i}):null},isDisabled:function(){return"disabled"===this.get("state")},addThumbnail:function(e,t,i){!n.isEmpty(e)&&n.isNumber(t)&&n.isNumber(i)&&this.set("clientThumbnail",{url:e,width:t,height:i})},_getClientThumbnail:function(){return this.get("clientThumbnail")},_getPostThumbnail:function(e){var t,i,s=this.get("thumbnail_url"),o=this.get("thumbnail_height"),r=this.get("thumbnail_width"),a=this.get("photos");return e=e||250,!n.isEmpty(a)||!n.isEmpty(s)&&n.isFinite(o)&&n.isFinite(r)?n.isEmpty(a)?{url:s,height:o,width:r}:(i=n.sortBy(n.get(n.first(a),"alt_sizes"),"width"),t=n.find(i,function(t){return n.get(t,"width",0)>=e}),n.isEmpty(t)?n.last(i):t):null},_isThumbnailGIF:function(){var e,t=n.get(this.getThumbnail(),"url");return!n.isEmpty(t)&&(e=r.getExtension(t),"gif"===(e||"").toLowerCase())}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(185),r=i(659),a=i(665),l=i(666),c=o.extend({mixins:[r],relations:{alt_sizes:a,original_size:l},defaults:{alt_sizes:null,original_size:null},getActionMarkup:function(e,t,i){return e=n.escape(e),t=t||"",i=i||"",n.isEmpty(e)?s("sent a photo"):s("%1$s%2$s%3$s sent a photo",t,e,i)},getAltSizes:function(){return this.get("alt_sizes")},getHighResImageUrl:function(){var e=this.getAltSizes().sort().last();return n.isEmpty(e)?null:e.get("url")},getOriginalSize:function(){return this.get("original_size")},hasAltSizes:function(){return!this.getAltSizes().isEmpty()},getImageAtSize:function(e){var t,i=this.getAltSizes().sort();return e=e||250,i.isEmpty()?this.getOriginalSize():(t=i.find(function(t){return t.get("width")>=e}),n.isEmpty(t)&&(t=i.last()),t)}});e.exports=c},function(e,t,i){"use strict";var n=i(190),s=i(666),o=n.extend({model:s,comparator:function(e){return e.get("width")}});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({idAttribute:"url",defaults:{width:null,height:null,url:null}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(668),r=i(661),a=s.extend({url:"/svc/conversations/messages",mixins:[o],model:r,_getRoot:function(e){return n.has(e,"response")?n.get(e,"response.messages"):e},parse:function(e,t){return n.get(this._getRoot(e),"data")||[]},parsePreviousLink:function(e,t){return n.get(this._getRoot(e),"_links.previous")},parseNextLink:function(e,t){return n.get(this._getRoot(e),"_links.next")},poll:function(e){return e=e||{},n.extend(e,{cache:!1,remove:!1,skipParseLinks:!0}),this.fetch(e)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(192),o=i(187),r=new o({extend:{setNextLink:function(e){var t,i=this.hasNextPage();this._nextLink=e,t=this.hasNextPage(),i!==t&&this.trigger("change:hasNextPage",this,t)},setPreviousLink:function(e){var t,i=this.hasPreviousPage();this._previousLink=e,t=this.hasPreviousPage(),i!==t&&this.trigger("change:hasPreviousPage",this,t)},getNextLink:function(){return this._nextLink},getPreviousLink:function(){return this._previousLink},hasNextPage:function(){return!n.isEmpty(this.getNextLink())},hasPreviousPage:function(){return!n.isEmpty(this.getPreviousLink())},fetchNextPage:function(e,t){return e=e||{},this.hasNextPage()?(e.isInfiniteScroll!==!1&&n.extend(e,{skipParsePreviousLink:!0,remove:!1}),this._fetchPage(this.getNextLink(),e)):s.reject()},fetchPreviousPage:function(e,t){return e=e||{},this.hasPreviousPage()?(e.isInfiniteScroll!==!1&&n.extend(e,{skipParseNextLink:!0,remove:!1}),this._fetchPage(this.getPreviousLink(),e)):s.reject()},_fetchPage:function(e,t){var i=n.isString(e)?e:e.href;return t=t||{},n.extend(t,{url:i}),this.fetch(t)}},defaults:{parsePreviousLink:function(e,t){return null},parseNextLink:function(e,t){return null}},before:{reset:function(e){this.setPreviousLink(null),this.setNextLink(null)},parse:function(e,t){t=t||{},t.skipParseLinks||(!t.skipParsePreviousLink&&n.isFunction(this.parsePreviousLink)&&this.setPreviousLink(this.parsePreviousLink(e,t)),!t.skipParseNextLink&&n.isFunction(this.parseNextLink)&&this.setNextLink(this.parseNextLink(e,t)))}}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(670),r=s.extend({model:o,getSortedByChannels:function(e,t){var i=this.clone(),s=t?-1:1,o=e.length;return i.sortBy(function(t){var i=n.indexOf(e,t.get("uuid")),r=i>-1,a=r?o-i:-1;return s*a})},getWithout:function(e){var t=this.clone();return t.filter(function(t){return!n.contains(e,t.get("uuid"))})}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(659),o=i(250),r=i(185),a=i(671),l=r.extend({url:"/svc/conversations/participant_info",mixins:[s],relations:{theme:a},defaults:{theme:null,is_blog_following_you:!1,is_following_blog:!1,duration_blog_following_you:null,duration_following_blog:null,seconds_since_last_activity:-1,blog_tags:[]},idAttribute:"uuid",parse:function(e){return!n.has(e,"theme")&&n.has(e,"global_theme_params")&&n.extend(e,{theme:n.get(e,"global_theme_params")}),n.get(e,"response",e)},getAvatarUrl:function(e){return e=e||96,o(this.get("avatar_url"),e)},getAvatarShape:function(){return this.get("theme").get("avatar_shape")},getBlogTags:function(){var e=this.get("blog_tags");return n.isArray(e)?e:[]},getDescription:function(){return this.get("theme").get("show_description")!==!0?"":this.get("description")},fetchAdditionalInfo:function(e,t){return t=n.extend({},t,{merge:!0,data:{q:this.get("uuid"),participant:e}}),this.fetch(t)},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 e=this.get("duration_blog_following_you");return this.isFollowingYou()&&n.isNumber(e)?e:null},getDurationFollowingSeconds:function(){var e=this.get("duration_following_blog");return this.isFollowing()&&n.isNumber(e)?e:null},getDurationMutualsSeconds:function(){var e,t;return this.isMutuals()?(e=this.getDurationFollowingSeconds(),t=this.getDurationFollowingYouSeconds(),Math.min(e,t)):null}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(672),o=i(185),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(e){var t;return this.get("tint"+e)?this.get("tint"+e):n.isEmpty(e)?null:(t=s.isLight(e,.5)?s.isLight(e,.05,.95)?r.TINT_WHITE:r.TINT_LIGHT:r.TINT_DARK,this.set("tint"+e,t),t)},isDark:function(e){return this.getTint(e)===r.TINT_DARK},isReadableOn:function(e,t){return e=s.hexToHsv(e),t=s.hexToHsv(t),!s.compare(e,t)},adjustColorForBackground:function(e,t){var i=this.get("adjustBrightnessFactor");return this.isReadableOn(e,t)?e:this.adjustBrightness(e,this.isDark(e)?i:i*-1)},getReadableColor:function(e,t){return this.isReadableOn(e,t)?e:s.readable(e)},adjustBrightness:function(e,t){return s.brighten(e,t)},getTintSuffix:function(e){return e===r.TINT_WHITE?"-white":e===r.TINT_LIGHT?"-light":e===r.TINT_DARK?"-dark":void 0}},{TINT_LIGHT:"light",TINT_DARK:"dark",TINT_WHITE:"white"});e.exports=r},function(e,t,i){"use strict";function n(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)}function s(e){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function o(e,t,i){var n=Math.min(Math.min(e,t),i),s=Math.max(Math.max(e,t),i),o=s-n,r={h:6,s:s?(s-n)/s:0,v:s/255};return o?s===e?r.h+=(t-i)/o:s===t?r.h+=2+(i-e)/o:r.h+=4+(e-t)/o:r.h=0,r.h=60*r.h%360,r}function r(e,t,i){var n,s,o;if(t){n=s=o=0;var r=(e+360)%360/60,a=i*t,l=i-a,c=a*(1-Math.abs(r%2-1));r<1?(n=a,s=c):r<2?(n=c,s=a):r<3?(s=a,o=c):r<4?(s=c,o=a):r<5?(o=a,n=c):(o=c,n=a),n+=l,s+=l,o+=l}else n=s=o=i;return{r:Math.round(255*n),g:Math.round(255*s),b:Math.round(255*o)}}function a(e){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=s(e),i=o(t.r,t.g,t.b);return i}function l(e,t,i){var s=r(e,t,i),o=n(s.r,s.g,s.b);return o}function c(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var i,n,s,o=parseInt(e,16),r=t<0?0:255,a=t<0?-t:t,l=o>>16,c=o>>8&255,u=255&o;return i=Math.round((r-l)*a)+l,n=Math.round((r-c)*a)+c,s=Math.round((r-u)*a)+u,"#"+(16777216+65536*i+256*n+s).toString(16).slice(1)}function u(e,t,i){return"string"==typeof e&&(e=a(e)),t||(t=.2),i||(i=.8),e.si}function h(e){return"string"==typeof e&&(e=a(e)),u(e)?"#444":"#FFF"}function d(e,t,i){var n={upperBound:.8,lowerBound:.2,diffBound:.1,hueBound:15};p.extend(n,i),"string"==typeof e&&(e=a(e)),"string"==typeof t&&(t=a(t));var s=n.upperBound,o=n.lowerBound,r=n.diffBound,l=n.hueBound,c=Math.abs(e.h-t.h),u=Math.abs(e.s-t.s),h=Math.abs(e.v-t.v);return c<=r&&u<=r&&h<=r||u<=r&&h<=r&&(u>=s||u<=o&&h>=s||h<=o&&c<=l)}var p=i(3);e.exports={rgbToHex:n,hexToRgb:s,rgbToHsv:o,hsvToRgb:r,hexToHsv:a,hsvToHex:l,brighten:c,readable:h,compare:d,isLight:u}},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(214),r=i(136),a=o.extend({name:"MessagingNotifier",defaults:{isEnabled:!1,notificationTimeout:5e3,notificationIcon:null},initialize:function(e){n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},notifyOnUnread:function(e,t){var i=s("New message for %1$s",t.get("name")),n={conversationId:e,channelUuid:t.get("uuid")};this._generateNotification(i,n)},_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(e){window.Notification.requestPermission(e)},_generateNotification:function(e,t){var i,s;this._supportsNotifications()&&(s={icon:this.get("notificationIcon")},this._isNotificationPermissionGranted()?(i=new Notification(e,s),i instanceof Notification&&(i.addEventListener("click",n.bind(function(e){r.trigger("messaging:conversation:open:id",t.conversationId,t.channelUuid,"notification"),e.target.close()}),this),n.delay(n.bind(function(){this.close()},i),this.get("notificationTimeout")),this.trigger("notification:display",t.conversationId))):this._needsNotificationPermission()&&this._requestPermission(n.bind(function(i){this.trigger("notification:permission:change","granted"===i),this._generateNotification(e,t)},this)))}});e.exports=a},function(e,t,i){"use strict";var n,s=i(214),o=i(3),r=i(675),a=i(676),l=i(677),c=s.extend({name:"NotificationSoundManager",initialize:function(){var e=o.get(this.data,"sounds",[]),t=o.get(this.data,"soundpacks",{});this.soundCollection=new r(this._getSoundModels(e)),this.soundPackCollections=this._getSoundpackCollections(t)},playSoundName:function(e){var t=this.soundCollection.get(e);o.isEmpty(t)||this._playSoundModel(t)},playRandomFromSoundpack:function(e){var t=o.get(this.soundPackCollections,e);t&&this._playSoundModel(t.sample())},_playSoundModel:function(e){var t=new l({model:e}).render();this.listenToOnce(t,"ended",this._removeSoundView),t.play()},_removeSoundView:function(e){e.remove()},_getSoundModels:function(e){return o.map(e,function(e,t){return new a({name:t,filePath:e})})},_getSoundpackCollections:function(e){var t=this;return o.reduce(e,function(e,i,n){return e[n]=new r(t._getSoundModels(i)),e},{})}}),u=function(){return null==n&&(n=new c),n};e.exports=u},function(e,t,i){"use strict";var n=i(190),s=i(676),o=n.extend({model:s});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({idAttribute:"name",defaults:{name:null,filePath:null,fileType:"audio/mpeg"}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(678),r=s.extend({tagName:"audio",template:o,defaults:{filePath:null,fileType:null},events:{ended:"triggerRemove"},initialize:function(e){n.extend(this,n.pick(e,"model"))},getTemplateData:function(){return this.model.toJSON()},play:function(){this.el.play()},triggerRemove:function(){this.trigger("ended",this)}});e.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+='';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.extend({renderWithTemplate:n.noop,initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"channels"))},afterRender:function(){this.listenTo(this.channels,"change:unread_messages_count_sum",this._onChangeChannelUnreadCount),this._onChangeChannelUnreadCount()},updateBadge:function(e){e>0&&this.$(".tab_notice_value").text(e>99?"99+":e),this.$(".tab_notice").toggleClass("tab-notice--active",e>0)},_onChangeChannelUnreadCount:function(){this.updateBadge(n.sum(this.channels.pluck("unread_messages_count_sum")))}});e.exports=o},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(277),r=i(226),a=i(489),l=i(681),c=i(694),u=i(704),h=i(708),d=i(689),p=i(712),g=r.extend({className:"messaging-inbox",template:p,defaults:{isLoading:!1,isAutoFetch:!0,isEmpty:!1,isLoadingEmptyInboxFavorites:!1,numFavorites:5},mixins:[o],subviews:{headerView:{constructor:c,options:function(e){return{eventBus:e.eventBus,user:e.user,channels:e.channels,currentBlogModel:e.currentBlogModel,popoverContainer:e.popoverContainer,isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}},composeView:{constructor:u,options:function(e){return{eventBus:e.eventBus,favoritesCollection:e.favoritesCollection,currentBlogModel:e.currentBlogModel,keyboardManager:e.keyboardManager,isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}},conversationsView:{constructor:l,options:function(e){return{eventBus:e.eventBus,collection:e.collection,emptyInboxCollection:e.emptyInboxCollection,currentBlogModel:e.currentBlogModel,channels:e.channels,favoritesCollection:e.favoritesCollection,appendFavoritesToInboxLimit:e.appendFavoritesToInboxLimit,isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}},inboxRecipientsView:{constructor:d,options:function(e){return{eventBus:e.eventBus,collection:e.favoritesCollection,title:s("Recently Followed"),context:"new:inbox:empty",isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}},emptyView:{constructor:h,options:function(e){return{eventBus:e.eventBus,collection:e.emptyInboxCollection}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection","user","channels","favoritesCollection","emptyInboxCollection","popoverContainer","currentBlogModel","appendFavoritesToInboxLimit","keyboardManager","isNewEmptyInboxEnabled"))},afterRenderSubviews:function(){this.loader=new a({$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(),this.isNewEmptyInboxEnabled&&this._fetchFavorites()},beforeRemove:function(){this.keyboardManager.remove("inbox")},getTemplateData:function(){return{isNewEmptyInboxEnabled:this.isNewEmptyInboxEnabled}},getCurrentChannel:function(){return this.currentBlogModel.getChannel()},fetch:function(e){this.collection.fetchInbox(this.currentBlogModel.getId(),e)},_onComposeSubmitRecipient:function(e){this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_NAMES,e)},_setViewStates:function(){var e=this.get("isEmpty"),t=this.get("isLoading")||this.get("isLoadingEmptyInboxFavorites"),i=this.headerView.get("isComposing");this.loader.set("loading",t&&!i),this.conversationsView.toggle(!i&&!e&&!t),this.emptyView.toggle(e&&!i&&!t&&!this.isNewEmptyInboxEnabled),this.inboxRecipientsView&&this.inboxRecipientsView.toggle(e&&!i&&!t&&this.isNewEmptyInboxEnabled),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(e,t,i){this.set({isEmpty:0===this.collection.length,isLoading:!this.getCurrentChannel().get("isInboxFetched")})},_fetchEmptyInboxFavorites:function(){var e=this;this.set("isLoadingEmptyInboxFavorites",!0),this.emptyInboxCollection.fetchFavorites(null,null,null,this.isNewEmptyInboxEnabled,"empty").then(function(){e.rendered&&(e.isNewEmptyInboxEnabled||e.favoritesCollection.reset(n.take(e.emptyInboxCollection.toJSON(),e.get("numFavorites"))))}).always(function(){e.rendered&&e.set("isLoadingEmptyInboxFavorites",!1)})},_fetchFavorites:function(){var e=this.get("numFavorites"),t=this.currentBlogModel.getId();this.favoritesCollection.fetchFavorites(e,t,null,!0)}});e.exports=g},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(682),a=i(277),l=i(331),c=i(683),u=i(688),h=i(689),d=i(693),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:c,enableBatchRendering:!0,options:function(e){return{eventBus:e.eventBus,channels:e.channels,currentBlogModel:e.currentBlogModel}},collection:function(e){return e.collection}},paginationLoaderView:{constructor:l,options:{variation:"small h-centered",loading:!1}},favoritesView:{constructor:h,options:function(e){return{showMessageOnEmpty:!1,eventBus:e.eventBus,collection:e.favoritesCollection,title:s(e.isNewEmptyInboxEnabled?"Recently Followed":"More Tumblrs to talk to"),context:"inbox:moretumblrs",isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection","channels","favoritesCollection","currentBlogModel","isNewEmptyInboxEnabled"))},afterRenderSubviews:function(){this.scrollBar=new u({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")),n.defer(n.bind(this.updateScrollBar,this))},toggle:function(e){this.$el.toggle(e),this.updateScrollBar()},beforeRemove:function(){this.scrollBar&&this.scrollBar.destroy()},getNextPage:function(){this.rendered&&this.collection.hasNextPage()&&(this.set("isPaginating",!0),this.collection.fetchNextPage().always(n.bind(function(){this.rendered&&this.set("isPaginating",!1)},this)))},updateScrollBar:function(){this.scrollBar&&this.scrollBar.update()},_setViewStates:function(){var e=this.get("hasNextPage"),t=this.collection.length>0&&!e&&this.collection.length<=this.get("appendFavoritesToInboxLimit");this.set({showFavorites:t,showLoadingContainer:e}),this.updateScrollBar()},_saveModelOrder:function(){this.lastModelOrder=this._getModelOrderString()},_getModelOrderString:function(){return n.pluck(this.collection.models,"cid").join(" ")},_onCollectionSort:function(e){var t=this._getModelOrderString();this.lastModelOrder&&t.indexOf(this.lastModelOrder)===-1&&this.renderCollectionSubviews("conversations"),this._saveModelOrder()},_onCollectionChange:function(e,t){this._setViewStates(),this._saveModelOrder()},_onCollectionSync:function(){this._onChangeCollectionHasNextPage(this.collection,this.collection.hasNextPage())},_onCollectionReset:function(e){this.$el.scrollTop(0),this._saveModelOrder()},_onConversationsBatchRendered:function(){this.updateScrollBar()},_onChangeCollectionHasNextPage:function(e,t){this.set("hasNextPage",t&&e.length>=10)},_onChangeHasNextPage:function(e,t){this._setViewStates()},_onChangeIsPaginating:function(e,t){this.paginationLoaderView.set("loading",t)},_onScrollBottom:function(e){e&&this.getNextPage()},_onChangeShowFavorites:function(e,t){this.favoritesView.$el.toggle(t)},_onChangeShowLoadingContainer:function(e,t){this.js$("loader-container").toggle(t)},_onFavoritesCollectionChange:function(){this.updateScrollBar()}});e.exports=p},function(e,t,i){"use strict";var n=i(3),s=i(187),o=new s({defaults:{removeCollectionSubviews:function(e){var t=this[e];this.subviews[e]&&!n.isEmpty(t)&&(t=this[e],this._subviews=n.difference(this._subviews,t),n.invoke(t,"remove"),this[e].length=0)},removeCollectionSubview:function(e,t){var i,s=this[e];this.subviews[e]&&!n.isEmpty(s)&&(i=n.findWhere(s,{model:t}),i&&(this._subviews=n.without(this._subviews,i),i.remove(),this[e]=n.without(this[e],i)))},addNewCollectionSubview:function(e,t,i){var s=this.subviews[e];if(i||(i=this._getSubviewCollection(e)),s&&i){var o=s.container||this._createDefaultContainerFunction(e),r=s.prepareViewForAdd||this._createDefaultPrepareViewForAddFunction(e),a=s.options||{},l={insertionIndex:i.indexOf(t)},c=n.has(this,e),u=this.createCollectionSubviewRenderer([t],o,r,a,e,c,l);return this._isBatchRenderingInProgress(e)?void this.once("rendered:"+e,u,this):void(this.rendered?u():this.once("rendered",u,this))}},sortCollectionSubviews:function(e,t){var i,s=this.subviews[e];t||(t=this._getSubviewCollection(e)),s&&t&&this[e]&&(i=n.pluck(t.models,"cid"),i=n.zipObject(i,n.range(0,i.length)),this[e]=n.sortBy(this[e],function(e){return n.get(i,e.model.cid,0)}))},batchRenderCollectionSubviews:function(e){var t=this.subviews[e];if(t){var i=t.container||this._createDefaultContainerFunction(e),s=t.prepareView||this._createDefaultPrepareViewFunction(e),o=t.options||{},r=n.result(t,"batchSize")||5,a=n.result(t,"batchDelay")||100,l=this._getSubviewCollection(e),c=n.chunk(l.models,r),u=n.map(c,function(t,r){return n.bind(function(){var n=this.createCollectionSubviewRenderer(t,i,s,o,e,r>0);return n.call(this)},this)},this),h=n.bind(function(){this._scheduleBatchRenders(e,u,a)},this);this.rendered?h():this.once("rendered",h,this)}},_isBatchRenderingInProgress:function(e){return n.get(this._deferredRenders,e,[]).length>0},_scheduleBatchRenders:function(e,t,i){var s=t.length,o=function(){this._afterBatchRenderCollectionSubviews(e)},r=function(t){t.call(this,e),this._afterEachBatchRenderCollectionSubviews(e),s--,0===s&&o.call(this)};return this._deferredRenders||(this._deferredRenders={}),n.has(this._deferredRenders,e)||(this._deferredRenders[e]=[]),this._cancelBatchRenders(e),0===s?void o.call(this):void n.each(t,function(t,s){var o;return 0===s?void r.call(this,t):(o=setTimeout(n.bind(function(){r.call(this,t),this._deferredRenders[e]=n.without(this._deferredRenders[e],o)},this),i*(s+1)),void this._deferredRenders[e].push(o))},this)},_cancelBatchRenders:function(e){n.isEmpty(this._deferredRenders)||(n.isEmpty(e)||n.has(this._deferredRenders,e))&&(n.isEmpty(e)?(n.each(this._deferredRenders,function(e,t){n.each(e,function(e){clearTimeout(e)},this)},this),this._deferredRenders={}):(n.each(this._deferredRenders[e],function(e){clearTimeout(e)},this),this._deferredRenders[e].length=0))},_afterEachBatchRenderCollectionSubviews:function(e){this.trigger("batch:rendered:"+e)},_afterBatchRenderCollectionSubviews:function(e){this.trigger("rendered:"+e)},_attachCollectionListeners:function(e){var t=this._getSubviewCollection(e);t&&(this.listenTo(t,"add",n.partial(this.addNewCollectionSubview,e)),this.listenTo(t,"remove",n.partial(this.removeCollectionSubview,e)),this.listenTo(t,"reset",n.partial(this.renderCollectionSubviews,e)),this.listenTo(t,"update",n.partial(this.sortCollectionSubviews,e)))},_getSubviewCollection:function(e){var t=n.get(this.subviews[e],"collection");return t===!0?this.collection:n.isFunction(t)?t(this):t?t:null},_createDefaultPrepareViewForAddFunction:function(e){var t=this.subviews[e];return n.bind(function(i,s){var o=i.children(),r=new t.constructor(s),a=s.insertionIndex;return r.$el.attr("data-subview",e),n.isNumber(a)&&a',""),n.compact([t,s]).join(": ")},_safeTruncateMessage:function(e){var t=this.js$("message"),i=this.js$("message-text"),s=function(){a(t),n.isFunction(e)&&e.call(this,i.html())};t.height()?s.call(this):(this.$el.css("visibility","hidden"),n.defer(n.bind(function(){this.rendered&&(s.call(this),this.$el.css("visibility",""))},this)))},_isLastMessageFromSelf:function(e){return!n.isEmpty(e)&&!n.isEmpty(this.otherParticipant)&&this.otherParticipant.get("uuid")!==e.get("uuid")},_getAdditionalBlogName:function(e){var t;return n.isEmpty(e)?null:(t=this.getMessageParticipant(e),n.isEmpty(t)?null:this._isLastMessageFromSelf(t)?t.get("name"):null)},_onChangeTimestamps:function(e){this.set("currentMessage",this.model.getInboxMessage())},_onChangeCurrentMessage:function(e,t){var i=this.getMessageParticipant(t),s=t.get("truncatedText");this.$el.toggleClass("is-unread",this.model.isUnread()&&!this._isLastMessageFromSelf(i)),n.isEmpty(s)?(this.js$("message-text").html(this._getEscapedMessageMarkup(t)),this._safeTruncateMessage(function(e){t.set("truncatedText",e)})):this.js$("message-text").html(s)},_onClickConversation:function(e){e.preventDefault(),this.openConversation()},_getOwnSortedBlogIds:function(){return this.channels.getSortedIds(this.currentBlogModel.getId())}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
',__p+=blogIsAdult&&isSafeModeEnabled&&!isUser?' ':' ',__p+='

'+__e(name)+'

'+(null==(__t=message)?"":__t)+"

";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";function n(e,t){return e.scrollHeight-t.maxHeight<5}function s(e){return parseInt(c(e).css("max-height"),10)}function o(e,t,i){var s,o=e.nodeValue,r=l.get(t,"truncationString","..."),a="",c="",u=0,h=o.length;if(n(i,t))return!0;for(;u<=h;)s=u+h>>>1,a=l.trimRight(o.substring(0,s))+r,e.nodeValue=a,n(i,t)?(u=s+1,a.length>c.length&&(c=a)):h=s-1;return c.length>0?(e.nodeValue=c,!0):(e.nodeValue="",!1)}function r(e,t,i){var n=c(e).contents();l.each(n.get().reverse(),function(e){e.nodeType===Node.TEXT_NODE?o(e,t,i):r(e,t,i)})}function a(e,t){if(t=t||{},l.defaults(t,{truncationString:"..."}),e instanceof c&&(e=e.get(0)),l.has(t,"maxHeight")||l.extend(t,{maxHeight:s(e)}),l.isFinite(l.get(t,"maxHeight"))&&!n(e,t))return r(e,t,e)}var l=i(3),c=i(8);e.exports=a},function(e,t,i){"use strict";var n=i(130),s=i(226),o=i(687),r=s.extend({template:o,className:"status-indicator-wrapper",initialize:function(e){this.set({isOnline:e.isOnline&&e.canSeeUIFlag,ariaText:n("%1$s is online",e.name)})},render:function(){return this.get("isOnline")?s.prototype.render.call(this):this}});e.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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(485),o=s.extend({defaults:n.defaults({isDisabled:!1,isAtTop:!1,isAtBottom:!1,topThreshold:50,bottomThreshold:50},s.prototype.defaults),initialize:function(e){return this.options=e||{},s.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),s.prototype.render.apply(this,arguments)},_stealScroll:function(e){return this.get("isDisabled")?(e.preventDefault(),void e.stopPropagation()):s.prototype._stealScroll.apply(this,arguments)},update:function(){return this._updateInfiniteScrollFlags(),s.prototype.update.apply(this,arguments)},_onScrollStop:function(){return this._updateInfiniteScrollFlags(),s.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(e){return this._isUserScroll()&&!this.get("isDisabled")&&this._currentScrollTop<=e&&this._currentHeight>e},_isAtBottom:function(e){return this._isUserScroll()&&!this.get("isDisabled")&&this._currentScrollBottom<=e&&this._currentHeight>e},_isUserScroll:function(){var e,t=5;return!!n.isFinite(this._previousScrollHeight)&&(e=Math.abs(this._currentScrollHeight-this._previousScrollHeight),e<=t)},setDisabled:function(e){this.set("isDisabled",e)},isDisabled:function(){return this.get("isDisabled")},_setCurrentPositions:function(){var e=this.container;this._previousScrollHeight=this._currentScrollHeight,this._currentScrollHeight=e.scrollHeight,this._currentHeight=e.clientHeight,this._currentScrollBottom=e.scrollHeight-e.scrollTop-this.container.clientHeight,this._currentScrollTop=e.scrollTop},_updateInfiniteScrollFlags:function(){return!this.destroyed&&(this._setCurrentPositions(),void this.set({isAtTop:this._isAtTop(this.get("topThreshold")),isAtBottom:this._isAtBottom(this.get("bottomThreshold"))}))},_changeIsAtTop:function(e,t){this.trigger("scrolltop",t)},_changeIsAtBottom:function(e,t){this.trigger("scrollbottom",t)}});e.exports=o},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(682),r=i(277),a=i(232),l=i(471),c=i(690),u=i(692),h=s.extend({className:"inbox-recipients",template:u,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:c,options:function(e){return{eventBus:e.eventBus,onSelect:n.bind(e._onSubviewSelect,e),onClear:n.bind(e._onSubviewClear,e),context:e.context,isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}},collection:function(e){return e.collection}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection","title","context","isNewEmptyInboxEnabled")),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(e){this.$el.toggle(e),e&&this.deselect(this.keyboardViewName)},_onChangeSelectedView:function(e,t){var i=this.previous("selectedView");i&&i.setSelected(!1),t&&t.setSelected(!0)},_onChangeIsEmpty:function(e,t){this.get("showMessageOnEmpty")?this.js$("no-results-container").toggle(t):(this.js$("container").toggle(!t),this.js$("no-results-container").hide())},_shuffleNoResultsText:function(){this.js$("no-results-text").text(this.collection.getNoResultsFoundMessage())},_onCollectionSort:function(){this.renderCollectionSubviews("recipients")},_onCollectionChange:function(e){this.set("isEmpty",0===e.length),this.deselect(this.keyboardViewName)},_onCollectionSync:function(e){0===e.length&&this.get("showMessageOnEmpty")&&this._shuffleNoResultsText()},_onSubviewSelect:function(e){this.set("selectedView",e),this.setSelectedIndex(this.keyboardViewName,n.indexOf(this.recipients,e))},_onSubviewClear:function(e){this.set("selectedView",null),this.deselect(this.keyboardViewName)},_onKeyPressDown:function(e){var t;e.preventDefault(),t=this.isLastSelected(this.keyboardViewName)?this.selectFirst(this.keyboardViewName):this.selectNext(this.keyboardViewName),this.set("selectedView",t)},_onKeyPressUp:function(e){var t;e.preventDefault(),t=this.isFirstSelected(this.keyboardViewName)?this.selectLast(this.keyboardViewName):this.selectPrevious(this.keyboardViewName),this.set("selectedView",t)},_onKeyPressEnter:function(e){var t,i=this.get("selectedView");e.preventDefault(),i?t=i.model:1===this.collection.length&&(t=this.collection.first()),t&&this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[t],this.context)}});e.exports=h},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(262),r=i(685),a=i(277),l=i(180),c=i(226),u=i(182),h=i(691),d=c.extend({className:"inbox-recipient",template:h,mixins:[a],defaults:{isSelected:!1,context:"inbox:recipients"},events:{"click [data-start-conversation]":"_onStartConversationClick",mouseenter:"_onRecipientHover",mouseleave:"_onRecipientLeave"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","onSelect","onClear","context","isNewEmptyInboxEnabled"))},afterRender:function(){this.listenTo(this,"change:isSelected",this._onChangeIsSelected),this.isNewEmptyInboxEnabled&&r(this.js$("tags-string"));var e=this.$el.find(".pixelated-avatar");n.each(e,n.bind(function(e){this.$(e).removeClass("hide").addClass("show"),o.drawPixelatedImages(this)},this))},setSelected:function(e){this.rendered&&this.set("isSelected",e)},getTemplateData:function(){var e=u(),t=this.model.get("is_adult"),i=n.pluck(e.get("channels"),"name"),s=n.contains(i,this.model.get("name")),o=l.bool("safe_mode")&&e.get("safe_mode");return{name:this.model.get("name"),title:this.model.get("title"),avatarUrl:this.model.getAvatarUrl(),isNewEmptyInboxEnabled:this.isNewEmptyInboxEnabled,tagsString:this.getTagsString(),isSafeModeEnabled:o,isUser:s,blogIsAdult:t}},getTagsString:function(){var e=this.model.get("tags");return n.isEmpty(e)?null:e.length>1?s("Posts about #%1$s and #%2$s",e[0],e[1]):1===e.length?s("Posts about #%1$s",e[0]):void 0},_onStartConversationClick:function(e){e.preventDefault(),this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[this.model],this.get("context")),this.isNewEmptyInboxEnabled&&this.eventBus.trigger(this.eventBus.NEW_EMPTY_INBOX_SUGGESTION_CLICK,this.model,this.get("context"),!0)},_onChangeIsSelected:function(e,t){this.$el.toggleClass("selected",t)},_onRecipientHover:function(){n.isFunction(this.onSelect)&&this.onSelect(this,this.model)},_onRecipientLeave:function(){n.isFunction(this.onClear)&&this.onClear(this,this.model)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+=' ',__p+=blogIsAdult&&isSafeModeEnabled&&!isUser?' ':' ',__p+='
',__p+=isNewEmptyInboxEnabled?"

"+__e(name)+'

'+__e(tagsString)+'

":"

"+__e(name)+"

"+__e(title)+"

",__p+="
";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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+="
",title&&(__p+="

"+__e(title)+"

"),__p+='

'+__e(noResultsText)+"

";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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(695),r=i(701),a=i(703),l=s.extend({className:"inbox-header",template:a,defaults:{isComposing:!1},subviews:{senderView:{constructor:o,options:function(e){return{eventBus:e.eventBus,user:e.user,channels:e.channels,popoverContainer:e.popoverContainer,currentBlogModel:e.currentBlogModel}}},composeToggleView:{constructor:r,options:function(e){return{eventBus:e.eventBus,isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","user","channels","popoverContainer","currentBlogModel","isNewEmptyInboxEnabled"))},afterRenderSubviews:function(){this.listenTo(this.composeToggleView,"change:isComposing",function(e,t){this.set("isComposing",t)}),this.listenTo(this,"change:isComposing",function(e,t){this.composeToggleView.set("isComposing",t)})}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(696),r=i(700),a=s.extend({className:"inbox-sender",template:r,subviews:{blogSelector:{constructor:o,options:function(e){return{className:"inbox-sender-blog-selector",collection:e.channels,popoverOptions:{popoverContainer:e.popoverContainer},currentTumblelog:e.channels.findWhere({uuid:e.currentBlogModel.getId()}),badgeCountField:"unread_messages_count_sum"}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","user","channels","currentBlogModel","popoverContainer"))},afterRenderSubviews:function(){this.listenTo(this.blogSelector,"change:currentTumblelog",this._onBlogSelectorChange)},_onBlogSelectorChange:function(e,t){this.currentBlogModel.setChannel(t)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(697),r=i(698),a=i(277),l=i(250),c=s.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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"collection")),this.get("currentTumblelog")||this.set("currentTumblelog",this.collection.findWhere({is_current:!0})),this.set("requiresDropdown",this.collection.length>1),!n.isEmpty(this.get("badgeCountField"))&&this.get("requiresDropdown")||this.set("showTotalBadge",!1)},getTemplateData:function(){var e=this.get("showTotalBadge"),t=e&&this.get("showNumberInBadge"),i=e?this.getBadgeCount():null;return{avatarUrl:l(this.getCurrentTumblelogProperty("avatar_url"),this.get("avatarSize")),displayName:this.getCurrentTumblelogProperty("name"),requiresDropdown:this.get("requiresDropdown"),hasBadge:e&&i>0,badgeCountString:t?this.getBadgeCountString(i):null}},createDropdown:function(){var e=n.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(e),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(e,t){this.js$("caret").toggleClass("is-open",t)},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(e){var t=this.getCurrentTumblelog();if(t&&t.has(e)&&n.isString(e))return t.get(e)},adjustCurrentTumblelog:function(){var e;this.set("currentTumblelog",this.dropdown.get("currentTumblelog")),this.rendered&&(e=l(this.getCurrentTumblelogProperty("avatar_url"),this.get("avatarSize")),this.js$("avatar").attr("src",e),this.js$("label").text(this.getCurrentTumblelogProperty("name")),this.get("showTotalBadge")&&!this.get("includeCurrentBlogInTotalBadge")&&this._onBadgeCountChange())},teardown:function(){return this.remove(),this},getBadgeCount:function(){var e,t=this.get("currentTumblelog");return this.get("badgeCountField")?(e=n.sum(this.collection.pluck(this.get("badgeCountField"))),t&&!this.get("includeCurrentBlogInTotalBadge")&&(e-=t.get(this.get("badgeCountField"))),Math.max(0,e)):null},getBadgeCountString:function(e){var t=this.get("maxBadgeCount");return e>t?t+"+":e>0?e:""},updateBadge:function(e){var t=this.js$("badge");t.toggleClass(this.get("badgeActiveClass"),e>0),this.get("showNumberInBadge")&&t.text(this.getBadgeCountString(e))},_onBadgeCountChange:function(){this.updateBadge(this.getBadgeCount())},_onChangeShowCaret:function(e,t){this.js$("caret").toggle(t)},_onChangeShowName:function(e,t){this.js$("label").toggle(t)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
'+(null==(__t=displayName)? '+(null==(__t=displayName)?"":__t)+" ",requiresDropdown&&(__p+=' ',badgeCountString&&(__p+=__e(badgeCountString)),__p+=" "),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(699),r=i(283),a=i(277),l=i(250),c=i(485),u=s.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(e){if(e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"collection")),!this.get("currentTumblelog")){var t=this.collection.findWhere({is_current:!0});this.set("currentTumblelog",t)}},selectBlog:function(e){var t=this.$(e.currentTarget).index();this.set("currentTumblelog",this.collection.at(t)),this.teardown()},createScrollbar:function(){this.scrollbar||(this.scrollbar=new c(this.js$("scrollbar")))},afterRender:function(){return this.js$("scrollbar").addClass("popover-sublist popover-sublist--scrollable"),n.defer(n.bind(this.createScrollbar,this)),this.delegateEvents(),this.isShowBadges()&&this.listenTo(this.collection,"change:"+this.get("badgeCountField"),this._onBadgeCountChange),this},isShowBadges:function(){return!n.isEmpty(this.get("badgeCountField"))},getBadgeCount:function(e){return this.get("badgeCountField")&&e?e.get(this.get("badgeCountField")):null},getBadgeCountString:function(e){var t=this.get("maxBadgeCount");return e<=0?"":e>t?t+"+":e},getTemplateData:function(){var e,t=this.toJSON(),i=this.get("currentTumblelog");return i&&n.extend(t,{currentTumblelog:i.get("name")}),e=this.collection.map(function(e){return n.extend({avatarUrl:l(e.get("avatar_url"),this.get("avatarSize")),displayName:e.getDisplayName(),badgeCountString:this.getBadgeCountString(this.getBadgeCount(e))},e.toJSON())},this),n.extend(t,{channels:e,isShowBadges:this.isShowBadges()}),t},beforeTeardown:function(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.stopListening()},teardown:function(){return this.remove()},updateBadge:function(e){var t,i=this.$$("[data-js-channel-badge="+e.get("name")+"]");0!==i.length&&(t=this.getBadgeCount(e),i.toggleClass(this.get("badgeActiveClass"),t>0),t>0&&i.find("[data-js-channel-badge-text]").text(this.getBadgeCountString(t)))},_onBadgeCountChange:function(e){return this.updateBadge(e)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
    ',_.forEach(channels,function(e){__p+='
  • '+__e(e.name)+' ',isShowBadges&&(__p+=' '+__e(e.badgeCountString)+" "),__p+='

    '+__e(e.displayName)+'

    '+(null==(__t=e.directory_safe_title)?"":__t)+"

  • "}),__p+="
";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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(702),a=o.extend({className:"inbox-compose-toggle",template:r,defaults:{isComposing:!1},events:{"click [data-js-compose-toggle]":"_onClickToggleCompose"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","isNewEmptyInboxEnabled"))},afterRender:function(){this.listenTo(this,"change:isComposing",this._onChangeIsComposing)},getTemplateData:function(){return{message:s(this.isNewEmptyInboxEnabled?"New Message":"Compose message")}},_onChangeIsComposing:function(e,t){this.$el.toggleClass("active",t)},_onClickToggleCompose:function(e){var t=void 0;e.preventDefault(),this.set("isComposing",!this.get("isComposing")),t=this.isNewEmptyInboxEnabled?this.eventBus.NEW_EMPTY_INBOX_NEW_MESSAGE_CLICK:this.eventBus.OLD_EMPTY_INBOX_NEW_MESSAGE_CLICK,this.eventBus.trigger(t,this.isNewEmptyInboxEnabled)}});e.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+=''+__e(message)+''+__e(__("Nevermind"))+"";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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(130),r=i(226),a=i(277),l=i(705),c=i(689),u=i(489),h=i(707),d=r.extend({className:"inbox-compose",template:h,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:c,options:function(e){return{showMessageOnEmpty:!1,eventBus:e.eventBus,collection:e.favoritesCollection,title:o(e.isNewEmptyInboxEnabled?"Recently Followed":"Favorites"),context:"inbox:favorites",isNewEmptyInboxEnabled:e.isNewEmptyInboxEnabled}}},searchResultView:{constructor:c,options:function(e){return{eventBus:e.eventBus,collection:e.collection,context:"inbox:typeahead"}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","favoritesCollection","currentBlogModel","keyboardManager","isNewEmptyInboxEnabled")),this.collection=new l,this._debouncedSearch=n.bind(n.debounce(this._search,250),this)},afterRenderSubviews:function(){this.loader=new u({$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(e,t){this._setKeyboardState()},fetchResults:function(e){var t=this.currentBlogModel.getChannel().get("uuid");return this.set("isLoading",!0),this.collection.fetchByQuery(e,t).always(n.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(e){n.isEmpty(e)?this.set("isShowFavorites",!0):this.fetchResults(e)},_onTextInputChange:function(e){this._debouncedSearch(s(e.target).val())},_onTextInputBlur:function(e){this.set("hasEditorFocus",!1)},_onTextInputFocus:function(e){this.set("hasEditorFocus",!0)},_onChangeIsShowFavorites:function(e,t){this.favoritesView.toggle(t),this.searchResultView.toggle(!t),this._setKeyboardState()},_onChangeIsLoading:function(e,t){return this._loaderTimeout&&(clearTimeout(this._loaderTimeout),this._loaderTimeout=null),t?void(this._loaderTimeout=setTimeout(n.bind(function(){this.loader.set("loading",!0)},this),this.get("showLoadingAfterMs"))):this.loader.set("loading",!1)}});e.exports=d},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(130),r=i(190),a=i(670),l=i(706),c=r.extend({url:"/svc/conversations/participant_suggestions",model:a,resultCache:{},fetchFlags:["empty","post"],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(e,t){return s.get(e,"response.blogs")||e},fetchByQuery:function(e,t,i){return i=i||{},s.extend(i,{reset:!0,data:{q:e,participant:t}}),this.fetch(i)},fetchFavorites:function(e,t,i,n,o,r){return e=e||8,r=r||{},s.extend(r,{reset:!0,data:{limit:e,participant:t,include_recent:i,exclude_active:n},flag:o}),this.fetch(r)},fetch:function(e){var t=JSON.stringify(s.get(e,"data")),i=s.get(e,"flag",""),o=new n.Deferred,a=s.get(this.resultCache,t);return this.cancelFetch(),a&&this.fetchFlags.indexOf(i)!==-1?(this.reset(a),this.trigger("sync",this),o.resolve(),o):(this._request=r.prototype.fetch.apply(this,arguments),this._request.then(s.bind(function(e){this.fetchFlags.indexOf(i)!==-1&&s.set(this.resultCache,t,this.parse(e))},this)).always(s.bind(function(){this._request=null},this)),this._request)},cancelFetch:function(){this._request&&(this._request.abort(),this._request=null)}});e.exports=c},function(e,t,i){"use strict";function n(e){var t,i;return e=e||[],function(){return s.isEmpty(t)&&(t=s.shuffle(e),s.isEmpty(i)||(t=s.without(t,i))),i=t.pop()}}var s=i(3);e.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 __t,__p="",__e=_.escape;with(obj)__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(277),r=i(226),a=i(709),l=i(711),c=r.extend({className:"inbox-empty",template:l,mixins:[o],subviews:{blogsView:{constructor:a,options:function(e){return{collection:e.collection,eventBus:e.eventBus}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection"))},getTemplateData:function(){return{header:s("Talk to a Tumblr")}},toggle:function(e){this.$el.toggle(e)}});e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(710),a=o.extend({className:"inbox-empty-blogs",template:r,defaults:{numItemsPerRow:4},events:{"click [data-js-start-conversation]":"_onStartConversation"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection"))},afterRender:function(){this.listenTo(this.collection,"update reset",this.render)},getTemplateData:function(){var e,t=this.get("numItemsPerRow"),i=n.map(this.collection.models,function(e){return n.extend(e.toJSON(),{avatarUrl:e.getAvatarUrl()})});return i.length>0&&(e=Math.max(1,Math.floor(i.length/t)),i=i.slice(0,e*t)),{blogs:i}},_onStartConversation:function(e){var t=s(e.currentTarget).attr("data-js-start-conversation"),i=this.collection.findWhere({name:t});this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[i],"inbox:empty"),this.eventBus.trigger(this.eventBus.OLD_EMPTY_INBOX_SUGGESTION_CLICK,i,"old:inbox:empty",!1),e.preventDefault()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)_.isEmpty(blogs)||(__p+='
',_.each(blogs,function(e){__p+=' '+__e(e.name)+' '}),__p+="
");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="",__e=_.escape;with(obj)__p+='

'+__e(header)+'

';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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__j=Array.prototype.join;with(obj)__p+='
',isNewEmptyInboxEnabled&&(__p+='
'),__p+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(235),r=i(130),a=i(226),l=i(331),c=i(277),u=i(220).animation,h=i(430),d=i(136),p=i(714),g=i(716),f=i(742),_=i(744),m=i(748),v=i(751),b=i(753),y=i(728),w=i(658),C=i(755),k=i(758),x=i(720).html,S=i(706),T=i(760),E=i(765),P=i(768),I=a.extend({template:P,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,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,canModifySafeMode:!0,isProjectXEnabled:!1},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:[c],subviews:{conversationLoaderView:{constructor:l,options:{variation:"small centered",loading:!1}},headerView:{constructor:p,options:function(e){return{eventBus:e.eventBus,participants:e.sortedParticipants,theme:e.theme,channels:e.channels,user:e.user}}},messagesView:{constructor:g,options:function(e){return{eventBus:e.eventBus,collection:e.model.get("messages"),participants:e.model.get("participants"),conversation:e.model,isSafeModeEnabled:e.isSafeModeEnabled,messageFormatter:e.messageFormatter,animateInMessage:n.bind(e._animateInMessage,e),otherParticipant:e.otherParticipant,canModifySafeMode:e.canModifySafeMode,isProjectXEnabled:e.isProjectXEnabled}}},previewView:{constructor:_,options:function(e){return{animateInDurationMs:e.get("imagePreviewAnimateInDurationMs"),animateOutDurationMs:e.get("imagePreviewAnimateOutDurationMs"),animateInEasing:e.get("imagePreviewAnimateInEasing"),animateOutEasing:e.get("imagePreviewAnimateOutEasing")}}},composeView:{constructor:m,options:function(e){return{eventBus:e.eventBus,keyboardManager:e.keyboardManager,keyboardNamespace:e.keyboardNamespace+":compose",pluginsArray:e.getPluginsArray(),pluginAnimateInDurationMs:e.get("imagePreviewAnimateOutDurationMs"),pluginAnimateOutDurationMs:e.get("imagePreviewAnimateInDurationMs"),pluginAnimateInEasing:e.get("imagePreviewAnimateOutEasing"),pluginAnimateOutEasing:e.get("imagePreviewAnimateInEasing")}}},minimizedView:{constructor:v,options:function(e){return{eventBus:e.eventBus,model:e.model}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","user","model","channels","messageFormatter","popoverContainer","keyboardManager","collection","isSafeModeEnabled","canModifySafeMode","isProjectXEnabled")),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.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.js$("conversation-open").toggleClass(this.get("noBlurSupportClass"),!h.cssFilters())},beforeRemove:function(){this.conversation.get("messages").reset(this.conversation.getInboxMessage()),this.keyboardManager.remove(this.keyboardNamespace),this.trigger("close")},fetch:function(e){return e=e||{},n.extend(e,{error:n.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(e).then(n.bind(this._onFetchConversationSuccess,this)).always(n.bind(this._onFetchConversationAlways,this))},poll:function(e,t){return e=e||{},this.eventBus.trigger(this.eventBus.CONVERSATION_FETCHING,this.conversation),this.conversation.poll(e,t).then(n.bind(function(){this.messagesView.scrollToBottom()},this))},refresh:function(e){this._queueMessages(e.getQueueItems()),this.unminimize(),this.focus()},focus:function(){return this.isMinimized()?this.focusMinimized():this.focusCompose(),this},getImageUploadMaxBytes:function(){return this.get("imageUploadMaxBytes")},getPluginsArray:function(){var e=[];return e.push(new T({collection:this.collection})),n.isEmpty(this.imageUploadPlugin)||e.push(this.imageUploadPlugin),e},isMinimized:function(){return this.get("isMinimized")},focusMinimized:function(){this.minimizedView&&this.minimizedView.focus()},focusCompose:function(){this.composeView&&this.composeView.focus()},toggleMinimize:function(e,t){var i,o,r,a=new s.Deferred,l=this.get("minimizeOpeningClass"),c=this.get("minimizeClosingClass"),u=this.js$("conversation-open"),h=this.js$("conversation-minimized"),d=[a];return e===this.isMinimized()?(new s.Deferred).resolve():(i=function(){this.set("isMinimized",e)},o=function(){a.resolve()},t?(i.call(this),o.call(this)):e?this._addAnimationClass(u,c).then(n.bind(function(){i.call(this),this._addAnimationClass(h,l).then(n.bind(o,this))},this)):this._addAnimationClass(h,c).then(n.bind(function(){i.call(this),this._addAnimationClass(u,l).then(n.bind(o,this))},this)),e||this.get("isFetched")||(r=this.fetch(),d.push(r)),s.when.apply(s,d))},minimize:function(e){return this.toggleMinimize(!0,e)},unminimize:function(e){return this.toggleMinimize(!1,e)},_showError:function(e){var t,i,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.conversationErrorView&&this.conversationErrorView.remove(),i=this.js$("main"),t=new b(e),i.append(t.render().$el),this.conversationErrorView=t,this.set({isOffline:n,isError:!0}),this._applyTheme(t.el),t},_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.set(this.conversation.getOtherParticipant().toJSON()),this.messagesView.statusBannerView.trigger("setActiveTime",this.otherParticipant.get("seconds_since_last_activity")),this.minimizedView.trigger("setIsOnline",this.otherParticipant.get("seconds_since_last_activity")!==-1),this._queueMessages(this._pendingQueueItems),this._pendingQueueItems=null,this.conversation.get("messages").hasNextPage()||(this.set("isFetchingIcebreakers",!0),this._createIcebreakersView().always(n.bind(function(){this.set("isFetchingIcebreakers",!1),this.focus()},this))))},_flushMessageQueue:function(){var e;return this.conversation.hasQueue()?(e=this.conversation.getQueueItems(),this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_SEND_REQUESTED,e,this.conversation),this.conversation.isFlushingQueue()?this._flushDefer:(this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_SENDING,e,this.conversation),this._flushDefer=this.conversation.flushMessageQueue().progress(n.bind(this._onFlushProgress,this)).fail(n.bind(this._onFlushFail,this)).always(n.bind(this._onFlushAlways,this)),this._flushDefer)):(new s.Deferred).reject()},_onFlushProgress:function(e,t){this.rendered&&this.set("isHidePendingPost",!t&&!this._canRenderPendingMessage(e)),t?this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_SENT,e,this.conversation):this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_SENDING,e,this.conversation)},_onFlushFail:function(e){this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_FAILED,e,this.conversation),this.rendered&&(this._canRenderPendingMessage(e)||(this.conversation.get("messages").remove(e),this._showPostSendingError(e)),this._flushMessageQueue())},_onFlushAlways:function(){this.rendered&&(this.set("isHidePendingPost",!1),this.focus())},_onFetchConversationFail:function(e,t){var i,s=t.status,o=n.get(t,"responseJSON.errors.0.code");this.rendered&&(n.isFinite(o)&&o>0&&(i=this.customErrorMessages[s+"."+o]),n.isEmpty(i)&&(i=n.get(this.customErrorMessages,s,this.getGenericErrorMessage())),this._showError({message:i,buttonCallback:n.bind(this._onConversationErrorRetryClick,this),showButton:e.canRetryFetch(n.get(t,"status"))}))},_showPostSendingError:function(e){var t,i,s;if(this.rendered){if(!e.canRetry())return t=this.permanentPostErrorMessage,i=r("Close"),s=this._onPostSendingErrorCloseClick,void this._showError({message:t,buttonCallback:n.bind(s,this),buttonText:i},!1);t=this.getRetryPostErrorMessage(),s=n.partial(this._onPostSendingErrorRetryClick,e),this._showError({message:t,buttonCallback:n.bind(s,this),buttonText:i})}},_onPostSendingErrorCloseClick:function(){this._hideError()},_onPostSendingErrorRetryClick:function(e){this._resendMessage(e).then(n.bind(function(){this._hideError()},this))},_onFetchConversationAlways:function(){this.rendered&&this.set("isFetching",!1)},_onComposeSubmit:function(e,t){var i,s,o=this.previewView.getMessage(),r=!n.isEmpty(e),a=!n.isEmpty(o);r&&(i=w.createTextMessage(e,{hasAnimation:!0,creationUserAction:t})),a&&(o.set({isFromPreview:!0,hasAnimation:!0,creationUserAction:t}),r&&i.set({context:o.get("context")})),s=n.compact([o,i]),a?this.previewView.close().then(n.bind(function(){n.delay(n.bind(function(){this.rendered&&this._queueMessages(s)},this),150)},this)):this._queueMessages(s),this.messagesView.scrollToBottom()},_canRenderPendingMessage:function(e){return!n.isEmpty(e)&&(!e.isPost()||e.getPost().hasThumbnail())},_queueMessages:function(e,t){return n.isEmpty(e)?(new s.Deferred).reject():(t=n.extend({},t,{isSendingMessage:!0}),n.isArray(e)||(e=[e]),n.each(e,n.bind(function(e){e.set("isQueued",!0),this.conversation.addMessage(e,t)},this)),this.conversation.appendToQueue(e,t),this._flushMessageQueue())},_resendMessage:function(e){var t=this.conversation.get("messages");return t.last()!==e&&t.remove(e),this._queueMessages(e)},_onComposeResize:function(){this.messagesView.updateScrollBar()},_onComposeInput:function(e,t){this.trigger("compose:input",e,t),this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_INPUT,this.conversation,e)},_onComposeFocus:function(e){this.trigger("compose:focus",e)},_onComposeBlur:function(e){this.trigger("compose:blur",e)},_onComposePasteBlob:function(e){this._isFileDropEnabled()&&this._addImageToFilePreview(e,"clipboard")},_onChangeId:function(e){e.isNew()||this.trigger("created",e)},_onChangeUnreadCount:function(e,t){0===t||this.isMinimized()||(this.messagesView.isAtBottom()?this._fetchUnreadMessages().then(n.bind(function(){this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_UNREAD_FETCHED)},this)):this.messagesView.showPill(t).then(n.bind(this._fetchUnreadMessages,this)).catch(n.noop))},_fetchUnreadMessages:function(){var e=this.conversation.get("unreadCount"),t=Math.min(10,e+5);return 0===e?(new s.Deferred).reject():(this.conversation.markAsRead(),this.poll(null,t))},_getSortedParticipantsCopy:function(){var e=this.conversation.get("participants"),t=this.channels.getSortedIds(this.conversation.get("participantUuid")),i=e.getSortedByChannels(t,!0);return new e.constructor(i)},_setLoadingState:function(){var e=this.get("isFetching")||this.get("isHidePendingPost")||this.get("isFetchingIcebreakers");this.set("isLoading",!this.get("isError")&&e)},_setMainViewStates:function(){var e=this.get("isMinimized"),t=this.js$("conversation-open"),i=this.js$("conversation-minimized");t.toggle(!e),i.toggle(e),e?i.css("display",""):t.css("display","")},_setOpenViewStates:function(){var e=this.get("isError"),t=this.get("isLoading");this.messagesView.toggle(!e&&!t),this.composeView.set("isDisabled",e||t),this.conversationLoaderView.set("loading",t)},_setDragDropClasses:function(){var e=this.get("droppingClassName"),t=this.get("isCurrentDropValid"),i=this.get("isDropping"),n=this._isFileDropEnabled(),s=n&&i&&t;this.js$("conversation-open").toggleClass(e,s),this.js$("conversation-minimized").toggleClass(e,s)},_createIcebreakersView:function(){var e;return this.icebreakersView?(e=new s.Deferred,e.reject(),e):this.otherParticipant.fetchAdditionalInfo(this.conversation.getParticipantId()).then(n.bind(function(){var e;this.rendered&&(e=this.conversation.isNew(),this.icebreakersView=new k({participant:this.otherParticipant,isShowTags:e,isShowRelationship:!e,isShowDescription:!e}),this.messagesView.addHeaderView(this.icebreakersView))},this))},_onTriggeredClose:function(){this.trigger("close")},_onHeaderMoreActions:function(e){this.actionsPopover&&this.actionsPopover.isOrWasRecentlyRendered()||this._showMoreActionsPopover(e)},_onHeaderMinimizeClick:function(){this.minimize()},_onMinimizedViewClick:function(){this.unminimize()},_onPillClick:function(){this.focus()},_onBlogClick:function(e){var t=s(e.currentTarget);this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_TUMBLR_URL,{blogName:t.attr("data-js-tumblelog-name"),postId:t.attr("data-js-post-id"),searchTagTerm:t.attr("data-js-tumblelog-tag"),url:t.attr("href"),originalEvent:e,otherParticipant:this.otherParticipant})},_onMessagingBlogClick:function(e){var t=s(e.currentTarget);this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_MESSAGING_URL,{blogName:t.attr("data-js-messaging-tumblelog-name"),url:t.attr("href"),originalEvent:e})},_onImageLightboxUrlClick:function(e){e.preventDefault();var t,i=s(e.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");n.isEmpty(a)||n.isEmpty(l)||(t={width:o,height:r,low_res:a,high_res:l},n.get(t,"low_res")&&(this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_LIGHTBOX,{lightBoxImageData:[t]}),this.composeView.set("isLightboxOpen",!0)))},_onActionsBlock:function(e){var t=this.conversation.getParticipantModel();n.isEmpty(t)||this.eventBus.trigger(this.eventBus.BLOCK,{currentTumblelog:t.get("name"),blockedTumblelog:e,context:"messaging"},this.conversation)},_onActionsDelete:function(){this.eventBus.trigger(this.eventBus.CONVERSATION_DELETE_MODEL,this.conversation)},_applyTheme:function(e){var t;return n.isEmpty(this.otherParticipant)?null:(t=this.otherParticipant.get("theme"),n.isEmpty(t)?null:new y({el:e,theme:t}).render())},_showMoreActionsPopover:function(e){var t;this.actionsPopover&&this.actionsPopover.remove(),this.actionsPopover=new C({autoTeardown:!0,pinnedSide:"bottom",pinnedTarget:e,popoverContainer:this.popoverContainer,viewOptions:{participants:this.conversation.get("participants"),user:this.user}}),t=this.actionsPopover.getView(),this.listenTo(t,"block",this._onActionsBlock),this.listenTo(t,"delete",this._onActionsDelete),this.actionsPopover.render()},_animateInMessage:function(e,t,i){var s,r,a=e.$el,l=this.composeView.$el.offset(),c=a.offset(),u=Math.max(0,l.top-c.top)+a.height();i.get("isFromPreview")?s=0:(r=t.offset(),s=l.left-r.left),this.messagesView.setIsAnimating(!0),o.animate(a,{translateY:[0,u],translateX:[0,s],opacity:[1,1]},{duration:this.get("animateInMessageDuration"),easing:this.easeOutExpo,complete:n.bind(function(){this.messagesView.setIsAnimating(!1),i.set("hasAnimation",!1),a.css("transform","")},this)})},_addAnimationClass:function(e,t){var i=new s.Deferred;return e.removeClass(t),u(e,function(){e.removeClass(t),i.resolve()}),e.addClass(t),i},_addImageToFilePreview:function(e,t){var i=function(){this.imageUploadPlugin.addImageFile(e,t)};this.isMinimized()?this.unminimize().then(n.bind(i,this)):i.call(this)},_isFileDropEnabled:function(){return this.rendered&&!this.previewView.hasImage()&&this.get("canSend")&&!this.get("isError")},_onConversationErrorRetryClick:function(e){return this.fetch()},_onChangeIsOffline:function(e,t){this.composeView.set("isOffline",t)},_onMessageRetryClick:function(e){this._resendMessage(e)},_onMessageImageUnblur:function(e){this.conversation.unblurImages()},_onChangeConversationCanSend:function(e,t){this.set("canSend",t)},_onChangeConversationIsPossibleSpam:function(e,t){this.set("isPossibleSpam",t)},_onChangeCanSend:function(e,t){var i=r("This Tumblr can't receive messages.");this.composeView.toggle(t),!t&&this.canSendErrorView||t&&!this.canSendErrorView||(t?(this.messagesView.removeFooterView(this.canSendErrorView),delete this.canSendErrorView):(this.canSendErrorView=new f({message:i,showErrorIcon:!0}),this.messagesView.addFooterView(this.canSendErrorView)))},_onChangeIsPossibleSpam:function(e,t){t&&this.isPossibleSpamView||!t&&!this.isPossibleSpamView||(t?(this.isPossibleSpamView=new f({message:this.getSpamErrorMessage(),actionText:r("Mark as spam"),actionCallback:n.bind(this._onMarkAsSpamLinkClick,this)}),this.messagesView.addFooterView(this.isPossibleSpamView)):(this.messagesView.removeFooterView(this.isPossibleSpamView),delete this.isPossibleSpamView))},_onChangeIsMinimized:function(e,t){this._setMainViewStates(),t||n.defer(n.bind(function(){this.messagesView.updateScrollBar(),this.focus(),this.conversation.get("unreadCount")>0&&(this._fetchUnreadMessages(),this.messagesView.scrollToBottom())},this)),this.trigger(t?"minimized":"unminimized")},_onChangeIsDropping:function(e,t){this._setDragDropClasses()},_onChangeIsCurrentDropValid:function(e,t){this._setDragDropClasses()},_onMainContainerClick:function(){window.getSelection().isCollapsed&&this.focus()},_onKeyDown:function(e){var t=e.keyCode;9===t&&(e.shiftKey?this.trigger("keydown:shift+tab",e):this.trigger("keydown:tab",e))},_onDragOver:function(e){var t=n.get(e,"originalEvent.dataTransfer.types",[]),i=n.contains(t,"Files"),s=this._isFileDropEnabled();e.preventDefault(),this.set("isCurrentDropValid",i),n.set(e,"originalEvent.dataTransfer.dropEffect",i&&s?"copy":"none")},_onDragEnter:function(){this.dragCount++,this.set("isDropping",!0)},_onDragLeave:function(){this.dragCount--,this.set("isDropping",this.dragCount>0)},_onDragDrop:function(e){var t=n.get(e,"originalEvent.dataTransfer.files",[]);if(e.preventDefault(),this.dragCount=0,this.set("isDropping",!1),0!==t.length)return this.previewView.hasImage()?void(this.isMinimized()&&this.unminimize()):void(this._isFileDropEnabled()&&this._addImageToFilePreview(n.last(t),"drop"))},_onComposeViewPluginPreviewAddImage:function(e){this.previewView.addImage(e),this.messagesView.updateScrollBar(),this.composeView.toggleAutoValidation(!1),this.focus(),this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_ADD,this.conversation,e)},_onComposeViewPluginClick:function(e){this.eventBus.trigger(this.eventBus.CONVERSATION_COMPOSE_PLUGIN_CLICK,this.conversation,e)},_onPreviewViewClosing:function(e){this.focus()},_onPreviewViewClose:function(e){this.messagesView.updateScrollBar(),this.composeView.toggleAutoValidation(!0),this.focus()},_onPreviewViewDismiss:function(e){this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_DISMISS,this.conversation,e)},_onPreviewViewEdit:function(e){this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_EDIT,this.conversation,e)},_onMarkAsSpamLinkClick:function(){this.eventBus.trigger(this.eventBus.CONVERSATION_MARK_AS_SPAM,this.conversation,this.otherParticipant)},_onChangeMessagesHasNextPage:function(e,t){!this.rendered||this.conversation.isNew()||t||this._createIcebreakersView()},_onTumblrLightboxFormHide:function(){this.composeView.set("isLightboxOpen",!1)}});e.exports=I},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(277),r=i(715),a=s.extend({className:"conversation-header",template:r,mixins:[o],defaults:{separator:"+"},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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","participants","user","channels"))},getTemplateData:function(){var e;return e=this.channels.length>1?this.participants.toJSON():n.invoke(this.participants.getWithout(this.channels.pluck("uuid")),"toJSON"),e=n.filter(e,function(e){return!n.isEmpty(n.get(e,"name"))}),{participants:e,separator:this.get("separator")}},_onClickCloseButton:function(e){this.trigger("closeClick"),e.preventDefault()},_onClickMoreActions:function(e){var t=e.currentTarget;this.trigger("moreActionsClick",t),e.preventDefault()},_onClickMinimizeButton:function(e){this.trigger("minimizeClick"),e.preventDefault()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj){__p+='
';var lastIndex=participants.length-2;__p+=" ",_.each(participants,function(e,t){__p+=' '+__e(e.name)+" "+__e(t===lastIndex?" "+separator+" ":t'+__e(__("Minimize"))+''+__e(__("Close"))+"
"}return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(9),o=i(192),r=i(226),a=i(682),l=i(277),c=i(331),u=i(688),h=i(717),d=i(736),p=i(738),g=i(739),f=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:c,options:{variation:"small h-centered",loading:!1}},messagesView:{constructor:h,options:function(e){return{eventBus:e.eventBus,participants:e.participants,conversation:e.conversation,formatter:e.messageFormatter,animateInMessage:e.animateInMessage,isSafeModeEnabled:e.isSafeModeEnabled,afterRetryClick:n.bind(e.afterRetryClick,e),afterImageUnblur:n.bind(e.afterImageUnblur,e),canModifySafeMode:e.canModifySafeMode,isProjectXEnabled:e.isProjectXEnabled}},collection:function(e){return e.collection}},statusBannerView:{constructor:g,options:function(e){return{otherParticipant:e.otherParticipant,name:e.otherParticipant.get("name")}}},pillView:{constructor:d,options:function(e){return{eventBus:e.eventBus}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","collection","participants","conversation","messageFormatter","animateInMessage","isSafeModeEnabled","otherParticipant","canModifySafeMode","isProjectXEnabled"))},afterRenderSubviews:function(){this.scrollBar=new u({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()),n.defer(n.bind(function(){this._processMessages(),this.updateScrollBar(),this.scrollToBottom()},this))},beforeRemove:function(){this.scrollBar&&this.scrollBar.destroy()},scrollToBottom:function(e){this._setScrollTop(this.el.scrollHeight,e)},getNextPage:function(){this.collection.hasNextPage()&&(this.set("isPaginating",!0),this.collection.fetchNextPage({at:0,isPaginating:!0,scrollBottom:this._getCurrentScrollBottom()}).always(n.bind(function(){this.set("isPaginating",!1)},this)))},updateScrollBar:function(){var e,t=this.scrollBar.isDisabled();this.scrollBar.setDisabled(!0),this.scrollBar&&this.scrollBar.update(),e=this._getPositionDiff(),e&&this._setScrollTop(this.$el.scrollTop()+e.height+e.scrollTop),this._createPositionSnapshot(),this.scrollBar.setDisabled(t)},afterRetryClick:function(e){this.trigger("messageRetryClick",e)},afterImageUnblur:function(e){this.trigger("messageImageUnblur",e)},toggle:function(e){this.set("isVisible",e)},isAtBottom:function(){return!this._lastPosition||!this.scrollBar||this._lastPosition.scrollBottomi;return r?s(n).calendar():null},_getIsCollapsed:function(e,t,i,n){return e.has("collapseGroup")||e.set("collapseGroup",e.isNew()?"new":n),!!t&&(e.get("collapseGroup")===t.get("collapseGroup")&&(e.get("participant")===t.get("participant")&&e.getTimestamp()-t.getTimestamp()e/100*i&&t.addClass(this.get("fullWidthBubbleClass"))}});e.exports=u},function(e,t,i){"use strict";e.exports={html:i(721)}},function(e,t,i){"use strict";var n=i(3),s=i(722),o=i(723),r=s.extend({name:"html",formatters:{link:o},escape:function(e){return n.escape(e)},applyFormatting:function(e,t){var i=n.bind(this.escape,this),s=n.bind(this.getFormatter,this),o={};n.forEach(t,function(e){var t=s(e.type);if(t){var i=e.position,r=e.attributes,a=i[0],l=i[1];n.isEmpty(o[a])&&(o[a]=[]),n.isEmpty(o[l])&&(o[l]=[]),o[a].push(n.bind(t.open,this,r)),o[l].unshift(n.bind(t.close,this,r))}},this);var r,a,l=n.sortBy(n.keys(o),function(e){return n.parseInt(e)}),c="",u=0;return n.forEach(l,function(t){r=o[t],a=e.substr(u,t-u),c+=i(a),n.forEach(r,function(e){c+=e()}),u=t},this),a=e.substr(u),c+=i(a)}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(215),o=s.extend({name:"unknown",formatters:{},constructor:function(e){this.options=e||{},n.isFunction(this.formatters)?this.formatters=this.formatters():this.formatters=n.clone(this.formatters||{})},registerFormatter:function(e,t){this.formatters[e]=t},getFormatter:function(e){return n.result(this.formatters,e)},escape:function(e){return e},applyFormatting:function(e,t){return this.escape(e)},postFilter:function(e){return e},render:function(e,t){return this.postFilter(this.applyFormatting(e,t))}});e.exports=o},function(e,t,i){"use strict";function n(e){return s(e).omit(s.isUndefined).reduce(function(e,t,i){return(e?e+" ":"")+o('%s="%s"',s.escape(i),s.escape(t))},"")}var s=i(3),o=i(6).sprintf,r={open:function(e){var t=n({"data-js-tumblelog-name":e.blog_name,"data-js-post-id":e.post_id,"data-js-messaging-tumblelog-name":e.messaging_blog_name,target:"_blank",href:e.url});return""},close:function(e){return""}};e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+=' ',__p+=canPixelateAvatar?' ':' ',__p+='
'+__e(name)+'
'+(null==(__t=message)?"":__t)+"
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(277),r=i(685),a=i(726),l=s.extend({className:"conversation-message-post",mixins:[o],template:a,defaults:{thumbnailWidth:210},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(e){var t,i=this.model.get("post"),s=i.getThumbnail(e);return n.isEmpty(s)?null:(t=i.getScaledDimensionsForWidth(s,e),n.extend({},s,t))},getTemplateData:function(){var e=this.model.get("post"),t=this.participants.get(this.model.get("participant")),i=this.getThumbnailAtWidth(this.get("thumbnailWidth"));return{postType:e.getType(),isDisabled:e.isDisabled(),isError:this.model.get("isError"),isPending:this.model.get("isPending"),actionString:t?e.getActionMarkup(t.get("name")):null,message:e.getMessage(),thumbnail:i,avatarUrl:t?t.getAvatarUrl():null,name:t?t.get("name"):null,blogUrl:t?t.get("url"):null,url:e.get("post_url"),postBlogName:e.get("blog_name"),postId:e.get("id")}},_startTruncateSummary:function(){n.defer(n.bind(this._truncateSummary,this))},_truncateSummary:function(){r(this.js$("summary",!0))},_onModelChange:function(){this.renderWithTemplate(),this._startTruncateSummary(),n.isFunction(this.setRetryButtonState)&&this.setRetryButtonState()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
',isDisabled?__p+='
'+__e(actionString)+"
":(__p+=' ",_.isEmpty(url)||(__p+=' '),__p+=" "),__p+="
",_.isEmpty(thumbnail)||(__p+='
',_.isEmpty(url)||(__p+=' '),__p+=' ',_.isEmpty(url)||(__p+=" "),__p+="
");return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(725),o=i(728),r=i(729),a=i(136),l=i(8),c=s.extend({className:"conversation-message-safemode-post",template:r,events:{"click .link-safemode-settings":"_onlinkClick"},initialize:function(e){n.extend(this,n.pick(e,"conversation","canModifySafeMode")),s.prototype.initialize.apply(this,arguments)},getTemplateData:function(){var e=this.model.get("post"),t=this.participants.get(this.model.get("participant")),i=this.getThumbnailAtWidth(this.get("thumbnailWidth"));return{postType:e.getType(),isDisabled:e.isDisabled(),actionString:t?e.getActionMarkup(t.get("name")):null,thumbnail:i,avatarUrl:t?t.getAvatarUrl():null,name:t?t.get("name"):null,blogUrl:t?t.get("url"):null,canModifySafeMode:this.canModifySafeMode?this.canModifySafeMode:null,isProjectXEnabled:this.isProjectXEnabled?this.isProjectXEnabled:null}},afterRenderSubviews:function(){this.theme=new o({el:this.el,theme:this.conversation.getOtherParticipant().get("theme")}).render()},_onlinkClick:function(e){e.preventDefault();var t={source:"messaging_post"};a.trigger("Kraken:safeMode:FilteringSettingLinkClicked",{loggingData:t}),window.open(l(e.currentTarget).attr("href"))}});e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(277),r=i(230),a=i(180),l=s.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(e,t,i){e.css("color",i.adjustColorForBackground(t,"#ffffff"))}},"theme-accent-color-on-grey":{themeField:"link_color",unsetMissingStyle:"color",applyStyle:function(e,t,i){e.css("color",i.adjustColorForBackground(t,"#f2f2f2"))}},"theme-accent-color-on-background":{themeField:"link_color",unsetMissingStyle:"color",applyStyle:function(e,t,i){e.css("color",i.getReadableColor(t,i.get("background_color")))}},"theme-accent-color-as-background":{themeField:"link_color",unsetMissingStyle:"background-color",applyStyle:function(e,t,i){e.css("background-color",i.adjustColorForBackground(t,"#ffffff"))}},"theme-button":{themeField:function(e){var t=e.get("background_color"),i=e.get("link_color");return n.isEmpty(t)||n.isEmpty(i)?null:{text:t,background:e.getReadableColor(i,t)}},applyStyle:function(e,t,i){e.addClass("themed"),i.getHeaderImage()||e.css({"background-color":t.background,"border-color":t.background,color:t.text})}},"theme-header-image":{themeField:function(e){return e.getHeaderImage()},applyStyle:function(e,t){e.css("background-image","url("+t+")")}},"theme-background-tint":{themeField:function(e){return e.getTintSuffix(e.getBackgroundTint())},applyStyle:function(e,t,i){e.addClass("theme-background"+t)}},"theme-background-color-or-image-class":{themeField:"background_color",applyStyle:function(e,t,i){n.isEmpty(i.getHeaderImage())?e.css("background-color",t):e.addClass("has-image")}},"theme-avatar-shape-class":{themeField:"avatar_shape",applyStyle:function(e,t){e.addClass("avatar-shape--"+t)}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"theme"))},render:function(){this.theme&&!a.bool("aim_messenger")&&n.each(this.configuration,function(e,t){var i,s,o=e.unsetMissingStyle,r=e.applyStyle;if(i=n.isFunction(e.themeField)?e.themeField.call(this,this.theme):this.theme.get(e.themeField),s=this.js$(t),0!==s.length){if(n.isEmpty(i))return void(n.isFunction(o)?o.call(this,s,i,this.theme):n.isEmpty(o)?n.isFunction(r)||s.css(r,""):s.css(o,""));n.isFunction(r)?r.call(this,s,i,this.theme):s.css(r,i),this.get("removeDataAttrAfterApplyingTheme")&&s.removeAttr("data-js-"+t)}},this)},setTheme:function(e){return this.theme=e,this.render()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
',isDisabled?__p+='
'+__e(actionString)+"
":(__p+='
'+__e(actionString)+'

',isProjectXEnabled?__p+=' '+__e(__("This post may contain sensitive content."))+"
"+(null==(__t=__("%1$sLearn more%2$s",'',""))?"":__t)+" ":(__p+=' '+__e(__("This post may contain sensitive media."))+"
",__p+=canModifySafeMode?" "+(null==(__t=__("%1$sSafe Mode is on%2$s",'',""))?"":__t)+" ":" "+(null==(__t=__("%1$sWhy am I seeing this?%2$s",'',""))?"":__t)+" ",__p+=" "),__p+='

"),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(277),a=i(262),l=i(331),c=i(731),u=o.extend({className:"conversation-message-image",mixins:[r],template:c,defaults:{thumbnailWidth:195,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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","participants","conversation","model","setRetryButtonState","afterImageUnblur")),this.set("blurMessageString",s("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 e=this.image.getImageAtSize(this.get("thumbnailWidth")),t=this.getThumbnailDimensions(e),i=n.get(t,"width"),s=n.get(t,"height"),o=this.participants.get(this.model.get("participant"));return this.thumbnailUrl=this.thumbnailUrl||e.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:s}},getThumbnailDimensions:function(e){var t=this.get("thumbnailWidth"),i=a.heightForWidth(t,e.get("width"),e.get("height"));return n.extend({},{width:t,height:i})},_onModelIsPendingChange:function(e,t){t?(this.imageLoaderView=new l({variation:"small centered",loading:t}),this.js$("image-loader-container").append(this.imageLoaderView.render().$el)):this._removeImageLoader(),this.$el.toggleClass(this.get("pendingClassName"),t)},_onModelIsErrorChange:function(e,t){this.$el.toggleClass(this.get("errorClassName"),t)},_removeImageLoader:function(){this.imageLoaderView&&this.imageLoaderView.remove()},_onModelImagesUpdate:function(){this.renderWithTemplate(),this._toggleBlurred(this.get("isBlurred")),n.isFunction(this.setRetryButtonState)&&this.setRetryButtonState()},_toggleBlurred:function(e){var t=this.get("unblurringClassName"),i=this.js$("overlay-text",!0),s=!e&&this.previous("isBlurred"),o=this.get("blurClassName");this.$el.toggleClass(o,e).toggleClass(t,s),e?i.text(this.get("blurMessageString")):s||i.empty(),this._unblurTimer&&clearTimeout(this._unblurTimer),s&&(this._unblurTimer=n.delay(n.bind(function(){this.rendered&&(i.empty(),this.$el.removeClass(t),delete this._unblurTimer)},this),this.get("blurAnimationDurationMs")))},_onChangeIsBlurred:function(e,t){this._toggleBlurred(t)},_onChangeConversationIsBlurredImages:function(e,t){this.set("isBlurred",t&&e.shouldBlurImageMessage(this.model))},_onOverlayContainerClick:function(e){this.get("isBlurred")&&(e.preventDefault(),e.stopImmediatePropagation(),this.set("isBlurred",!1),n.isFunction(this.afterImageUnblur)&&this.afterImageUnblur(this.model))}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
",_.isEmpty(highResUrl)||_.isEmpty(lowResUrl)||(__p+=' '),__p+='

',_.isEmpty(highResUrl)||_.isEmpty(lowResUrl)||(__p+="
"),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(733),r=s.extend({className:"conversation-message-timestamp",template:o,initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus"))},getTemplateData:function(){return{label:this.model.get("tsHeader")}}});e.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+='
'+__e(label)+"
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(277),r=i(735),a=s.extend({className:"conversation-message-sticker message-container",mixins:[o],template:r,defaults:{thumbnailWidth:210,rawWidth:1280,errorClassName:"is-error"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","participants","conversation"))},afterRenderSubviews:function(){this.listenTo(this.model,"change:isError",this._onModelIsErrorChange)},getTemplateData:function(){var e=this.model.toJSON(),t=e.sticker.original_size_url,i=e.sticker.url,n=this.participants.get(this.model.get("participant"));return{name:n?n.get("name"):null,avatarUrl:n?n.getAvatarUrl():null,blogUrl:n?n.get("url"):null,rawUrl:t?t:null,url:i?i:null,thumbnailWidth:this.get("thumbnailWidth"),rawWidth:this.get("rawWidth")}},_onModelIsErrorChange:function(e){this.$el.toggleClass(this.get("errorClassName"),e)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
",_.isEmpty(rawUrl)||(__p+=' '),__p+='
',_.isEmpty(rawUrl)||(__p+="
"),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(277),a=i(737),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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus"))},afterRender:function(){this.listenTo(this,"change:count",this._onChangeCount),this._onChangeCount(this,this.get("count"))},setCount:function(e){this.set("count",n.isFinite(e)?e:0)},getCount:function(){return this.get("count")},getTitle:function(e){var t,i;return n.isFinite(e)?(t=this.get("maxCount"),i=e>t?t+"+":e,e>1?s("%1$s unread messages",i):s("%1$s unread message",i)):null},getTemplateData:function(){return{title:this.getTitle(this.get("count"))}},_onChangeCount:function(e,t){var i=this.getTitle(t);this.$el.toggleClass("hide-pill",0===t||n.isEmpty(i)),t>0&&this.js$("unread-button").text(i)},_onClick:function(e){e.preventDefault(),this.trigger("click")}});e.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+='"; 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+='
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(180),o=i(226),r=i(686),a=i(740),l=i(741),c=o.extend({template:a,className:"chat-status-banner",subviews:{statusIndicator:{constructor:r,options:function(e){return{isOnline:e.get("seconds_since_last_activity")!==-1,canSeeUIFlag:s.bool("status_indicator"),name:e.get("name")}}}},initialize:function(e){this.set("name",n.get(e,"name","")),this.listenTo(this,"setActiveTime",function(e){this.set("lastOnlineString",l(e)),this.render()})},render:function(){return this.get("lastOnlineString")?o.prototype.render.call(this):this}});e.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;with(obj)__p+='
'+__e(lastOnlineString)+"
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";function n(e){return!(e===-1||e>o)&&(e>=r?s("Active in the last 4 hours"):e>=a?s("Active in the last 3 hours"):e>=l?s("Active in the last 2 hours"):e>=0&&s("Active in the last hour"))}var s=i(130),o=14400,r=10800,a=7200,l=3600;e.exports=n},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(743),r=s.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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(e){e.preventDefault(),n.isFunction(this.actionCallback)&&this.actionCallback()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
'+__e(message)+" ",_.isEmpty(actionText)||(__p+=' '+__e(actionText)+" "),__p+="
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(226),r=i(277),a=i(262),l=i(745),c=i(235),u=i(746),h=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!s.isEmpty(this.previewImageModel)},addImage:function(e){var t=e.get("height"),i=e.get("width"),n=this.get("maxHeight"),o=this.get("maxWidth"),r=a.maxSize(i,t,o,n),l=this.js$("image-container");return this.previewImageView&&this.previewImageView.remove(),this.previewImageView=new u({src:e.get("url"),width:s.get(r,"width"),height:s.get(r,"height")}),l.append(this.previewImageView.render().$el),this.set("isVisible",!0),this.set("isEditable",s.isFunction(e.get("editCallback"))),this.previewImageModel=e,this._slideElement(l)},_slideElement:function(e,t){var i=new n.Deferred,o=e.height(),r=e.offset().top-this.$el.offset().top,a=o+r;return c.animate(e,{translateY:t?[a,0]:[0,a]},{duration:t?this.get("animateOutDurationMs"):this.get("animateInDurationMs"),easing:t?this.get("animateOutEasing"):this.get("animateInEasing"),complete:s.bind(function(){i.resolve(),e.css("transform","")},this)}),i},getMessage:function(){return s.isEmpty(this.previewImageModel)?null:this.previewImageModel.get("message")},close:function(){return this.trigger("closing",this.previewImageModel),this._slideElement(this.js$("image-container"),!0).then(s.bind(this._onAfterCloseAnimation,this))},_onAfterCloseAnimation:function(){var e=this.previewImageModel;this.previewImageView.remove(),delete this.previewImageModel,delete this.previewImageView,this.set("isVisible",!1),this.trigger("close",e)},_onImageContainerClick:function(e){var t,i=this.previewImageModel;this.get("isEditable")&&!s.isEmpty(i)&&(t=i.get("editCallback"),s.isFunction(t)&&(e.preventDefault(),t(e),this.trigger("edit",i)))},_onClickPreviewRemove:function(e){e.preventDefault(),e.stopPropagation(),this.trigger("dismiss",this.previewImageModel),this.close()},_onChangeIsVisible:function(e,t){this.$el.toggle(t)},_onChangeIsEditable:function(e,t){this.$el.toggleClass("editable",t)}});e.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;with(obj)__p+='";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(747),r=s.extend({className:"conversation-preview-image",template:o,defaults:{width:null,height:null,src:null,context:null,loggingData:null},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))}});e.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+=''+__e(__(';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(235),o=i(130),r=i(277),a=i(232),l=i(226),c=i(749),u=i(706),h=i(750),d=l.extend({className:"conversation-compose",template:h,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:c,options:function(e){return{pluginsArray:e.pluginsArray}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","keyboardManager","keyboardNamespace","pluginsArray","isGifSearchEnabled","isSendAPost")),this.getRandomPlaceholder=u([o("New message"),o("Your message here"),o("Write a message"),o("Say something"),o("Say your thing")]),n.isEmpty(this.pluginsArray)&&this.hideComposePluginsView(!0),this.set("isShufflePlaceholder",n.isEmpty(this.get("placeholder"))),n.isEmpty(this.get("placeholder"))&&this.set("placeholder",this.getRandomPlaceholder()),this.set("currentPlaceholder",this.get("placeholder")),n.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(),n.defer(n.bind(function(){this._resizeInput()},this))},getTemplateData:function(){return{placeholder:this.get("placeholder"),isSendAPost:this.isSendAPost}},hideComposePluginsView:function(e){var t,i=this.get("hideComposePluginsClass"),o=this.get("hidingComposePluginsClass");if(this.get("isPluginsVisible")){if(this.set("isPluginsVisible",!1),e)return void this.$el.addClass(i);this.$el.addClass(o),this._resizeInput(),t=this.composePluginsView.$el.outerWidth(),s.animate(this.$el,{marginLeft:[-t,0]},{duration:this.get("pluginAnimateOutDurationMs"),easing:this.get("pluginAnimateOutEasing"),complete:n.bind(function(){this._resizeInput(),this.$el.css("marginLeft","").addClass(i).removeClass(o)},this)})}},showComposePluginsView:function(e){var t,i=this.get("hideComposePluginsClass");if(!this.get("isPluginsVisible")){if(this.set("isPluginsVisible",!0),e)return void this.$el.removeClass(i);t=this.composePluginsView.$el.outerWidth(),this.$el.css("margin-left",-t).removeClass(i),this._resizeInput(),s.animate(this.$el,{marginLeft:[0,-t]},{duration:this.get("pluginAnimateInDurationMs"),easing:this.get("pluginAnimateInEasing"),complete:n.bind(function(){this._resizeInput(),this.$el.css("marginLeft","")},this)})}},toggle:function(e){this.$el.toggle(e),e&&this.$el.css("display","")},submit:function(e){var t=this.get("currentText");this.get("isValid")&&!this.get("isDisabled")&&(this.trigger("submit",t,e),this._startAnimation(n.bind(function(){this.trigger("submit:animated",t,e)},this)),this.clear())},escape:function(){this.get("isLightboxOpen")||(n.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(){n.defer(n.bind(function(){this.rendered&&this.js$("text-input").focus()},this))},getMessage:function(){return this.js$("text-input").val()},setPlaceholder:function(e){this.set({placeholder:e,isShufflePlaceholder:!1}),this._setPlaceholderState()},beforeRemove:function(){this.keyboardManager&&this.keyboardManager.remove(this.keyboardNamespace)},toggleAutoValidation:function(e){this.set("isAutoValidationEnabled",e)},_onComposePluginPreviewAddImage:function(e){this.trigger("plugin:preview:add:image",e)},_onComposePluginClick:function(e){this.trigger("plugin:click",e)},_onKeyPressEscape:function(e){e.preventDefault(),this.escape()},_onTextInputChange:function(){var e=n.trim(this.js$("text-input").val());this._resizeInput(),this.set("currentText",e),this.trigger("input",e,this)},_setValidState:function(){return this.get("isAutoValidationEnabled")?void this.set("isValid",!n.isEmpty(this.get("currentText"))):void this.set("isValid",!0)},_resizeInput:function(){var e,t=this.js$("text-input"),i=t.get(0);this._originalInputHeight||(this._originalInputHeight=t.outerHeight()),this.$el.css("height",this.$el.height()),t.css("height","auto"),e=i.scrollHeight,Math.abs(e-this._originalInputHeight)<5&&(e=this._originalInputHeight),t.css("height",e),this.$el.css("height",""),this._detectResize()},_detectResize:function(){var e=this.$el.height();return this._previousHeight?void(e!==this._previousHeight&&(this.trigger("resize",e),this._previousHeight=e)):void(this._previousHeight=e)},_startAnimation:function(e){var t=this.js$("submit-button"),i=this.get("buttonSubmittedClass");return n.isEmpty(i)?void(n.isFunction(e)&&e.call(this)):(t.addClass(i),void n.delay(n.bind(function(){t.removeClass(i),n.isFunction(e)&&e.call(this)},this),this.get("composeAnimationSpeed")))},_setPlaceholderState:function(){this.set("currentPlaceholder",this.get("isShufflePlaceholder")?this.getRandomPlaceholder():this.get("placeholder"))},_onChangeCurrentText:function(e,t){this._setValidState()},_onChangeIsValid:function(e,t){this.js$("submit-button").prop("disabled",!t||this.get("isDisabled"))},_onSubmitButtonClick:function(e){e.preventDefault(),this.submit("button")},_onChangeIsDisabled:function(e,t){this.js$("text-input").prop("disabled",t),this.js$("submit-button").prop("disabled",t||!this.get("isValid")),this.composePluginsView.toggleDisabled(t)},_onChangeIsOffline:function(e,t){t?(this.set("previousPlaceholder",this.get("placeholder")),this.set("currentPlaceholder",this.get("offlinePlaceholder"))):this.set("currentPlaceholder",this.get("previousPlaceholder"))},_onChangeCurrentPlaceholder:function(e,t){this.js$("text-input").attr("placeholder",t)},_onTextInputFocus:function(){this.set("hasEditorFocus",!0),this.trigger("focus",this)},_onTextInputBlur:function(){this.set("hasEditorFocus",!1),this.trigger("blur",this)},_onTextInputPaste:function(e){var t,i,s=n.get(e,"originalEvent.clipboardData.items",[]),o=n.filter(s,{kind:"file"});this.get("isDisabled")||0!==o.length&&(t=n.last(o),t&&(i=n.result(t,"getAsFile"),this.trigger("pasteBlob",i)))},_onTextInputKeydown:function(e){13!==e.keyCode||e.shiftKey||(this.submit("keyboard"),e.preventDefault())},_onChangeHasEditorFocus:function(e,t){this.keyboardManager&&this.keyboardManager.toggle(this.keyboardNamespace,e,t)},_onChangeIsAutoValidationEnabled:function(e,t){this._setValidState()}});e.exports=d},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.extend({className:"conversation-compose-plugins-container",mixins:[],renderWithTemplate:n.noop,defaults:{isDisabled:!1},initialize:function(e){e=n.extend({},e),n.extend(this,n.pick(e,"pluginsArray"))},afterRender:function(){this.listenTo(this,"change:isDisabled",this._onChangeIsDisabled),n.each(this.pluginsArray,n.bind(this._addPluginView,this)),this._onChangeIsDisabled(this,this.get("isDisabled"))},toggleDisabled:function(e){this.set("isDisabled",e)},_addPluginView:function(e){e.render(),this.$el.append(e.el),this.listenTo(e,"preview:add:image",this._onPluginViewPreviewAddImage),this.listenTo(e,"click",this._onPluginViewClick)},_onPluginViewPreviewAddImage:function(e){this.trigger("plugin:preview:add:image",e)},_onPluginViewClick:function(e){this.trigger("plugin:click",e)},_onChangeIsDisabled:function(e,t){n.each(this.pluginsArray,n.bind(function(e){e.toggleDisabled(t)}),this)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+=isSendAPost?'
":'
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(180),o=i(226),r=i(277),a=i(686),l=i(752),c=o.extend({className:"conversation-minimized",tagName:"a",attributes:{href:"#"},template:l,mixins:[r],events:{click:"_onClick"},defaults:{maxBadgeCount:99,activeBadgeClass:"tab-notice--active",newMessageClass:"new-message"},subviews:{statusIndicator:{constructor:a,options:function(e){return{isOnline:e.get("isOnline"),canSeeUIFlag:s.bool("status_indicator"),name:e.participant.get("name")}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus")),this.participant=this.model.getOtherParticipant(),this.set({blogName:this.participant?this.participant.get("name"):null,avatarUrl:this.participant?this.participant.getAvatarUrl():null,statusIndicatorUiFlag:s.bool("status_indicator")})},setIsOnline:function(e){this.set("isOnline",e),this.renderSubviews()},afterRenderSubviews:function(){this.listenTo(this.model,"change:unreadCount",this._onChangeUnreadCount),this.listenTo(this.model,"sync",this._onConversationSync),this.listenTo(this,"setIsOnline",this.setIsOnline),this.listenTo(this.participant,"change:seconds_since_last_activity",function(e,t){this.setIsOnline(t!==-1)})},updateBadge:function(e){var t=this.get("maxBadgeCount"),i=this.get("activeBadgeClass");e>0&&this.js$("badge-value").text(e>t?t+"+":e),this.js$("badge").toggleClass(i,e>0)},animate:function(){var e=this.get("newMessageClass");this.$el.addClass(e),n.delay(n.bind(function(){this.$el.removeClass(e)},this),250)},focus:function(){this.$el.focus()},blur:function(){this.$el.blur()},_onChangeUnreadCount:function(e,t){this.updateBadge(t),t>0&&this.animate()},_onConversationSync:function(e){this.renderWithTemplate(),this.renderSubviews()},_onClick:function(e){e.preventDefault(),this.blur(),this.trigger("click")}});e.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;with(obj)__p+='
2
';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(226),r=i(277),a=i(754),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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","buttonCallback")),n.isEmpty(this.get("message"))&&this.set("message",s("Something went screwy.")),n.isEmpty(this.get("buttonText"))&&this.set("buttonText",s("Retry")),n.isEmpty(this.get("buttonTextLoading"))&&this.set("buttonTextLoading",s("Retrying...")),n.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(e){e.preventDefault(),this.get("isLoading")||(this.set("isLoading",!0),this.trigger("buttonClick"),n.isFunction(this.buttonCallback)&&this.buttonCallback.call(this,this))},_onChangeIsLoading:function(e,t){var i=t?this.get("buttonTextLoading"):this.get("buttonText");this.set("buttonTextCurrent",i),this.js$("button").toggleClass("disabled",t).prop("disabled",t)},_onChangeButtonTextCurrent:function(e,t){this.js$("button").text(t)},_onChangeShowButton:function(e,t){this.js$("button").toggle(t)}});e.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+='
";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(283),a=i(756),l=o.extend({className:"popover--conversation-actions info_popover popover_gradient popover",mixins:[r],initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"viewOptions")),this.view=new a(this.viewOptions)},render:function(){return this.$wrapper=s("
").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}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(757),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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"eventBus","user","participants")),this.blockableParticipants=this.participants.getWithout(this.user.channels.pluck("uuid"))},getTemplateData:function(){return{blockableParticipants:n.invoke(this.blockableParticipants,"toJSON")}},_onBlockClick:function(e){var t=s(e.currentTarget),i=t.attr("data-js-block-blogname");e.preventDefault(),n.isEmpty(i)||this.trigger("block",i)},_onDeleteConversationClick:function(e){e.preventDefault(),this.trigger("delete")}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
  • '+__e(__("Sound settings"))+'
  • '+__e(__("Delete conversation"))+"
  • ",_.each(blockableParticipants,function(e){__p+='
  • '+__e(__("Block %1$s",e.name))+"
  • "});return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(8),r=i(9),a=i(180),l=i(226),c=i(277),u=i(262),h=i(354),d=i(685),p=i(728),g=i(686),f=i(759),_=n.template(''),m=l.extend({className:"conversation-icebreakers",template:f,mixins:[c],defaults:{isShowTags:!0,isShowRelationship:!0,isShowDescription:!0},subviews:{statusIndicator:{constructor:g,options:function(e){return{isOnline:e.participant.get("seconds_since_last_activity")!==-1,canSeeUIFlag:a.bool("status_indicator"),name:e.participant.get("name")}}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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,canPixelateAvatar:this.participant.get("can_pixelate_avatar"),name:this.participant.get("name"),avatarUrl:this.participant.getAvatarUrl(),url:this.participant.get("url")}},afterRender:function(){this.theme=new p({el:this.el,theme:this.participant.get("theme")}).render(),this.get("isShowDescription")&&n.defer(n.bind(function(){d(this.js$("description"))},this));var e=this.$el.find(".pixelated-avatar");n.each(e,n.bind(function(e){o(e).removeClass("hide").addClass("show"),u.drawPixelatedImages(this)},this))},_getOpeningTagAnchor:function(e){var t=this.participant.get("name"),i=this.participant.get("url");return _({blogUrl:i,blogName:t,tag:e})},_getClosingTagAnchor:function(){return""},_getOpeningTagText:function(){return''},_getClosingTagText:function(){return""},_getTagsDescriptionMarkup:function(){var e=this.participant.getBlogTags(),t=this._getOpeningTagText(),i=this._getClosingTagText(),o=this._getClosingTagAnchor();return e.length>1?s("%1$sPosts about%2$s %3$s#%4$s%5$s %6$sand%7$s %8$s#%9$s%10$s",t,i,this._getOpeningTagAnchor(e[0]),n.escape(e[0]),o,t,i,this._getOpeningTagAnchor(e[1]),n.escape(e[1]),o):1===e.length?s("%1$sPosts about%2$s %3$s#%4$s%5$s",t,i,this._getOpeningTagAnchor(e[0]),n.escape(e[0]),o):null},_getCleanDescriptionString:function(){return h.stripTags(this.participant.getDescription())},_getRelationshipString:function(){var e;if(this.participant.isMutuals()){if(e=this._getRelativeTimeString(this.participant.getDurationMutualsSeconds()),!n.isEmpty(e))return s("Mutuals for %1$s",e)}else if(this.participant.isFollowingYou()){if(e=this._getRelativeTimeString(this.participant.getDurationFollowingYouSeconds()),!n.isEmpty(e))return s("Followed you %1$s ago",e)}else if(this.participant.isFollowing()&&(e=this._getRelativeTimeString(this.participant.getDurationFollowingSeconds()),!n.isEmpty(e)))return s("Following for %1$s",e);return s("Not following each other")},_getRelativeTimeString:function(e){return n.isNumber(e)?r(Date.now()-1e3*e).fromNow(!0):null}});e.exports=m},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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+=' ',__p+=canPixelateAvatar?' ':' ',__p+='
    ",_.isEmpty(description)||(__p+=' "),__p+=" ",_.isEmpty(relationship)||(__p+='
    '+__e(relationship)+"
    "),__p+=" ",_.isEmpty(tagsMarkup)||(__p+='
    '+(null==(__t=tagsMarkup)?"":__t)+"
    ");return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(461),r=i(761),a=i(763),l=i(658),c=i(764),u=r.extend({className:"conversation-compose-plugin conversation-compose-plugin--gif-search",template:c,defaults:s.defaults({selectedGif:null,query:"",resultLimit:200,resultImageWidth:250},r.prototype.defaults),events:{click:"_onClick"},initialize:function(e){e=s.extend({},e),s.extend(this,s.pick(e,"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(e,t,i){var s,o,r;this.$el.is(":visible")||(o=n(i.currentTarget),r=o.height(),s={pinnedTarget:o,shift:{x:0,y:Math.ceil(r*-.8)}}),this._openGifSearchPopover(e,t,s)},_onClick:function(e){e.preventDefault(),this._openGifSearchPopover(this.get("query")),this.trigger("click",this)},_openGifSearchPopover:function(e,t,i){var n;this.gifSearchPopover&&this._closePopover(),n=s.extend({},this.popoverOptions,i,{query:e,selectedImageUrl:t}),this.gifSearchPopover=new o(n),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(e){this.set("query",e)})},_closePopover:function(){this.stopListening(this.gifSearchPopover),this.stopListening(this.collection),this.gifSearchPopover.teardown(),this.toggleActive(!1)},_onGifSearchPopoverSelectImage:function(e){var t,i,n,o,r,c,u,h=s.get(e,"postId"),d=s.get(e,"postBlogUuid"),p=this.get("resultImageWidth"),g=this.getName();s.isEmpty(h)||s.isEmpty(d)||(n=s.get(e,"mediaUrl",""),r=s.get(e,"width"),c=s.get(e,"height"),u=this.get("query"),o=n.replace(/_\d+\./,"_"+p+"."),t=l.createImagePostMessage(h,d,o,r,c,{context:g,loggingData:{query:u}}),i=new a({url:o,width:r,height:c,message:t,context:g,editCallback:s.bind(s.partial(this.onEdit,u,n),this),loggingData:{query:u,postId:h,postBlogUuid:d}}),this.addToImagePreview(i),this._closePopover())},_onGifSearchPopoverClose:function(){this._closePopover()}});e.exports=u},function(e,t,i){"use strict";var n=i(762),s=n.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(e,t){this.$el.toggleClass("active",t)},_onChangeIsDisabled:function(e,t){this.$el.prop("disabled",t)}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.extend({defaults:{isDisabled:!1,isActive:!1},initialize:function(e){ e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},getName:function(){return null},addToImagePreview:function(e){this.trigger("preview:add:image",e)},toggleActive:function(e){this.set("isActive",e)},toggleDisabled:function(e){this.set("isDisabled",e)}});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({defaults:{message:null,url:null,width:null,height:null,editCallback:null}});e.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;with(obj)__p+=__e(__("Add GIF"));return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(8),r=i(277),a=i(213),l=i(761),c=i(763),u=i(658),h=i(766),d=i(767),p=l.extend({className:"conversation-compose-plugin conversation-compose-plugin--image-upload",template:d,mixins:[r],defaults:n.defaults({isFilePickerOpen:!1},l.prototype.defaults),events:{click:"_onClick",focus:"_onFocus","change [data-js-file-picker]":"_onFilePickerChange","click [data-js-file-picker]":"_onFilePickerClick"},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,"imageUploadMaxBytes"))},getName:function(){return"messaging-image-upload"},afterRender:function(){this.listenTo(this,"change:isFilePickerOpen",this._onChangeIsFilePickerOpen),l.prototype.afterRender.apply(this,arguments)},addImageFile:function(e,t){var i=void 0,o=void 0,r=Math.floor(this.get("imageUploadMaxBytes")/1048576);this.messagingImageUploader=new h({file:e,imageUploadMaxBytes:this.get("imageUploadMaxBytes")}),this.messagingImageUploader.uploadImage().then(n.bind(function(s){var r=n.get(s,"src"),a=n.get(s,"width"),l=n.get(s,"height");o=u.createImageMessage(r,e,a,l,{context:this.getName(),loggingData:{imageSource:t}}),i=new c({url:r,file:e,width:a,height:l,message:o,context:this.getName(),editCallback:n.bind(this.onEdit,this),loggingData:{imageSource:t}}),this.addToImagePreview(i)},this),function(e){var t=n.get(e,"type");if(t)switch(t){case"format":a.alert(s("Invalid file type."));break;case"size":a.alert(s("Image must be smaller than %1$sMB",r))}else a.alert(s("Something about that file is off. Try sending something else."))})},_openFilePicker:function(){this.$el.focus(),this.set("isFilePickerOpen",!0),this.js$("file-picker").click()},onEdit:function(){this._openFilePicker()},_onFilePickerChange:function(e){var t=n.first(o(e.target).prop("files"));this.set("isFilePickerOpen",!1),this.js$("file-picker").val(""),this.addImageFile(t,"filesystem")},_onFilePickerClick:function(e){e.stopPropagation()},_onClick:function(e){this._openFilePicker(),this.trigger("click",this)},_onFocus:function(){this.set("isFilePickerOpen",!1)},_onChangeIsFilePickerOpen:function(e,t){this.toggleActive(t)}});e.exports=p},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(214),r=i(259),a=i(260),l=o.extend({name:"MessagingImageUploader",defaults:{imageUploadMaxBytes:null,file:null},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},uploadImage:function(){var e=new s.Deferred,t=this.get("imageUploadMaxBytes"),i=this.get("file"),o=function(){e.resolve.apply(this,arguments)},l=function(){e.reject.apply(this,arguments)};return i?n.get(i,"type","").match(/image\/(jpg|jpeg|png|gif)/i)?n.get(i,"size")>t?e.reject({type:"size"}):(a.read(i).then(function(e){r.load(e.objectUrl||e.base64).then(o,l)}),e):e.reject({type:"format"}):e.reject()}});e.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+=__e(__("Add Photo"))+' ';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+='
    ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(185),s=n.extend({defaults:{channel:null},getChannel:function(){return this.get("channel")},setChannel:function(e){return this.set("channel",e)},getId:function(){return this.get("channel").get("uuid")},getPrevChannel:function(){return this.previous("channel")},getPrevProperty:function(e){var t=this.getPrevChannel();return t?t.get(e):null},getPrevId:function(){return this.getPrevProperty("uuid")}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(668),r=i(658),a=s.extend({url:"/svc/conversations",mixins:[o],model:r,comparator:function(e){return-e.get("last_modified_ts")},_getRoot:function(e){return n.has(e,"response")?n.get(e,"response"):e},parse:function(e,t){return n.get(this._getRoot(e),"conversations")||[]},parsePreviousLink:function(e,t){return n.get(this._getRoot(e),"_links.previous")},parseNextLink:function(e,t){return n.get(this._getRoot(e),"_links.next")},fetchInbox:function(e,t){t=t||{};var i=n.extend({},t.data,{participant:e});return n.extend(t,{cache:!1,remove:!1,skipParseLinks:0!==this.length,data:i,isFetchInbox:!0}),this.fetch(t)},getUnreadCount:function(){return n.reduce(this.models,function(e,t){return t.isUnread()?e+1:e},0)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(190),o=i(772),r=s.extend({model:o,getSortedModels:function(e){return this.sortBy(function(t){return t.get("uuid")===e?-1:0})},getSortedIds:function(e){var t=this.getSortedModels(e);return n.pluck(n.invoke(t,"toJSON"),"uuid")}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(185),o=i(659),r=i(770),a=i(191),l=s.extend({idAttribute:"uuid",mixins:[o],relations:{conversations:r},defaults:{conversations:null,unread_messages_count_sum:0}});n.defaults(l.prototype,a.prototype),e.exports=l},function(e,t,i){"use strict";var n,s=i(8),o=i(214),r=i(774),a=i(775),l=o.extend({name:"footer",initialize:function(){this.createFooter()},createFooter:function(){s(".l-footer").length&&(this.footerView=new r({el:".l-footer"})),s(".sidebar_nav").length&&(this.sidebarFooterView=new a({el:".pinned_sidebar_footer"}))}});e.exports=function(){return n||(n=new l),n}},function(e,t,i){"use strict";var n=i(226),s=n.extend({});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(136),r=i(220).transition,a=s.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(e){e&&(e.windowScrollY>=this.get("fadeScrollDistance")?this.set("visible",!1):this.set("visible",!0))},toggleVisibility:function(e,t){t===!0?(this.showElement(),n.defer(n.bind(function(){this.$nav.toggleClass("visible",t)},this))):(r(this.$nav,n.bind(function(){this.hideElement()},this)),this.$nav.toggleClass("visible",t)),o.trigger("toastr:canDisplayToggle",t)},hideElement:function(){this.$el.css("display","none")},showElement:function(){this.$el.css("display","block")}});e.exports=a},function(e,t,i){"use strict";var n=i(8),s=i(214),o=i(136),r=i(430),a=s.extend({name:"SponsoredPosts",initialize:function(){if(this.isScrollEnabled=!1,this.transform=r.get("transform"),this.transform){this.rings=n(),this.ctas=n();var e=n.proxy(this.checkForRingsAndCTAs,this);o.on("AutoPaginator:after",e),o.on("sponsoredPosts:checkRings",e),this.checkForRingsAndCTAs()}},checkForRingsAndCTAs:function(){this.rings=this.rings.add(".sponsored_badge_icon .ring, .recommendation-reason-footer .icon_explore"),this.ctas=this.ctas.add(".tsp-cta-animated").map(function(){var e=n(this);this.$el=e,this.elHeight=e.height(),this.elBottom=e.offset().top+e.height(),this.$aCTA=e.find("a.cta"),this.$aCTA.css("color","#ffffff"),this.$overlay=e.find(".tsp-opacity-overlay");var t=/([\d]+)[^\d]+([\d]+)[^\d]+([\d]+).+/.exec(this.$overlay.css("border-top-color")),i=t[1],s=t[2],o=t[3];return this.overlayColor=i+", "+s+", "+o,this.$aCTA.addClass("cta-color-applied"),this}),!this.isScrollEnabled&&(this.rings.length>0||this.ctas.length>0)&&(this.isScrollEnabled=!0,o.on("DOMEventor:flatscroll",this.onWindowScroll,this))},onWindowScroll:function(e){var t=e.windowScrollTop,i=void 0,n=void 0;for(i=0,n=this.rings.length;i=0&&n<=i?s=1-n/i:(s=0,this.ctas=this.ctas.not(t),t.$el.removeClass("tsp-cta-animated"));var o=2*(s-.5),r="rgba("+t.overlayColor+", "+o+")";t.$overlay.css({opacity:s,"border-color":r});var a=s<.5?"#FFFFFF":"";t.$aCTA.css("color",a)}});e.exports=a},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(136),r=i(214),a=i(129),l=r.extend({name:"peepr",params:"",selector:"body",initialize:function(){var e=a.get("Components/Peepr")||{};this.params=e,e.blog_name&&(this.listenToOnce(o,"peepr:close",this.onPeeprClose),n(document).ready(s.bind(this.onPeeprRequestWithParams,this))),this.$container=n(this.container),this.bindEvents()},bindEvents:function(){this.listenTo(o,"peepr-open-request",this.onPeeprRequest),this.$container.on("click","[data-peepr]",s.bind(this.onPeeprTargetClicked,this))},onPeeprTargetClicked:function(e){if(!e.ctrlKey&&!e.metaKey){e.preventDefault();var t=n(e.currentTarget),i=t.data("peepr");if(i){var s=i.tumblelog,r=i.postId,a=i.searchTagTerm,l=i.replyNoteToTumblelogName;o.trigger("peepr-open-request",{tumblelog_name:s,post_id:r,searchTagTerm:a,reply_note_to_tumblelog_name:l})}else window.open(t.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(e){e.tumblelog_name&&(e.editing_appearance="undefined"!=typeof e.editing_appearance&&e.editing_appearance,"undefined"==typeof e.should_bypass_safemode&&"undefined"!=typeof this.params.bn&&(e.should_bypass_safemode=this.params.bn),this.open(e))},open:function(e){var t="https://www.tumblr.com/blog/view/"+e.tumblelog_name;e.post_id?window.location=t+"/"+e.post_id:e.searchTagTerm?window.location=t+"/search/"+e.searchTagTerm:window.location=t}});e.exports=l},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(214),r=i(136),a=i(618),l=i(619),c=i(779),u=i(781),h=o.extend({name:"AskComponent",initialize:function(e){e=e||{},this.user=e.user,this.user&&(this.blog=this.user.getChannel(),this.question=new u({recipient:null,anonymous:!1,question:""}),this.listenTo(r,"ask:form:open",this.presentAskForm),this.listenTo(this.question,"save:success",this.onSaveSuccess))},presentAskForm:function(e){return this.askFormView?this:(this.question.set("recipient",e.recipient),n("body").addClass("postforms-open"),r.trigger("drawer:suspend"),r.trigger("keycommands:suspend"),this.glass=new a,this.modal=new l,this.askFormView=new c({model:this.question,characterLimit:500,recipient:{name:e.recipient,allowAnonymous:e.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(s.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"),n("body").removeClass("postforms-open"))},submit:function(e){this.question.set("anonymous",!!e.anonymous),this.question.set("question",e.question),this.question.save()},onSaveSuccess:function(){r.trigger("ask:form:success"),this.dismissAskForm()}});e.exports=h},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(250),r=i(226),a=i(232),l=i(277),c=i(780),u=r.extend({className:"ask-form",template:c,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(e){this.characterLimit=e.characterLimit,this.sender=e.sender,this.recipient=e.recipient,this.onTextAreaUpdate=s.throttle(s.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 e={};return e.recipient=s.clone(this.recipient)||{},e.recipient.allow_anonymous=e.recipient.allowAnonymous,e.sender=this.sender.toJSON(),e.sender.avatar_url=o(this.sender.get("avatar_url"))(128),e.character_limit=this.characterLimit,e},dismiss:function(){this.trigger("close")},toggleSubmit:function(e,t){t?this.disableSubmit():this.enableSubmit()},toggleAnonymous:function(e){var t=this.$(e.target);this.isAnonymous=t.prop("checked");var i=this.$$(".post_avatar_link"),n=this.$$(".ask-from .tumblelog_name"),s=this.$$(".ask-from .anonymous");this.isAnonymous?(i.removeClass("use_blog_avatar"),n.hide(),s.show()):(i.addClass("use_blog_avatar"),n.show(),s.hide())},submit:function(e){e.preventDefault(),this.trigger("submit",{question:this.$$(".ask-question").val(),anonymous:this.isAnonymous})},preventNewlines:function(e){e.preventDefault()},onTextAreaUpdate:function(){var e=this.$$(".ask-question").val(),t=e;e.match(/\n/g)&&(e=e.replace(/\n/g,""));var i=s.trim(e).length;040?o.addClass("count-ok"):n>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(e,t){var i=this.$$("."+e),o=i.get(0);o&&(i.removeClass("active").hide().empty(),"string"==typeof t&&(t=[t]),s.each(t,s.bind(function(e){var t=n("
  • ",{text:e});i.append(t)},this)),i.show(),s.defer(function(){i.addClass("active")}))},displayErrors:function(e){this.showMessages("errors-ask",e)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj){__p+='
    ';var senderMarkup=''+sender.name+''+__("anonymous")+"",recipientMarkup=''+recipient.name+"";if(__p+=" "+(null==(__t=__('%1$s to %2$s',senderMarkup,recipientMarkup))?"":__t)+'
    ",recipient.allow_anonymous){__p+='
    ';var randId=Math.floor(1e6*Math.random());__p+='
    "}__p+='
      '}return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(185),s=i(3),o=i(130),r=n.extend({urlRoot:"/svc/post/ask",validate:function(e){return s.trim(e.question)?this.isUrl(e.question)?{error:o("Sorry, but please don't include links in questions.")}:void 0:{error:o("You need to enter a question!")}},isUrl:function(e){return!!(e.match(/(http|https):\/\//i)||e.match(/www\./i)||e.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(e,t){t=t||{};var i=t.success,o=t.error;t.success=s.bind(function(e,t){if(s.isEmpty(s.result(t.response,"errors")))this.trigger("save:success"),i&&i.call(null,e,t);else{var n=t.response.errors[0];this.trigger("save:error",n),o&&o.call(null,e,n)}this.set("isSaving",!1)},this),t.error=s.bind(function(e,t){this.trigger("save:error",t),o&&o.call(null,e,t)},this),this.set("isSaving",!0);var r=n.prototype.save.call(this,e,t);!r&&this.validationError&&(this.trigger("save:error",this.validationError.error),this.set("isSaving",!1))}});e.exports=r},function(e,t,i){"use strict";var n=i(214),s=i(180),o=i(783),r=n.extend({name:"MobileNav",autoAppend:!0,view:function(){if(this.data)return this.data.npfMobileCreate=s.bool("redpop_post_form_mobile_create"),new o(this.data)}});e.exports=r},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(219),r=i(136),a=i(181),l=i(180),c=i(276),u=i(230),h=i(784),d=i(785),p=i(793),g=i(803),f=o.extend({className:"mobile-header",mixins:[c,u],template:h,defaults:{logged_in:!1},initialize:function(e){e=s.extend({},e),s.extend(this.attributes,s.pick(e,s.keys(this.defaults))),this.subViews.logoTitle=new d(e),this.subViews.navMenu=new p(e),l.bool("mobile_web_sticky_header")&&this.setSticky(),this.subViews.search=new g(e)},render:function(){return this.$el.html(this.template()),this.attachSubViews(),this},setSticky:function(){n("body").addClass("sticky-header"),this.lastPosition=a.rect().windowScrollTop,this.listenTo(r,"DOMEventor:flatscroll",this.getScrollDirection)},getScrollDirection:function(e){e.windowScrollTop>45?s.delay(s.bind(function(){this.$el.addClass("sticky")},this),500):this.$el.removeClass("sticky"),this.lastPosition45?this.$el.addClass("hide-nav"):this.$el.removeClass("hide-nav"),this.lastPosition=e.windowScrollTop}});e.exports=f},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+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(276),r=i(230),a=i(786),l=i(787),c=i(789),u=i(791),h=s.extend({className:"nav-logo-title",mixins:[o,r],template:a,initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e),this.subViews.logo=new l,this.get("page_title")&&this.get("logged_in")&&!this.get("search_term")?(this.subViews.pageTitle=new c(e),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(e)},render:function(){return this.$el.html(this.template(this.toJSON())),this.attachSubViews(),this}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__j=Array.prototype.join;with(obj)__p+='
      '+(null==(__t=_subview("loader"))?"":__t)+" ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(219),r=i(276),a=i(230),l=i(136),c=i(794),u=i(795),h=i(801),d=o.extend({className:"nav-menu",template:c,mixins:[r,a],events:{"click .menu-burger":"__clickMenuBurger","click [data-subnav]":"__clickSubnav","click .sneeze-guard":"__clickSneezeGuard"},__clickSneezeGuard:function(e){e.preventDefault(),this.closeDrawer()},__clickSubnav:function(e){e.preventDefault(),this.openSubNav(s(e.currentTarget).data("subnav"))},__clickMenuBurger:function(e){e.preventDefault(),this.toggleDrawer()},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e),this.get("drawer_open")&&this.openDrawer(),this.get("logged_in")?this.subViews.drawer=new u(e):this.subViews.drawer=new h(e),this.listenTo(l,"mobileHeader:search:click",this.closeDrawer)},render:function(){return this.$el.html(this.template()),this.$body=s("body"),this.$html=s("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(e){this.$el.addClass("subnav-active"),l.trigger("drawer:subnav:open",e)},closeSubNav:function(){this.$el.removeClass("subnav-active"),l.trigger("drawer:subnav:close")}});e.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="";with(obj)__p+='
      ';return __p; }.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(230),r=i(276),a=i(796),l=i(797),c=i(799),u=s.extend({template:a,mixins:[r,o],className:"drawer logged-in",initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e),this.subViews.primaryNav=new l(e),this.subViews.secondaryNav=new c(e)},render:function(){return this.$el.html(this.template(this.toJSON())),this.attachSubViews(),this}});e.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="";with(obj)__p+='';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(230),r=i(798),a=s.extend({template:r,mixins:[o],className:"primary-nav",initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e)},render:function(){return this.$el.html(this.template(this.toJSON())),this}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(230),r=i(136),a=s.extend({mixins:[o],className:"secondary-nav",templates:{settings:i(800)},_getTemplate:function(e){if("settings"===e)return this.templates.settings(this.toJSON())},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e),this.listenTo(r,"drawer:subnav:open",this.render)},render:function(e){return e&&this.$el.html(this._getTemplate(e)),this}});e.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+='";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(230),r=i(136),a=i(802),l=s.extend({template:a,mixins:[o],className:"drawer logged-out",initialize:function(e){e=n.extend({},e),n.extend(this.attributes,e),this.listenToOnce(r,"drawer:open",this.downloadBackground)},downloadBackground:function(){var e=new Image,t=this.$splashBg.data("img-src");e.onload=n.bind(function(){this.$splashBg.css("background-image","url("+t+")"),this.$splashBg.addClass("loaded")},this),e.src=t},render:function(){return this.$el.html(this.template(this.toJSON())),this.$splashBg=this.$(".splash-bg"),this}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(136),o=i(219),r=i(276),a=i(230),l=i(804),c=i(805),u=i(807),h=i(812),d=o.extend({className:"nav-search",mixins:[r,a],template:l,events:{"click .search-label":"__searchLabelClick","click .filter-icon":"__filterIconClick"},__searchLabelClick:function(){s.trigger("mobileHeader:search:click")},togglePopover:function(){this.popover||(this.popover=new u({pinnedTarget:this.subViews.filterIcon.$el,model:this.model}),this.popover.render(),this.listenTo(this.popover,"close",this.onPopoverClose))},onPopoverClose:function(){n.defer(n.bind(function(){this.popover=null},this))},__filterIconClick:function(){this.togglePopover()},onFilterChange:function(e){s.trigger("mobileHeader:filter:update",e),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(e){e=n.extend({},e),n.extend(this.attributes,e),this.get("logged_in")&&(this.subViews.filterIcon=new c,this.model=new h({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()}});e.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="";with(obj)__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(226),s=i(806),o=n.extend({template:s,className:"filter-icon",render:function(){return this.$el.html(this.template()),this}});e.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 __t,__p="";with(obj)__p+='';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(808),s=i(810),o=n.extend({className:n.prototype.className+" blog-search-filters-popover",Subview:s});e.exports=o},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(220).transition,r=i(284),a=i(276),l=i(283),c=i(232),u=i(809),h=s.extend({className:"popover--blog-search",mixins:[a,l,c],template:u,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(e){return this.options=n.defaults(e,this.defaults),this.Subview?(this.subview=new this.Subview(e),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"),n.delay(n.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(e){e.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(e){e.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,n.bind(function(){this.subview.remove(),this.remove(),this.teardown()},this))}});e.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="";with(obj)__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(226),o=i(811),r=s.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(e){var t=n(e.currentTarget).data("filter").split(":");this.model.set(t[0],t[1])},onCheckboxChange:function(e){var t=n(e.currentTarget),i=e.currentTarget.id,s=t.data("value"),o=t.prop("checked");this.model.set(i,o?s:this.model.defaults[i])},onCheckboxClick:function(e){e.stopPropagation()},onToggleFilterClick:function(e){var t=n(e.currentTarget).find("[type=checkbox]"),i=t.prop("checked");t.prop("checked",!i).trigger("change")}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
      • '+__e(__("Top Posts"))+'
      • '+__e(__("Recent Posts"))+"
      ",model.showOriginalPostsSwitch&&(__p+='
      • '+__e(__("Original Posts"))+"
      "),__p+='
      • '+__e(__("All Types"))+'
      • '+__e(__("Text"))+'
      • '+__e(__("Photo"))+'
      • '+__e(__("Quote"))+'
      • '+__e(__("Link"))+'
      • '+__e(__("Chat"))+'
      • '+__e(__("Audio"))+'
      • '+__e(__("Video"))+"
      ",model.showNsfwSwitch&&(__p+='
      • '+__e(__("Safe search"))+"
      ");return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(136),o=i(185),r=i(190),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(s,"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(n.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(){var e=this.get("term").replace(/#/g,"");return this.urlRoot+"/"+this.get("blogname")+"/"+e},onTermSelect:function(e){this.search(e.term)},onUnsetTermChange:function(){s.trigger("peeprsearch:change:unsetTerm",{term:this.get("unsetTerm")})},search:function(e){e=e||this.get("unsetTerm"),e.length&&this.set("term",e)},fetch:function(){this.get("next_offset")<0||o.prototype.fetch.apply(this,arguments)},parse:function(e){return this.posts.length?n.each(e.response.posts,function(e){this.posts.add(e)},this):this.posts.reset(e.response.posts),delete e.response.posts,e.response},sync:function(e,t,i){"read"===e&&(i.data=this.pick("next_offset","limit","sort","post_type","post_role","filter_nsfw")),o.prototype.sync.apply(this,arguments)}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(214),r=i(136),a=i(132),l=i(814),c=i(815),u=o.extend({name:"YamPlusAd",counter:1,adConfiguration:{name:"LREC",sp:1197719223,ps:"LREC",ssl:1},initialize:function(e){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(e){return s("#yam-plus-ad-units-"+e)},canServeAds:function(){return window.DARLA},checkAdexist:function(e){if(this.canServeAds()&&e){var t=e[0].replace("LREC",""),i=this.$placeholderFor(t);0===i.find(".darla").length&&i.parents(".yamplus-unit-container").remove()}},setupDarla:function(){window.DARLA_CONFIG=l(this.setupFirstAd(!0)),c()},setupFirstAd:function(e){var t=s(".yam-plus-ad-container, .sidebar-ad-content").eq(0);if(!t.length)return null;var i=t.find(".yam-plus-ad-target"),n=i.attr("id"),o=t.attr("data-yam-ad-id"),r={dest:n,id:o};return e?r:this.setupAd(r)},setupAd:function(e){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;e=n.defaults(e,{asz:"300x250",w:"300",h:"250",pos:"LREC-"+this.counter,id:!1,dest:!1,fdb:!0});var t="LRECP",i=n.defaults({name:t},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}});e.exports=u},function(e,t,i){"use strict";var n=i(3),s=i(136);e.exports=function(e){e=n.extend({dest:!1,id:!1},e);var t={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(){s.trigger("darla:failure",arguments)},onSuccess:function(){s.trigger("darla:success",arguments)},onFinishParse:function(e,t){t.ps().forEach(function(e){""!==e.hasErr&&s.trigger("darla:failure",arguments)})}};return t.positions.LREC.dest=e.dest,t.positions.LREC.id=e.id,t}},function(e,t,i){"use strict";var n,s=("https:"===document.location.protocol?"https://":"http://")+"fc.yahoo.com/sdarla/php/client.php?f=1197719150",o=5,r=0,a=i(136),l=function e(){clearTimeout(n),n=null,window.DARLA&&!window.DARLA.inProgress()?a.trigger("darla:ready"):++r0&&void 0!==arguments[0]?arguments[0]:{},t=this.data||{},i=t.automattic_id,n=e.isBlogNetwork,s=this.getLoggingData(i,n),o=this.getImageUrl(s);this.createPixel(o)},outputDebugCode:function(e){var t=e.tid,i=e.user_id,n=t===a&&!i;console.groupCollapsed(""+this.name+(n?" (warning!)":"")),n&&console.warn("This is a non-blog-network entry without a user id. It might be fine (e.g. login page), but please make sure."),console.info(e),console.groupEnd()},getLoggingData:function(e,t){var i=n.extend({},c,{tid:t?l:a,rand:Math.round(1e7*Math.random()),_ts:Date.now(),ref:document.location.href});return e&&(i.user_id=e),i},getImageUrl:function(e){var t=o.param(e);return r+"?"+t},createPixel:function(e){var t=new Image(1,1);t.src=e}});e.exports=u},function(e,t,i){"use strict";var n=i(3),s=i(818),o=s.extend({logKey:"dashboard_embed",logOptions:{init_event:!1},events:{"/^post:((?:un)?docked)$/":"handleEvent","post:embed:stateChange":"logStateChange"},handleEvent:function(e,t){var i=n.extend({},t);i.postData&&(i.post_id=i.postData.id,i.tumblelog=i.postData.tumblelog,delete i.postData),this.log(e,i)},logStateChange:function(e,t){if(!n.isEmpty(t)&&t.state&&t.postID&&t.service){if("tumblr"===t.service)return;this.log(t.state,{service:t.service,post_id:t.postID})}}});e.exports=o},function(e,t,i){"use strict";var n=i(7),s=i(3),o=i(215),r=i(136),a=i(132),l=[];l.push(i(819));var c=/^\/(.+)\/([gimy]*)$/,u=o.extend({constructor:function(){this._eventHandlers=[],this.setupEndpoints(),this.initialize();var e=s.result(this,"events")||{};s.forEach(e,this._addEventHandlerByString,this);var t=s.result(this,"eventBus");this.listenTo(t,"all",this._handleEvent),a.log("LogLady","[instrument]",this.logKey)},logSpots:l,eventBus:r,_addEventHandlerByString:function(e,t){var i,n=t.match(c);if(n){var s=new RegExp(n[1],n[2]);i=function(e){var t=e.match(s);if(t){for(var i=new Array(t.length-1),n=0;n0&&(i[n-1]=t[n]);return i}}}else if("*"===t[t.length-1]){var o=t.substring(0,t.length-1);i=function(e){var t=e.indexOf(o);if(0===t)return[e.substring(o.length,e.length)]}}else i=function(e){return e===t?[e]:null};this._addEventHandler(e,i)},_addEventHandler:function(e,t){this._eventHandlers.push({method:e,matcher:t})},_handleEvent:function(e,t){for(var i,n,o,r=this._eventHandlers.length-1;r>=0;r--)i=this._eventHandlers[r],o=i.callback||this[i.method],o&&(n=i.matcher.call(this,e,t),s.isArray(n)&&(t&&t.loggingData&&n.push(s.cloneDeep(t.loggingData)),o.apply(this,n)))},setupEndpoints:function(){var e=s.result(this,"logSpots");this.loggers=s(e).map(function(e){return e(this)},this).compact().value()},initialize:s.noop,log:function(){for(var e=this.loggers.length-1;e>=0;e--){var t=this.loggers[e];t.trigger.apply(t,arguments)}}},{start:function(){return this._setupInstance||(this._setupInstance=new this),this._setupInstance}});s.extend(u.prototype,n.Events),e.exports=u},function(e,t,i){"use strict";function n(e){var t=s.result(e,"logKey"),i=s.result(e,"logEnv");if(t){var n=s.result(e,"logOptions")||{};return i&&(n.env=i),o.log(t,n)}}var s=i(3),o=i(820);e.exports=n},function(e,t,i){"use strict";var n=i(821),s=i(832),o=new n({EventClass:s,event_payload_name:"payload",event_filter:function(){return!1},endpoint:function(){return[window.location.protocol,"//",window.location.hostname,"/services/cslog"].join("")}});e.exports=o},function(e,t,i){"use strict";function n(e){this.watching={},this.pending_events=[],this.endpoint=e.endpoint,this.overrides=e.overrides,e.event_payload_name&&(this.event_payload_name=e.event_payload_name),e.event_filter&&(this.event_filter=e.event_filter),e.payload_formatter&&(this.payload_formatter=e.payload_formatter),s.bindAll(this,"_flush_from_timeout"),this._flush_from_timeout();var t=e.EventClass||_;this.Log=f.extend({EventClass:t}),o(window).on("beforeunload.log_lady",s.bind(this._flush_on_unload,this)),this.set_flush_rate()}var s=i(3),o=i(8),r=i(7),a=(i(132),i(180)),l=i(822),c=l.getRealNow,u=i(823),h=i(824),d=i(825),p=[].slice,g=i(826),f=i(828),_=i(831),m=1e3;s.extend(n.prototype,r.Events,{initialize:s.noop,defaults:{flush_rate:15*m},min_flush_rate:function(){var e=s.map(this.watching,function(e){return s.result(e,"flush_rate")});return e.push(this.defaults.flush_rate),s.min(e)},set_flush_rate:function(e){return e&&(this.defaults.flush_rate=e),this.flush_rate=this.min_flush_rate(),this.flush_is_overdue()&&this._flush_from_timeout(),this.flush_rate},flush:function(){var e=s.result(this,"endpoint"),t=this.build_payload();if(e&&!s.isEmpty(t)&&(!this.event_payload_name||!s.isEmpty(t[this.event_payload_name]))&&a.bool("log_lady")){var i=o("#tumblr_form_key").attr("content");return i&&(t.form_key=i),d(e,t,!this.unloading),this.last_flush_at=c(),!0}},_flush_on_unload:function(){this._flush_timeout&&clearTimeout(this._flush_timeout),this._trigger_unloads(),this.unloading=!0,this.flush()},_trigger_unloads:function(){var e;for(var t in this.watching)e=this.watching[t],"function"==typeof e.unloaded&&e.unloaded()},_flush_from_timeout:function(){this._flush_timeout&&clearTimeout(this._flush_timeout);var e=this.flush();e!==!1&&(this._flush_timeout=setTimeout(this._flush_from_timeout,this.flush_rate))},flush_is_overdue:function(){this.last_flush_at||(this.last_flush_at=c());var e=c()-this.last_flush_at;return e>this.flush_rate},watch:function(){var e,t,i,n=p.apply(arguments);for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=t.pt,n=t.is_ad,s=t.video_details,o=t.extraData;i&&(a.default.log(i).trigger(e,{pt:i,eventName:e,video_details:s,extraData:o}),(n||"supply_unload"===e)&&a.default.flush())}});t.default=u},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=[];return(0,o.forEach)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.pt,n=e.event_data,s=(0,o.find)(t,{pt:i});s||(s={pt:i,events:[]},t.push(s)),s.events.push(n)}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.LsLogger=t.lsEndpoint=t.POST_TRACKER=void 0,t.logLadyFormat=s;var o=i(3),r=i(822),a=i(821),l=n(a),c=i(846),u=n(c),h=t.POST_TRACKER="pt",d=t.lsEndpoint="/services/bblog",p=t.LsLogger=l.default.extend({build_payload:function(){var e=l.default.prototype.build_payload.call(this),t=this.event_payload_name&&(0,o.isEmpty)(e[this.event_payload_name]);return(0,o.isEmpty)(e)||t?{}:(e.flushTime=(0,r.getRealNow)(),e)}}),g=new p({EventClass:u.default,event_payload_name:"trackers",event_filter:function(e){var t=e.data;return(0,o.has)(t,h)},payload_formatter:s,endpoint:d});t.default=g},function(e,t,i){"use strict";function n(e,t,i){this.name=t,this.log_key=s.result(e,"log_key"),this.data=i||{};var n=r(),o={pt:this.data.pt,event_data:{timestamp:n,eventString:this.data.eventName||t}};this.data.video_details&&(o.event_data.data=this.data.video_details),this.data.extraData&&(o.event_data.data=o.event_data.data||{},s.extend(o.event_data.data,this.data.extraData)),this.json=o}var s=i(3),o=i(822),r=o.getRealNow;e.exports=n},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(818),o=n(s),r=i(848),a=n(r),l=i(180),c=n(l),u=o.default.extend({logKey:"kraken",logSpots:[],events:function(){return c.default.bool("kraken_web_logging_library")?{"Kraken:*":"log"}:{}},log:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a.default.log("kraken").trigger(e,t),(t.is_ad||"supply_unload"===e)&&a.default.flush()}});t.default=u},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return u.default.groupBy(e,function(e){return u.default.has(e,p.POST_TRACKER)&&!!e.pt})}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,p.logLadyFormat)(e),i=function(e){var t=e.kraken;return delete t.pt,t},n=function(e){return e.data=e.data||e.kraken.event_details,delete e.data.pt,delete e.kraken,e};return t.map(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pt,s=e.events;return{pt:t,krakenEvents:s.map(i),events:s.map(n)}})}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(function(e){var t=e.event_data;return t.kraken})}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new d.default(window,e);return{language:t.language,manufacturer:t.vendor,os_version:t.osVersion,platform:t.platform,build_version:"1728678926-8bc509ecfb9",carrier:"",connection:"",model:""}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!e.length)return{};var t=s(e),i=o(t[_]),n=r(t[m]);return u.default.assign({krakenClientDetails:a()},i.length&&{trackers:i},n.length&&{krakenEvents:n})}Object.defineProperty(t,"__esModule",{value:!0});var c=i(3),u=n(c),h=i(849),d=n(h),p=i(845),g=i(852),f=n(g),_="true",m="false",v=new p.LsLogger({EventClass:f.default,payload_formatter:l,event_filter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,i=e.name,n=t.pt;return!!n||u.default.includes(g.allowedEventNames,i)},endpoint:p.lsEndpoint});t.default=v},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:window,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e);var n=t.screen,o=t.location,a=t.navigator,c=a.appVersion,u=a.browserLanguage,h=a.cookieEnabled,d=a.onLine,p=a.language,g=a.languages,f=a.userAgent,_=a.vendor,m=new l.default(f).getResult(),v=m.browser,b=m.os,y=m.device,w=(new t.Date).getTime(),C=!0,k=t.outerWidth+"x"+t.outerHeight;(0,r.assign)(this,{appVersion:c,browserName:v.name,browserVersion:v.version,client:t,colorDepth:n.colorDepth,cookiesEnabled:h,createdAt:w,deviceModel:y.model,deviceType:y.type,deviceVendor:y.vendor,hasJavascript:C,isOnline:d,language:p||u,languages:g||[],location:o,osName:b.name,osVersion:b.version,resolution:k,screenHeight:n.height,screenWidth:n.width,userAgent:f,vendor:_},i)}return o(e,[{key:"toJSON",value:function(){var e=this.appVersion,t=this.colorDepth,i=this.cookiesEnabled,n=this.hasFlash,s=this.hasImages,o=this.hasJavascript,r=this.language,a=this.languages,l=this.isOnline,c=this.platform,u=this.plugins,h=this.resolution,d=this.screenHeight,p=this.screenWidth,g=this.createdAt,f=this.timezone,_=this.userAgent;return{app_version:e,color_depth:t,cookies_enabled:i,flash_enabled:n,images_enabled:s,javascript_enabled:o,language:r,languages:a,online:l,platform:c,plugins:u,resolution:h,screen_height:d,screen_width:p,time_zone_offset:f,timestamp:g,user_agent:_}}},{key:"screenType",get:function(){if(this.page)return this.page;var e=this.location.pathname,t={Dashboard:"/dashboard",Explore:"/explore",Tagged:"/tagged",SearchResults:"/search",About:"/about",Jobs:"/jobs",Logo:"/logo",Business:"/business",Buttons:"/buttons",Press:"/press",Developers:"/developers",Terms:"/terms",Policy:"/policy",Apps:"/apps",Themes:"/themes",Analytics:"/analytics"};for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if((0,r.startsWith)(e,n))return i}return"Unknown"}},{key:"timezone",get:function(){return(new this.client.Date).getTimezoneOffset()}},{key:"isHeadlessBrowser",get:function(){var e=this,t=["_phantom","Buffer","callPhantom","domAutomation","domAutomationController","emit","spawn","webdriver"];return(0,r.some)(t,function(t){return!!e.client[t]})}},{key:"plugins",get:function(){return(0,r.map)(this.client.navigator.plugins,"name")}},{key:"hasImages",get:function(){var e=this.client.document.getElementById("clp_image");return!!e&&e.width>0}},{key:"hasFlash",get:function(){var e=this.client,t=e.ActiveXObject,i=e.navigator,n=!1;try{n=new t("ShockwaveFlash.ShockwaveFlash")}catch(e){n=i.mimeTypes["application/x-shockwave-flash"]&&i.mimeTypes["application/x-shockwave-flash"].enabledPlugin}return!!n}},{key:"platform",get:function(){var e=(0,r.get)(this,"client.navigator.platform"),t=(0,r.includes)(["iPhone","iPod","iPad","iPhone Simulator","iPod Simulator","iPad Simulator"],e),i=(0,r.includes)(["Android"],e);return t?"Web:iOS":i?"Web:Android":"Web"}}]),e}();t.default=c},function(e,t,i){var n;!function(s,o){"use strict";var r="0.7.12",a="",l="?",c="function",u="undefined",h="object",d="string",p="major",g="model",f="name",_="type",m="vendor",v="version",b="architecture",y="console",w="mobile",C="tablet",k="smarttv",x="wearable",S="embedded",T={extend:function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2===0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i},has:function(e,t){return"string"==typeof e&&t.toLowerCase().indexOf(e.toLowerCase())!==-1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===d?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},E={rgx:function(){for(var e,t,i,n,s,r,a,l=0,d=arguments;l0?2==s.length?typeof s[1]==c?e[s[0]]=s[1].call(this,a):e[s[0]]=s[1]:3==s.length?typeof s[1]!==c||s[1].exec&&s[1].test?e[s[0]]=a?a.replace(s[1],s[2]):o:e[s[0]]=a?s[1].call(this,a,s[2]):o:4==s.length&&(e[s[0]]=a?s[3].call(this,a.replace(s[1],s[2])):o):e[s]=a?a:o;l+=2}return e},str:function(e,t){for(var i in t)if(typeof t[i]===h&&t[i].length>0){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i,n)),a=r.data,c=a.extraData,u=a.eventDetails,h=a.eventString,p=a.ts,g=a._experiments,f=a._clientOverrides;r.experiments=g||{},r.overrides=f||{},delete r.data._experiments,delete r.data._clientOverrides;var _=new d.default(window,r.overrides);return r.json.event_data.kraken={event_name:h||r.name,client_session_id:_.sessionID||"",page:_.screenType||"Unknown",section:_.section||"",client_timestamp:p||Date.now(),event_details:l.default.assign({},c,u,l.default.omit(r.data,"pt","extraData","eventDetails")),experiments:r.experiments},r}return r(t,e),t}(u.default));t.default=p},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"reactivation",logOptions:{init_event:!1},events:{"reactivation:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(e,t){this.log(e,t)}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"notes_interactions",logOptions:{init_event:!1},logEnv:{location:document.location.pathname},events:{"notes-interactions:*":"log"}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"postchrome_interactions",logOptions:{init_event:!1},events:{"postchrome-interactions:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(e,t){this.log(e,t)}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"toastlog",events:{"toastlog:*":"log"}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"async_loading",events:{"async-loading:*":"log"}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"ads_interactions",logOptions:{init_event:!1},events:{"ads-interaction:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(e,t){this.log(e,t)}});e.exports=s},function(e,t,i){"use strict";var n=i(818),s=n.extend({logKey:"user_tag_filtering",logOptions:{init_event:!1},events:{"userTagFiltering:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(e,t){this.log(e,t)}});e.exports=s},function(e,t,i){"use strict";var n=i(237);n({"Tumblr.Prima.Upload":i(523),"Tumblr.Prima.Ligature":i(293),"Tumblr.Events":i(136),"Tumblr.Prima.Events":i(136),"Tumblr.Prima.Dialog":i(213),"Tumblr.Dialog":i(213),"Tumblr.PostMessageChannel":i(861),"Tumblr.Prima.DOMEventor":i(181),"Tumblr.Prima.gutterMediaManager":i(864),"Tumblr.Prima.Vendor.when":i(192),"Tumblr.Prima.Vendor.sequence":i(239),"Tumblr.log_lady":i(865),"Tumblr.Prima.logLady":i(865),"Tumblr.Prima.Models.Post":i(347),"Tumblr.Prima.Models.Tumblelog":i(191),"Tumblr.Prima.CrtPlayer":i(428),"Tumblr.Prima.CrtControl":i(427),"Tumblr.Prima.BlogCard":i(868),"Tumblr.Prima.Url":i(265),"Tumblr.Prima.ToolTip":i(878),"Tumblr.Prima.SharePopover":i(341),"Tumblr.Prima.Messaging.SharePost":i(881),"Tumblr.Prima.utils.caniuse":i(430),"Tumblr.Prima.ConfettiView":i(911),"Tumblr.Prima.FlatSelect":i(925),"Tumblr.Prima.Mixins.loggingData":i(348),"Tumblr.Prima.Mixins.withFormKeyTrue":i(186),"Tumblr.Prima.Scrollbar":i(485),"Tumblr.Prima.MessageControlsPopover":i(927),"Tumblr.Prima.Block":i(212),"Tumblr.Prima.SafeMode":i(929),"Tumblr.Prima.PeeprSearch":i(930),"Tumblr.Prima.MessagingPopover":i(944),"Tumblr.Prima.currentUser":i(182),"Tumblr.Prima.AdsPaginationHelper":i(951),"Tumblr.Prima.SortableView":i(316),"Tumblr.Prima.getLoggingPayloadFromNote":i(952),"Tumblr.Prima.Snowman":i(873),"Tumblr.Prima.postActivityLoader":i(953),"Tumblr.Prima.KnightRiderLoader":i(331),"Tumblr.Prima.Lib.hosts":i(959),"Tumblr.Prima.LivePhotos":i(544),"Tumblr.Prima.Carousel":i(1002),"Tumblr.Prima.ExpandableTags":i(1007),"Tumblr.Prima.Translate":i(130),"Tumblr.Prima.NativeAudio":i(596),"Tumblr.Prima.CTAButton":i(1010),"Tumblr.Prima.Viewability":i(1011),"Tumblr.Prima.ViewabilityTracker":i(1021),"Tumblr.Prima.StatusIndicator":i(686),"Tumblr.Prima.Utils.CanvasTools":i(262),"Tumblr.Prima.Utils.Cookie":i(342)}),e.exports=n},function(e,t,i){"use strict";function n(e){return"string"==typeof e||e&&"object"===("undefined"==typeof e?"undefined":l(e))&&"[object String]"===p.call(e)||!1}function s(){var e=new f;return e.cid=_,_+=1,m[e.cid]=e,e}function o(e,t){for(var i,n=v.length-1;n>=0;n--)v[n].message_callback(e,t);for(n=b.length-1;n>=0;n--)i=b[n],i&&i.shouldRespond&&i.shouldRespond(e,t)&&i.cb(e,t)}function r(e){if(e||(e={}),!(u&&u.stringify&&u.parse))throw"Must have JSON parsing and stringify";if(e.iframe&&(e.window=e.iframe.contentWindow,!e.origin)){var t=e.iframe.src,i=t.match(/^(http(?:s)?:\/\/[\w_\-\.]+(?::\d+)?)\/?/); i&&(e.origin=i[1])}this.namespace=e.namespace?e.namespace+":":"",this.origin=e.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),e.window&&this.setWindow(e.window)}function a(e,t,i){i||(i=this.origin),e.postMessage(t,i)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=i(128),u=c("JSON",function(e){return e&&e.stringify}),h=[].slice,d=function(e,t){return function(){return e.apply(t,arguments)}},p=Object.prototype.toString,g=i(862),f=i(863),_=1,m={},v=[],b=[];!function(){var e=window.addEventListener?"addEventListener":"attachEvent",t=window[e],i="attachEvent"===e?"onmessage":"message";t(i,function(e){var t;if("string"==typeof e.data){try{e.data&&"{"===e.data[0]&&(t=u.parse(e.data))}catch(e){}t&&t.method&&o(e,t)}},!1)}();var y=function(e){if(e.cid_response&&e.cid_response in m){var t=m[e.cid_response];t.resolve.call(null,this,e.response),delete m[e.cid_response]}};r.prototype.setWindow=function(e){if(e){this.window=e;var t=this.call("_syn");t.then(d(function(e,t){"ack"===t&&this._is_connected()},this))}},r.on=function(e,t){var i;i="*"===e?function(){return!0}:"*"===e[e.length-1]?function(t,i){return 0===i.method.indexOf(e.substring(0,e.length-2))}:function(t,i){return i.method===e},b.push({shouldRespond:i,cb:t})},r.off=function(e){for(var t,i=b.length-1;i>=0;i--)if(b[i].cb===e){t=i;break}return!!(t&&t>-1)&&(b.splice(t,1),!0)},r.prototype.match_origin=function(e){return"*"===this.origin||this.origin===e},r.prototype.message_callback=function(e,t){var i;if((!this.window||e.source===this.window)&&this.match_origin(e.origin)){if(t.method&&t.method.slice(0,this.namespace.length)===this.namespace&&(i=t.method.slice(this.namespace.length,t.method.length)),t.args&&n(t.args))try{t.args=u.parse(t.args)}catch(e){return}this.call_responder(i,e,t)}},r.prototype.call_responder=function(e,t,i){var n,s;if(e){if(i.args||(i.args=[]),s=this.responders[e],!s)return this._unanswered_calls[e]||(this._unanswered_calls[e]=[]),void this._unanswered_calls[e].push(arguments);n=s.apply(t,i.args),i.cid&&"_method_callback_responder"!==e&&this.send_to_window(t.source,"_method_callback_responder",{cid_response:i.cid,response:n})}},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(e){return this._on_connected.push.apply(this._on_connected,arguments),this},r.prototype.method=function e(t){var i=this,e=function(){var e=1<=arguments.length?h.call(arguments,0):[];return e.unshift(t),i.send.apply(i,e)};return e},r.prototype.call=function(){var e=1<=arguments.length?h.call(arguments,0):[];return this.window?(e.unshift(this.window),this.call_on_window.apply(this,e)):void console.warn("no window specified on channel")},r.prototype.call_on_window=function(e,t){var i=3<=arguments.length?h.call(arguments,2):[],n=s();try{var o=u.stringify({method:this.namespace+t,args:i,cid:n.cid});"_syn"===t||"_method_callback_responder"===t?a.call(this,e,o):this.send_post_message(e,o)}catch(e){n.reject(e)}return n.promise()},r.prototype.send=function(){var e=1<=arguments.length?h.call(arguments,0):[];return this.window?(e.unshift(this.window),this.send_to_window.apply(this,e)):void console.warn("no window specified on channel")},r.prototype.send_to_window=function(e,t){var i=3<=arguments.length?h.call(arguments,2):[],n=u.stringify({method:this.namespace+t,args:i});"_syn"===t||"_method_callback_responder"===t?a.call(this,e,n):this.send_post_message(e,n)},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 e=0;e0,this.layoutHasGutter||(this.gutterMargin=-65)},$right_column:function(){return this._$right_column||(this._$right_column=r(".right_column")),this._$right_column},toggleBackground:function(e){this.layoutHasGutter&&(e?(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(e,t){return t=a.defaults(t||{},{winRect:s.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(e,t)&&(t.onDock=t.onDock||a.noop,this.gutteredView&&this.removeGutteredView(),this.gutteredView={view:e,options:t},t.onDock.call(e,t),t.dimRadar&&this.toggleBackground(!0),t.dockLoggingName&&t.dockLoggingData&&o.trigger(t.dockLoggingName,{loggingData:t.dockLoggingData}),this.gutteredView)},removeGutteredView:function(){if(this.gutteredView){var e=this.gutteredView.options,t=this.gutteredView.view;e.onUndock=e.onUndock||a.noop,e.onUndock.call(t,e),this.gutteredView=null,e.dimRadar&&this.toggleBackground(!1),e.undockLoggingName&&e.undockLoggingData&&o.trigger(e.undockLoggingName,{loggingData:e.undockLoggingData})}},isViewInGutter:function(e){return this.gutteredView&&this.gutteredView.view===e},isDockable:function(e,t){if(!this.gutteredView)return!0;var i=!this.gutteredView||this.gutteredView.options.alwaysEvict,n=t.alwaysEvict;return!(this.gutteredView.view===e||n&&!i)},handleGutterClick:function(e){this.gutteredView&&(e.preventDefault(),this.gutteredView.options.removeOnGutterClick&&this.removeGutteredView())},gutterPosition:function(){var e=s.rect(),t=this.viewportTransitionWidth/2-this.gutterMargin-this.gutterWidth,i={width:this.maxViewWidth,left:"50%",bottom:20,translateX:t},n=this.maxViewWidth-this.gutterWidth+this.viewportTransitionWidth;return e.windowWidth=0}},function(e,t,i){"use strict";e.exports=i(869)},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(870),r=i(876),a=s.extend({defaults:{include_info_popover:!0,disableUnfollowConfirm:!1},className:"poptica_header",initialize:function(e){this.options=n.extend({},this.defaults,e);var t=n.extend({model:this.model},n.pick(this.options,"targetPost","include_info_popover","disableUnfollowConfirm"));this.header=new o(t),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}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(180),r=i(129),a=i(219),l=i(136),c=i(672),u=i(265),h=i(130),d=i(871),p=i(872),g=i(873),f=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(e){if(this.options=n.extend({},this.defaults,e||{}),this.bindEvents(),this.is_rendered=!1,this.assets_host=r.get("Context/hosts/assets_host")||"",this.$description=null,this.$description_inner=null,!n.isEmpty(this.current_data)){var t=n.extend({},this.current_data,this.model.toJSON());this.model.set(t,{silent:!0})}this.model.get("global_theme_params")&&n.delay(n.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 e=this.model.toJSON();if(e.following||(e.following=!1),this.is_rendered||!e.global_theme_params)return this;var t=n.result(p,e.global_theme_params.title_font),i=c.hexToRgb(e.global_theme_params.title_color);return this.$el.html(this.template(n.merge({},e,{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:!!t&&t.family,title_color_rgb:String(n.values(i).join(",")),followText:h("Follow"),unfollowText:h("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&&(n.delay(n.bind(this.truncateDescription,this),100),this.options.stripDescriptionLineBreaks&&this.stripDescriptionLineBreaks()),this.trigger("ready"),this},stripDescriptionLineBreaks:function(){this.$description_inner.find("br").remove();var e=this.$description_inner.html(),t=e.replace(/[\n\r]/g," ");this.$description_inner.html(t)},truncateDescription:function(){var e=this.$description_inner.get(0);if(!(e.scrollHeight<=e.clientHeight)){var t=this.model.get("global_theme_params"),i=t.background_color,s=c.hexToRgb(i);this.$description.append(this.description_gradient_template({background_color:String(n.values(s).join(","))}))}},__addSnowMan:function(){var e={el:this.$("[data-snowman-container]"),tumblelogName:this.model.get("name")};this.options.include_info_popover&&(e.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(e)},_onFollowClick:function(e){if(e.preventDefault(),!o.bool("is_logged_in"))return void window.open("/follow/"+this.model.get("name"),"_self");var t={follow_data:this.options.follow_data};this.model.get("following")?this._confirm_unfollow(t):(l.trigger("tumblelog:log_follow"),this.model.follow(t))},_confirm_unfollow:function(e){var t={tumblelog:this.model.get("name")},i=this.model.requestUnfollow();if(this.options.disableUnfollowConfirm)i.resolve(),l.trigger("tumblelog:log_unfollow",{loggingData:t});else{var n=h("Are you sure you want to unfollow %1$s?").replace("%1$s",""+this.model.get("name")+""),s={text:n,text_ok:h("Ok"),text_cancel:h("Nevermind")};i.promise.then(function(){l.trigger("tumblelog:log_unfollow",{loggingData:t})}),l.trigger("dialog:confirm:promise",i,s)}},_infoPopoverButtonClicked:function(e){e.preventDefault(),e.stopPropagation(),l.trigger("popticainfopopover:show")},_descriptionLinkClicked:function(e){e.preventDefault();var t=s(e.currentTarget).attr("href");try{if(u&&u.hasAllowedProtocol(t)){if(!u.isAbsoluteUrl(t)){var i="http://"+this.model.get("name")+".tumblr.com/";t="/"===t.charAt(0)?t.substr(1):t,t=i+t}window.open(t,"_blank")}}catch(e){}},_renderFollowButton:function(){var e=this.model.get("following");this.$el.find(".follow").toggle(!e),this.$el.find(".unfollow").toggle(e)},_hidePosts:function(){},_open_dialog:function(e,t){function i(e,t){e.is_disabled=e.is_menu_open,t&&t()}this.is_disabled=!0,e.fail(n.bind(i,null,this)),e.done(n.bind(i,null,this,t))},_renderInlineStyles:function(){var e=this.model.get("global_theme_params"),t=this.model.get("has_default_header")&&o.bool("hide_default_headers_blog_cards"),i=!(!(e.header_image_focused&&e.header_stretch&&e.show_header_image)||t),n=c.hexToHsv(e.background_color),s=c.hexToHsv(e.link_color),r=e.link_color;return c.compare(s,n)&&(r=c.readable(n)),i||(this.$(".navigation .nav_icon").css("color",r),this.$(".navigation .blog_name").css("color",r),this.$(".navigation button").css({color:e.background_color,"background-color":r})),this.$(".description a").css("color",e.link_color),this},_renderFontStyles:function(){if(p){var e=this.model.get("global_theme_params");if(n.has(p,e.title_font)){var t=n.result(p,e.title_font),i="webfont_"+t.path;if(t.path&&!s("head #"+i).length){var o=this.assets_host+"/fonts/"+t.path+"/stylesheet.css";o+=n.has(t,"_v")?"?v="+t._v:"",s("",{id:i,rel:"stylesheet",type:"text/css",href:o}).appendTo(s("head"))}}}},description_gradient_template:n.template('
      ')});e.exports=f},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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj){var is_blog_card_compact="boolean"==typeof blog_card_compact&&blog_card_compact,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),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+='
      ',show_navigation&&(__p+=' "),__p+=" ",global_theme_params.header_image_focused&&global_theme_params.show_header_image&&!hide_default_header&&(__p+='
      ',__p+=is_blog_card_compact||!customizable?' '+__e(title)+' ':' ',__p+="
      "),__p+=" ",avatar_url&&global_theme_params.show_avatar&&(__p+='
      ',__p+=is_blog_card_compact||!customizable?' '+__e(title)+' ':' ',__p+="
      "),__p+=" ",(has_title||has_description)&&(__p+='
      ',has_title&&(__p+='

      '+__e(title)+"

      "),__p+=" ",has_description&&(__p+='
      '+(null==(__t=description_sanitized)?"":__t)+"
      "),__p+="
      "),__p+="
      "}return __p}.toString()).apply(void 0,_values(_imports))},function(e,t){"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"},Favorit:{display_name:"Favorit",family:"'Favorit', sans-serif",path:"favorit",_v:"1"},"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"}};e.exports=i},function(e,t,i){"use strict";var n=i(214),s=i(874),o=n.extend({name:"Snowman",autoAppend:!0,initialize:function(e){this.view=new s(e)}});e.exports=o},function(e,t,i){"use strict";var n=i(226),s=i(875),o=i(191),r=n.extend({template:s,defaults:{canSubscribe:!1},events:{click:"__toggleInfoPopover"},initialize:function(e){return this.options=e,this.model||(this.model=new o({name:this.options.tumblelogName})),this.set({canSubscribe:this.model.get("can_subscribe"),isSubscribed:this.model.get("is_subscribed"),isBlocking:this.model.get("is_blocking")}),this.listenTo(this.model,"change:is_subscribed",this.__subscribeActionSuccess),e.infoPopoverOnDemand||this.__createInfoPopover(),this},__subscribeActionSuccess:function(e){if(e.id===this.model.get("name")){var t=this.model.get("is_subscribed");this.$("[data-subscription-indicator]").toggleClass("is-subscribed",t)}},__toggleInfoPopover:function(e){e.preventDefault(),e.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))}});e.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+=' ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(219),r=i(136),a=i(877),l=o.extend({className:"recent_posts",template:a,events:{"click a":"onPostClick",mouseenter:"onMouseEnter"},defaults:{on_bottom:!0,blog_bg_color:!0,$popover:s(),min_load_time:500,model:{},dashboard_post:{}},initialize:function(e){n.extend(this,this.defaults,e),this.model&&(this.renderLoader(),this.renderInlineStyles(),this.posts=this.model.get("highlighted_posts"),n.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(e){this.model=e,this.posts=this.model.get("highlighted_posts"),n.isUndefined(this.posts)?this.fetchPosts():this.render(!0)},renderLoader:function(){var e=this.model.toJSON();this.$el.html(this.template({loader_color:e.global_theme_params?e.global_theme_params.title_color:"#D9D9D9"}))},renderInlineStyles:function(){var e=this.model.get("global_theme_params");e&&this.blog_bg_color&&(this.$el.css("background-color",e.background_color),this.$el.css("color",e.title_color))},render:function(e){var t=this.posts||this.model.get("highlighted_posts");if(!n.isArray(t))return this;var i=t.join("");return t.length<2?(setTimeout(n.bind(function(){this.$popover.addClass("is_empty"),this.$el.html("")},this),this.min_load_time),this):(this.$el.addClass("has_"+t.length+"_posts"),e===!0?this.$el.addClass("is_cached").html(i):setTimeout(n.bind(function(){this.$el.addClass("is_loaded").html(i)},this),this.min_load_time),this)},onPostClick:function(e){},onMouseEnter:function(e){r.trigger("TumblelogPopover:mouseenter_posts")}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__j=Array.prototype.join;with(obj){var color="undefined"!=typeof loader_color?loader_color:"#D9D9D9";__p+='
      '}return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(214),s=i(879),o=n.extend({name:"ToolTip",class_name:"tumblr_tooltip",initialize:function(e){this.toolTipView=new s(e)}});e.exports=o},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(219),r=i(880),a=o.extend({class_name:"tumblr_tooltip",template:r,defaults:{selector:"",class_name:"",offset:"50%",placement:"up"},initialize:function(e){this.options=e||{},this.options.selector=n.trim((e.selector||this.defaults.selector)+" "),this.options.class_name=e.class_name||this.defaults.class_name,this.options.offset=e.offset||this.defaults.offset,this.options.placement=e.placement||this.defaults.placement,this.tooltips=n(this.options.selector+"[data-tooltip]"),this.tooltips.on("remove",n.proxy(this.remove,this)),this.tooltips.on("mouseenter",s.bind(this.show,this)),this.tooltips.on("mouseleave",s.bind(this.hide,this))},show:function(e){var t=n(e.currentTarget);this.tooltip_template_data={tooltip:t.data("tooltip")};var i=n(this.tooltip(this.tooltip_template_data));t.append(i),this.setElement(i),this.delegateEvents(),i.removeClass("is_closed").addClass("is_open")},hide:function(e){var t=n(e.currentTarget),i=t.find("."+this.class_name);i.removeClass("is_open").addClass("is_closed"),i.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",s.bind(function(e){this.remove(e)},this))},remove:function(e){n(e.currentTarget).remove()},tooltip:function(e){return this.class_name="tooltip_wrapper",this.attributes={text:e.tooltip,placement:this.options.placement,class_name:this.options.class_name,left_css:this.options.offset},this.template(this.attributes)}});e.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+='
      '+(null==(__t=text)?"":__t)+"
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(7),o=i(214),r=i(182),a=i(191),l=i(136),c=i(882),u=i(883),h=i(705),d=i(670),p=i(924),g=new h,f=o.extend({ name:"MessagingSharePost",initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),this.options=e,this.user=r(),this.channels=this._getChannelsEnabledForMessagingAsCollection(),this.messagingShareLogger=new c},render:function(){return this.openPopover(this.options),this},openPopover:function(e){var t,i,s=n.get(e,"postId"),o=n.get(e,"blogUuid"),r=n.get(e,"isNsfw"),a=n.get(e,"favoritesNames",[]),l=n.get(e,"popoverContainer"),c=n.get(e,"pinnedTarget"),h=n.get(e,"externalNetworksData",{}),d=new p(n.extend({post_id:s,tumblelog_name:o},h));return n.isEmpty(s)?null:n.isEmpty(o)?null:n.isEmpty(c)?null:(t={viewOptions:n.bind(function(e){return{shareData:{blogUuid:o,postId:s,isNsfw:r},popoverContainer:e.el,favoritesCollection:g,additionalFavorites:this._getAdditionalFavoritesAsParticipants(a),channels:this.channels,externalNetworksDataModel:d,isExternalSharingEnabled:this.isExternalSharingEnabled(),senderBlogUuid:this.user.getCurrentMessagingChannelUuid()}},this),autoTeardown:!0,teardownOnEscape:!1,pinnedSide:"bottom",isFixedPosition:!1,pinnedTarget:c,popoverContainer:l},this.messagingShareLogger.logShareIntent(s,o),i=new u(t).render(),this._afterPopoverOpen(i),i)},isExternalSharingEnabled:function(){return n.get(this.data,"is_external_sharing_enabled",!1)},_afterPopoverOpen:function(e){var t=e.getView();this.listenToOnce(e,"close",function(){this._onPopoverClose(e)}),this.listenTo(t,"external:click",this._onPopoverExternalNetworkShareClick),this.listenTo(t,"external:success",this._onPopoverExternalNetworkShareSuccess),this.listenTo(t,"external:fail",this._onPopoverExternalNetworkShareFail),l.trigger("keycommands:suspend")},_onPopoverClose:function(e){this.stopListening(e),this.stopListening(e.getView()),l.trigger("keycommands:resume")},_onPopoverExternalNetworkShareClick:function(e){this.messagingShareLogger.logExternalNetworkClicked(e)},_onPopoverExternalNetworkShareSuccess:function(e){this.messagingShareLogger.logExternalNetworkShareSuccess(e)},_onPopoverExternalNetworkShareFail:function(e){this.messagingShareLogger.logExternalNetworkShareFail(e)},_getChannelsEnabledForMessagingAsCollection:function(){return new s.Collection(this.user.getChannelsEnabledForMessaging())},_getAdditionalFavoritesAsParticipants:function(e){return n.reduce(e,function(e,t){var i=new a({name:t});return i.get("uuid")&&i.get("can_receive_messages")&&e.push(new d(i.toJSON(),{parse:!0})),e},[],this)}});e.exports=f},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(214),r=i(136),a=o.extend({name:"MessagingShareLogger",defaults:{namespace:"postchrome-interactions",platform:"web",isDebugEnabled:!1},initialize:function(e){e=s.extend({},e),s.extend(this.attributes,s.pick(e,s.keys(this.defaults)))},logShareIntent:function(e,t){this._logIt("share:intent",{postId:e,postBlogUuid:t})},logExternalNetworkClicked:function(e){var t=e.getName(),i=e.getPostModel(),o=s.extend({},this._getCommonExternalShareData(e),{viewType:e.getType()});this._logIt("share:external",o),r.trigger("dashboard-share:"+t),e.isTypePopup()&&!s.isEmpty(i)&&n.ajax({url:"/svc/share/"+t,method:"POST",withFormKey:!0,data:{post_id:i.get("post_id"),tumblelog_name:i.get("tumblelog_name"),share_fallback:!0}})},logExternalNetworkShareSuccess:function(e){this._logIt("share:external:success",this._getCommonExternalShareData(e))},logExternalNetworkShareFail:function(e){this._logIt("share:external:fail",this._getCommonExternalShareData(e))},_logIt:function(e,t){t=t||{},s.extend(t,{platform:this.get("platform")}),r.trigger(this.get("namespace")+":"+e,{loggingData:t})},_getCommonExternalShareData:function(e){var t=e.getPostModel(),i={network:e.getName()};return s.isEmpty(t)||s.extend(i,{postId:t.get("post_id"),tumblelogName:t.get("tumblelog_name")}),i}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(283),a=i(884),l=o.extend({className:"popover--messaging-share-post popover popover_menu popover_gradient",mixins:[r],initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"viewOptions"))},render:function(){var e=n.isFunction(this.viewOptions)?this.viewOptions(this):this.viewOptions;return this.$wrapper=s("
      ").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(e),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}});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(136),r=i(277),a=i(232),l=i(226),c=i(489),u=i(885),h=i(331),d=i(886),p=i(888),g=i(892),f=i(918),_=i(920),m=i(922),v=i(464),b=i(658),y=i(728),w=i(748),C=i(705),k=i(923),x=l.extend({className:"messaging-share-post",template:u,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(e){return{collection:e.collection,selectedRecipientModel:e.selectedRecipientModel,keyboardManager:e.keyboardManager,keyboardNamespace:"messagingshare:search"}}},resultsView:{constructor:p,options:function(e){return{collection:e.collection,selectedRecipientModel:e.selectedRecipientModel,keyboardManager:e.keyboardManager,keyboardNamespace:"messagingshare:results"}}},messageView:{constructor:w,options:function(e){return{isAutoValidationEnabled:!1,className:"messaging-share-post-message",placeholder:e.get("currentPlaceholder"),keyboardManager:e.keyboardManager,keyboardNamespace:"messagingshare:message",buttonSubmittedClass:"submitted--send-a-post",animationSpeed:250,pluginsArray:e.pluginsArray,isSendAPost:!0}}},externalNetworksView:{constructor:g,options:function(e){return{isExternalSharingEnabled:e.get("isExternalSharingEnabled"),keyboardManager:e.keyboardManager,keyboardNamespace:"messagingshare:external",externalNetworksDataModel:e.externalNetworksDataModel}}},errorView:{constructor:_},favoritesLoaderView:{constructor:h,options:{className:"messaging-share-post-favorites-loader",variation:"small centered",loading:!1}}},initialize:function(e){var t;e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"favoritesCollection","shareData","channels","popoverContainer","additionalFavorites","externalNetworksDataModel")),this.collection=new C,t=this.channels.findWhere({uuid:n.get(e,"senderBlogUuid")})||this.channels.first(),this.keyboardManager=new v({allowMultipleActiveViews:!0}),n.isEmpty(this.get("defaultPlaceholder"))&&this.set("defaultPlaceholder",s("Say something if you like...")),n.isEmpty(this.get("additionalFavoritesPlaceholder"))&&this.set("additionalFavoritesPlaceholder",s("Discuss this post if you like...")),n.isEmpty(this.get("sendingPlaceholder"))&&this.set("sendingPlaceholder",s("Sending...")),this.set({currentPlaceholder:this.get("defaultPlaceholder"),senderBlog:t}),this.additionalFavoritesIds=n.pluck(n.invoke(this.additionalFavorites,"toJSON"),"uuid"),this.channelIds=this.channels.pluck("uuid"),this.selectedRecipientModel=new k,this.blogSelectorPlugin=new m({collection:this.channels,currentTumblelog:t,popoverOptions:{popoverContainer:this.popoverContainer}}),this.pluginsArray=[this.blogSelectorPlugin],this.disableKeys()},afterRenderSubviews:function(){this.loader=new c({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),this._onSearchInputDebounced=n.bind(n.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}),n.defer(n.bind(function(){this.rendered&&this.searchView.focus()},this)),this.keyboardManager.add("messagingshare:main",this),this.focusKeys()},beforeRemove:function(){this.keyboardManager.remove("messagingshare")},fetchByQuery:function(e){n.isEmpty(e)?this.set({isEmpty:!1,isShowFavorites:!0,isLoading:!1}):(this.set("isLoading",!0),this.collection.fetchByQuery(e,this.get("senderBlog").get("uuid")).always(n.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(e,t){var i,s,r,a=this.shareData,l=n.get(this.shareData,"postId"),c=n.get(this.shareData,"blogUuid"),u=n.get(this.shareData,"isNsfw"),h=[],d=!n.isEmpty(e),p=this._getLoggingContext();this.get("isDisabled")||this.get("isSending")||n.isEmpty(a)||(s=b.createPostMessage(l,c,{context:p,creationUserAction:t,is_nsfw:u}),h.push(s),d&&(r=b.createTextMessage(e,{context:p,creationUserAction:t}),h.push(r)),i=this._createConversation(),n.isEmpty(i)||(this.set("isSending",!0),i.appendToQueue(h),o.trigger("messaging:conversation:open:model",i,p),this.close()))},close:function(){this.trigger("close")},_createConversation:function(){var e=this.get("senderBlog"),t=this.getSelectedRecipient();if(n.isEmpty(e)||n.isEmpty(t))return null;var i=e.toJSON(),s=t.toJSON();return new b({participantUuid:e.get("uuid"),participants:[i,s]})},_onCollectionSync:function(e){var t;return!this.rendered||n.isEmpty(this.searchView.getQuery())?void this._setCollectionState():(this.clearSelectedRecipient(),t=0===this.collection.length,t&&this.errorView.setTitle(this.collection.getNoResultsFoundMessage()),this.set({isShowFavorites:!1,isEmpty:t}),void this._resetResultsScroll())},_resetResultsScroll:function(){this.resultsView.$el.scrollLeft(0)},_resetExternalNetworksScroll:function(){this.externalNetworksView.$el.scrollLeft(0)},_applyTheme:function(e){this.messageTheme.setTheme(e),this.searchTheme.setTheme(e)},_setViewStates:function(){var e=this.get("isShowMessage"),t=this.get("isEmpty"),i=this.get("isLoadingFavorites"),n=this.get("isShowExternalNetworksRow");this.js$("submission").toggleClass("show-submission",e),this.js$("external").toggle(n),this.errorView.$el.toggle(t),this.resultsView.toggle(!t),this.favoritesLoaderView.set("loading",i),this._setFocusViews()},_onSearchInput:function(e){this.rendered&&this.fetchByQuery(e)},_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 e=this.getSelectedRecipient(),t=this.get("isSending"),i=!n.isEmpty(e)&&n.contains(this.additionalFavoritesIds,e.get("uuid"));return t?void this.set("currentPlaceholder",this.get("sendingPlaceholder")):void this.set("currentPlaceholder",i?this.get("additionalFavoritesPlaceholder"):this.get("defaultPlaceholder"))},_setButtonState:function(){var e=this.get("isSending"),t=this.get("isDisabled"),i=e||t;this.messageView.set("isDisabled",i)},_setDisabledState:function(){var e=this.getSelectedRecipient(),t=this.get("senderBlog"),i=!n.isEmpty(e)&&e.get("uuid")===t.get("uuid");this.set("isDisabled",i)},_setCollectionState:function(){this.get("isShowFavorites")&&this.collection.reset(this.favoritesCollection.toJSON())},_setFocusViews:function(){var e=[this.searchView],t=[];this.get("isEmpty")||this.get("isLoadingFavorites")||(e.push(this.resultsView),t.push(this.resultsView)),this.get("isShowExternalNetworksRow")&&(e.push(this.externalNetworksView),t.push(this.externalNetworksView)),this.get("isShowMessage")&&e.push(this.messageView),this._focusViews=e,this._tabbableViews=t},_getLoggingContext:function(){var e,t,i=this.get("baseLoggingContext"),s=this.getSelectedRecipient();return n.isEmpty(s)?i:(e=n.contains(this.additionalFavoritesIds,s.get("uuid")),t=e?"trail":this.get("isShowFavorites")?"favorites":"search",i+":"+t)},_onChangeIsSending:function(e,t){this._setButtonState(),this._setPlaceholderState()},_onChangeIsDisabled:function(e,t){this._setButtonState()},_onChangeSelectedRecipient:function(e,t){var i=!n.isEmpty(t);i?(this.messageView.focus(),this._applyTheme(t.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(e,t){this.set("isShowExternalNetworksRow",!t)},_onBlogSelectorChange:function(e,t){this.set("senderBlog",t),this.messageView.focus(),this._setDisabledState()},_onChangeIsLoading:function(e,t){return this._loaderTimeout&&(clearTimeout(this._loaderTimeout),this._loaderTimeout=null),t?void(this._loaderTimeout=setTimeout(n.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(e,t){this.sendPost(e,t)},_onChangeCurrentPlaceholder:function(e,t){this.messageView.setPlaceholder(t)},_addAdditionalFavorites:function(){!n.isEmpty(this.additionalFavorites)&&n.isArray(this.additionalFavorites)&&n.each(this.additionalFavorites.reverse(),function(e){var t=e.get("uuid"),i=this.favoritesCollection.get(t);n.contains(this.channelIds,t)||(n.isEmpty(i)?this.favoritesCollection.unshift(e):(this.favoritesCollection.remove(t),this.favoritesCollection.unshift(i)))},this)},_fetchFavorites:function(){var e=this;this.set("isLoadingFavorites",!0),this.favoritesCollection.fetchFavorites(this.get("numFavorites"),null,!0,!1,"post").always(function(){e.rendered&&(e._addAdditionalFavorites(),e._setCollectionState(),e.set("isLoadingFavorites",!1))})},_getFocusViews:function(){return this._focusViews},_moveFocusUp:function(){this.set("focusIndex",Math.max(0,this.get("focusIndex")-1))},_moveFocusDown:function(){var e=this._getFocusViews()||[];this.set("focusIndex",Math.min(e.length-1,this.get("focusIndex")+1))},_onViewFocusChange:function(e){var t=this._getFocusViews(),i=n.indexOf(t,e);this.set("tabbingView",n.contains(this._tabbableViews,e)?e:null),this.set("focusIndex",i,{silent:!0})},_onChangeFocusIndex:function(e,t){var i=n.get(this._getFocusViews(),t);this.set("tabbingView",n.contains(this._tabbableViews,i)?i:null),n.result(i,"focus")},_onKeyPressTab:function(e){var t=this.get("tabbingView");e.preventDefault(),n.isEmpty(t)||t.isLastFocused()?this._moveFocusDown():t.focusNext()},_onKeyPressShiftTab:function(e){var t=this.get("tabbingView");e.preventDefault(),n.isEmpty(t)||t.isFirstFocused()?this._moveFocusUp():t.focusPrevious()},_onKeyPressEscape:function(e){this.close(),e.preventDefault()},_onKeyPressUp:function(e){e.preventDefault(),this._moveFocusUp()},_onKeyPressDown:function(e){e.preventDefault(),this._moveFocusDown()},_onExternalNetworkShowSubview:function(e){var t="messagingshare:externalnetwork",i=new f({externalNetworkSubview:e});i.render(),this.disableKeys(),this.keyboardManager.add(t,i),this.listenToOnce(i,"goBack",function(){this.stopListening(e),this.keyboardManager.remove(t,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(e){setTimeout(n.bind(function(){this.rendered&&this.close()},this),this.get("closeAfterExternalNetworkShareMs")),this.trigger("external:success",e)},_onExternalNetworkShareFail:function(e){this.trigger("external:fail",e)},_onExternalNetworkClick:function(e){this.trigger("external:click",e)}});e.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 __t,__p="";with(obj)__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(277),a=i(232),l=i(887),c=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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(e){e=e||"",this.js$("input").val(e),this._prevVal=e},_getSelectedRecipient:function(){return this.selectedRecipientModel.get("participant")},_hasSelectedRecipient:function(){return!n.isEmpty(this._getSelectedRecipient())},_onChangeSelectedRecipient:function(e,t){this._setBlogPillRecipient(t),n.isEmpty(t)?this._setInputValue(this.get("currentQuery")):this._clearInput()},_setBlogPillRecipient:function(e){var t=!n.isEmpty(e);this.js$("selected-blog").text(t?e.get("name"):"").toggle(t),this.$el.toggleClass(this.get("hasSelectedBlogNameClass"),t)},_setCurrentQuery:function(e,t){t&&this.unset("currentQuery",{silent:!0}),this.set("currentQuery",e)},_onInputChange:function(e){var t,i,n=s(e.currentTarget).val();this._prevVal!==n&&(t=this.get("currentQuery"),i=this._hasSelectedRecipient()&&n===t,this._setCurrentQuery(n,i),this._prevVal=n)},_onKeyPressBackspace:function(e){this._hasSelectedRecipient()&&(e.preventDefault(),this._setCurrentQuery("",!0))},_onKeyPressEnter:function(e){e.preventDefault(),this.trigger("submit",this)},_onContainerClick:function(){this.focus()},_onInputFocus:function(){this.set("isFocused",!0)},_onInputBlur:function(){this.set("isFocused",!1)},_onChangeIsFocused:function(e,t){t?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onChangeCurrentQuery:function(e,t){t=t||"",this._hasSelectedRecipient()&&this._setBlogPillRecipient(null),n.isEmpty(t)?this.trigger("clear"):this.trigger("search",t)}});e.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;with(obj)__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(682),r=i(232),a=i(485),l=i(471),c=i(889),u=i(891),h=s.extend({className:"messaging-share-post-results",template:u,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:c,options:function(e){return{onSelect:n.bind(e._onSubviewSelect,e),onFocus:n.bind(n.partial(e._setIsFocusedDebounced,!0),e),onBlur:n.bind(n.partial(e._setIsFocusedDebounced,!1),e)}},collection:function(e){return e.collection}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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=n.debounce(n.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(e){this.$el.toggle(e),e||this.resetFocus()},focus:function(){var e=this.get("selectedView"),t=!n.isEmpty(e);t&&this.setSelectedIndex(this.keyboardViewName,n.indexOf(this.resultView,e)),t?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(e){this.rendered&&this.scrollbar&&n.defer(n.bind(this.scrollbar.update,this.scrollbar))},beforeRemove:function(){this.keyboardManager.remove(this.keyboardNamespace),this.scrollbar&&this.scrollbar.destroy()},_onKeyPressLeft:function(e){e.preventDefault(),this.focusPrevious()},_onKeyPressRight:function(e){e.preventDefault(),this.focusNext()},_onKeyPressBackspace:function(e){e.preventDefault()},_onChangeFocusedView:function(e,t){var i=this.previous("focusedView");i&&i.setFocused(!1),t&&t.setFocused(!0)},_onChangeSelectedView:function(e,t){var i=this.previous("selectedView");i&&i.setSelected(!1),t&&t.setSelected(!0)},_onSubviewSelect:function(e,t){var i=e!==this.get("selectedView")?e:null,s=n.isEmpty(i)?null:t;this.selectedRecipientModel.set("participant",s),this.set("selectedView",i)},_setIsFocused:function(e){this.rendered&&this.set("isFocused",e)},_onChangeIsFocused:function(e,t){t?(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(e,t){var i;return n.isEmpty(t)?void this.set("selectedView",null):(i=n.find(this.resultView,function(e){return e.model.get("uuid")===t.get("uuid")}),void this.set("selectedView",i))}});e.exports=h},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(890),r=i(728),a=s.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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(e){this.rendered&&this.set("isSelected",e)},setFocused:function(e){this.rendered&&this.set("isFocused",e)},_onSelect:function(e){e.preventDefault(),n.isFunction(this.onSelect)&&this.onSelect(this,this.model)},_onFocus:function(e){e.preventDefault(),n.isFunction(this.onFocus)&&this.onFocus(this,this.model)},_onBlur:function(e){e.preventDefault(),n.isFunction(this.onBlur)&&this.onBlur(this,this.model)},_onChangeIsSelected:function(e,t){this.$el.toggleClass(this.get("selectedClass"),t)},_onChangeIsFocused:function(e,t){this.$el.toggleClass(this.get("focusedClass"),t),t&&this.$el.focus()}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
      '+__e(name)+'
      '+__e(name)+'
      ',__p+=_.isEmpty(title)?" ":__e(title),__p+="
      ";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+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(682),r=i(232),a=i(485),l=i(347),c=i(331),u=i(471),h=i(893),d=i(895),p=i(897),g=i(917),f=s.extend({className:"messaging-share-post-external-networks",template:g,defaults:{isLoading:!1,isFocused:!1,focusedView:null,isExternalSharingEnabled:!0},mixins:[r,o,u],keycommands:{"keydown:left":"_onKeyPressLeft","keydown:right":"_onKeyPressRight","keydown:backspace":"_onKeyPressBackspace","keydown:shift+backspace":"_onKeyPressBackspace"},subviews:{networkView:{constructor:d,options:function(e){return{onFocus:n.bind(n.partial(e._setIsFocusedDebounced,!0),e),onBlur:n.bind(n.partial(e._setIsFocusedDebounced,!1),e),onShowSubview:n.bind(e._onShowSubview,e),onShareSuccess:n.bind(e._onShareSuccess,e),onShareFail:n.bind(e._onShareFail,e),onShareClick:n.bind(e._onShareClick,e)}},collection:function(e){return e.collection}},networksLoaderView:{constructor:c,options:{className:"messaging-share-post-favorites-loader",variation:"small centered",loading:!1}}},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"keyboardNamespace","keyboardManager","externalNetworksDataModel")),this._setIsFocusedDebounced=n.debounce(n.bind(this._setIsFocused,this),0),this.keyboardViewName="networkView",this.collection=new h,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(e){this.$el.toggle(e),e||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(e){this.rendered&&this.scrollbar&&n.defer(n.bind(this.scrollbar.update,this.scrollbar))},updateComponents:function(){this.collection.reset(n.map(this._getExternalNetworks(),function(e){return{component:e}}))},_setIsFocused:function(e){this.rendered&&this.set("isFocused",e)},_getExternalNetworks:function(){var e=this.get("isExternalSharingEnabled"),t=[{Constructor:p.Flag,options:this._getFlagOptions,isExternal:!1},{Constructor:p.Permalink,options:this._getPermalinkOptions,isExternal:!1},{Constructor:p.CopyPermalink,options:this._getPermalinkOptions,isExternal:!1},{Constructor:p.Embed,options:this._getEmbedOptions,isExternal:!1,isIncluded:this._isShowEmbed},{Constructor:p.Email,options:this._getEmailOptions,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 n.reduce(t,n.bind(function(t,i){var s;return!e&&i.isExternal?t:n.isFunction(i.isIncluded)&&!i.isIncluded.call(this)?t:(s=new i.Constructor(this._getBaseAndNetworkOptions(i.options.call(this))),t.push(s),t)},this),[])},_getPermalinkOptions:function(){return{}},_getEmbedOptions:function(){return{}},_getEmailOptions:function(){return{}},_getTwitterOptions:function(){var e=this.externalNetworksDataModel.get("twitter_username");return{isPopup:n.isEmpty(e),username:e}},_getPinterestOptions:function(){var e=this.externalNetworksDataModel.get("pinterest_share_window"),t=n.get(e,"url"),i=n.get(e,"dimensions");return{popupOptions:i,popupUrl:t}},_isShowPinterest:function(){return this.externalNetworksDataModel.get("show_pinterest")},_isShowEmbed:function(){return this.externalNetworksDataModel.get("show_embed")},_getRedditOptions:function(){return{}},_getFlagOptions:function(){return{}},_getBaseExternalNetworkOptions:function(){var e=this.externalNetworksDataModel.toJSON(),t=n.extend({},e,{id:n.get(e,"post_id")}),i=new l(t);return{postModel:i}},_getBaseAndNetworkOptions:function(e){return this._baseExternalNetworkOptions||(this._baseExternalNetworkOptions=this._getBaseExternalNetworkOptions()),n.extend({},this._baseExternalNetworkOptions,e)},_onKeyPressLeft:function(e){e.preventDefault(),this.focusPrevious()},_onKeyPressRight:function(e){e.preventDefault(),this.focusNext()},_onKeyPressBackspace:function(e){e.preventDefault()},_onChangeFocusedView:function(e,t){var i=this.previous("focusedView");i&&i.setFocused(!1),t&&t.setFocused(!0)},_onChangeIsFocused:function(e,t){t?(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(e){this.trigger("share:subview:show",e)},_onShareSuccess:function(e){this.trigger("share:success",e)},_onShareFail:function(e){this.trigger("share:fail",e)},_onShareClick:function(e){this.trigger("share:click",e)},_onChangeIsLoading:function(e,t){this.networksLoaderView.set("loading",t)},_externalNetworksDataModelRequest:function(e){this.set("isLoading",!0)},_externalNetworksDataModelSync:function(e){this.set("isLoading",!1),this.updateComponents()}});e.exports=f},function(e,t,i){"use strict";var n=i(190),s=i(894),o=n.extend({model:s});e.exports=o},function(e,t,i){"use strict";var n=i(185),s=n.extend({defaults:{component:null}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(896),r=s.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(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(e){this.rendered&&this.set("isFocused",e)},_setLinkHref:function(){var e=this.component.getButtonHref();n.isEmpty(e)||this.$el.attr({href:e,target:"_blank"})},_setLinkClass:function(){this.$el.addClass("network--"+this.component.getName())},_onFocus:function(e){e.preventDefault(),n.isFunction(this.onFocus)&&this.onFocus(this,this.model)},_onBlur:function(e){e.preventDefault(),n.isFunction(this.onBlur)&&this.onBlur(this,this.model)},_onClick:function(e){this.onShareClick&&this.onShareClick(this.component),this.component.isTypeHref()||(e.preventDefault(),this.component.isTypeCallback()?this.component.onClickHandler(e):this.component.isTypePopup()?this._openShareWindow():this.component.isTypeSubview()&&this.component.getSubviewInstance().then(n.bind(function(e){n.isFunction(this.onShowSubview)&&this.onShowSubview(e)},this)).catch(n.bind(function(e){},this)))},_openShareWindow:function(){var e=this.component.getPopupUrl(),t=this.component.getPopupOptions(),i=this.component.getName();n.isEmpty(e)||window.open(e,i+"-share-dialog",t)},_onChangeIsFocused:function(e,t){this.$el.toggleClass(this.get("focusedClass"),t),t&&this.$el.focus()},_onShareSuccess:function(){n.isFunction(this.onShareSuccess)&&this.onShareSuccess(this.component)},_onShareFail:function(){n.isFunction(this.onShareFail)&&this.onShareFail(this.component)}});e.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+=__e(label);return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(898),s=i(901),o=i(902),r=i(903),a=i(904),l=i(907),c=i(913),u=i(916);e.exports={Reddit:n,Pinterest:s,Permalink:o,Embed:a,Flag:r,Email:l,Twitter:c,CopyPermalink:u}},function(e,t,i){"use strict";var n=i(130),s=i(899),o=s.extend({getName:function(){return"reddit"},getLabel:function(){return n("Reddit")},getPopupOptions:function(){return"scrollbars=1,width=860,height=600"},getPopupUrl:function(){return"https://reddit.com/submit?url="+encodeURIComponent(this.getPostUrl())}});e.exports=o},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(192),r=i(214),a=i(900),l=r.extend({name:"BaseExternalNetwork",initialize:function(e){s.extend(this.attributes,s.pick(e,s.keys(this.defaults))),s.extend(this,s.pick(e,"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(e){},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(e){return this.getType()===e},createSubviewInstance:function(e){var t,i,n;return t=this.getSubviewConstructor(),s.isEmpty(t)?null:t.prototype instanceof a?(i=s.extend({},this.getSubviewOptions(),e),n=new t(i),this.listenToOnce(n,"remove",function(e){this.stopListening(e),this.afterSubviewRemoved(e)}),this.listenTo(n,"share",function(e,t){this.onSubviewShare(e,t)}),this.afterSubviewCreated(n),n):null},getSubviewInstance:function(e){var t=o.defer(),i=this.createSubviewInstance(e);return s.isEmpty(i)?t.reject("Could not create external network subview (subview constructor must extend ExternalNetworkEmbedSubview)."):t.resolve(i),t.promise},getShareRequestDataFromSubviewData:function(e){return e},sendShareRequest:function(e){return n.ajax({url:this.getShareUrl(),method:"POST",withFormKey:!0,data:e})},onSubviewShare:function(e,t){var i=this.getShareRequestDataFromSubviewData(e),n=s.extend({},this._getBaseShareRequestData(),i);return this._beforeShare(t,e),this.sendShareRequest(n).then(s.bind(function(){this._afterShareSuccess(t,e),this._afterShare(t,e)},this)).fail(s.bind(function(){this._afterShareFail(t,e),this._afterShare(t,e)},this))},afterSubviewCreated:function(e){},afterSubviewRemoved:function(e){},_getBaseShareRequestData:function(){var e=this.getPostModel(),t={post_id:e.get("post_id"),tumblelog_name:e.get("tumblelog_name")};return this.isTypeSubview()||s.extend(t,{share_fallback:!0}),t},_beforeShare:function(e,t){e.set({isSharing:!0,isShareSuccess:!1,isShareFail:!1}),this.trigger("share:start")},_afterShareSuccess:function(e,t){e.set({isShareSuccess:!0,isShareFail:!1}),e.onShareSuccess(t),this.trigger("share:success")},_afterShareFail:function(e,t){e.set({isShareFail:!0,isShareSuccess:!1}),e.onShareFail(t),this.trigger("share:fail")},_afterShare:function(e,t){e.set("isSharing",!1),e.afterShare(t),this.trigger("share:finished")}},{TYPE_POPUP:"popup",TYPE_SUBVIEW:"subview",TYPE_CALLBACK:"callback",TYPE_HREF:"href"});e.exports=l},function(e,t,i){"use strict";var n=i(3),s=i(226),o=s.extend({defaults:{isSharing:!1,isShareSuccess:!1,isShareFail:!1},initialize:function(e){n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},getTitle:function(){return null},onShareSuccess:function(e){},onShareFail:function(e){},afterShare:function(e){},isShareSuccess:function(){return this.get("isShareSuccess")},isShareFail:function(){return this.get("isShareFail")},share:function(e){this.trigger("share",e,this)},close:function(){this.trigger("close",this)},remove:function(){return this.trigger("remove",this),s.prototype.remove.apply(this,arguments)}});e.exports=o},function(e,t,i){"use strict";var n=i(130),s=i(899),o=s.extend({defaults:{popupUrl:null,popupOptions:null},getName:function(){return"pinterest"},getLabel:function(){return n("Pinterest")},getPopupOptions:function(){return this.get("popupOptions")},getPopupUrl:function(){return this.get("popupUrl")}});e.exports=o},function(e,t,i){"use strict";var n=i(130),s=i(899),o=s.extend({getName:function(){return"permalink"},getLabel:function(){return n("Permalink")},getType:function(){return s.TYPE_HREF},getButtonHref:function(){return this.getPostUrl()}});e.exports=o},function(e,t,i){"use strict";var n=i(136),s=i(130),o=i(899),r=o.extend({getName:function(){return"flag"},getLabel:function(){return s("Report")},getType:function(){return o.TYPE_CALLBACK},onClickHandler:function(e){n.trigger("abuseform:open",{mode:"post",post:this.getPostModel()}),n.trigger("Kraken:abuseform:open",{mode:"post"})}});e.exports=r},function(e,t,i){"use strict";var n=i(130),s=i(899),o=i(905),r=s.extend({getName:function(){return"embed"},getLabel:function(){return n("Embed")},getType:function(){return s.TYPE_SUBVIEW},getSubviewConstructor:function(){return o},getSubviewOptions:function(){return{embedCode:this.postModel.getEmbedCode()}}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(900),r=i(906),a=i(277),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 s("Embed")},getTemplateData:function(){return{embedCode:this.get("embedCode")}},afterRender:function(){n.defer(n.bind(this.selectEmbedCode,this))},selectEmbedCode:function(){var e=this.js$("embed-code");e.focus(),e.select()},_onEmbedCodeClick:function(e){this.selectEmbedCode()}});e.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+='
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(899),r=i(908),a=o.extend({getName:function(){return"email"},getLabel:function(){return s("Email")},getType:function(){return o.TYPE_SUBVIEW},getSubviewConstructor:function(){return r},getShareRequestDataFromSubviewData:function(e){var t={message:n.get(e,"message"),email_address:n.get(e,"email")};return n.get(e,"isAllowReply",!1)&&n.extend(t,{allow_reply_to:!0}),t}});e.exports=a},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(909),r=i(910),a=i(912),l=r.extend({className:"external-network-email-subview external-network-form-subview",template:a,events:n.defaults({"input [data-js-email]":"_onEmailInput"},r.prototype.events),getTitle:function(){return s("Email")},afterRender:function(){n.defer(n.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(e){var t,i,n;this.isFormValid()&&(t=this.js$("email").val(),i=this.js$("message").val(),n=this.js$("allow-reply-checkbox").is(":checked"),this.share({email:t,message:i,isAllowReply:n}))},_onEmailInput:function(e){this.validateForm()}});e.exports=l},function(e,t,i){"use strict";var n=i(8),s={tumblrUrlBasePattern:"^\\s*((https?:)?[/\\\\]+)?([a-z0-9\\.-])*(.com|.net)",tumblrUrlEolPattern:"\\/?\\s*\\/*[a-zA-Z0-9_]*?",isBlank:function(e){return""===n.trim(e)},minLength:function(e,t){return e.length>=t},maxLength:function(e,t){return e.length<=t},range:function(e,t,i){return e.length>=t&&e.length<=i},pattern:function(e,t){return new RegExp(t,"gi").test(e)},isEmail:function(e){return this.pattern(e,"^[a-zA-Z0-9._+-]+@[a-zA-Z0-9][a-zA-Z0-9.-]*[.]{1}[a-zA-Z]{2,20}$")},isUrl:function(e){return this.pattern(e,"^\\s*((https?:)?[/\\\\]+)?([a-z0-9_-]+\\.){1,}([a-z\\.]{2,6})(/[^\\s]*)?\\s*$")},isReportableTumblrUrl:function(e){return this.isTumblrPostUrl(e)||this.isTumblrImageUrl(e)||this.isTumblrSubmissionsUrl(e)||this.isTumblrChatUrl(e)||this.isTumblrChatMessageUrl(e)||this.isTumblrBlogUrl(e)||this.isTumblrBlogViewUrl(e)},isTumblrBlogUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+this.tumblrUrlEolPattern)},isTumblrSubmissionsUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/submissions\\/[a-z0-9-_\\/\\.]{1,}"+this.tumblrUrlEolPattern)},isTumblrChatUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/chats?\\/[0-9]{1,}"+this.tumblrUrlEolPattern)},isTumblrChatMessageUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/chat_message\\/[a-z0-9-_\\/\\.]{1,}"+this.tumblrUrlEolPattern)},isTumblrPostUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/(?:post|blog|private)\\/[a-z0-9-_\\/\\.]{1,}"+this.tumblrUrlEolPattern)},isTumblrBlogViewUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/blog\\/view\\/[a-z0-9-_\\/\\.]{1,}"+this.tumblrUrlEolPattern)},isTumblrImageUrl:function(e){return this.pattern(e,this.tumblrUrlBasePattern+"\\/image\\/[a-z0-9-_\\/\\.]{1,}"+this.tumblrUrlEolPattern)},equals:function(e,t){return e===t},isPhoneNumber:function(e){return e&&/^\d+$/.test(e)&&(10===e.length||11===e.length)},isPostalCode:function(e){return e&&/^\d+$/.test(e)&&(5===e.length||9===e.length)}};e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(900),r=i(911),a=i(277),l=o.extend({tagName:"form",mixins:[a],className:"external-network-form-subview",defaults:n.defaults({isFormValid:!1,isShowConfetti:!0},o.prototype.defaults),events:{"click [data-js-success-container]":"_onSuccessContainerClick",submit:"_onFormSubmit"},initialize:function(e){n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),o.prototype.initialize.apply(this,arguments)},afterRender:function(){var e=this.getSubmitButtonElement();this.listenTo(this,"change:isFormValid",this._onChangeIsFormValid),this.listenTo(this,"change:isSharing",this._onChangeIsSharing),n.isEmpty(e)||(this.submitTextDefault=e.text(),this.submitTextSending=e.attr("data-text-sending")||s("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(e){var t,i=this.getShareSuccessElement();this._toggleElement(i,!0),this._toggleElement(this.getShareFailElement(),!1),i&&this.get("isShowConfetti")&&(t=this._createConfettiView(),i.append(t.render().$el))},onShareFail:function(e){this._toggleElement(this.getShareFailElement(),!0),this._toggleElement(this.getShareSuccessElement(),!1)},isFormFieldsValid:function(){return!0},validateForm:function(){this.set("isFormValid",this.isFormFieldsValid())},setFormIsValid:function(e){this.set("isFormValid",e)},isFormValid:function(){return this.get("isFormValid")},onFormSubmit:function(e){},_createConfettiView:function(){return new r({className:"external-network-form-subview-confetti",autoParty:!0,amount:30,speed:.2})},_setSubmitButtonState:function(){var e=this.getSubmitButtonElement(),t=this.get("isFormValid"),i=this.get("isSharing"),n=!t||i;e.prop("disabled",n),e.text(i?this.submitTextSending:this.submitTextDefault)},_onChangeIsSharing:function(e,t){this._setSubmitButtonState()},_onChangeIsFormValid:function(e,t){this._setSubmitButtonState()},_onSuccessContainerClick:function(e){this.close()},_toggleElement:function(e,t){n.isEmpty(e)||e.toggleClass("visible",t)},_onFormSubmit:function(e){e.preventDefault(),this.onFormSubmit(e)}});e.exports=l},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(226),r=i(136),a=o.extend({id:"milestone-confetti",tagName:"canvas",defaults:{amount:100,autoParty:!1,colors:["#ff492f","#ff8a00","#e8d738","#00cf35","#00b8ff","#7c5cff"],size:40,speed:.5,onDone:n.noop},__resize:function(){this.$parent.length&&(this.el.width=this.$parent.width(),this.el.height=this.$parent.height())},_updateConfetti:function(e,t){this.confettiAngle+=.001,e.off||(e.tiltAngle+=e.tiltAngleIncrement,e.tilt=15*Math.sin(e.tiltAngle-t/3),e.y+=(Math.cos(this.confettiAngle+e.density)+.5*e.radius)*this.options.speed),e.y>this.el.height+20&&(this.isAnimating?(e.tilt=a.range(-10,10,!0),e.tileAngle=0,e.tiltAngleIncrement=a.range(.05,.1),e.x=Math.random()*this.el.width,e.y=-20):e.off||(e.off=!0,this.confettiOffscreen++))},_stopAnimating:function(){this.animationInterval&&(clearInterval(this.animationInterval),this.animationInterval=null),this.isAnimating=!1},_startAnimating:function(e){e=e||!1,this._stopAnimating(),this.animationInterval=setInterval(s.bind(this.draw,this),15),this.isAnimating=!!e||this.isAnimating},initialize:function(e){this.options=s.extend({},this.defaults,e||{}),this.colors=this.options.colors,this.$win=n(window),this.$parent=n(),this.context=this.el.getContext("2d"),this.animationInterval=null,this.confetti=[],this.confettiAngle=0,this.confettiOffscreen=0,this.isAnimating=!1},render:function(){return s.defer(s.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 e=this.options.size,t=.5*e,i=0,n=this.options.amount;i
      '+__e(__("Something went screwy."))+'
      '+__e(__("Post shared!"))+"
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(130),s=i(899),o=i(914),r=s.extend({defaults:{isPopup:!0,username:null,urlToken:"[URL]"},getName:function(){return"twitter"},getLabel:function(){return n("Twitter")},getType:function(){return this.get("isPopup")?s.TYPE_POPUP:s.TYPE_SUBVIEW},getPopupUrl:function(){var e=this.getPostTinyUrl()||this.getPostUrl();return"https://twitter.com/intent/tweet?url="+encodeURIComponent(e)},getPopupOptions:function(){return"width=550,height=420"},getSubviewConstructor:function(){return o},getSubviewOptions:function(){return{username:this.get("username"),urlToken:this.get("urlToken")}}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(130),o=i(910),r=i(915),a=i(277),l=o.extend({className:"external-network-twitter-subview external-network-form-subview",template:r,mixins:[a],defaults:n.defaults({username:null,urlToken:"[URL]",shortUrlLength:23,characterLimit:280,characterCount:0,characterCountExceedsLenghClass:"exceeds-length"},o.prototype.defaults),events:n.defaults({"input [data-js-message]":"_onMessageInput"},o.prototype.events),getTitle:function(){var e=this.get("username");return n.isEmpty(e)?s("Twitter"):s("Twitter (@%1$s)",e)},getTemplateData:function(){return{urlToken:this.get("urlToken")}},afterRender:function(){this.listenTo(this,"change:characterCount",this._onChangeCharacterCount),this._updateCharacterCount(),this._onChangeCharacterCount(this,this.get("characterCount")),n.defer(n.bind(this.focus,this)),o.prototype.afterRender.apply(this,arguments)},isFormFieldsValid:function(){var e=this.get("characterCount");return e>0&&e<=this.get("characterLimit")},onFormSubmit:function(e){this.isFormValid()&&this.share({message:this._getMessage()})},focus:function(){this.js$("message").focus()},_getMessage:function(){return this.js$("message").val()},_updateCharacterCount:function(){var e=this._calculateCharacterCount(this._getMessage());this.set("characterCount",e)},_updateCharacterCountContainer:function(e){var t=this.js$("character-count"),i=this.get("characterCountExceedsLenghClass"),n=this.get("characterLimit")-e;t.text(n).toggleClass(i,n<0)},_getUrlTokenCountFromMessage:function(e){var t=this.get("urlToken"),i=new RegExp(n.escapeRegExp(t),"ig"),s=e.match(i);return n.isEmpty(s)?0:s.length},_getAdditionalUrLengthFromMessage:function(e){var t=this.get("urlToken"),i=this.get("shortUrlLength"),n=this._getUrlTokenCountFromMessage(e);return 0===n?0:n*i-n*t.length},_calculateCharacterCount:function(e){return e.length+this._getAdditionalUrLengthFromMessage(e)},_onChangeCharacterCount:function(e,t){this._updateCharacterCountContainer(t)},_onMessageInput:function(e){this._updateCharacterCount(),this.validateForm()}});e.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+='
      '+__e(__("Something went screwy."))+'
      '+__e(__("Post shared!"))+"
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(130),s=i(899),o=i(213),r=s.extend({getName:function(){return"copy-permalink"},getLabel:function(){return n("Copy Link")},getType:function(){return s.TYPE_CALLBACK},getButtonHref:function(){return this.getPostUrl()},onClickHandler:function(e){e.preventDefault();var t=this._copyText(this.getPostUrl(),e.currentTarget);t?o.alert(n("It's copied! Paste it wherever!")):o.alert(n("Failed to copy permalink."))},_copyText:function(e,t){var i=document.createElement("input");i.value=e,t.appendChild(i),i.focus(),i.select();var n=!1;try{n=document.execCommand("copy")}catch(e){}return t.removeChild(i),n}});e.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+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(919),r=i(277),a=i(232),l=s.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(e){n.extend(this.attributes,n.pick(e,n.keys(this.defaults))),n.extend(this,n.pick(e,"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(),s.prototype.remove.apply(this,arguments)},_onSubviewChangeTitle:function(e){this.js$("title").text(e)},_onSubviewClose:function(){this.close()},_onBackButtonClick:function(e){e.preventDefault(),this.goBack()},_onKeyPressEscape:function(e){e.preventDefault(),this.externalNetworkSubview.isShareSuccess()?this.close():this.goBack()}});e.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+='
      '+__e(__("Back"))+'
      '+__e(title)+'
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(277),r=i(921),a=s.extend({className:"messaging-share-post-error",mixins:[o],template:r,defaults:{title:null},initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)))},setTitle:function(e){this.set("title",e)},getTemplateData:function(){return{title:this.get("title")}},afterRender:function(){this.listenTo(this,"change:title",this._onChangeTitle)},_onChangeTitle:function(e,t){this.js$("title").text(t)}});e.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+="

      "+__e(title)+"

      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(762),o=i(696),r=s.extend({className:"conversation-compose-plugin conversation-compose-plugin--blog-selector",defaults:n.defaults({currentTumblelog:null},s.prototype.defaults),renderWithTemplate:n.noop,initialize:function(e){e=n.extend({},e),n.extend(this.attributes,n.pick(e,n.keys(this.defaults)));var t=n.extend({className:"conversation-compose-plugin-blog-selector",showName:!1,showCaret:!1},n.pick(e,"collection","currentTumblelog","popoverOptions"));this.blogSelectorView=new o(t)},afterRender:function(){this.blogSelectorView.render(),this.$el.html(this.blogSelectorView.el)},getName:function(){return"blog-selector"},getBlogSelector:function(){return this.blogSelectorView}});e.exports=r},function(e,t,i){"use strict";var n=i(185),s=n.extend({defaults:{participant:null}});e.exports=s},function(e,t,i){"use strict";var n=i(3),s=i(185),o=s.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,pinterest_share_window:null,show_pinterest:null,show_embed:null,post_url:null},parse:function(e){return n.get(e,"response.share_popover_data",e)},isValid:function(){return!n.isEmpty(this.get("post_id"))&&!n.isEmpty(this.get("tumblelog_name"))},isPopulated:function(){return!n.isEmpty(this.get("post_url"))}});e.exports=o},function(e,t,i){"use strict";var n=i(214),s=i(926),o=n.extend({name:"FlatSelect",view:function(e){return new s(e)}});e.exports=o},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(219),r=o.extend({el:"body",defaults:{},events:{ "change .flat_select select":"__selectChange"},__selectChange:function(e){var t=n(e.currentTarget);this.updateSelect(t)},initialize:function(e){this.options=s.extend({},this.defaults,e)},updateSelect:function(e){var t=e.siblings("label");t.text(e.find(":selected").text())}});e.exports=r},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(136),r=i(276),a=i(283),l=i(129),c=i(928),u=s.extend({className:"popover--message-controls-popover",mixins:[r,a],template:c,events:{'click [data-action="delete"]':"_delete",'click [data-action="block"]':"_block",'click [data-action="flag"]':"_flag"},initialize:function(e){this.options=n.extend({},e),this.showFlagAndBlock=this.options.blockString&&this._notUsersOwnBlog(),this.post=e.post},_getSender:function(){return!(!this.options.blockString||this.options.blockString.indexOf(":")!==-1)&&this.options.blockString},_notUsersOwnBlog:function(){var e=this._getSender();if(e){var t=l.get("Context/userinfo/channels");return t=n.pluck(t,"name"),!n.includes(t,e)}return!0},_delete:function(e){e.preventDefault(),this.post.delete(e)},_block:function(e){e.preventDefault(),this.post.block(e)},_flag:function(e){e.preventDefault();var t={mode:"message",post:this.post.model},i=this._getSender();i&&(t.sender=i),o.trigger("abuseform:open",t),o.trigger("Kraken:abuseform:open",t)},render:function(){return this.$el.html(this.template()),this},teardown:function(){return this.$el.remove(),this}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=[{id:"-1",appeal:"OWNER_APPEAL_NSFW_UNAVAILABLE",readable:"unavailable"},{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"}],s=i(8),o=i(3),r=i(130),a=i(136),l=i(213),c=function(e){return this.xhr&&this.xhr.abort(),this.xhr=s.ajax({method:"POST",url:"/svc/appeal",data:{post_id:this.model.get("id"),blog_name:this.model.get("tumblelog"),state:e},withFormKey:!0}),this.xhr},u=function(e){return parseInt(o.find(n,{appeal:e}).id,10)},h={_handleProjectXBannerRequest:function(e,t,i){var a=this,c=i.model.get("classification-status");if(o.isObject(c)){var u=c.classification,h=c.status,d=!!i.model.get("reblogged_from_tumblr_url")||!!i.model.get("is_reblog"),p={type:"wide",visible_glass:!0,escape_button:0};if(h===o.find(n,{appeal:"OWNER_APPEAL_NSFW_IN_REVIEW"}).readable||h===o.find(n,{appeal:"OWNER_APPEAL_NSFW_NONE"}).readable||h===o.find(n,{appeal:"OWNER_APPEAL_NSFW_COMPLETE"}).readable){var g=d?"InfoExplicitReblogClick":"InfoExplicitClick";this.logExplicitAction(g,{postId:t,state:h})}else this.logExplicitAction("ReviewExplicitClick",{postId:t});var f={text:r("Appeal"),callback:function(){a.logExplicitAction("RequestReviewExplicit",{postId:t}),a.request(e,t,i),i.model.set("classification-status",{classification:u,status:o.find(n,{appeal:"OWNER_APPEAL_NSFW_IN_REVIEW"}).readable});var l=r(d?"This reblog is in content appeal":"Your post is in content appeal"),c=s(e.target).closest(".x-banner");c.addClass("in-review"),c.find(".message-status").text(l);var h=c.find(".review");h.addClass("question-mark"),h.removeClass("appeal"),h.html("?")}},_=function(e){return{text:r("Learn more"),callback:function(){a.logExplicitAction("LearnMoreExplicit",{postId:t}),window.open(e,"_blank")}}},m={text:r("Dismiss"),btn_class:"blue",callback:function(){a.logExplicitAction("CancelReviewExplicit",{postId:t})}},v={none:r("This content contains sexually explicit content which violates our User Guidelines."),available:r("This post was flagged because we think it contains sexually explicit content which violates our User Guidelines. It has been hidden from others, but not deleted. If you think this was done in error, tap Appeal and a real, live human will review it."),in_review:r("Your post is in content appeal. Once a decision has been made, we'll send you an email."),complete:r("This post was flagged because it contains sexually explicit content which violates our User Guidelines. It has not been deleted but is now only viewable to you. This decision cannot be appealed."),reblog:r("This post was flagged because somewhere in your reblog there might be sexually explicit content which is a violation of our User Guidelines.")},b={contentAppeals:"https://www.tumblr.com/docs/contentappeals",adultContent:"https://www.tumblr.com/docs/adultcontentfaq"};if(d&&h!==o.find(n,{appeal:"OWNER_APPEAL_NSFW_COMPLETE"}).readable&&h!==o.find(n,{appeal:"OWNER_APPEAL_NSFW_AVAILABLE_PRIORITIZE"}).readable&&h!==o.find(n,{appeal:"OWNER_APPEAL_NSFW_AVAILABLE"}).readable)o.extend(p,{text:v.reblog,buttons:{0:_(b.adultContent),1:m}});else switch(h){case o.find(n,{appeal:"OWNER_APPEAL_NSFW_AVAILABLE_PRIORITIZE"}).readable:case o.find(n,{appeal:"OWNER_APPEAL_NSFW_AVAILABLE"}).readable:o.extend(p,{text:v.available,buttons:{0:f,1:_(b.adultContent),2:m}});break;case o.find(n,{appeal:"OWNER_APPEAL_NSFW_IN_REVIEW"}).readable:o.extend(p,{text:v.in_review,buttons:{0:_(b.contentAppeals),1:m}});break;case o.find(n,{appeal:"OWNER_APPEAL_NSFW_COMPLETE"}).readable:case o.find(n,{appeal:"OWNER_APPEAL_NSFW_UNAVAILABLE"}).readable:o.extend(p,{text:v.complete,buttons:{0:_(b.adultContent),1:m}});break;default:o.extend(p,{text:v.none,buttons:{0:_(b.adultContent),1:m}})}l.dialog(p)}},request:function(e,t,i){this._appealState=o.bind(c,i),this.xhr=this._appealState(u("OWNER_APPEAL_NSFW_IN_REVIEW")),this.xhr.done(o.bind(function(){l.alert(r("Okay! We'll review the status of this and email you when we're done."))},this)),this.logAction("RequestReviewButtonClicked",t)},openPeepr:function(e,t){a.trigger("peepr-open-request",{tumblelog_name:e,post_id:t,editing_appearance:!1,should_bypass_safemode_forpost:!0,should_bypass_safemode_forblog:!1}),this.logAction("ShowNsfwPostAnywaysClicked",t)},getAppealArray:function(){return n},logAction:function(e,t){(o.isNumber(t)||o.isString(t))&&a.trigger("safeMode:"+e,{loggingData:{postId:t}})},logExplicitAction:function(e,t){var i=t.postId,n=t.state;(o.isNumber(i)||o.isString(i))&&("InfoExplicitClick"!==e||o.isString(n))&&a.trigger("Kraken:"+e,{loggingData:{state:n,postId:i}})}};e.exports=h},function(e,t,i){"use strict";function n(e){return new s(e)}var s=i(931);e.exports=n},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(226),r=i(136),a=i(180),l=i(182),c=i(932),u=i(933),h=i(935),d=i(942),p=i(812),g=o.extend({className:"peepr-blog-search",template:c,subviews:{filters:{constructor:u},input:{constructor:h}},events:{"submit .blog-search-form":"formSubmitHandler","click .blog-search-form":"onFormClick","click .clear-search":"clearSearch","click .toggle-search":"toggleSearch"},initialize:function(e){this.options=e,this.user=l(),this.searchActive=!1,this.blog=e.blog,this.model=new p({blogname:this.blog.tumblelog_name_or_id,themeParams:this.blog.get("global_theme_params"),isAdult:this.blog.get("nsfw"),isSafeModeEnabled:a.bool("safe_mode")&&this.user.get("safe_mode")}),n.each(this.subviews,function(e){e.options=e.options||{},e.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",n.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 e=this.$el.parents(".navigation_inner"),t=e.width(),i=e.find(".header_controls").outerWidth();this.$el.width(t-i)},onFetchRequested:function(e){this.model.fetch(e)},formSubmitHandler:function(e){e.preventDefault(),this.model.search()},onFormClick:function(e){e.stopPropagation()},toggleSearch:function(e){return e=n.defaults(e,{force:null,focus:!0}),this.model.get("term").length&&null===e.force?void this.clearSearch():(this.searchActive=n.isBoolean(e.force)?e.force:!this.searchActive,this.$el.toggleClass("show-search",this.searchActive),s(".indash_header_wrapper").toggleClass("search-active",this.searchActive),void(this.searchActive?e.focus&&n.delay(n.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 e=this.model.get("term").length>0;this.$el.toggleClass("term-entered",e),e&&(r.trigger("indashblog:search:start"),this.searchActive||this.toggleSearch({focus:!1,force:!0}))},onPostsReset:function(e){e.length&&(r.trigger("indashblog:search:complete",e.toJSON()),this.log("search-complete"))},onOffsetChange:function(e,t){t>=0||(r.trigger("indashblog:search:results-end",this.model.posts.length?null:new d({model:this.model})),this.log("search-results-end"))},onPostsAdd:function(e){r.trigger("indashblog:search:post-added",e.toJSON())},log:function(e,t){var i={loggingData:n.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")},t||{})};r.trigger("peepr-search:"+e,i)},remove:function(){this.model.stopListening(),o.prototype.remove.call(this)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__j=Array.prototype.join;with(obj)__p+='
      ',model.isSafeModeEnabled&&model.isAdult||(__p+=' '),__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(934),r=i(807),a=s.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(){n.defer(n.bind(function(){this.popover=null},this))}});e.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+='';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(136),r=i(277),a=i(936),l=i(940),c=i(941),u=s.extend({className:"search-input",template:c,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 n.trim(this.$$(".blog-search-input").val())},setTerm:function(e){this.$$(".blog-search-input").val(e).blur()},onTermChange:function(e,t){this.setTerm(t)},onModelReset:function(){this.setTerm("")},inputFocusHandler:function(){o.trigger("indashblog:keycommands:suspend",!0)},inputBlurHandler:function(){o.trigger("indashblog:keycommands:resume")}});e.exports=u},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(937),r=s.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(n.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(){n.delay(n.bind(this.hidePopover,this),100)},hidePopover:function(){this.popover&&this.popover.hide()},onPopoverClose:function(){n.defer(n.bind(function(){this.popover=null},this))}});e.exports=r},function(e,t,i){"use strict";var n=i(808),s=i(938),o=n.extend({className:n.prototype.className+" blog-search-autocomplete-popover",bindEvents:function(){n.prototype.bindEvents.apply(this,arguments),this.listenTo(this,"itemSelected",this.subview.selectTerm)},Subview:s});e.exports=o},function(e,t,i){"use strict";var n=i(8),s=i(136),o=i(226),r=i(939),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(e){this.selectTerm(n(e.currentTarget))},selectTerm:function(e){s.trigger("peeprsearch:change:term",{term:e.attr("data-term")})}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj){__p+='
      • '+__e(__("Popular Tags:"))+"
      • ";for(var i=0;i#'+__e(model.typeAheadMatches[i].tag)+" ";__p+="
      "}return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(136),r=i(185),a=i(190),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(e){this.set("matchTerm",e.term)},hasMatches:function(){return this.items.length&&this.get("typeAheadMatches").length||!this.fetched},setMatches:function(){var e=this.get("matchTerm");if(!e.length)return void this.set("typeAheadMatches",this.items.toJSON());var t=this.items.filter(function(t){return t.get("tag").indexOf(e)>-1});this.set("typeAheadMatches",s.invoke(t,"toJSON"))},getItems:function(){if(this.items.length){var e=n.Deferred();return e.resolve(),e.promise()}return this.fetch(arguments)},parse:function(e){return this.items.reset(e.tags),this.fetched=!0,s.omit(e,"tags")}});e.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+='';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(8),s=i(3),o=i(136),r=i(226),a=i(943),l=r.extend({className:"search-no-results",template:a,afterRender:function(){this.setHeight(),this.listenTo(o,"DOMEventor:flatresize",s.throttle(this.setHeight,300))},setHeight:function(){var e=n(".indash_blog .posts"),t=e.outerHeight()-e.height(),i=n(".indash_blog .header").height();this.$el.height(n(window).height()-i-t)}});e.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+='

      '+(null==(__t=__("Nothing here about
      %s.",_.escape(model.term)))?"":__t)+"

      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";e.exports=i(945)},function(e,t,i){"use strict";var n=i(3),s=i(136),o=i(180),r=i(226),a=i(946),l=i(950),c=i(686),u=r.extend({template:l,className:"messaging-popover-icon nav_icon",events:{click:"_onIconClick"},initialize:function(e){this.options=n.extend({},this.defaults,e),n.extend(this,n.pick(e,"model"))},subviews:{statusIndicator:{constructor:c,options:function(e){return{isOnline:e.model.get("isOnline"),canSeeUIFlag:o.bool("status_indicator"),name:e.model.get("name")}}}},showPopover:function(){this.popover||(this.popover=new a({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(){s.trigger("messaging:conversation:open:tumblelogs",[this.model],"peepr")},openAsk:function(){s.trigger("ask:form:open",{recipient:this.model.get("name"),allow_anonymous:this.model.get("anonymous_asks")})},_onIconClick:function(){this.openMessaging(),(this.model.get("asks")||this.model.get("submissions"))&&this.showPopover()},_onMessagingSelected:function(){this.openMessaging()},_onAskSelected:function(){this.openAsk()},_onPopoverClose:function(){this.stopListening(this.popover),this.stopListening(this.popover.getView()),this.popover=null}});e.exports=u},function(e,t,i){"use strict";var n=i(3),s=i(219),o=i(947),r=i(276),a=i(283),l=i(949),c=s.extend({className:"popover--messaging-peepr popover info_popover popover_gradient",template:l,mixins:[r,a],initialize:function(e){this.options=n.extend({},this.defaults,e),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}});e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(226),o=i(948),r=s.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(e){e.preventDefault(),this.trigger("messagingSelected"),this.trigger("popoverClose")},_onClickAsk:function(e){e.preventDefault(),this.trigger("askSelected"),n.delay(n.bind(function(){this.trigger("popoverClose")},this),1)}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)hasMessaging&&(__p+='
    • '+__e(_("Send a message"))+"
    • "),__p+=" ",hasAsks&&(__p+='
    • '+__e(_("Ask a question"))+"
    • "),__p+=" ",hasSubmissions&&(__p+='
    • '+__e(_("Submit"))+"
    • ");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+='
      ';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="",__e=_.escape;with(obj)__p+='
      '+__e(_("Send a message"));return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(214),s=n.extend({name:"AdsPaginationHelper",defaults:{nextAdPos:0},initialize:function(){this.set(this.data)},getNextAdPos:function(){return this.get("nextAdPos")}});e.exports=s},function(e,t,i){"use strict";function n(e){var t=e.filter(function(e){return o.includes(r,e)});return t.join("_")}function s(e){var t=e.closest(".post"),i=o.get(t.data("json"),"post-id")||t.attr("data-post-id"),s=t.find(".note_link_current").data("count"),r=n(e.attr("class").split(" "));return{postId:i,noteCount:s,noteType:r}}var o=i(3),r=["like","reblog","answer","reply","photo","with_commentary"];e.exports=s},function(e,t,i){"use strict";var n=i(248),s=function(e){i.e(3,function(t){try{e(i(954))}catch(e){n(e,"post-activity")}})};e.exports=s},,,,,,function(e,t,i){"use strict";function n(e){s||(s=r.get("Context/hosts"));var t=o.snakeCase(e);return o.endsWith(t,"_host")||(t+="_host"),o.get(s,t)}var s,o=i(3),r=i(129),a={get:o.memoize(n)};e.exports=a},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n=i(1003);e.exports=n},function(e,t,i){"use strict";var n=i(226),s=i(1004),o=i(3),r=i(1006),a=i(138),l=i(136),c=i(220),u=i(348),h=n.extend({className:"carousel-container",template:r,hasPeeked:!1,mixins:[u],subviews:{carouselPositionView:{constructor:s,options:function(e){return{photoCount:e.model.get("photoset_photos").length}}}},events:{"click .carousel-item-container a":"contentLinkClick"},initialize:function(e){e=e||{},this.currentItem=0,this.redirectUrlPrimary=e.redirect_url_primary,this.setupWatcher(),this.model.set("is_carousel",!0),this.model.set("carousel_index",this.currentItem)},afterRenderSubviews:function(){var e=this;o.defer(function(){e.imageWidth=e.carouselPositionView.$el.width(),window.parent.postMessage("resize_photoset_iframe;"+e.model.get("id")+";"+e.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,redirect_url_primary:this.redirectUrlPrimary})),this},peekIfInViewport:function(){var e=this;!this.hasPeeked&&this.watcher&&this.watcher.isFullyInViewport&&(this.carouselItemContainer.addClass("peek-animation"),c.animation(this.carouselItemContainer,function(){e.carouselItemContainer.removeClass("peek-animation")}),this.hasPeeked=!0,this.stopListening(l,"DOMEventor:flatscroll"),this.watcher=null)},peekLeft:function(){var e=this.$(".carousel-wrapper");e.addClass("peek-left-animation"),c.animation(e,function(){e.removeClass("peek-left-animation")})},peekRight:function(){var e=this.$(".carousel-wrapper");e.addClass("peek-right-animation"),c.animation(e,function(){e.removeClass("peek-right-animation")})},processCarouselItemSwitch:function(e){this.model.get("pt")&&l.trigger("carousel:slide",{loggingData:this.loggingData({userAction:"slide",extraData:{offset:this.currentItem,target_offset:e}})}),this.carouselItemContainer.css({transform:"translate3d("+e*-this.imageWidth+"px, 0, 0)"}),this.currentItem=e,this.model.set("carousel_index",e)},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}})})}});e.exports=h},function(e,t,i){"use strict";var n=i(8),s=i(226),o=i(1005),r=s.extend({autoAppend:!0,template:o,events:{"click .carousel-button":"onCarouselButtonClick","click .carousel-arrow-right":"goToNextItem","click .carousel-arrow-left":"goToPrevItem"},initialize:function(e){e=e||{},this.photoCount=e.photoCount||0,this.currentItem=0},switchCarouselItem:function(e){this.trigger("switchCarouselItem",e)},goToItem:function(e){e>=0&&e<=this.photoCount-1?(this.$(".carousel-button").removeClass("current"),this.$('.carousel-button[data-carousel-button-index="'+e+'"]').addClass("current"),this.currentItem=e,this.switchCarouselItem(this.currentItem)):e<0?this.trigger("peekLeft"):e>this.photoCount-1&&this.trigger("peekRight")},goToNextItem:function(e){this.goToItem(this.currentItem+1)},goToPrevItem:function(e){this.goToItem(this.currentItem-1)},onCarouselButtonClick:function(e){var t=n(e.target).data("carousel-button-index");this.goToItem(t)},render:function(){return this.$el.html(this.template({photoCount:this.photoCount})),this}});e.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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj){for(__p+='"}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){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;with(obj)__p+='
      ';return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(1008);e.exports=n},function(e,t,i){"use strict";var n=i(226),s=i(1009),o=i(136),r=i(8),a=n.extend({events:{"click .see-all-tags":"_expandTags","click .post_tag":"_clickTag"},hasExpandedTags:!1,template:s,_expandTags:function(e){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(e){var t=r(e.target);o.trigger("postchrome-interactions:tag-click",{loggingData:{action:"tag-click",tag:t.text(),hasExpandedTags:this.hasExpandedTags?"true":"false",wasHidden:this.hasExpandedTags&&t.position().top>81?"true":"false",postId:this.model.get("id"),tagIndex:t.index()}})}});e.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+='
      ... '+__e(__("See all"))+"
      ";return __p}.toString()).apply(void 0,_values(_imports))},function(e,t,i){"use strict";var n=i(219),s=i(136),o=n.extend({events:{click:"_onLinkClick"},initialize:function(e){e&&e.postModel?this.postModelJSON=e.postModel.toJSON():this.postModelJSON=""},_onLinkClick:function(){this._triggerEvent("buttonClick")},_triggerEvent:function(e){s.trigger("CTAButton:"+e,{loggingData:{postData:this.postModelJSON,userAction:"action_click"}})}});e.exports=o},function(e,t,i){"use strict";var n=i(214),s=i(1012),o=i(1015),r=i(1017),a=i(1016),l=n.extend({name:"Viewability",autoAppend:!0,defaults:{},initialize:function(e){var t=this,i=e.isVideo,n=e.beacons,a=e.beaconRules,l=e.element;this.el=l,i?this.context=new o(this.el,function(){return t.stateChanged}):this.context=new s(this.el,function(){return t.stateChanged}),this.rulesEngine=new r(a,n,this.context)},stateChanged:function(e){switch(e){case a.RESET:this.rulesEngine.resetRules(function(e){return!0});break;case a.RESET_AUDIO:this.rulesEngine.resetAudioOnContinuousRules();break;case a.RESET_CONTINUOUS:this.rulesEngine.resetContinuousRules();break;default:this.rulesEngine.checkRules(this.context)}}});e.exports=l},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{ constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var r=function(){function e(e,t){for(var i=0;il}return s(e,[{key:"isMuted",value:function(){}},{key:"getTimeOffset",value:function(){return Date.now()/1e3}},{key:"percentageInView",value:function(){var e=100*this.positionMonitor.getPercentageInView();return e>0&&0===this.timeInView?this.timeInView=this.getTimeOffset():0===e&&(this.timeInView=0),e}},{key:"timePosition",value:function(){}},{key:"maxDuration",value:function(){}},{key:"getElHeight",value:function(){var e=this.positionMonitor.getElHeight();return o.isNumber(e)?e:-1}},{key:"getElWidth",value:function(){var e=this.positionMonitor.getElWidth();return o.isNumber(e)?e:-1}},{key:"getMacroValue",value:function(e){}}]),e}();e.exports=c},function(e,t,i){"use strict";var n=i(3),s=i(8),o=i(136),r=i(226),a=r.extend({defaults:{frameLeft:null,frameTop:null,frameRight:null,frameBottom:null,isTabHidden:!1,headerHeight:0},initialize:function(e){this.listenTo(o,"DOMEventor:flatresize",this.setHeaderHeight),this.$headerEl=s(e.headerEl),this.setHeaderHeight(),this.$window=s(window),this.setFramePositions(),s(document).on("visibilitychange",n.bind(this.setVisibility,this))},setVisibility:function(e){this.set("isTabHidden","hidden"===document.visibilityState)},setHeaderHeight:function(){this.set("headerHeight",this.getFramePosition(this.$headerEl.outerHeight()))},setFramePositions:function(){this.set({frameTop:this.getFramePosition(this.$window.scrollTop())+this.get("headerHeight"),frameBottom:this.getFramePosition(this.$window.scrollTop())+this.getFramePosition(this.$window.height()),frameLeft:this.getFramePosition(this.$window.scrollLeft()),frameRight:this.getFramePosition(this.$window.scrollLeft())+this.getFramePosition(this.$window.width())})},getFramePosition:function(e){return n.isNumber(e)?e:-1},getElWidth:function(){var e=this.$el.width();return n.isNumber(e)?e:-1},getElHeight:function(){var e=this.$el.height();return n.isNumber(e)?e:-1},getPercentageInView:function(){if(this.get("isTabHidden"))return 0;this.setFramePositions();var e=this.getElWidth(),t=this.getElHeight(),i=this.$el.offset(),n=i.left,s=i.top,o=i.left+e,r=i.top+t,a=0,l=0,c=0,u=0,h=0,d=0,p=0,g=0,f=0;if(this.get("frameTop")>r||this.get("frameBottom")o||this.get("frameRight")s&&(d=this.get("frameTop")-s,a=d*e),this.get("frameBottom")n&&(g=this.get("frameLeft")-n,c=g*t),this.get("frameRight")=Math.min(15e3,t)&&(this.isInViewHalfTime=!0)}return r(this.isInViewHalfTime)}},{key:"macroIsInView",value:function(){return this.percentageInView()>=50?1:2}},{key:"isMuted",value:function(){return this.videoPlayer.player.crt.get("muted")}},{key:"macroIsMuted",value:function(){return this.isMuted()===!1?"1":"2"}},{key:"isExpanded",value:function(){return this.videoPlayer.player.crt.get("isFullscreen")}},{key:"macroIsExpanded",value:function(){return r(this.isExpanded())}},{key:"getIVT",value:function(){var e=l.get(window,"DARLA.metrics.getIvtSignals");return e?window.encodeURIComponent(e()):"-1"}},{key:"addEventListeners",value:function(){this.videoPlayer.on({"change:muted":this.handleMute,"change:paused":this.handlePause,"change:_position":this.positionChanged},this),this.videoPlayer.player.on("loop",l.bind(this.handleLoop,this))}},{key:"handleMute",value:function(e,t){t&&this.resetAudioTimedMacros(),this.stateChangeFn(u.POSITION_CHANGE)}},{key:"handlePause",value:function(){this.stateChangeFn(u.RESET_CONTINUOUS),this.resetContinuousTimedMacros()}},{key:"positionChanged",value:function(e,t){this.processTimedMacros(t),this.currentTimePos=t,this.stateChangeFn(u.POSITION_CHANGE)}},{key:"handleLoop",value:function(){this.resetState(),this.stateChangeFn(u.RESET)}},{key:"timePosition",value:function(){return this.currentTimePos}},{key:"maxDuration",value:function(){return 0===this.duration&&(this.duration=this.videoPlayer.player.crt.get("duration")),this.duration}},{key:"resetState",value:function(){this.resetAllTimedMacroState()}},{key:"processTimedMacros",value:function(e){var t=this;l.forEach(this.timedMacros,function(i,n){var s=!0,o=!0;if(i.a&&t.videoPlayer.player.crt.get("muted")&&(s=!1),i.p&&t.percentageInView()=t)}},{key:"getMacroValue",value:function(e){return this.callbackMacros[e]?this.callbackMacros[e].call(this,e):"-1"}}]),t}(c);e.exports=h},function(e,t){"use strict";var i={POSITION_CHANGE:"position_change",RESET:"reset",RESET_AUDIO:"reset_audio",RESET_CONTINUOUS:"reset_continuous"};e.exports=i},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;i0&&e.percentageInView()