lounge_002.js 258 KB

123456789
  1. define("core/utils/getEmbeddedData",[],function(){"use strict";return function(a){var b=window.document.getElementById("disqus-"+a);try{return b&&JSON.parse(b.textContent||b.innerHTML)}catch(c){return null}}}),define("core/analytics/jester",["jquery","underscore","backbone","core/analytics/identity","core/config/urls"],function(a,b,c,d,e){"use strict";var f=c.Model.extend({url:e.jester+"/event.js",defaults:{experiment:"default",variant:"control"},setHostReferrer:function(a){a&&-1!==a.indexOf("http")&&this.set("page_referrer",a)},decoratePayload:function(c){c.event||(c.event="activity"),c=b.extend(this.toJSON(),c),b.extend(c,{imp:d.impression.impId,prev_imp:d.impression.prevImp}),c.section||(c.section="default"),c.area||(c.area="n/a");var e=a.param(c).length;if(e>2048&&this.has("page_referrer")){var f=window.document.createElement("a");f.href=this.get("page_referrer");var g=f.hostname;g&&(c.page_referrer_domain=g),delete c.page_referrer}return c},emit:function(c){return a.ajax({url:b.result(this,"url"),data:this.decoratePayload(c),dataType:"script",cache:!0})}}),g=function(b){var c=new window.Image;return c.src=e.jester+"/stat.gif?"+a.param({event:b}),c},h=function(c,d){if(!b.any(d,function(a){return 0>a})){b.each(d,function(a,b){d[b]=Math.round(a)});var f=new window.Image;return f.src=e.jester+"/telemetry/"+c+".gif?"+a.param(d),f}},i=new f;return{ActivityClient:f,client:i,logStat:g,telemetry:h}}),define("core/utils/isAdBlockEnabled",["jquery","underscore"],function(a,b){"use strict";var c="adsbox",d=100,e=window.document;return b.memoize(function(){var b=a.Deferred(),f=e.createElement("div");return f.innerHTML="&nbsp;",f.className=c,e.body.appendChild(f),setTimeout(function(){b.resolve(0===f.offsetHeight),e.body.removeChild(f)},d),b.promise()})}),define("core/utils/html/toRGBColorString",[],function(){"use strict";var a="Color components should be numbers.";return function(b){var c=Number(b.red),d=Number(b.green),e=Number(b.blue);if(isNaN(c)||isNaN(d)||isNaN(e))throw new Error(a);var f="rgb",g=[c,d,e],h=b.alpha;if(h){if(h=Number(h),isNaN(h))throw new Error(a);f+="a",g.push(h)}return f+"("+g+")"}}),define("lounge/tracking",["jquery","underscore","core/analytics/identity","core/analytics/jester","core/bus","core/utils/url/serialize","core/utils/isAdBlockEnabled","core/utils/html/toRGBColorString","remote/config","common/intelligence","common/urls","common/utils","common/main"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){"use strict";function n(i,n){function p(a,d,e){var g=a.user.id,h=l.isDNTEnabled(),j=b.extend({event:"init_embed",thread:v,forum:s,forum_id:t,imp:c.impression.impId,prev_imp:c.impression.prevImp,thread_slug:u.get("slug"),user_type:a.user.get("user_type")||"anon",referrer:i.document.referrer,theme:"next",dnt:h?"1":"0",abe:e?"1":"0",tracking_enabled:d?"1":"0",embed_hidden:n.config.isBehindClick?"1":"0"},n.config.experiment);g&&"0"!==g&&(j.user_id=g);var m=r.get("settings");m&&b.has(m,"organicDiscoveryEnabled")&&b.extend(j,{organic_enabled:m.organicDiscoveryEnabled,promoted_enabled:m.promotedDiscoveryEnabled,max_enabled:m.discoveryMax,thumbnails_enabled:m.discoveryThumbnailsEnabled}),(new i.Image).src=f(k.jester+"/event.gif",j,!1)}var q=new j.Intelligence,r=n.forum,s=r.id,t=r.get("pk"),u=n.thread,v=u.id;n.session.on("change:id",function(a){d.client.set("user_id",a.id)}),n.session.once("change:id",function(){var a=this,b=o.shouldTrack(r,this.user);b&&o.load3rdParties(u),q.init({version:"next",forum:s,features:n.initialData.features,session:a.user}),n.session.on("change:id",function(a){q.setSession(a),q.trackEvent(a.id?"login":"logout")}),g().then(function(c){p(a,b,c)})}),d.client.set({product:"embed",thread:v,thread_id:v,forum:s,forum_id:t,zone:"thread",version:m.version}),n.once("bootstrap:complete",function(){d.client.set({page_url:n.config.referrer});var a=n.config.experiment;a&&d.client.set({experiment:a.experiment,variant:a.variant,service:a.service}),d.client.setHostReferrer(n.config.hostReferrer)});var w={inViewport:function(){var c=n.config;q.trackEvent("view_embed");var e={color_scheme:c.colorScheme,anchor_color:h(c.anchorColor),typeface:c.typeface,width:a(i.document).width()};e=b.pick(e,function(a,c){switch(c){case"width":return b.isNumber(a);default:return b.isString(a)&&""!==a}}),d.client.emit({verb:"view",object_type:"product",object_id:"embed",extra_data:JSON.stringify(e)}),n.off("inViewport")},"uiAction:createPost":function(a){n.session.user.id||q.setSession("guest"),a.get("parent")?q.trackEvent("post_comment_reply"):q.trackEvent("post_comment")},"uiCallback:postCreated":function(a,c){c=c||{},b.extend(c,{object_type:"post",object_id:a.id,verb:"post"}),a.has("parent")&&(c.target_type="post",c.target_id=a.get("parent")),d.client.emit(c)},"uiAction:seeMore":function(a){d.client.emit({verb:"open",object_type:"section",object_id:"thread/page-"+a})},"uiAction:postUpvote":function(a,b){q.trackEvent("like_comment"),d.client.emit({verb:"like",object_type:"post",object_id:a.id,area:o.getEventTrackingArea(b)})},"uiAction:postUnvote":function(a,b){d.client.emit({verb:"unlike",object_type:"post",object_id:a.id,area:o.getEventTrackingArea(b)})},"uiAction:postDownvote":function(a,b){q.trackEvent("dislike_comment"),d.client.emit({verb:"dislike",object_type:"post",object_id:a.id,area:o.getEventTrackingArea(b)})},"uiAction:upvotersCardShow":function(){q.trackEvent("upvoters_card_shown")},"uiAction:showProfileFromUpvotes":function(){q.trackEvent("upvoters_profile_click")},"uiAction:threadUnlike":function(){d.client.emit({verb:"unlike",object_type:"thread",zone:"thread"})},"uiAction:threadLike":function(){q.trackEvent("like_thread"),d.client.emit({verb:"like",object_type:"thread"})},"uiAction:postShare":function(a,b){q.trackEvent("share_comment_"+b),d.client.emit({verb:"share",object_type:"post",object_id:a.id,target_type:"service",target_id:b})},"uiAction:threadShare":function(a){q.trackEvent("share_thread_"+a),d.client.emit({verb:"share",object_type:"thread",target_type:"service",target_id:a})},"uiAction:clickLink":function(a,b){d.client.emit({verb:"click",object_type:"link",object_id:a[0].href,area:o.getEventTrackingArea(b)})},"uiAction:followUser":function(a){q.trackEvent("follow_user"),d.client.emit({verb:"follow",object_type:"user",object_id:a.id})},"uiAction:unfollowUser":function(a){d.client.emit({verb:"stop-following",object_type:"user",object_id:a.id})},"uiAction:openLogin":function(a){q.trackEvent("open_login_"+a),d.client.emit({verb:"open",object_type:"login",object_id:a})},"uiAction:finishRegistrationEmbed":function(){q.trackEvent("finish_registration_embed")},"uiAction:finishRegistrationWindow":function(){q.trackEvent("finish_registration_window")},"uiAction:finishAccountComplete":function(){q.trackEvent("finish_account_complete")},"uiAction:onboardAlertShow":function(){d.client.emit({verb:"view",object_type:"area",object_id:"onboard_alert"})},"uiAction:onboardAlertDismiss":function(){d.client.emit({verb:"close",object_type:"area",object_id:"onboard_alert"})},"uiAction:openHome":function(){d.client.emit({verb:"open",object_type:"product",object_id:"bridge"})},viewActivity:function(a,b){var c={verb:"view",object_type:a,object_id:b};d.client.emit(c)}};n.on(w),e.on(w)}var o={};return o.init=function(a){n(window,a)},o.getEventTrackingArea=function(b){return a(b.currentTarget).closest("[data-tracking-area]").attr("data-tracking-area")},o.load3rdParties=function(c){if(k.glitter){var d=i.lounge.tracking||{},e=d.iframe_limit||0;a.ajax({dataType:"jsonp",cache:!0,url:k.glitter,data:{forum_shortname:c.forum.id,thread_id:c.id},jsonpCallback:"dsqGlitterResponseHandler",success:function(c){var d=a("body");b.each(c,function(b){("img"===b.type||"iframe"===b.type)&&("iframe"===b.type&&(e-=1,0>e)||d.append(a("<"+b.type+">").hide().attr("src",b.url)))})}})}},o.shouldTrack=function(a,b){return!(a&&a.get("settings").disable3rdPartyTrackers||b&&b.get("disable3rdPartyTrackers")||"1"===l.cookies.read("disqus_tracking_optout")||l.isDNTEnabled())},o}),define("core/utils/uniqueId",[],function(){"use strict";var a=0;return function(b){a+=1;var c=String(a);return b?b+c:c}}),define("core/Events",["require","core/utils/collection/each","core/utils/object/has","core/utils/uniqueId"],function(a){"use strict";var b=a("core/utils/collection/each"),c=a("core/utils/object/has"),d=a("core/utils/uniqueId"),e=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},f=Object.keys||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var d in a)c(a,d)&&(b[b.length]=d);return b},g=[].slice,h={on:function(a,b,c){if(!j(this,"on",a,[b,c])||!b)return this;this._events=this._events||{};var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(a,b,c){if(!j(this,"once",a,[b,c])||!b)return this;var d=this,f=e(function(){d.off(a,f),b.apply(this,arguments)});return f._callback=b,this.on(a,f,c)},off:function(a,b,c){var d,e,g,h,i,k,l,m;if(!this._events||!j(this,"off",a,[b,c]))return this;if(!a&&!b&&!c)return this._events={},this;for(h=a?[a]:f(this._events),i=0,k=h.length;k>i;i++)if(a=h[i],g=this._events[a]){if(this._events[a]=d=[],b||c)for(l=0,m=g.length;m>l;l++)e=g[l],(c&&c!==e.context||b&&b!==e.callback&&b!==e.callback._callback)&&d.push(e);d.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=g.call(arguments,1);if(!j(this,"trigger",a,b))return this;var c=this._events[a],d=this._events.all;return c&&k(c,b),d&&k(d,arguments),this},stopListening:function(a,b,c){var d=this._listeners;if(!d)return this;var e=!b&&!c;"object"==typeof b&&(c=this),a&&((d={})[a._listenerId]=a);for(var f in d)d[f].off(b,c,this),e&&delete this._listeners[f];return this}},i=/\s+/,j=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(i.test(c)){for(var f=c.split(i),g=0,h=f.length;h>g;g++)a[b].apply(a,[f[g]].concat(d));return!1}return!0},k=function(a,b){var c,d,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(d=0;e>d;d++)(c=a[d]).callback.call(c.ctx);return;case 1:for(d=0;e>d;d++)(c=a[d]).callback.call(c.ctx,f);return;case 2:for(d=0;e>d;d++)(c=a[d]).callback.call(c.ctx,f,g);return;case 3:for(d=0;e>d;d++)(c=a[d]).callback.call(c.ctx,f,g,h);return;default:for(d=0;e>d;d++)(c=a[d]).callback.apply(c.ctx,b)}},l={listenTo:"on",listenToOnce:"once"};return b(l,function(a,b){h[b]=function(b,c,e){var f=this._listeners||(this._listeners={}),g=b._listenerId||(b._listenerId=d("l"));return f[g]=b,"object"==typeof c&&(e=this),b[a](c,e,this),this}}),h.bind=h.on,h.unbind=h.off,h}),define("core/utils/function/debounce",[],function(){"use strict";return function(a,b,c){var d,e,f,g,h,i=function(){var j=(new Date).getTime()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=(new Date).getTime();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}}}),define("core/utils/function/throttle",[],function(){"use strict";return function(a,b,c){c||(c=0);var d,e,f,g,h=0,i=function(){h=new Date,f=null,g=a.apply(d,e)};return function(){var j=new Date,k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(f),f=null,h=j,g=a.apply(d,e)):f||(f=setTimeout(i,k+c)),g}}}),define("core/utils/html/addEvent",[],function(){"use strict";return function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else{if(!a.attachEvent)throw new Error("No event support.");a.attachEvent("on"+b,c)}}}),define("core/utils/html/removeEvent",[],function(){"use strict";return function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else{if(!a.detachEvent)throw new Error("No event support.");a.detachEvent("on"+b,c)}}}),define("core/utils/array/indexOf",[],function(){"use strict";return function(a,b){for(var c=0;c<a.length;++c)if(a[c]===b)return c;return-1}}),define("core/utils/array/some",[],function(){"use strict";return function(a,b,c){for(var d=0;d<a.length;++d)if(b.call(c,a[d],d,a))return!0;return!1}}),define("core/utils/html/getCurrentStyle",[],function(){"use strict";return window.getComputedStyle?function(a,b,c){try{return window.document.defaultView.getComputedStyle(a,null).getPropertyValue(b)}catch(d){return null}}:function(a,b,c){return a.currentStyle[b]||a.currentStyle[c]}}),define("core/utils/html/isVisible",["core/utils/html/getCurrentStyle"],function(a){"use strict";return function(b){return Boolean(b&&(b.offsetWidth||b.offsetHeight||b.getClientRects().length)&&"hidden"!==a(b,"visibility"))}}),define("core/utils/lang/isFunction",[],function(){"use strict";return function(a){return"[object Function]"===Object.prototype.toString.call(a)}}),define("core/utils/object/result",["core/utils/lang/isFunction"],function(a){"use strict";return function(b,c,d){var e=null===b||void 0===b?void 0:b[c];return void 0===e&&(e=d),a(e)?e.call(b):e}}),define("core/utils/lang/isElement",[],function(){"use strict";return function(a){return Boolean(a&&1===a.nodeType)}}),define("stance/utils",["exports","core/utils/lang/isElement","core/utils/uniqueId"],function(a,b,c){"use strict";a.getElement=function(a){return b(a)?a:a&&a.el},a.EL_ID_ATTR="data-visibility-id",a.OBJ_ID_PROP="_visibility_id",a.getId=function(d){var e=null;return b(d)?(e=d.getAttribute(a.EL_ID_ATTR)||null,e||(e=c(),d.setAttribute(a.EL_ID_ATTR,e))):d&&(e=d[a.OBJ_ID_PROP]||null,e||(e=d[a.OBJ_ID_PROP]=c())),e},a.visiblePercent=function(a,b){var c=0;if(!b)return c;var d=a.top,e=d+a.height,f=b.visibleTop<d,g=b.visibleBottom>e;return!f&&!g||f&&g?c=1:f?c=(b.height-(d-b.visibleTop))/b.height:g&&(c=(e-b.visibleTop)/b.height),Math.round(100*c)}}),define("stance/tracking",["core/utils/array/indexOf","core/utils/array/some","core/utils/html/isVisible","core/utils/object/result","./utils","exports"],function(a,b,c,d,e,f){"use strict";f.events=[],f.lastPos=null,f.clearCache=function(a){if(void 0===a)f.getElementOffset.cache={};else{var b=e.getId(a);b&&(f.getElementOffset.cache[b]=null)}},f.calculateOffset=function(a){if(!a)return null;if(!c(a))return null;var b=a.ownerDocument.documentElement;return{height:a.offsetHeight,top:a.getBoundingClientRect().top+window.pageYOffset-(b.clientTop||0)}},f._getElementOffset=function(a){var b=e.getElement(a);if(!b)return null;var c=f.calculateOffset(b);return c?{visibleTop:c.top+(d(a,"topEdgeOffset")||0),visibleBottom:c.top+c.height-(d(a,"bottomEdgeOffset")||0),offsetTop:c.top,height:c.height}:null},f.getElementOffset=function(){var a=function(b){var c=a.cache,d=e.getId(b);if(d&&c[d])return c[d];var g=f._getElementOffset(b);return d&&g&&(c[d]=g),g};return a.cache={},a}(),f.EVENT_NAMES=["enter","exit","visible","invisible","all"],f.updateTracking=function(c){var d,e=function(a){return a?function(b){return a[b]}:function(){}};b(f.EVENT_NAMES,e(c._events))?(d=a(f.events,c),-1===d&&f.events.push(c)):(d=a(f.events,c),-1!==d&&f.events.splice(d,1))},f.processEvents=function(a){f.lastPos=a;var b=f.events;if(b.length)for(var c=b.length-1;c>=0;--c){var d=b[c],e=d.isVisible(a);null!==e&&(e!==d.lastVisible&&d.trigger(e?"enter":"exit",d,a),d.trigger(e?"visible":"invisible",d,a),d.lastVisible=e)}}}),define("stance/main",["core/Events","core/utils/function/debounce","core/utils/function/throttle","core/utils/html/addEvent","core/utils/html/removeEvent","core/utils/object/extend","./tracking"],function(a,b,c,d,e,f,g){"use strict";function h(a){return this instanceof h?(this.obj=a,void(this.lastVisible=!1)):new h(a)}var i=b(function(){g.processEvents(g.lastPos)},250);return f(h.prototype,a,{on:function(b){var c=!(this._events&&this._events[b]),d=a.on.apply(this,arguments);return c&&g.updateTracking(this),i(),d},off:function(b){var c=a.off.apply(this,arguments);return this._events&&this._events[b]||g.updateTracking(this),c},offset:function(){return g.getElementOffset(this.obj)},isVisible:function(a){if(a=a||g.lastPos,!a)return null;var b=a.top,c=b+a.height,d=this.offset();return d?d.offsetTop>=b&&d.visibleTop<c||d.offsetTop+d.height<=c&&d.visibleBottom>b:null},invalidate:function(){return g.clearCache(this.obj),this}}),f(h,{invalidate:g.clearCache,scroll:g.processEvents,_windowScrollHandlerBound:!1,_ignoreCache:!1,_windowScrollHandler:c(function(){h._ignoreCache&&h.invalidate(),g.processEvents({top:window.pageYOffset,height:window.document.documentElement.clientHeight})},250),bindWindowEvents:function(a){this._windowScrollHandlerBound||("undefined"!=typeof a&&(h._ignoreCache=a),d(window,"scroll",this._windowScrollHandler),d(window,"resize",this._windowScrollHandler),this._windowScrollHandlerBound=!0,this._windowScrollHandler())},unbindWindowEvents:function(){h._ignoreCache=!1,e(window,"scroll",this._windowScrollHandler),e(window,"resize",this._windowScrollHandler),this._windowScrollHandlerBound=!1}}),h}),define("stance",["stance/main"],function(a){return a}),define("core/templates/handlebars.partials",["handlebars"],function(a){a.registerPartial("cardGuestUpvoterText",a.template({1:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"%(guestCount)s Guest Votes",{name:"gettext",hash:{guestCount:null!=b?b.guestCount:b},data:e}))+" "},3:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"1 Guest Vote",{name:"gettext",hash:{},data:e}))+" "},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c["if"].call(g,c.gt.call(g,null!=b?b.guestCount:b,1,{name:"gt",hash:{},data:e}),{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.program(3,e,0),data:e}))?f:"")+"\n"},useData:!0})),a.registerPartial("cardGuestUser",a.template({1:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.lambda,i=a.escapeExpression;return'<li class="user '+(null!=(f=c["if"].call(g,null!=b?b.highlight:b,{name:"if",hash:{},fn:a.program(2,e,0),inverse:a.noop,data:e}))?f:"")+'" data-role="guest">\n<span class="avatar" title="'+i(h(null!=b?b.guestText:b,b))+'">\n<img src="'+i(h(null!=b?b.guestAvatarUrl:b,b))+'" alt="'+i(c.gettext.call(g,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n</span>\n<span class="username" title="'+i(h(null!=b?b.guestText:b,b))+'">\n'+i(h(null!=b?b.guestText:b,b))+"\n</span>\n</li>\n"},2:function(a,b,c,d,e){return"highlight"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=b?b.guestCount:b,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:""},useData:!0})),a.registerPartial("cardOtherUserText",a.template({1:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"%(guestCount)s Others",{name:"gettext",hash:{guestCount:null!=b?b.guestCount:b},data:e}))+" "},3:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"1 Other",{name:"gettext",hash:{},data:e}))+" "},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c["if"].call(g,c.gt.call(g,null!=b?b.guestCount:b,1,{name:"gt",hash:{},data:e}),{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.program(3,e,0),data:e}))?f:"")+"\n"},useData:!0})),a.registerPartial("cardUser",a.template({1:function(a,b,c,d,e){return"highlight"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.lambda,i=a.escapeExpression;return'<li class="user '+(null!=(f=c["if"].call(g,null!=b?b.highlight:b,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+'" data-action="profile" data-username="'+i(h(null!=b?b.username:b,b))+'">\n<a class="avatar" href="'+i(h(null!=b?b.profileUrl:b,b))+'" title="'+i(h(null!=b?b.name:b,b))+'">\n<img src="'+i(h(null!=(f=null!=b?b.avatar:b)?f.cache:f,b))+'" alt="'+i(c.gettext.call(g,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n</a>\n<a class="username" href="'+i(h(null!=b?b.profileUrl:b,b))+'" title="'+i(h(null!=b?b.name:b,b))+'">\n'+i(h(null!=b?b.name:b,b))+"\n</a>\n</li>\n"},useData:!0})),a.registerPartial("carouselArrowLeft",a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){return'<button class="carousel-control carousel-control__previous"><span class="icon icon-right-bracket icon-flipped"></span></button>\n'},useData:!0})),a.registerPartial("carouselArrowRight",a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){return'<button class="carousel-control carousel-control__next"><span class="icon icon-right-bracket"></span></button>\n'},useData:!0})),a.registerPartial("channelsHeader",a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<div class="align-inline spacing-top">\n<div class="module-header__icon icon-colorful spacing-right">\n<svg class="icon-discover" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 18 18" enable-background="new 0 0 18 18" xml:space="preserve" width="26" height="26"><rect x="14" width="4" height="4" class="dot"/><rect x="14" y="7" width="4" height="4" class="dot"/><rect x="14" y="14" width="4" height="4" class="dot"/><rect x="7" width="4" height="4" class="dot"/><rect x="7" y="7" width="4" height="4" class="dot"/><rect x="7" y="14" width="4" height="4" class="dot"/><rect width="4" height="4" class="dot"/><rect y="7" width="4" height="4" class="dot"/><rect y="14" width="4" height="4" class="dot"/></g></svg>\n</div>\n<div class="module-header__title">\n<h1 class="text-larger text-darker">'+g(c.gettext.call(f,"Channels",{name:"gettext",hash:{},data:e}))+'</h1>\n</div>\n</div>\n<p class="text-medium text-gray spacing-bottom-narrow">'+g(c.gettext.call(f,"Places to start your own discussions.",{name:"gettext",hash:{},data:e}))+"</p>\n"},useData:!0})),a.registerPartial("genericFollowButton",a.template({1:function(a,b,c,d,e){return" active"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<button class="btn-follow'+(null!=(f=c["if"].call(g,null!=b?b.isFollowing:b,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+'" data-action="toggle-follow">\n<span class="symbol-default"><span class="icon-plus"></span></span><span class="text-default">'+h(c.gettext.call(g,"Follow",{name:"gettext",hash:{},data:e}))+'</span><span class="symbol-following"><span class="icon-checkmark"></span></span><span class="text-following">'+h(c.gettext.call(g,"Following",{name:"gettext",hash:{},data:e}))+"</span>\n</button>\n"},useData:!0}))}),define("core/templates/alert",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){return'<span class="icon icon-warning"></span>\n'},3:function(a,b,c,d,e){var f;return(null!=(f=a.lambda(null!=b?b.message:b,b))?f:"")+"\n"},5:function(a,b,c,d,e){return a.escapeExpression(a.lambda(null!=b?b.message:b,b))+"\n"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<a class="close" data-action="dismiss" title="'+a.escapeExpression(c.gettext.call(g,"Dismiss",{name:"gettext",hash:{},data:e}))+'">×</a>\n<span>\n'+(null!=(f=c["if"].call(g,null!=b?b.icon:b,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+(null!=(f=c["if"].call(g,null!=b?b.safe:b,{name:"if",hash:{},fn:a.program(3,e,0),inverse:a.program(5,e,0),data:e}))?f:"")+"</span>\n"},useData:!0})}),define("core/views/AlertView",["backbone","core/templates/alert"],function(a,b){"use strict";var c=a.View.extend({className:"alert",events:{"click [data-action=dismiss]":"dismiss"},initialize:function(a){this.options=a,this.message=a.message,this.safe=a.safe,this.type=a.type},render:function(){var a=this.$el;return a.html(b({message:this.message,safe:this.safe,icon:"error"===this.type})),a.attr("class",this.className),this.type&&a.addClass(this.type),this},dismiss:function(a){a&&a.preventDefault&&a.preventDefault(),this.remove(),this.trigger("dismiss")}});return c}),define("core/mixins/withAlert",["underscore","core/views/AlertView"],function(a,b){"use strict";var c={alert:function(c,d){a.isObject(d)||(d={});var e=d.target||this._alertSelector;this.dismissAlert();var f=this._alert=new b(a.extend({message:c},d));return f.render(),e?this.$el.find(e).prepend(f.el):this.el.parentNode&&this.el.parentNode.insertBefore(f.el,this.el),f},dismissAlert:function(a){this._alert&&(!a||a(this._alert))&&this._alert.dismiss()},setAlertSelector:function(a){this._alertSelector=a}},d=function(){return a.extend(this,c)};return d}),define("core/mixins/withEmailVerifyLink",["jquery","underscore","core/config","core/utils"],function(a,b,c,d){"use strict";var e=d.preventDefaultHandler,f={events:{"click [data-action=verify-email]":"showVerifyEmailPopup"},showVerifyEmailPopup:e(function(b){var e=a(b.target).attr("data-forum"),f=c.urls.verifyEmail;return e&&(f=f+"?f="+e),d.openWindow(f,"_blank",{width:460,height:355})})};return function(){this.events=b.defaults({},this.events,f.events),b.extend(this,b.pick(f,"showVerifyEmailPopup"))}}),define("lounge/common",[],function(){"use strict";var a,b=function(b){a=b},c=function(){return a};return{setLounge:b,getLounge:c}}),define("lounge/menu-handler",["jquery","core/bus"],function(a,b){"use strict";return{init:function(){function c(){a(".dropdown").removeClass("open")}a("html").on("click",c),a("body").delegate("[data-toggle]","click",function(b){b.stopPropagation(),b.preventDefault();var d=a(b.currentTarget),e=d.closest("."+d.attr("data-toggle")),f="disabled"!==e.attr("data-dropdown")&&!e.hasClass("open");e.attr("data-dropdown","enabled"),c(),f&&e.addClass("open")}),b.frame.on("window.click",c)}}}),define("lounge/mixins",["core/utils/url/serialize"],function(a){"use strict";var b={_sharePopup:function(a,b){return window.open(a,"_blank",b||"width=550,height=520")},share:function(a){this.sharers[a].call(this)},sharers:{twitter:function(){var b="https://twitter.com/intent/tweet",c=this.model.shortLink();this._sharePopup(a(b,{url:c,text:this.model.twitterText(c)}))},facebook:function(){this._sharePopup(a("https://www.facebook.com/sharer.php",{u:this.model.shortLink()}),"width=655,height=352")}}},c=function(){function a(){return this.collapseTarget&&this.collapseTarget.length||(this.collapseTarget=this.collapseTargetSelector?this[this.collapseScope].find(this.collapseTargetSelector):this[this.collapseScope]),this.collapseTarget}function b(){var b=this;if(b.isCollapseAllowed){var c=a.call(b);c&&c.length&&(c.height(b.collapsedHeight),e.call(b))}}function c(a){var b=this;if(b.collapseTarget&&b.collapseTarget.length){var c=b.collapseTarget;c.css("height","auto"),c.css("maxHeight","none"),f.call(b),a||(b.isCollapseAllowed=!1)}}function d(){return this.seeMoreButton&&this.seeMoreButton.length||(this.seeMoreButton=a.call(this).siblings("[data-action=see-more]")),this.seeMoreButton}function e(){var a=this;d.call(this).removeClass("hidden").on("click",function(){a.expand()})}function f(){d.call(this).addClass("hidden").off("click")}return function(a){var d=this;d.isCollapseAllowed=!0,d.collapsedHeight=a.collapsedHeight,d.collapseTargetSelector=a.collapseTargetSelector,d.collapseScope=a.collapseScope||"$el",d.collapse=b,d.expand=c}}();return{ShareMixin:b,asCollapsible:c}}),define("lounge/realtime",["jquery","underscore","backbone","loglevel","core/utils/url/serialize","common/utils","common/urls"],function(a,b,c,d,e,f,g){"use strict";function h(){n.apply(this,arguments),this.reqCounter=0,this.marker=0,this.interval=1,this._boundOnError=b.bind(this.onError,this),this._boundOnLoad=b.bind(this.onLoad,this),this._boundOnProgress=b.bind(this.onProgress,this)}function i(){n.apply(this,arguments),this.handshakeSuccess=null,this.interval=1,this._boundOnOpen=b.bind(this.onOpen,this),this._boundError=b.bind(this.onError,this),this._boundClose=b.bind(this.onClose,this),this._boundMessage=b.compose(b.bind(this.onMessage,this),function(a){return JSON.parse(a.data)})}var j=2,k=120,l=function(){},m=function(){throw new Error("Pipe class cannot be used directly.")},n=function(a,c){this.channel=a,this.since=c,this.connection=null,this.paused=!1,this._msgBuffer=[],this._boundOpen=b.bind(this.open,this)};b.extend(n.prototype,c.Events,{getUrl:function(a){var c={};return this.since&&(c.since=this.since),b.extend(c,a),e(this.baseUrl+this.channel,c)},onMessage:function(a){var b=a.message_type,c=a.firehose_id;this.lastEventId=c,d.debug("RT: new message:",b,c);var e={type:b,data:a.message_body,lastEventId:c};this.trigger(b,e)},_msgToBuffer:function(){this._msgBuffer.push(b.toArray(arguments))},pause:function(a){this.paused||(this.paused=!0,this._trigger=this.trigger,this.trigger=a===!1?l:this._msgToBuffer,d.debug("RT: paused, buffered: %s",a!==!1))},resume:function(){if(this.paused){this.paused=!1,this.trigger=this._trigger,d.debug("RT: resumed, buffered messages: %s",this._msgBuffer.length);for(var a;a=this._msgBuffer.shift();)this.trigger.apply(this,a)}},open:m,close:function(){var a=this.connection;return a?(this.connection=null,a):!1}}),b.extend(h.prototype,n.prototype,{baseUrl:g.realertime+"/api/2/",onError:function(){this.connection&&(this.connection=null,this.trigger("error",this),this.interval<=k&&(this.interval*=j),d.info("RT: Connection error, backing off %s secs",this.interval),b.delay(this._boundOpen,1e3*this.interval))},onLoad:function(){this.connection&&(this.connection=null,this.since=null,this.trigger("success",this),b.defer(this._boundOpen))},onProgress:function(){if(this.connection){var a,b,c,e,f=this.connection.responseText,g=0;if(f&&!(this.marker>=f.length)){a=f.slice(this.marker).split("\n");for(var h=a.length,i=0;h>i;i++)if(b=a[i],g+=b.length+1,c=b.replace(/^\s+|\s+$/g,"")){try{e=JSON.parse(c)}catch(j){if(i===h-1){g-=b.length+1;break}d.debug("RT: unable to parse: ",c,b);continue}this.onMessage(e)}else d.debug("RT: ignoring empty row...");g>0&&(this.marker+=g-1)}}},open:function(){this.close();var a=this.connection=f.CORS.request("GET",this.getUrl({bust:++this.reqCounter}),this._boundOnLoad,this._boundOnError);if(!a)return void d.debug("RT: Cannot use any cross-domain request tool with StreamPipe. Bailing out.");a.onprogress=this._boundOnProgress,this.connection=a,this.marker=0;try{a.send()}catch(b){this.connection=null,d.debug("RT: Attempt to send a CORS request failed.")}},close:function(){var a=n.prototype.close.apply(this);return a&&a.abort()}}),b.extend(i.prototype,n.prototype,{baseUrl:("https:"===window.location.protocol?"wss:":"ws:")+g.realertime+"/ws/2/",onOpen:function(){d.debug("RT: [Socket] Connection established."),this.handshakeSuccess=!0,this.since=null},onError:function(){if(this.connection){if(this.connection=null,!this.handshakeSuccess)return d.debug("RT: [Socket] Error before open, bailing out."),void this.trigger("fail");this.trigger("error"),this.interval<=k&&(this.interval*=j),d.error("RT: Connection error, backing off %s secs",this.interval),b.delay(this._boundOpen,1e3*this.interval)}},onClose:function(a){if(this.connection){if(!a.wasClean)return void this.onError();this.connection=null,d.debug("RT: [Socket] Connection closed. Restarting..."),this.trigger("close"),this.open()}},open:function(){this.close();var a=this.connection=new window.WebSocket(this.getUrl());a.onopen=this._boundOnOpen,a.onerror=this._boundError,a.onmessage=this._boundMessage,a.onclose=this._boundClose},close:function(){var a=n.prototype.close.apply(this);return a&&a.close()}});var o={_wsSupported:window.WebSocket&&2===window.WebSocket.CLOSING,initialize:function(a,c,d,e){this.close(),this._initArgs=[a,c,d,e];var f=this._wsSupported,g=f?i:h,j=this.pipe=new g(a,c);b.chain(d).pairs().each(function(a){j.on(a[0],a[1],e)}),f&&j.on("fail",function(){this._wsSupported=!1,j.off(),this.initialize.apply(this,this._initArgs)},this),j.open()},pause:function(a){this.pipe&&this.pipe.pause(a)},resume:function(){this.pipe&&this.pipe.resume()},close:function(){this.pipe&&(this.pipe.close(),this.pipe=null)}};return a(window).on("unload",b.bind(o.close,o)),{Pipe:n,StreamPipe:h,SocketPipe:i,Manager:o}}),define("core/models/MediaUpload",["backbone","core/models/Media"],function(a,b){"use strict";var c=a.Model.extend({defaults:{token:null,original_url:null,
  2. thumbnail_url:null,expires:null},validate:function(a){if(null===a.expires)return new Error("Upload is missing expiry timestamp");var b=Number(new Date);return a.expires<b/1e3?new Error("Expired upload"):void 0},toMediaJSON:function(){return{mediaType:b.MEDIA_TYPES.IMAGE_UPLOAD,thumbnailUrl:this.get("original_url"),url:this.get("original_url")}}});return c}),define("core/utils/media/upload",["underscore","when","exports","core/api","core/models/Media","core/models/MediaUpload","core/UniqueModel"],function(a,b,c,d,e,f,g){"use strict";c.uploadSupported=Boolean(window.FormData),c._extractFirstImageFile=function(b){return a.find(b,function(a){return a.type.match(/^image\//)})},c._uploadViaApi=function(a,c,e){return b(d.call(a,{data:c,contentType:!1,processData:!1,method:"POST",xhr:function(){var a=new window.XMLHttpRequest,b=e&&e.onProgress;return b&&a.upload.addEventListener("progress",function(a){a.total&&b(100*a.loaded/a.total)}),a}}))},c.UPLOAD_URL="https://uploads.services.disqus.com/api/3.0/media/create.json",c.uploadMediaUrl=function(d,f){var h=new window.FormData,i=c._extractFirstImageFile(d);return i?(h.append("upload",i),h.append("permanent",1),c._uploadViaApi(c.UPLOAD_URL,h,f).then(function(b){var c=b.response,d=a.first(a.values(c));if(!d||!d.ok)throw new Error("Upload failed");return new g(e,{mediaType:e.MEDIA_TYPES.IMAGE_UPLOAD,url:d.url,thumbnailUrl:d.url})})):b.reject(new Error("No image file to upload"))},c.uploadMedia=function(a,b){var d=new window.FormData,e=c._extractFirstImageFile(a);return d.append("attachment",e),c._uploadViaApi("media/upload",d,b).otherwise(function(a){var b=a.responseJSON||{};throw new Error(b.response||"Upload failed")}).then(function(a){return new f(a.response)})}}),define("core/views/media/DragDropUploadView",["underscore","backbone","core/utils"],function(a,b,c){"use strict";var d=c.stopEventHandler,e=b.View.extend({events:{dragover:"_dragOn",dragenter:"_dragOn",dragleave:"_dragOff",dragexit:"_dragOff",drop:"_drop"},_dragOn:d(function(){this.trigger("uploader:dragEnter"),this._toggleDragPlaceholder(!0)}),_dragOff:d(function(){this._toggleDragPlaceholder(!1)}),_drop:d(function(a){this._toggleDragPlaceholder(!1);var b=a.originalEvent.dataTransfer.files;return b.length?void this.trigger("uploader:attachMedia",b):void this.trigger("uploader:dropError","No files")}),_toggleDragPlaceholder:a.throttle(function(a){a?this.trigger("uploader:showPlaceholder"):this.trigger("uploader:hidePlaceholder")},50)});return e}),define("core/templates/postMediaUploadButton",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<a href="#" tabindex="-1" data-action="attach" class="attach" title="'+g(c.gettext.call(f,"Upload Images",{name:"gettext",hash:{},data:e}))+'"><span>'+g(c.gettext.call(f,"Attach",{name:"gettext",hash:{},data:e}))+'</span></a>\n<input type="file" data-role="media-upload" tabindex="-1" accept="image/*">\n'},useData:!0})}),define("core/views/media/UploadButtonView",["jquery","backbone","core/templates/postMediaUploadButton","core/utils"],function(a,b,c,d){"use strict";var e=d.stopEventHandler,f="input[type=file][data-role=media-upload]",g=b.View.extend({events:function(){var a={"click [data-action=attach]":"_attachMedia"};return a["change "+f]="_selectorChange",a}(),initialize:function(a){this.template=a&&a.template||c},render:function(){return this.$el.html(this.template()),this},_attachMedia:e(function(){this.$(f).click()}),_selectorChange:function(b){var c=b.target,d=c.files;d.length&&(this.trigger("uploader:attachMedia",d),a(c).replaceWith(c.cloneNode()))}});return g}),define("core/templates/postMediaUploadProgress",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){return'<li>\n<div class="media-progress-box">\n<div class="media-progress">\n<div class="bar" style="right: '+a.escapeExpression(a.lambda(null!=b?b.remainingPerc:b,b))+'%"></div>\n</div>\n</div>\n</li>\n'},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f;return null!=(f=c.each.call(null!=b?b:{},null!=b?b.collection:b,{name:"each",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:""},useData:!0})}),define("core/views/media/UploadsProgressSubView",["backbone","core/templates/postMediaUploadProgress"],function(a,b){"use strict";var c=a.View.extend({initialize:function(){this.collection=new a.Collection,this.listenTo(this.collection,"add remove change",this.render)},hasVisible:function(){return Boolean(this.collection.length)},render:function(){return this.$el.html(b({collection:this.collection.toJSON()})),this}});return c}),define("core/collections/MediaUploadCollection",["backbone","core/models/MediaUpload"],function(a,b){"use strict";var c=a.Collection.extend({model:b});return c}),define("core/utils/media/MediaStore",["underscore","core/utils/storage"],function(a,b){"use strict";var c=function(a){if(!a)throw new Error("Cannot instantiate MediaStore without a valid storageKey!");this._storageKey=a};return a.extend(c.prototype,{getItems:function(){return b.get(this._storageKey)||{}},clear:function(){b.remove(this._storageKey)},getItem:function(a){return this.getItems()[a]},setItem:function(a,c){var d=this.getItems();return d[a]=c,b.set(this._storageKey,d),c},removeItem:function(a){var c=this.getItems();return a in c?(delete c[a],b.set(this._storageKey,c),!0):!1}}),c}),define("core/templates/postMediaUploadLegacy",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f=a.lambda,g=a.escapeExpression;return'<li class="publisher-border-color" data-media-id="'+g(f(null!=b?b.original_url:b,b))+'">\n<div class="media-box">\n<div class="media-ct">\n<div class="media-surface">\n<img src="'+g(f(null!=b?b.original_url:b,b))+'?w=128&h=128" alt="'+g(c.gettext.call(null!=b?b:{},"Media attachment",{name:"gettext",hash:{},data:e}))+'">\n<a href="#" class="media-delete" data-action="detach">&#10005;</a>\n</div>\n</div>\n</div>\n</li>\n'},useData:!0})}),define("core/views/media/UploadsLegacySubView",["jquery","underscore","backbone","core/collections/MediaUploadCollection","core/utils","core/utils/media/MediaStore","core/templates/postMediaUploadLegacy"],function(a,b,c,d,e,f,g){"use strict";var h=e.stopEventHandler,i=c.View.extend({events:{"click [data-action=detach]":"onDetach"},initialize:function(a){this.collection=new d;var c=a.mediaStorageKey;this.mediaStore=c&&new f(c),this.mediaStore&&this.collection.reset(b.values(this.mediaStore.getItems()),{validate:!0}),this.listenTo(this.collection,{add:this.onAdd,remove:this.onRemove,reset:this.onReset})},setElement:function(){var a=c.View.prototype.setElement.apply(this,arguments);return this.collection&&this.collection.each(this._addElement,this),a},hasVisible:function(){return Boolean(this.collection.length)},onDetach:h(function(b){var c=a(b.target).closest("li"),d=c.attr("data-media-id"),e=this.collection.where({original_url:d});this.collection.remove(e,{$el:c})}),_addElement:function(b){var c=a(g(b.toJSON()));c.attr("data-media-id",b.get("original_url")),this.$el.append(c)},onAdd:function(a){this.mediaStore&&this.mediaStore.setItem(a.get("original_url"),a),this._addElement(a)},onRemove:function(a,b,c){c.$el&&c.$el.remove();var d=this.mediaStore&&this.mediaStore.getItem(a.get("original_url"));d&&this.mediaStore.removeItem(a.get("original_url"))},onReset:function(){this.$el.empty(),this.mediaStore&&this.mediaStore.clear()}});return i}),define("core/templates/postMediaUploadRich",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){var f;return a.escapeExpression(a.lambda(null!=(f=null!=b?b.media:b)?f.title:f,b))},3:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Media attachment",{name:"gettext",hash:{},data:e}))},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<li class="publisher-border-color">\n<div class="media-box">\n<div class="media-ct">\n<div class="media-surface">\n<a href="'+h(g(null!=(f=null!=b?b.media:b)?f.url:f,b))+'" target="_blank">\n<img src="'+h(g(null!=(f=null!=b?b.media:b)?f.thumbnailUrl:f,b))+'" alt="'+(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.media:b)?f.title:f,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.program(3,e,0),data:e}))?f:"")+'">\n</a>\n</div>\n</div>\n</div>\n</li>\n'},useData:!0})}),define("core/views/media/UploadsRichSubView",["underscore","backbone","core/models/Media","core/UniqueModel","core/utils","core/templates/postMediaUploadRich"],function(a,b,c,d,e,f){"use strict";var g=b.View.extend({initialize:function(){this._hasVisible=!1,this.collection=new b.Collection([],{model:c,comparator:"index"}),this.listenTo(this.collection,"add remove reset sort change:thumbnailUrl change:mediaType change:editsFinished",this.render),this.listenTo(this.collection,"change:index",a.bind(this.collection.sort,this.collection))},render:function(){return this.$el.empty(),this._hasVisible=!1,this.collection.each(function(b){b.get("thumbnailUrl")&&(a.contains(c.WEBPAGE_TYPES,b.get("mediaType"))||b.get("editsFinished")&&(this.$el.append(f({media:b.toJSON()})),this._hasVisible=!0))},this),this},hasVisible:function(){return this._hasVisible},addMedia:function(a){var b=d.get(c,a.url);if(b)b.set(a);else{if(!a.editsFinished)return;b=new d(c,a),b.fetch()}return this.collection.add(b),b},updateFromText:function(b,c,d){if(!b)return void this.collection.reset();var f=e.bleachFindUrls(b);f=a.uniq(f,!1,function(a){return a.url});var g={};a.each(f,function(e){g[e.url]=!0;var f=a.pick(e,"index","url"),h=e.index<c&&c<=e.endIndex||"."===b[e.endIndex];(!h||d.isPasteEvent)&&(f.editsFinished=!0),this.addMedia(f)},this);var h=this.collection.pluck("url");g=a.keys(g);var i=a.difference(h,g);this.collection.remove(this.collection.filter(function(b){return a.contains(i,b.get("url"))}))}});return g}),define("core/templates/postMediaUploads",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){return'<ul data-role="media-legacy-list"></ul>\n<ul data-role="media-progress-list"></ul>\n<ul data-role="media-rich-list"></ul>\n<div class="media-expanded empty" data-role="media-preview-expanded">\n<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="\ndata-role="media-preview-expanded-image" alt="'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Media preview placeholder",{name:"gettext",hash:{},data:e}))+'">\n</div>\n'},useData:!0})}),define("core/views/media/UploadsView",["backbone","core/views/media/UploadsProgressSubView","core/views/media/UploadsLegacySubView","core/views/media/UploadsRichSubView","core/templates/postMediaUploads"],function(a,b,c,d,e){"use strict";var f=a.View.extend({initialize:function(a){this.legacyView=new c({mediaStorageKey:a.mediaStorageKey}),this.legacy=this.legacyView.collection,this.richView=new d,this.rich=this.richView.collection,this.uploadProgressView=new b,this.uploadProgress=this.uploadProgressView.collection,this.listenTo(this.legacy,"all",this._updateEmpty),this.listenTo(this.rich,"all",this._updateEmpty),this.listenTo(this.uploadProgress,"all",this._updateEmpty)},render:function(){return this.legacyView.$el.detach(),this.richView.$el.detach(),this.uploadProgressView.$el.detach(),this.$el.html(e()),this._updateEmpty(),this.legacyView.setElement(this.$("[data-role=media-legacy-list]")[0]),this.richView.setElement(this.$("[data-role=media-rich-list]")[0]),this.uploadProgressView.setElement(this.$("[data-role=media-progress-list]")[0]),this},clear:function(){this.legacy.reset(),this.rich.reset(),this.uploadProgress.reset()},_updateEmpty:function(){this.legacyView.hasVisible()||this.richView.hasVisible()||this.uploadProgressView.hasVisible()?this.$el.removeClass("empty"):this.$el.addClass("empty")}});return f}),define("core/mixins/withUploadForm",["underscore","backbone","core/strings","core/utils","core/utils/media/upload","core/utils/storage","core/views/media/DragDropUploadView","core/views/media/UploadButtonView","core/views/media/UploadsView"],function(a,b,c,d,e,f,g,h,i){"use strict";var j=c.get,k=function(){a.defaults(this,k.bothProto,k.uploadsProto,k.previewsProto)};return k.previewsProto={initMediaPreviews:function(b,c,d){this.mediaUploadsView=new i({el:b[0],mediaStorageKey:c}),this.mediaUploadsView.render(),this.updateLiveMediaDebounced=a.partial(a.debounce(this.updateLiveMedia,500),d,!1),this.listenTo(d,{keychange:this.updateLiveMediaDebounced,paste:function(b,c){c&&c.fake||a.defer(a.bind(this.updateLiveMedia,this,d,!0))}}),this.updateLiveMedia(d,!0)},clearMediaPreviews:function(){this.mediaUploadsView&&this.mediaUploadsView.clear()},updateLiveMedia:function(a,b){if(this.mediaUploadsView){var c=a.get(),d=a.offset();this.mediaUploadsView.richView.updateFromText(c,d,{isPasteEvent:b})}}},k.uploadsProto={initMediaUploads:function(a,b,c){this.mediaDragDropView=new g({el:b[0]}),this.listenTo(this.mediaDragDropView,{"uploader:attachMedia":function(){f.set("usedDragDrop",1),this.handleAttachMedia.apply(this,arguments)},"uploader:dragEnter":function(){this.$el.addClass("expanded")},"uploader:showPlaceholder":function(){a.show()},"uploader:hidePlaceholder":function(){a.hide()},"uploader:dropError":function(){var a=j("Sorry we didn't catch that. Try again?");this.alert(a,{type:"error",isUploadError:!0})}}),this.mediaUploadButtonView=new h({el:c[0]}),this.listenTo(this.mediaUploadButtonView,{"uploader:attachMedia":this.handleUploadViaButton}),this.mediaUploadButtonView.render()},handleUploadViaButton:function(a){if(a&&f.isPersistent&&!f.get("usedDragDrop")&&!d.isMobileUserAgent()){var b=this.alert(j("Did you know you can drag and drop images too? Try it now!"));this.listenToOnce(b,"dismiss",function(){f.set("usedDragDrop",1)})}this.handleAttachMedia.apply(this,arguments)},handleAttachMedia:function(c,d){var f=this,g=new b.Model({remainingPerc:100});f.mediaUploadsView.uploadProgress.add(g),d=a.extend(d||{},{onProgress:function(a){g.set("remainingPerc",100-a)}});var h;h=a.result(f,"areUploadUrlsEnabled")?e.uploadMediaUrl(c,d).then(function(a){a.fetch(),f.textarea.insertAtCursor(a.get("url")),f.updateLiveMedia(f.textarea,!0),f.dismissUploadError()}).otherwise(function(){var a=j("Unfortunately your image upload failed. Please verify that your image is in a supported format (JPEG, PNG, or GIF). If you continue seeing this error, please try again later.");f.alert(a,{type:"error",isUploadError:!0})}):e.uploadMedia(c,d).then(function(a){f.mediaUploadsView.legacy.add(a),f.dismissUploadError()}).otherwise(function(){var a=j("Unfortunately your image upload failed. Please verify that your image is under 2MB. If you continue seeing this error, please try again later.");f.alert(a,{type:"error",isUploadError:!0})}),h.always(function(){f.mediaUploadsView.uploadProgress.remove(g)})},dismissUploadError:function(){this.dismissAlert(function(a){return a.options&&a.options.isUploadError})},uploadSupported:e.uploadSupported,isUploadInProgress:function(){return this.mediaUploadsView&&this.mediaUploadsView.uploadProgress.length},getMediaUploadTokens:function(){return this.mediaUploadsView?this.mediaUploadsView.legacy.pluck("token"):[]}},k.bothProto={initMediaViews:function(a){a.allowMedia&&this.initMediaPreviews(this.$("[data-role=media-preview]"),a.storageKey,a.textarea),a.allowUploads&&this.initMediaUploads(this.$("[data-role=drag-drop-placeholder]"),this.$("[data-role=textarea]"),this.$("[data-role=media-uploader]"))}},k}),define("core/editable",[],function(){"use strict";function a(a){return a.replace(f," ")}function b(c,d,e){var f,g,i,j,k="",l=[];for("string"!=typeof e&&(e="\n\n"),j=0;j<c.length;++j)g=c[j],f=g.nodeName.toLowerCase(),1===g.nodeType?(i=d&&d(g),i?k+=i:h.hasOwnProperty(f)?(k&&l.push(k),k=b(g.childNodes,d,e)):k+="br"===f?"\n":b(g.childNodes,d,e)):3===g.nodeType&&(k+=a(g.nodeValue));return l.push(k),l.join(e)}function c(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else{if(!a.attachEvent)throw new Error("No event support.");a.attachEvent("on"+b,c)}}var d=window.document,e="character",f=new RegExp(String.fromCharCode(160),"gi"),g="h1 h2 h3 h4 h5 h6 p pre blockquote address ul ol dir menu li dl div form".split(" "),h={},i=0;for(i=0;i<g.length;i++)h[g[i]]=!0;var j=function(a,b,d){var e=this;if(!a||!a.contentEditable)throw new Error("First argument must be contentEditable");this.elem=a,this.emulateTextarea=a.getAttribute("plaintext-only")||b,this.emulateTextarea&&(this.pasteHandler=function(){var a=e.plainTextReformat,b=function(){a.timeout=null,a.call(e)};a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(b,0)},c(a,"paste",this.pasteHandler));for(var f in d)d.hasOwnProperty(f)&&(this[f]=d[f])};return j.prototype={insertHTML:function(a){if(d.all){var b=d.selection.createRange();return b.pasteHTML(a),b.collapse(!1),b.select()}return d.execCommand("insertHTML",!1,a)},insertNode:function(a){var b,c,e;window.getSelection?(b=window.getSelection(),b.getRangeAt&&b.rangeCount&&(c=b.getRangeAt(0),c.deleteContents(),c.insertNode(a),c.collapse(!1),b.removeAllRanges(),b.addRange(c))):d.selection&&d.selection.createRange&&(c=d.selection.createRange(),e=3===a.nodeType?a.data:a.outerHTML,c.pasteHTML(e),c.collapse(!1))},getTextNodes:function(a){var b=this.elem;a&&a.nodeType?a=[a]:a||(a=b.childNodes);for(var c,d=[],e=0;e<a.length;++e)if(c=a[e])switch(c.nodeType){case 1:d=d.concat(this.getTextNodes(c.childNodes));break;case 3:/^\n\s+/.test(c.nodeValue)||d.push(c)}return d},text:function(a){var c,d,e,f=this.elem;try{d=Array.prototype.slice.call(f.childNodes)}catch(g){for(d=[],e=0;e<f.childNodes.length;++e)d.push(f.childNodes[e])}return c=b(d,a,this.emulateTextarea&&"\n"),c.replace(/^\s+|\s+$/g,"")},setText:function(a){a=a||"";var b,c,e,f=d.createDocumentFragment(),g=this.emulateTextarea?[a.replace(/(?:\r\n|\r|\n){2,}/g,"\n\n")]:a.split(/(?:\r\n|\r|\n){2,}/),h=g&&g.length;for(b=0;h>b;b++)c=g[b],e=this.createParagraph(c),f.appendChild(e);f.lastChild.appendChild(d.createElement("br")),this.elem.innerHTML="",this.elem.appendChild(f);var i=window.getSelection&&window.getSelection();i&&i.anchorNode===this.elem&&i.modify&&i.modify("move","forward","line")},createParagraph:function(a){var b,c,e,f,g,h,i,j=d.createElement("p");for(e=a.split(/\r\n|\r|\n/),c=0,g=e.length;g>c;c++){for(f=e[c],i=this.getHtmlElements(f),b=0,h=i.length;h>b;b++)j.appendChild(i[b]);j.appendChild(d.createElement("br"))}return j.lastChild&&j.removeChild(j.lastChild),j},getHtmlElements:function(a){return[d.createTextNode(a)]},plainTextReformat:function(){if(!(this.elem.getElementsByTagName("p").length<=1)){this.emulateTextarea=!1;var a=this.text();this.emulateTextarea=!0,this.setText(a)}},removeNode:function(a){var b,c,e;window.getSelection?(b=a.previousSibling,a.parentNode.removeChild(a),c=window.getSelection(),e=d.createRange(),b&&(e.setStart(b,b.length),e.setEnd(b,b.length)),c.addRange(e)):a.parentNode.removeChild(a)},selectedTextNode:function(){var b,c,f,g,h,i,j,k,l,m=this.elem;if(window.getSelection)return b=window.getSelection(),b.anchorNode;if(d.selection.createRange){for(c=d.selection.createRange().duplicate();-1e3===c.moveStart(e,-1e3);)continue;var n=c.text;for(k=0;k<m.childNodes.length;++k)for(f=m.childNodes[k],h=this.getTextNodes(f),l=0;l<h.length;++l)if(g=h[l],j=a(g.nodeValue),n.indexOf(j)>-1)i=g,n=n.replace(j,"");else if(j.indexOf(n)>-1)return g;return i}},selectedTextNodeOffset:function(b){var c,f,g;if(window.getSelection){var h=window.getSelection();h&&h.anchorOffset&&(g=h.anchorOffset)}else if(b&&d.selection.createRange){var i=a(b.nodeValue);c=d.selection.createRange();var j=c.duplicate(),k=j.parentElement();for(f=0;0!==c.moveStart(e,-1)&&(0!==i.indexOf(a(c.text))&&k===c.parentElement());f++)j=c.duplicate(),k=j.parentElement();g=f}return isNaN(g)?0:g},offset:function(){function b(d,e){function f(a){i+=a[0];for(var b=1;b<a.length;++b)g.push(i),i=a[b]}"string"!=typeof e&&(e="\n\n");for(var g=[],i="",j=0;j<d.length;++j){var k=d[j],l=k.nodeName.toLowerCase();1===k.nodeType?h.hasOwnProperty(l)?(i&&(i+=e),f(b(k.childNodes,e))):"br"===l?i+="\n":f(b(k.childNodes,e)):3===k.nodeType&&(k===c.anchorNode?(i+=a(k.nodeValue.slice(0,c.anchorOffset)),g.push(i),i=a(k.nodeValue.slice(c.anchorOffset))):i+=a(k.nodeValue))}return g.push(i),g}var c=window.getSelection();if(!c||!c.anchorNode||3!==c.anchorNode.nodeType)return 0;var d,e=this.elem;try{d=Array.prototype.slice.call(e.childNodes)}catch(f){d=[];for(var g=0;g<e.childNodes.length;++g)d.push(e.childNodes[g])}var i=b(d,this.emulateTextarea&&"\n");if(1===i.length)return 0;var j=i[0].length,k=i.join(""),l=k.match(/\s+$/);if(l){var m=l[0].length;j=Math.min(j,k.length-m)}var n=k.match(/^\s+/);if(n){var o=n[0].length;j-=o}return j},selectNodeText:function(b,c,f){var g,h,i=this.elem;if(window.getSelection)return g=window.getSelection(),g.removeAllRanges(),h=d.createRange(),h.setStart(b,c),h.setEnd(b,f),g.addRange(h),g;if(d.selection.createRange){h=d.selection.createRange();var j=a(b.nodeValue);if("body"===h.parentElement().nodeName.toLowerCase()){for(i.focus(),h=d.selection.createRange();-1e3===h.moveStart(e,-1e3);)continue;for(;1e3===h.moveEnd(e,1e3);)continue;var k=a(h.text),l=k.indexOf(j);l>0&&h.moveStart(e,l+2),h.collapse()}for(;-1===h.moveStart(e,-1)&&0!==j.indexOf(a(h.text));)continue;for(;1===h.moveEnd(e,1)&&j!==a(h.text);)continue;return h.moveStart(e,c),h.moveEnd(e,-1*(f-c-h.text.length)),h.select(),h}}},j.normalizeSpace=a,j}),define("core/CappedStorage",["core/utils/storage"],function(a){"use strict";var b=function(a,b){this.max=a||10,this.queueKey=b||"__queue",this.getQueue()||this.setQueue([])};return b.prototype.set=function(b,c){var d=this.getQueue()||this.setQueue([]);d.length===this.max&&a.remove(d.shift()),a.set(b,c),d.push(b),this.setQueue(d)},b.prototype.get=function(b){return a.get(b)},b.prototype.remove=function(b){a.remove(b);for(var c=this.getQueue()||[],d=0;d<c.length;d++)if(c[d]===b){c.splice(d,1);break}this.setQueue(c)},b.prototype.clear=function(){a.clear(),this.setQueue([])},b.prototype.getQueue=function(){return a.get(this.queueKey)},b.prototype.setQueue=function(b){return a.set(this.queueKey,b),b},b}),define("core/extensions/jquery.autoresize",["jquery","underscore"],function(a,b){"use strict";return a.fn.autoresize=function(c){var d=b.extend({extraSpace:0,maxHeight:1e3},c);return this.each(function(){var c=a(this).css({resize:"none",overflow:"hidden"}),e="true"===String(c[0].contentEditable)?"html":"val",f="html"===e?"<br>":"\n",g=c.height(),h=function(){var d={};b.each(d,function(a,b){d[b]=c.css(b)});var e=a(c[0].cloneNode(!0));return e.removeAttr("id").removeAttr("name").css({visibility:"hidden",position:"absolute",top:"-9999px",left:"-9999px",contentEditable:!1}).css(d).attr("tabIndex","-1"),e.insertAfter(c[0]),e}(),i=null,j=function(){h[0].style.height=0,h[e](c[e]()+f),h.scrollTop(h[0].scrollHeight);var a=Math.max(h[0].scrollHeight,g)+parseInt(d.extraSpace,10);d.maxHeight&&(a>=d.maxHeight?(c.css("overflow",""),a=d.maxHeight):c.css("overflow","hidden")),i!==a&&(i=a,c.height(a),c.trigger&&c.trigger("resize"))},k=b.throttle(j,500),l=function(a){13===a.keyCode?j():k()};c.bind("keyup",l).bind("paste",j).css("overflow","hidden"),j()})},a}),define("core/views/TextareaView",["underscore","jquery","backbone","core/utils","core/CappedStorage","core/extensions/jquery.autoresize"],function(a,b,c,d,e){"use strict";var f=c.View.extend({events:{"keydown [data-role=editable]":"handleKeyDown","keyup [data-role=editable]":"handleKeyUp","paste [data-role=editable]":"handlePaste","focusin [data-role=editable]":"handleFocusIn","blur [data-role=editable]":"handleBlur"},initialize:function(b){b=b||{},this.storageKey=b.storageKey,this.value=b.value||this.getDraft()[0],this.placeholder=b.placeholder,this.listenTo(this,"keychange",a.debounce(this.saveDraft,this.constructor.SAVE_DRAFT_INTERVAL))},render:function(){return this.$input=this.createInput(),this.set(this.value),this.$el.append(this.$input),this.$input.autoresize({maxHeight:this.constructor.MAX_TEXTAREA_HEIGHT}),this},createInput:function(){return b("<textarea>").attr({"class":"textarea",placeholder:this.placeholder,"data-role":"editable"})},resize:function(){this.$input.trigger("paste",{fake:!0})},get:function(){return this.$input.val()},getSelected:function(){var a=this.$input[0];return"number"==typeof a.selectionStart?this.$input.val().substring(a.selectionStart,a.selectionEnd):""},offset:function(){var a=this.$input[0];return"number"==typeof a.selectionStart?a.selectionStart:0},insertAtCursor:function(a){this.focus();var b=this.get(),c=this.offset(),e=d.insertWithWhitespace(b,c,a),f=this.$input[0];if(this.set(e),f.setSelectionRange){var g=e.indexOf(a,c)+a.length+1;f.setSelectionRange(g,g)}},insertAroundSelection:function(a,b){this.focus();var c,d,e=this.$input[0];"number"==typeof e.selectionStart?(c=e.selectionStart,d=e.selectionEnd):c=d=0;var f=this.get(),g=f.substring(0,c)+a+f.substring(c,d)+b+f.substring(d);this.set(g),e.setSelectionRange&&e.setSelectionRange(c+a.length,d+a.length)},set:function(a){this.$input.val(a)},clear:function(){this.set("")},focus:function(){this.$input[0].focus()},handleKeyDown:function(a){this.trigger("keydown",a)},handleKeyUp:function(a){this.trigger("keychange",a)},handlePaste:function(a,b){b=b||{},this.trigger(b.fake?"paste":"paste keychange"),this.$input.trigger("resize")},handleFocusIn:function(){this.trigger("focus")},handleBlur:function(){this.trigger("blur")},saveDraft:function(){return this.storageKey?b.trim(this.get())?void this.constructor.storage.set(this.storageKey,this.toJSON()):void this.removeDraft():void 0},toJSON:function(){return[this.get(),b.now()]},getDraft:function(){var a=[""];if(!this.storageKey)return a;var c=this.constructor.storage.get(this.storageKey);if(!c)return a;if(a=c,!a.length)return[""];var d=b.now()-a[1]>=this.constructor.DRAFT_MAX_AGE;return d?(this.removeDraft(),[""]):a},removeDraft:function(){this.storageKey&&this.constructor.storage.remove(this.storageKey)}},{MAX_TEXTAREA_HEIGHT:350,SAVE_DRAFT_INTERVAL:500,DRAFT_MAX_AGE:864e5,storage:new e(5,"drafts.queue")});return f}),define("core/views/ContentEditableView",["jquery","underscore","core/editable","core/views/TextareaView"],function(a,b,c,d){"use strict";var e=window.document,f=d,g=f.prototype,h=f.extend({events:function(){return b.extend({},g.events,{"focusout [data-role=editable]":"handleFocusOut","click .placeholder":"handlePlaceholderClick"})},initialize:function(){g.initialize.apply(this,arguments),this.hasFocus=!1,this._selectionRange=null},saveSelection:function(){var a=window.getSelection();this._selectionRange=a&&a.rangeCount&&a.getRangeAt(0)},restoreSelection:function(){if(this._selectionRange){var a=window.getSelection();a.removeAllRanges(),a.addRange(this._selectionRange),this._selectionRange=null}},render:function(){return this.$input=this.createInput(),this.$el.append(this.$input),this.set(this.value),this.renderPlaceholder(),this},createInput:function(){var b=a("<div>").attr({"class":"textarea",tabIndex:0,role:"textbox","aria-multiline":"true",contenteditable:"PLAINTEXT-ONLY","data-role":"editable"}).css({overflow:"auto","max-height":this.constructor.MAX_TEXTAREA_HEIGHT+"px"}),d=b[0];return"plaintext-only"!==d.contentEditable&&(d.contentEditable="true"),this.content=new c(d,!0),b},renderPlaceholder:function(){var b=this.placeholder;b&&(this.$input.attr("aria-label",b),this.$placeholder=a('<span class="placeholder">'+b+"</span>"),this.updatePlaceholderDisplay())},updatePlaceholderDisplay:function(){this.$placeholder&&(this.hasFocus||this.content.text()?this.$placeholder.remove():this.$el.prepend(this.$placeholder))},handlePlaceholderClick:function(){this.$input.focus()},handleFocusIn:function(){g.handleFocusIn.call(this),this.restoreSelection(),this.hasFocus=!0,this.updatePlaceholderDisplay()},handleFocusOut:function(){this.saveSelection(),this.hasFocus=!1,this.updatePlaceholderDisplay()},get:function(){return this.content.text()},getSelected:function(){return this.hasFocus&&window.getSelection?window.getSelection().toString():this._selectionRange?this._selectionRange.toString():""},offset:function(){return this.content.offset()},set:function(a){this.content.setText(a),this.resize(),this.updatePlaceholderDisplay()},insertAtCursor:function(a){this.focus();var b=" "+a+" ";e.queryCommandSupported&&e.queryCommandSupported("insertText")&&e.execCommand("insertText",!1,b)||this.content.insertNode(e.createTextNode(b))},clear:function(){g.clear.call(this),b.defer(function(a){a.$input.blur()},this)},insertAroundSelection:function(a,b){this.focus();var c=window.getSelection();if(c.rangeCount){var d=c.getRangeAt(0),f=d.cloneRange();f.collapse(!1);var g=e.createTextNode(b);f.insertNode(g);var h=d.cloneRange();h.collapse(!0);var i=e.createTextNode(a);h.insertNode(i),d.setStart(i,a.length),d.setEnd(g,0),c.removeAllRanges(),c.addRange(d)}}});return h}),define("core/views/PostReplyView",["jquery","underscore","backbone","modernizr","core/UniqueModel","core/mixins/withAlert","core/mixins/withUploadForm","core/models/Post","core/models/User","core/utils","core/views/ContentEditableView","core/views/TextareaView","core/strings"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){"use strict";var n=m.get,o=j.preventDefaultHandler,p=c.View.extend({tagName:"form",className:"reply",events:{submit:"submitForm"},postboxAlertSelector:"[role=postbox-alert]",initialize:function(a){this.session=a.session,this.parent=a.parent,this.thread=a.thread,this.post=this.makePostInstance(),this.setAlertSelector("[role=alert]"),this.shouldShowEmailAlertInForm=a.shouldShowEmailAlertInForm,this.parentView=a.parentView,this._isHidden=!1,this.parent&&(p.open[this.parent.cid]=this),this.allowMedia=this.thread.forum.get("settings").allowMedia,this.allowUploads=this.allowMedia&&this.uploadSupported,this.listenTo(this.session,"change:id",this.redraw)},redraw:function(){var b=this.$el.hasClass("expanded"),c=this.el,d=this.$el.find("textarea").val();this.render(),this.$el.find("textarea").val(d),b&&this.$el.addClass("expanded"),0!==a(c).parent().length&&c.parentNode.replaceChild(this.el,c)},getPlaceholderText:function(){return n(this.thread.get("posts")?"Join the discussion…":"Start the discussion…")},getTemplateData:function(){return{user:this.session.toJSON(),displayMediaPreviews:this.allowMedia,displayMediaUploadButton:this.allowUploads}},render:function(){return this.$el.html(this.template(this.getTemplateData())),this.parent?this.$el.addClass("expanded"):this.$el.removeClass("expanded"),this.initTextarea(),this.initMediaViews({allowMedia:this.allowMedia,allowUploads:this.allowUploads,storageKey:this.post.storageKey("media"),textarea:this.textarea}),this.constructor.mustVerifyEmailToPost(this.session.user,this.thread.forum)&&this._alertMustVerify(this.shouldShowEmailAlertInForm),this._isHidden&&this.$el.addClass("hidden"),this},createTextarea:function(){var a={placeholder:this.getPlaceholderText(),storageKey:this.post.storageKey()};return this.constructor.canUseContentEditable?new this.constructor.ContentEditableView(a):new this.constructor.TextareaView(a)},initTextarea:function(){var a=this.textarea=this.createTextarea();this.$("[data-role=textarea]").prepend(a.render().el),this.listenTo(a,{keydown:function(a){!a||!a.ctrlKey&&!a.metaKey||13!==a.keyCode&&10!==a.keyCode||this.submitForm()},focus:function(){this.$el.hasClass("expanded")||this.$el.addClass("expanded")}})},resize:function(){this.textarea.resize()},focus:function(){this.textarea.focus()},clear:function(){var a=this;a.textarea.clear(),a.clearMediaPreviews(),a.$el.removeClass("expanded"),b.delay(function(){a.resize()},200),a.parent&&a.hide();
  3. },restore:function(a){var c=this;c.textarea.set(a.get("raw_message")),c.textarea.handleFocusIn(),b.delay(function(){c.resize()},200),c.parent&&c.show()},_alertMustVerify:function(a){var b=this.emailVerifyAlertTemplate({user:this.session.user.toJSON(),forumName:this.thread.forum.get("name"),forumId:this.thread.forum.id});this.alert(b,{safe:!0,type:a?"error":"warn",target:a?this.postboxAlertSelector:null})},submitForm:o(function(){return this.dismissAlert(),this.initiatePost()}),makePostInstance:function(){return new e(this.constructor.Post,{thread:this.thread.id,depth:this.parent?this.parent.get("depth")+1:0,parent:this.parent?this.parent.id:null})},getPostParams:function(){var a={raw_message:this.textarea.get()};b.extend(a,this.getAuthorParams());var c=this.mediaUploadsView;return c&&(a.media=c.legacy.invoke("toMediaJSON").concat(c.rich.invoke("toJSON"))),a},getAuthorParams:function(){return{author_id:this.session.user.id}},initiatePost:function(){this.createPost(this.getPostParams())},createPost:function(c){var d=this.post;this.dismissAlert();var e=a.now();if(!this.shouldAbortCreatePost(d,c))return this.listenTo(d,{error:this._onCreateError,sync:b.partial(this._onCreateSync,e)}),d.save(c,{uploadTokens:this.getMediaUploadTokens()}),this.attachAuthorToPost(d,c),d.created=!0,this.addPostToThread(d),this.clear(),this.trigger("uiAction:createPost",d),d},shouldAbortCreatePost:function(a,b){return this.isUploadInProgress()?(this.alert(n("Please wait until your images finish uploading."),{type:"error",target:this.postboxAlertSelector}),!0):a.set(b,{validate:!0})?!1:(this.alert(a.validationError,{type:"error",target:this.postboxAlertSelector}),!0)},_onCreateError:function(a,c){if(12===c.code&&/not have permission to post on this thread/.test(c.response)){var d=this.blacklistErrorMessageTemplate({blocker:this.session.user.get("isOnGlobalBlacklist")?"Disqus":this.thread.forum.get("name")});this.alert(d,{type:"error",target:this.postboxAlertSelector,safe:!0})}else 12===c.code&&/verify/.test(c.response)?this._alertMustVerify(!0):b.isString(c.response)?this.alert(c.response,{type:"error",target:this.postboxAlertSelector}):this.alert(n("Oops! We're having trouble posting your comment. Check your internet connection and try again."),{type:"error",target:this.postboxAlertSelector});this.thread.posts.remove(a),this.restore(a)},_onCreateSync:function(b,c){this.textarea.removeDraft(),this.thread.trigger("create",c),this.trigger("uiCallback:postCreated",c,{duration:a.now()-b}),this.parentView&&this.parentView.toggleReplyLink(!1),this.stopListening(c,"error",this._onCreateError),this.stopListening(c,"sync",this._onCreateSync),this.post=this.makePostInstance(),this.trigger("domReflow")},attachAuthorToPost:function(a,b){this.session.isLoggedIn()?a.author=this.session.user:a.author=new e(this.constructor.User,{name:b.author_name,email:b.author_email})},addPostToThread:function(a){this.thread.posts.add(a)},remove:function(){this.parent&&delete p.open[this.parent.cid],c.View.prototype.remove.call(this)},toggle:function(){this.isOpen()?this.hide():this.show()},show:function(){var a=this;a._isHidden=!1,a.$el.removeClass("hidden"),a.trigger("show")},hide:function(){var a=this;a._isHidden=!0,a.dismissAlert(),a.$el.addClass("hidden"),a.trigger("hide")},isOpen:function(){return!this._isHidden}},{mustVerifyEmailToPost:function(a,b){if(a.isAnonymous())return!1;var c=b.get("settings").mustVerifyEmail,d=a.get("isVerified");return c&&!d},canUseContentEditable:d.contenteditable&&!j.isMobileUserAgent()&&!(window.opera&&window.opera.version),TextareaView:l,ContentEditableView:k,User:i,Post:h,open:{}});return f.call(p.prototype),g.call(p.prototype),p}),define("lounge/mixins/post-reply",["underscore","common/models","lounge/common"],function(a,b,c){"use strict";var d={initialize:function(){this.canBindTypingHandlers()&&this.bindTypingHandlers()},canBindTypingHandlers:function(){return this.parent&&c.getLounge().isRealtimeEnabled()&&this.session&&this.thread&&this.thread.forum},bindTypingHandlers:function(){return a.map([[this,"show",this.typingStart],[this,"hide",this.typingStop]],function(a){return this.listenTo.apply(this,a),a},this)},syncTyping:function(a){this.typingUser&&(void 0!==a&&this.typingUser.set("typing",a),this.typingUser.sync())},typingStart:function(){var a=this.parent;this.typingUser||(this.typingUser=b.TypingUser.make({user:this.session.user.id,post:a.id,thread:this.thread.id,forum:this.thread.forum.id}),a.usersTyping.add(this.typingUser)),this.syncTyping(!0)},typingStop:function(){this.syncTyping(!1)}},e=function(b){var c=b.initialize,e=b.remove;a.extend(b,d),b.initialize=function(){c.apply(this,arguments),d.initialize.call(this)},b.remove=function(){return this.parent&&this.typingStop(),e.call(this)}};return{asRealtimeTyping:e}}),define("lounge/views/posts/SuggestionView",["jquery","underscore","backbone","common/templates"],function(a,b,c,d){"use strict";var e=c.View.extend({events:{"click li":"handleClick"},initialize:function(a){this.active=!1,this.mentionsCache=a.mentions,this.userSuggestions=a.userSuggestions,this.userHtmlCache={}},suggest:function(a){var b=this.userSuggestions.find(a,this.mentionsCache);return b&&b.length?(this.renderUsers(b),this.active=!0,void this.$el.show()):void this.clear()},render:function(){return this.$el.html(d.render("suggestions")),this.active||this.$el.hide(),this},renderUsers:function(c){var d=b.reduce(c,function(b,c){var d=this.userHtmlCache[c.cid];return void 0===d&&(this.userHtmlCache[c.cid]=d=a(this.renderSingleUser(c))),b.appendChild(d[0]),b},window.document.createDocumentFragment(),this);this.$(".header").siblings().remove().end().after(d).siblings().removeClass("active").first().addClass("active")},renderSingleUser:function(a){var b=a.toJSON();return b.cid=a.cid,d.render("suggestedUser",b)},clear:function(){this.active=!1,this.$el.hide()},handleClick:function(b){var c=a(b.currentTarget);this.select(c.attr("data-cid"))},select:function(a){this.active&&(a||(a=this.$el.find(".active").attr("data-cid")),this.trigger("select",a),this.clear())},move:function(a){if(this.active){var b=this.$el.find(".active"),c="up"===a?"prev":"next",d=b[c]();d.length&&d.attr("data-cid")&&(b.removeClass("active"),d.addClass("active"))}}},{MAX_SUGGESTIONS:5});return e}),define("lounge/views/posts/ContentEditableView",["jquery","underscore","core/editable","core/views/ContentEditableView","common/collections","common/Session","lounge/views/posts/SuggestionView"],function(a,b,c,d,e,f,g){"use strict";var h=window.document,i=d,j=i.prototype,k=i.extend({initialize:function(a){j.initialize.call(this,a),a=a||{},this.userSuggestions=a.userSuggestions,this.mentionsCache=new e.UserCollection,this.restoreMentionedUsers(),this.suggestions=new g({userSuggestions:this.userSuggestions,mentions:this.mentionsCache}),this.listenTo(this.suggestions,"select",this.insertMention),this.reset(),this.$input=null},restoreMentionedUsers:function(){var a=this.getDraft()[2];a&&!b.isEmpty(a)&&this.userSuggestions.addRemote(new e.UserCollection(a))},reset:function(){this.anchorNode=null,this.anchorOffset=null,this.anchorLength=0,this.suggestions.clear()},render:function(){return d.prototype.render.call(this),this.$el.append(this.suggestions.render().el),this},createInput:function(){var a=d.prototype.createInput.call(this);return this.content.getHtmlElements=b.bind(this.getHtmlElements,this),a},getHtmlElements:function(a){if(!a)return a;var c=[a],d=this.getMentionNodes(a);return b.each(d,function(a,d){for(var e=0;e<c.length;e++){var f,g=c[e],h=e;if(b.isString(g)){for(;(f=g.indexOf(d))>-1;)f>0&&(c.splice(e,0,g.substring(0,f)),e+=1),c.splice(e,0,a.cloneNode(!0)),e+=1,g=g.substring(f+d.length);g&&g!==c[h]&&(c.splice(e,0,g),e+=1),h!==e&&c.splice(e,1)}}}),c=b.map(c,function(a){return b.isString(a)?h.createTextNode(a):a})},getMentionNodes:function(a){var b=k.MENTIONS_RE_GROUPED,c={};b.lastIndex=0;for(var d=b.exec(a);d;){var e=d[1],f=this.userSuggestions.all().findWhere({username:e});if(f){var g=k.getMentionDom(f),h=d[0];c[h]=g,this.updateCache(f,f.cid)}d=b.exec(a)}return c},handleKeyDown:function(a){switch(d.prototype.handleKeyDown.call(this,a),a.keyCode){case 9:this.suggestions.active&&(this.suggestions.select(),a.preventDefault(),a.stopPropagation());break;case 10:case 13:case 38:case 40:this.suggestions.active&&(a.preventDefault(),a.stopPropagation())}},handleKeyUp:function(a){switch(d.prototype.handleKeyUp.call(this,a),a.preventDefault(),a.stopPropagation(),this.checkExistingMentions(),f.get().isLoggedIn()&&this.userSuggestions.fetch(),a.keyCode){case 10:case 13:this.suggestions.select();break;case 27:this.reset(a);break;case 38:this.suggestions.move("up");break;case 40:this.suggestions.move("down");break;default:this.throttledSuggest(a)}},suggest:function(){var a=this.parseSearchTerms();this.suggestions.suggest(a)},throttledSuggest:b.throttle(function(){this.suggest()},250),insertMention:function(a){var c=this.userSuggestions.get(a);if(c){this.selectSearchString(c),this.updateCache(c,a);var d=k.getMentionDom(c);this.content.insertNode(d);var e=this.$el.find("span[data-cid]");b.each(e,function(a){a.contentEditable!==!1&&(a.contentEditable=!1)})}},updateCache:function(a,b){this.mentionsCache.get(b)||this.mentionsCache.add(a)},selectSearchString:function(){this.content.selectNodeText(this.anchorNode,this.anchorOffset-1,this.anchorOffset+this.anchorLength)},get:function(){function a(a){return c(a,!0)?b.mentionToText(a):null}var b=this,c=k.isMention;return this.content.text(a)},parseSearchTerms:function(){var a=this.content.selectedTextNode(),b=a?a.nodeValue:"",d=c.normalizeSpace;if(b){var e=this.content.selectedTextNodeOffset(a),f=c.normalizeSpace(b.slice(0,e).split("").reverse().join("")),g=f.indexOf("@");if(-1===g)return null;this.anchorNode=a,this.anchorOffset=e-g,this.anchorLength=g;var h=d(b.slice(this.anchorOffset-1,e)).match(k.MENTIONS_RE);return h?h[0].slice(1).split(" "):0===g?[""]:void 0}},checkExistingMentions:function(){var d=c.normalizeSpace,e=this.$el.find("span"),f=b.filter(e,k.isMention),g=this.mentionsCache,h={};b.each(f,function(c){var e=a(c).attr("data-cid"),f=b.reduce(this.content.getTextNodes(c),function(a,b){return a+d(b.nodeValue)},""),i=g.get(e);i&&i.get("name")!==f?(this.mentionsCache.remove(i),this.content.removeNode(c),this.content.insertHTML(" "),this.reset()):h[e]=c},this),g.each(function(a){h[a.cid]||g.remove(a)})},mentionToText:function(b){var c=a(b).attr("data-cid"),d=this.mentionsCache.get(c),e=b.innerText||b.textContent;return d&&d.get("username")&&(e=d.get("username")),["@",e,":","disqus"].join("")},toJSON:function(){var a=d.prototype.toJSON.call(this);return a.push(this.mentionsCache.models),a}},{MENTIONS_RE:new RegExp("@\\w+\\s?(?:\\w+\\s?){0,5}(?:\\w+)?$"),MENTIONS_RE_GROUPED:/@([\d\w]+)\s?(:\s?(\w+))?/gi,isMention:function(b,c){var d;do{if(d=a(b),d.hasClass("mention")&&d.attr("data-cid"))return!0;b=b.parentElement}while(c&&b);return!1},getMentionDom:function(a){var b=h.createDocumentFragment(),c=h.createElement("span"),d=h.createElement("span"),e=h.createTextNode(a.get("name")||a.get("username"));return c.setAttribute("contenteditable",!0),d.setAttribute("contenteditable",!1),d.setAttribute("data-cid",a.cid),d.className="mention",d.appendChild(e),c.appendChild(d),b.appendChild(c),b.appendChild(h.createTextNode(" ")),b}});return k}),define("core/views/common/LoginFormView",["underscore","backbone","core/strings"],function(a,b,c){"use strict";var d=c.get,e=b.View.extend({initialize:function(){this.model=new this.User},parseRegistrationErrorResponse:function(a){if(a.responseJSON){var b=a.responseJSON.response;return/Unable to create user/i.test(b)?{email:[d("That email address is already registered with a Disqus account. Log in or enter another email.")]}:/The e-mail address you specified is already in use./i.test(b)?{email:[d("The e-mail address you specified is already in use.")+'<br><a class="link" href="#" data-action="auth:disqus">'+d("Try logging in.")+"</a>"]}:{all:[b]}}},getPassword:function(){var a=this.$el.find("input[name=password]");return a.length?a.val():null},getDisplayName:function(){return this.$el.find("input[name=display_name]").val()},getEmail:function(){return this.$el.find("input[name=email]").val()},disableForm:function(){this.$("[data-role=submit-btn-container]").addClass("is-submitting")},enableForm:function(){this.$("[data-role=submit-btn-container]").removeClass("is-submitting")},handleRegistrationErrorResponse:function(a){this.handleRegistrationError(this.parseRegistrationErrorResponse(a))},registerUser:function(){return this.model.set({display_name:this.$el.find("input[name=display_name]").val(),email:this.$el.find("input[name=email]").val(),password:this.getPassword()}),this.model.isValid()?(this.disableForm(),void this.model.register({error:a.bind(this.handleRegistrationErrorResponse,this),success:a.bind(this.handleRegistrationSuccess,this)}).always(a.bind(this.enableForm,this))):void this.handleRegistrationError(this.model.validationError)}});return e}),define("lounge/views/posts/LoginFormView",["underscore","core/bus","core/views/common/LoginFormView","common/models","common/templates","lounge/common"],function(a,b,c,d,e,f){"use strict";var g=c.extend({events:{"click input[name=author-guest]":"updateLoginForm","focusin input[name=display_name]":"expandGuestForm"},User:d.User,initialize:function(a){c.prototype.initialize.call(this,a),this.thread=a.thread,this.session=a.session,this.alert=a.alert},expandGuestForm:function(){this.$("[data-role=guest-details]").addClass("expanded")},shouldRegisterUser:function(){return this.session.isLoggedOut()&&!this.$("input[name=author-guest]").is(":checked")},render:function(){var a=f.getLounge();return this.$el.html(e.render("loginForm",{user:this.session.toJSON(),forumName:this.thread.forum.get("name"),audienceSyncRequired:this.session.needsAudienceSyncAuth(this.thread.forum),allowAnonPost:this.thread.forum.get("settings").allowAnonPost,apiKey:a.config&&a.config.apiKey||"",sso:this.session.get("sso"),cid:this.cid})),this},handleRegistrationSuccess:function(){this.session.setUser(this.model),b.frame.trigger("onboardAlert.show"),f.getLounge().trigger("uiAction:finishRegistrationEmbed")},handleRegistrationError:function(b){var c=this;c.clearRegistrationErrors(),a.isString(b)&&(b={all:[b]}),a.has(b,"all")&&(c.alert&&c.alert(b.all[0],{type:"error"}),b=a.omit(b,"all")),a.each(b,function(a,b){var d=c.$("input[name="+b+"]");d.attr("aria-invalid","true").after('<label for="'+d.attr("id")+'" class="input-label">'+a[0]+"</label>").parent(".input-wrapper").addClass("has-error")}),c.$("[aria-invalid]").first().focus()},updateLoginForm:function(){var a=this.$el,b=a.find("input[name=author-guest]").is(":checked"),c=a.find(".guest"),d=a.find("input[name=password]");d.val(""),c.toggleClass("is-guest",b),this.clearRegistrationErrors()},clearRegistrationErrors:function(){this.$(".input-wrapper.has-error").removeClass("has-error").find(".input-label").remove(),this.$("[aria-invalid]").removeAttr("aria-invalid")}});return g}),define("lounge/views/posts/PostReplyView",["jquery","underscore","core/utils","core/bus","core/switches","core/views/PostReplyView","common/models","common/templates","lounge/mixins/post-reply","lounge/common","lounge/views/posts/ContentEditableView","lounge/views/posts/LoginFormView"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use strict";var m=c.preventDefaultHandler,n=f,o=n.prototype,p=n.extend({initialize:function(a){o.initialize.call(this,a),this.listenTo(this.session,"change:audienceSyncVerified",this.redraw),this.userSuggestions=a.userSuggestions,this.loginFormView=new l({thread:this.thread,session:this.session,alert:b.bind(this.alert,this)});var c=j.getLounge();b.each(["uiCallback:postCreated","domReflow","uiAction:createPost"],function(a){this.listenTo(this,a,b.bind(c.trigger,c,a))},this),this.template=h.getTemplate("form"),this.blacklistErrorMessageTemplate=h.getTemplate("blacklistErrorMessage"),this.emailVerifyAlertTemplate=h.getTemplate("emailVerifyAlert")},getTemplateData:function(){var a=o.getTemplateData.call(this);return a.audienceSyncRequired=this.session.needsAudienceSyncAuth(this.thread.forum),a},render:function(){return this.loginFormView.$el.detach(),o.render.call(this),this.loginFormView.render(),this.loginFormView.$el.appendTo(this.$("[data-role=login-form]")),this.session.user.id?this.$el.addClass("authenticated"):this.$el.removeClass("authenticated"),this},areUploadUrlsEnabled:function(){return j.getLounge().isInHome()||e.isFeatureActive("embed_upload_urls")},createTextarea:function(){var a={placeholder:this.getPlaceholderText(),storageKey:this.post.storageKey()};return this.constructor.canUseContentEditable?(a.userSuggestions=this.userSuggestions,new this.constructor.ContentEditableView(a)):new this.constructor.TextareaView(a)},getPostParams:function(){var b=a.Deferred(),c=o.getPostParams.call(this);return e.isFeatureActive("before_comment_callback",{forum:this.thread.forum.id})?(d.frame.sendHostMessage("posts.beforeCreate",{raw_message:c.raw_message}),this.listenToOnce(d.frame,"posts.beforeCreate.response",function(a){a&&(c.raw_message=a),b.resolve(c)})):b.resolve(c),b.promise()},getAuthorParams:function(){return this.session.isLoggedIn()?{author_id:this.session.user.id}:{author_name:this.loginFormView.getDisplayName(),author_email:this.loginFormView.getEmail()}},initiatePost:function(){var a=b.bind(this.createPost,this);this.getPostParams().done(a)},shouldAbortCreatePost:function(a,c){return this.constructor.mustVerifyEmailToPost(this.session.user,this.thread.forum)?(this.session.fetch().always(b.bind(function(){this.constructor.mustVerifyEmailToPost(this.session.user,this.thread.forum)?this._alertMustVerify(!0):this.createPost(c)},this)),!0):o.shouldAbortCreatePost.call(this,a,c)},_onCreateError:function(a,b){o._onCreateError.call(this,a,b),this.thread.incrementPostCount(-1)},_onCreateSync:function(a,b){o._onCreateSync.call(this,a,b),this.thread.posts.saveToCache(b)},addPostToThread:function(a){this.thread.incrementPostCount(1),this.thread.posts.add(a)},remove:function(){return this.loginFormView&&(this.loginFormView.remove(),this.loginFormView=null),o.remove.call(this)},submitForm:m(function(){return this.dismissAlert(),this.loginFormView.shouldRegisterUser()?void this.loginFormView.registerUser():this.initiatePost()})},{ContentEditableView:k,User:g.User,Post:g.Post});return i.asRealtimeTyping(p.prototype),p}),define("core/models/RichMediaViewModel",["backbone"],function(a){"use strict";return a.Model.extend({defaults:{deferred:!0,showButtons:!0,activated:!1,kind:"image",deferredHeight:0,providerExpandMessage:"",providerCollapseMessage:"",providerIcon:"icon-proceed",respectSettings:!0}})}),define("core/mediaConfig",["underscore","backbone"],function(a,b){"use strict";function c(){var b=window.document.body.offsetWidth,c=d,e=c.length;return a.find(c,function(a,d){return d+1===e||Math.abs(c[d+1]-b)>Math.abs(c[d]-b)})}var d=[320,480,600,800],e=new b.Model({collapsed:!1,defaultIframeHeight:300,mediaPersistedWidths:d,loadedThumbnailWidth:c()});return e.findClosestThumbnailSize=c,e}),define("core/templates/postMediaInlineLink",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=b?b.hasUserText:b,{name:"if",hash:{},fn:a.program(2,e,0),inverse:a.noop,data:e}))?f:""},2:function(a,b,c,d,e){var f=a.lambda,g=a.escapeExpression;return'<a href="'+g(f(null!=b?b.href:b,b))+'" rel="nofollow">'+g(f(null!=b?b.text:b,b))+"</a>\n"},4:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<a href="'+h(g(null!=b?b.href:b,b))+'" class="post-media-link" data-action="expand-collapse-media" rel="nofollow">'+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.model:b)?f.providerIcon:f,{name:"if",hash:{},fn:a.program(5,e,0),inverse:a.noop,data:e}))?f:"")+h(g(null!=b?b.mediaLinkText:b,b))+(null!=(f=c["if"].call(i,null!=b?b.domain:b,{name:"if",hash:{},fn:a.program(7,e,0),inverse:a.noop,data:e}))?f:"")+"</a>\n"},5:function(a,b,c,d,e){var f;return'<i class="'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.model:b)?f.providerIcon:f,b))+'"></i>'},7:function(a,b,c,d,e){return'<span class="post-media-link-domain"> &mdash; '+a.escapeExpression(a.lambda(null!=b?b.domain:b,b))+"</span>"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.model:b)?f.deferred:f,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.program(4,e,0),data:e}))?f:""},useData:!0})}),define("core/views/RichMediaLinkView",["backbone","core/utils","core/templates/postMediaInlineLink"],function(a,b,c){"use strict";return a.View.extend({tagName:"span",events:{"click [data-action=expand-collapse-media]":"handleToggle"},initialize:function(a){this.media=a.media;var c=a.$link;this.linkText=c.text(),this.linkHref=c.attr("href"),this.linkDomain=b.getDomain(this.linkHref),this.linkHasUserText=this.isUserText(c),this.hasGenericMessage=!1,this.linkHasUserText?this.mediaLinkText=this.linkText:this.media.get("title")?this.mediaLinkText=b.niceTruncate(this.media.get("title"),60):(this.hasGenericMessage=!0,this.mediaLinkText=this.model.get("providerExpandMessage")),this.listenTo(this.model,"change:deferred",this.render),this.listenTo(this.model,"change:activated",this.onChangeActivated)},isUserText:function(a){if("A"!==a[0].nodeName)return!1;var b=(a.text()||"").toLowerCase();if(!b)return!1;if(0===b.indexOf("http")||0===b.indexOf("www"))return!1;b=b.replace(/\.\.\.$/,"");var c=(a.attr("href")||"").toLowerCase();return-1===c.indexOf(b)},render:function(){var a=this.mediaLinkText;return this.hasGenericMessage&&this.model.get("activated")&&(a=this.model.get("providerCollapseMessage")),this.$el.html(c({model:this.model.toJSON(),text:this.linkText,href:this.linkHref,mediaLinkText:a,domain:this.linkDomain,hasUserText:this.linkHasUserText})),this},onChangeActivated:function(){this.hasGenericMessage&&this.render()},handleToggle:function(a){this.model.get("deferred")||(this.model.set("activated",!this.model.get("activated")),a&&a.preventDefault&&a.preventDefault())}})}),define("core/templates/postMedia",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){var f;return(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.media:b)?f.providerName:f,{name:"if",hash:{},fn:a.program(2,e,0),inverse:a.noop,data:e}))?f:"")+a.escapeExpression(a.lambda(null!=(f=null!=b?b.media:b)?f.title:f,b))},2:function(a,b,c,d,e){var f;return a.escapeExpression(a.lambda(null!=(f=null!=b?b.media:b)?f.providerName:f,b))+" &ndash; "},4:function(a,b,c,d,e){var f;return'<i class="'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.model:b)?f.providerIcon:f,b))+' publisher-background-color"></i>'},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'\n<a class="media-button media-button-expand publisher-color publisher-border-color" href="'+h(g(null!=(f=null!=b?b.media:b)?f.url:f,b))+'" rel="nofollow" target="_blank" data-action="expand"\ntitle="'+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.media:b)?f.title:f,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+'">\n'+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.model:b)?f.providerIcon:f,{name:"if",hash:{},fn:a.program(4,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+h(g(null!=(f=null!=b?b.model:b)?f.providerExpandMessage:f,b))+'\n</a>\n<a class="media-button media-button-contract publisher-color publisher-border-color" href="#" target="_blank" data-action="contract">\n<i class="icon-cancel publisher-background-color"></i> '+h(g(null!=(f=null!=b?b.model:b)?f.providerCollapseMessage:f,b))+'\n</a>\n<div class="media-content-loader" data-role="content-loader"></div>\n<div data-role="content-placeholder" class="media-content-placeholder"></div>\n'},useData:!0})}),define("core/templates/postMediaPlaceholder",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f;return'<a href="#" class="media-force-load" data-action="force-load"><i class="'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.model:b)?f.providerIcon:f,b))+'"></i></a>\n'},useData:!0})}),define("core/views/RichMediaView",["jquery","backbone","core/utils","core/mediaConfig","core/views/RichMediaLinkView","core/templates/postMedia","core/templates/postMediaPlaceholder"],function(a,b,c,d,e,f,g){"use strict";var h=c.preventDefaultHandler,i=function(a,b,c,d){a[b.get(c)?"addClass":"removeClass"](d)};return b.View.extend({className:"media-container",events:{"click [data-action=expand]":"handleExpand","click [data-action=contract]":"handleContract","click [data-action=force-load]":"handleForceLoad"},template:f,initialize:function(a){this.options=a,this.media=a.media,this.template=a.template||this.template,this.$linkEl=null,this.setupMode(),this.listenTo(this.model,"change:activated",this.applyState),this.listenTo(this.model,"change:deferredHeight",this.onChangeDeferredHeight),this.listenTo(this.model,"change:showButtons",this.updateElementClass),this.listenTo(this.model,"change:deferred",this.render),this.listenTo(d,"change:collapsed",this.setupMode)},getMediaDimensions:function(){return{width:null,height:null}},getAvailableWidth:function(){return this.$el.parent().width()||d.get("loadedThumbnailWidth")},updateDeferredHeight:function(){this.model.set("deferredHeight",this.calculateDeferredHeight())},calculateDeferredHeight:function(){var a=this.getMediaDimensions(),b=a.width,c=a.height;if(!b||!c)return c;var d=this.getAvailableWidth(),e=d*c/b;return e},convertToButton:function(a){this.model.set("showButtons",!1),this.linkSubview&&this.linkSubview.remove(),this.linkSubview=new e({model:this.model,media:this.media,$link:a}),a.replaceWith(this.linkSubview.$el),this.linkSubview.render()},applyContentNodeHeight:function(a){this.contentNode.height(a||"auto")},shouldAutoplay:function(){return!this.model.get("deferred")},generateContentHtml:function(){return this.media.get("html")},createContentNode:function(b){return a(b)},insertContentNode:function(a){this.contentNode.html(a)},prepareElementEvents:function(){},displayContent:function(){this.updateDeferredHeight();var a=this.generateContentHtml(),b=this.createContentNode(a);this.prepareElementEvents(b),this.insertContentNode(b),this.applyContentNodeHeight(null)},configureDeferred:function(){this.enterViewport()},configureContentFromActivated:function(){this.model.get("activated")?this.displayContent():this.displayPlaceholder()},displayPlaceholder:function(){this.contentNode.html(g({model:this.model.toJSON()}))},updateElementClass:function(){var a=this.$el,b=this.model;i(a,b,"deferred","media-mode-deferred"),i(a,b,"activated","media-activated"),i(a,b,"showButtons","media-show-buttons")},applyState:function(){this.configureDeferred(),this.configureContentFromActivated(),this.updateElementClass()},render:function(){return this.$el.html(this.template({model:this.model.toJSON(),media:this.media.toJSON()})),this.contentNode=this.$el.find("[data-role=content-placeholder]"),this.applyState(),this},remove:function(){this.linkSubview&&this.linkSubview.remove(),b.View.prototype.remove.apply(this,arguments)},enterViewport:function(){this.model.get("deferred")&&this.activate()},activate:function(){this.model.set("activated",!0)},setupMode:function(){if(this.model.get("respectSettings")){this.model.set("activated",!1);var a=d.get("collapsed");a?this.model.set("deferred",!1):this.model.set("deferred",!0)}},onChangeDeferredHeight:function(){this.model.get("deferred")&&!this.model.get("activated")&&this.applyContentNodeHeight(this.model.get("deferredHeight"))},handleExpand:h(function(){this.model.set("activated",!0)}),handleContract:h(function(){this.model.set("activated",!1)}),handleForceLoad:h(function(){this.model.get("deferred")&&this.model.set("activated",!0)})})}),define("core/templates/postMediaImage",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){var f;return' height="'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.model:b)?f.deferredHeight:f,b))+'" '},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<a href="'+h(g(null!=b?b.imageUrl:b,b))+'" target="_blank" rel="nofollow">\n<img src="'+h(g(null!=b?b.thumbnailUrl:b,b))+'" alt="'+h(c.gettext.call(i,"Thumbnail",{name:"gettext",hash:{},data:e}))+'" '+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.model:b)?f.deferredHeight:f,{name:"if",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+">\n</a>\n"},useData:!0})}),define("core/views/ImageRichMediaView",["core/views/RichMediaView","core/utils","core/config","core/mediaConfig","core/templates/postMediaImage"],function(a,b,c,d,e){"use strict";var f=new RegExp("(^|\\.)"+b.getDomain(c.urls.media).split(".").slice(-2).join("\\.")+"$");return a.extend({getMediaDimensions:function(){return{width:this.media.get("thumbnailWidth"),height:this.media.get("thumbnailHeight")}},getImageUrl:function(){return this.media.get("resolvedUrl")||this.media.get("url")||this.media.get("thumbnailUrl")},getImageThumbnailUrl:function(){var a=this.media.get("thumbnailUrl");return this.constructor.isOnDisqusCDN(a)&&(a=b.serialize(a,{w:d.get("loadedThumbnailWidth"),h:this.model.get("deferredHeight")})),a},generateContentHtml:function(){return e({model:this.model.toJSON(),media:this.media.toJSON(),thumbnailUrl:this.getImageThumbnailUrl(),imageUrl:this.getImageUrl()})},prepareElementEvents:function(a){var b=this,c=a.find("img");c.on("load.richMediaView error.richMediaView",function(a){b.trigger(a.type),c.off(".richMediaView")})},calculateDeferredHeight:function(){var b=Math.floor(a.prototype.calculateDeferredHeight.apply(this,arguments)),c=this.getMediaDimensions().height;return Math.min(c,b)||null}},{isOnDisqusCDN:function(a){var c=b.getDomain(a);return f.test(c)}})}),define("core/views/IframeRichMediaView",["underscore","core/mediaConfig","core/views/RichMediaView"],function(a,b,c){"use strict";return c.extend({getMediaDimensions:function(){return{width:this.media.get("htmlWidth"),height:this.media.get("htmlHeight")}},_findIframe:function(a){return a.is("iframe")?a:a.find("iframe")},configureContentFromActivated:function(){c.prototype.configureContentFromActivated.apply(this,arguments),this.model.get("activated")||this.$el.removeClass("media-loading")},createContentNode:function(){var a=c.prototype.createContentNode.apply(this,arguments);return a.attr({width:"100%",height:this.model.get("deferredHeight")}),a},insertContentNode:function(a){this.loaderNode=this.$el.find("[data-role=content-loader]"),this.loaderHeight=this.model.get("deferredHeight")||b.get("defaultIframeHeight"),this.loaderNode.height(this.loaderHeight),this.$el.addClass("media-loading"),c.prototype.insertContentNode.call(this,a)},prepareElementEvents:function(b){var c=this._findIframe(b);c.one("load",a.bind(this.finishLoad,this,c))},finishLoad:function(a){this.$el.removeClass("media-loading"),a.height(this.loaderHeight),this.trigger("load")}})}),define("core/views/FacebookPhotoRichMediaView",["core/views/ImageRichMediaView"],function(a){"use strict";return a.extend({getImageThumbnailUrl:function(){return this.media.get("metadata").imageUrl||a.prototype.getImageThumbnailUrl.call(this)}})}),define("core/views/AutoplayRichMediaView",["underscore","jquery","core/utils","core/views/IframeRichMediaView"],function(a,b,c,d){"use strict";return d.extend({createContentNode:function(){var a=d.prototype.createContentNode.apply(this,arguments),b=a.attr("src");return this.shouldAutoplay()&&b&&!this.model.get("playerjs")&&(b=c.serialize(b,{auto_play:!0,autoplay:1}),a.attr("src",b)),a},insertContentNode:function(c){if(this.model.get("playerjs")){
  4. var e=this._findIframe(c),f=e.attr("src");"//"===f.substr(0,2)&&(f=window.location.protocol+f);var g=f.split("/");g=g[0]+"//"+g[2],this.playerjs={ready:!1,queue:[],origin:g,$iframe:e},this.model.get("mute")&&this.send("mute"),this.shouldAutoplay()&&this.send("play");var h=a.once(a.bind(function(){this.playerjs.ready=!0;var b=this.playerjs.queue;this.playerjs.queue=[],a.each(b,this.send,this)},this));b(window).on("message",function(a){if(a=a.originalEvent,a.origin===g){var b;try{b=JSON.parse(a.data)}catch(c){return}"ready"===b.event&&b.value&&b.value.src===f&&h()}})}return d.prototype.insertContentNode.apply(this,arguments)},send:function(a){if(this.playerjs){if(!this.playerjs.ready)return void this.playerjs.queue.push(a);var b={context:"player.js",version:"0.0.10",method:a};this.playerjs.$iframe[0].contentWindow.postMessage(JSON.stringify(b),this.playerjs.origin)}}})}),define("core/views/DynamicHeightRichMediaView",["underscore","core/views/RichMediaView"],function(a,b){"use strict";return b.extend({insertContentNode:function(){b.prototype.insertContentNode.apply(this,arguments),this.finishLoad()},finishLoad:function(){var b=this,c=0,d=150,e=20,f=function(){c+=1,e>c?a.delay(f,d):b.trigger("load")};f()}})}),define("core/templates/postMediaTwitterContent",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f=a.lambda,g=a.escapeExpression;return'<meta name="twitter:widgets:csp" content="on">\n<blockquote class="twitter-tweet" data-theme="'+g(f(null!=b?b.theme:b,b))+'" data-link-color="'+g(f(null!=b?b.linkColor:b,b))+'" lang="'+g(f(null!=b?b.language:b,b))+'">\n<a href="'+g(f(null!=b?b.url:b,b))+'"></a>\n</blockquote>\n<script src="//platform.twitter.com/widgets.js"></script>\n'},useData:!0})}),define("core/views/TwitterRichMediaView",["underscore","core/views/DynamicHeightRichMediaView","core/templates/postMediaTwitterContent"],function(a,b,c){"use strict";var d=b.extend({generateContentHtml:function(){var b=window.document.documentElement.lang;b=b&&b.substring(0,2);var e=this.media.get("url");return-1!==this.media.get("resolvedUrl").indexOf("/status")&&(e=this.media.get("resolvedUrl")),c({url:e,theme:a.result(d,"theme"),linkColor:a.result(d,"linkColor"),language:b})}},{theme:"light",linkColor:"#2e9fff"});return d}),define("core/views/SoundCloudRichMediaView",["core/views/AutoplayRichMediaView"],function(a){"use strict";return a.extend({getMediaDimensions:function(){return{width:null,height:this.media.get("htmlHeight")}}})}),define("core/views/VineRichMediaView",["core/views/AutoplayRichMediaView","core/utils"],function(a,b){"use strict";return a.extend({createContentNode:function(){var c=a.prototype.createContentNode.apply(this,arguments),d=c.attr("src");return this.shouldAutoplay()&&d&&(d=b.serialize(d,{audio:1}),c.attr("src",d)),c}})}),define("core/media",["underscore","core/strings","core/models/Media","core/models/RichMediaViewModel","core/views/ImageRichMediaView","core/views/IframeRichMediaView","core/views/FacebookPhotoRichMediaView","core/views/AutoplayRichMediaView","core/views/TwitterRichMediaView","core/views/SoundCloudRichMediaView","core/views/VineRichMediaView"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";var l=b.get,m={PLAY_HIDE:{kind:"html",providerExpandMessage:l("Play"),providerCollapseMessage:l("Hide")},VIEW_HIDE:{kind:"html",providerExpandMessage:l("View"),providerCollapseMessage:l("Hide")},VIEW_IMAGE:{kind:"image",providerIcon:"icon-images",providerExpandMessage:l("View"),providerCollapseMessage:l("Hide")}},n=function(b){var l=function(b,c){return a.defaults({providerIcon:c},m[b])},n=null,o=null,p=c.MEDIA_TYPES;switch(b.get("mediaType")){case p.IMAGE:case p.IMAGE_UPLOAD:n=m.VIEW_IMAGE;break;case p.FACEBOOK_PHOTO:o=g,n=m.VIEW_IMAGE;break;case p.VIMEO_VIDEO:case p.YOUTUBE_VIDEO:o=h,n=l("PLAY_HIDE","icon-video");break;case p.TWITTER_STATUS:o=i,n=l("VIEW_HIDE","icon-twitter");break;case p.VINE_VIDEO:o=k,n=l("PLAY_HIDE","icon-video");break;case p.FACEBOOK_VIDEO:n=l("VIEW_HIDE","icon-video");break;case p.SOUNDCLOUD_SOUND:o=j,n=l("PLAY_HIDE","icon-music");break;case p.GOOGLE_MAP:n=l("VIEW_HIDE","icon-map");break;default:return null}if(null===o)switch(n.kind){case"webpage":return null;case"html":o=f;break;case"image":o=e}var q=new d(n);return{Cls:o,mediaViewModel:q}},o=function(a){var b=n(a);return b?new b.Cls({model:b.mediaViewModel,media:a}):null},p=function(a){return new e({model:new d(m.VIEW_IMAGE),media:a})};return{instantiateRichMediaView:o,instantiateRichMediaThumbnail:p,getRichMediaViewConfig:n}}),define("core/mixins/withRichMedia",["underscore","jquery","core/collections/MediaCollection","core/media"],function(a,b,c,d){"use strict";function e(a){var c={};return a.length?(a.find("a").each(function(a,d){var e=d.href;c[e]||(c[e]=b(d))}),c):c}function f(){a.extend(this,g)}var g={renderRichMedia:function(a,f,g){return g=g||{},a=a instanceof c?a:new c(a),a.chain().map(function(a){return d.instantiateRichMediaView(a)}).without(null).map(function(a){var c=a.media.get("url");g.normalize&&(c=g.normalize.call(this,c));var d=e(this.$("[data-role=message]")),h=d[c];return g.beforeRender&&g.beforeRender.call(this,a),a.render(),h?g.convertLinkToButton?(h.after(a.$el),a.convertToButton(h)):h.replaceWith(a.$el):(f=f||this.$("[data-role=post-media-list]"),f.append(b("<li>").append(a.$el))),a},this).value()}};return f}),define("core/views/common/HoverCard",["jquery","underscore","backbone","core/bus","core/utils"],function(a,b,c,d,e){"use strict";var f=c.View.extend({events:{mouseenter:"enter",mouseleave:"leave"},initialize:function(){this._id=b.uniqueId(),this._rendered=!1,this._hoverState="out",this._visible=!1,this._enterTimeout=null,this._leaveTimeout=null,f.open={},this.events=this.events||{},this.events["click [data-action=profile]"]="handleShowProfile",this.listenTo(this,"authenticating",this.keepOpen)},render:function(){return this.hide(),a("body").append(this.el),this},target:function(a){a.on("mouseenter",b.bind(this.enter,this,a)),a.on("mouseleave",b.bind(this.leave,this))},enter:function(a){var c=this;a.originalEvent&&(a=null),a&&(c.$target=a),c._leaveTimeout&&clearTimeout(c._leaveTimeout),"in"!==c._hoverState&&(c._hoverState="in",c._enterTimeout=b.delay(function(){"in"===c._hoverState&&c.show(),c._enterTimeout=null},f.DELAY_ENTER),f.open[this.uid]=this)},leave:function(){var a=this;a._enterTimeout&&clearTimeout(a._enterTimeout),"out"!==a._hoverState&&(a._hoverState="out",a._leaveTimeout=b.delay(function(){"out"===a._hoverState&&a.hide(),a._leaveTimeout=null},f.DELAY_LEAVE),f.open[this.uid]&&delete f.open[this.uid])},show:function(){var a=this;a._rendered||(a._rendered=!0,a.render()),a.moveTo(a.$target),a.$el.show(),a._visible=!0,a.trigger("show")},moveTo:function(a){if(a){var b=f.POSITION_OFFSET,c=a.offset(),d=this.$el,e=d.height(),g=this.getContainerPosition();c.top-=b;var h=c.top+e+g.containerOffset.top,i=g.pageOffset+g.containerHeight;i>=h?d.css("top",c.top):d.css("top",c.top-e+2*b),d.css("left",c.left+b)}},getContainerPosition:function(){return{pageOffset:a(window).scrollTop(),containerOffset:{top:0,height:a(window).height()},containerHeight:a(window).height()}},hide:function(){this._keepOpen||(this._enterTimeout&&clearTimeout(this._enterTimeout),this.$el.hide(),this._visible=!1)},keepOpen:function(){this._keepOpen=!0,this.setupKeepOpenCanceler()},setupKeepOpenCanceler:function(){var c=this,e=function(){"out"===c._hoverState&&(c.stopListening(d,"window.click",e),a("body").off("click",e),c._keepOpen=!1,c.hide())};b.delay(function(){c.listenTo(d,"window.click",e),a("body").on("click",e)},100)},isVisible:function(){return this._visible},handleShowProfile:e.preventDefaultHandler(function(){this.hide()})},{open:{},instances:{},DELAY_ENTER:350,DELAY_LEAVE:175,POSITION_OFFSET:20,exitAll:function(){b.invoke(f.open,"leave")},create:function(a,b,c,d){var e=f.instances[c];e||(f.instances[c]=e={});var g=e[a];return g||(g=new d(b),e[a]=g),b.targetElement&&g.target(b.targetElement),g}});return function(){a(window.document).on("mouseout",b.debounce(function(a){var b=a.relatedTarget||a.toElement;b&&"HTML"!==b.nodeName||f.exitAll()},10))}(),f}),define("core/utils/views",["underscore"],function(a){"use strict";var b=function(b,c,d){var e=b.prototype,f=a.extend({},c,d);if(a.defaults(e,f),a.defaults(e.events,f.events),void 0!==e.initialize&&void 0!==f.initialize){var g=e.initialize;e.initialize=function(){var a=g.apply(this,arguments);return f.initialize.apply(this,arguments),a}}};return{mixin:b}}),define("core/views/common/mixins/LocalScroll",[],function(){"use strict";var a={events:{mousewheel:"handleScrollEvent",wheel:"handleScrollEvent"},scrollMeasureSelector:"",getScrollMeasure:function(){return this.scrollMeasure||(this.scrollMeasure=this.$el,this.scrollMeasureSelector&&(this.scrollMeasure=this.$el.find(this.scrollMeasureSelector))),this.scrollMeasure},handleScrollEvent:function(a){var b=a.originalEvent,c=b.wheelDeltaY||-b.deltaY,d=this.$el,e=d.height(),f=this.getScrollMeasure(),g=f.height(),h=f.parent()[0].scrollTop,i=h>=g-e,j=0===h;(i&&0>c||j&&c>0)&&a.preventDefault()}};return a}),define("core/templates/usersCard",["handlebars","core/templates/handlebars.partials","core/extensions/handlebars.helpers"],function(a){return a.template({1:function(a,b,c,d,e){return"guests-only"},3:function(a,b,c,d,e){var f;return null!=(f=c.each.call(null!=b?b:{},null!=b?b.users:b,{name:"each",hash:{},fn:a.program(4,e,0),inverse:a.noop,data:e}))?f:""},4:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.cardUser,b,{name:"cardUser",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<div class="tooltip upvoters '+(null!=(f=c.unless.call(g,null!=(f=null!=b?b.users:b)?f.length:f,{name:"unless",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+'">\n<ul class="scroll-measure" data-role="content">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.users:b)?f.length:f,{name:"if",hash:{},fn:a.program(3,e,0),inverse:a.noop,data:e}))?f:"")+'</ul>\n</div>\n<div class="tooltip-point hidden"></div>\n'},usePartial:!0,useData:!0})}),define("core/views/UsersCard",["jquery","underscore","handlebars","core/config","core/bus","core/utils/views","core/views/common/HoverCard","core/views/common/mixins/LocalScroll","core/templates/usersCard"],function(a,b,c,d,e,f,g,h,i){"use strict";var j=function(a){return a.get("isAnonymous")||a.get("isBlocked")},k=g.extend({guestTextPartialName:"cardOtherUserText",className:"tooltip-outer upvoters-outer",initialize:function(a){g.prototype.initialize.call(this,a),this.collection=this.collection||a.collection,this.session=a.session,this.numUsers=a.numUsers,this.listenTo(this.collection,"add",this.addUser),this.listenTo(this.collection,"change:isBlocked",this.render),this.listenTo(this.collection,"remove",this.removeUser),this.listenTo(this.collection,"reset",this.render)},addUser:function(a){j(a)?this.updateGuests():this.$listEl&&this.$listEl.length&&(this.$listEl.prepend(c.partials.cardUser(b.extend({highlight:!0},a.toJSON()))),this.stopHighlightUsername())},removeUser:function(a){if(j(a))this.updateGuests();else{var b=this.$el.find("[data-username="+a.get("username")+"]");b.length&&b.remove()}},stopHighlightUsername:b.debounce(function(){var a=this.$el.find(".highlight");a.removeClass("highlight")},1100),getGuestCount:function(){return Math.max(this.numUsers-this.collection.reject(j).length,0)},updateGuests:function(){var a=this.$el.find("[data-role=guest]"),b=this.getGuestCount(),e=c.partials[this.guestTextPartialName]({guestCount:b}),f={guestCount:b,guestAvatarUrl:d.urls.avatar.generic,highlight:a.length,guestText:e},g=c.partials.cardGuestUser(f);a.length?(a.replaceWith(g),this.stopHighlightUsername()):this.$listEl&&this.$listEl.length&&this.$listEl.append(g)},render:function(){delete this.pointEl,this.$el.html(i({users:b.invoke(this.collection.reject(j),"toJSON"),highlight:!1})),g.prototype.render.call(this),this.$listEl=this.$el.find(".upvoters ul"),this.updateGuests()},show:function(){this.numUsers&&!this.isVisible()&&(g.prototype.show.call(this),e.trigger("uiAction:userCardShow"))},showPoint:function(a){var c=["tl","bl"];this.pointEl||(this.pointEl=this.$el.find(".tooltip-point"),this.pointEl.removeClass("hidden")),b.each(c,function(a){this.pointEl.removeClass("point-position-"+a)},this),this.pointEl.addClass("point-position-"+a)},moveTo:function(a,b){if(a){var c=g.POSITION_OFFSET,d=a.offset(),e=this.$el,f=e.height(),h=this.getContainerPosition();b&&(f+=e.find("li.user").height()+10),d.top-f-c>=0&&d.top-f+h.containerOffset.top>=h.pageOffset?(e.css({bottom:h.containerOffset.height-d.top+c,top:"inherit"}),this.showPoint("bl")):(e.css({bottom:"inherit",top:d.top+2*c}),this.showPoint("tl")),e.css("left",d.left-c)}},handleShowProfile:function(b){g.prototype.handleShowProfile.call(this,b);var c=a(b.currentTarget),d=c.attr("data-username");e.trigger("uiCallback:showProfile",d)}},{create:function(a,b){return g.create(a,b,"UsersCard",k)}});return f.mixin(k,h,{scrollMeasureSelector:"[data-role=content]"}),k}),define("core/views/UpvotersCard",["underscore","core/views/common/HoverCard","core/views/UsersCard","core/bus","core/utils"],function(a,b,c,d,e){"use strict";var f=e.preventDefaultHandler,g=c.extend({guestTextPartialName:"cardGuestUpvoterText",initialize:function(b){var d=b.model,e=d.getUpvotersUserCollection();a.extend(b,{collection:e,numUsers:d.get("likes")}),c.prototype.initialize.call(this,b),this.model=d,this.session=b.session,this.likes=d.get("likes"),this.hadLikes=Boolean(this.likes),this._fetched=!1,this._rendered=!1,this.listenTo(this.model,"change:userScore",this.updateUserSet),this.listenTo(this.model,"change:likes",this.updateGuests)},updateGuests:function(){this.numUsers=this.model.get("likes")||0,c.prototype.updateGuests.call(this)},updateUserSet:function(){var a=this.session.user,b=this.likes,c=!1;this.likes=this.model.get("likes"),this.model.get("userScore")>0?(this.session.isLoggedIn()&&this.collection.add(a),this.likes&&!b?(this._rendered=!1,this.show()):c=this.session.isLoggedOut()?!0:Boolean(this.likes-1-this.collection.length)):(this.collection.remove(a),this.likes||this.hide()),this.updateGuests(),this.moveTo(this.$target,c)},show:function(){if(this.likes&&!this.isVisible()){if(this.hadLikes||(this._fetched=!0),!this._fetched)return void this.collection.fetch().done(a.bind(function(){this._fetched=!0,this.show()},this));var b=this.session.user;this.model.get("userScore")>0&&this.session.isLoggedIn()&&!this.collection.contains(b)&&this.collection.add(b),c.prototype.show.call(this),d.trigger("uiAction:upvotersCardShow")}},handleShowProfile:f(function(a){c.prototype.handleShowProfile.call(this,a),d.trigger("uiAction:showProfileFromUpvotes")})},{create:function(a){var c=a.model;if(c.has("id"))return b.create(c.get("id"),a,"UpvotersCard",g)}});return g}),define("lounge/views/cards",["jquery","underscore","lounge/common","core/utils","common/models","common/templates","common/views/mixins","core/views/common/HoverCard","core/views/UpvotersCard"],function(a,b,c,d,e,f,g,h,i){"use strict";h.prototype.getContainerPosition=function(){var a=c.getLounge().getPosition();return{pageOffset:a.pageOffset,containerOffset:a.frameOffset,containerHeight:a.height}},function(){a(window.document).on("mouseout",b.debounce(function(a){var b=a.relatedTarget||a.toElement;b&&"HTML"!==b.nodeName||h.exitAll()},10))}();var j=h.extend({className:"tooltip-outer profile-card",events:b.defaults({"click [data-action=toggleFollow]":"toggleFollow"},h.prototype.events),initialize:function(a){var b=this;h.prototype.initialize.call(b,a),b.session=a.session,b.user=a.user,b._fetched=!1,b.listenTo(b.session,"change:id",function(){this._rendered&&this.render()})},onFetch:function(a){this.user=new e.SyncedUser(a.attributes),this.updateCounters(),this.updateActions(),this.listenTo(this.user,{"change:numPosts change:numLikesReceived":b.debounce(function(){this.updateCounters()}),"change:isFollowing":this.updateActions})},serialize:function(){var a=this.user.toJSON({session:this.session});return a.numLikesReceived=a.numLikesReceived||this.user.get("numVotes")||0,{user:a,showFollowButton:this.user.has("isFollowing")||this.session.isLoggedOut()}},render:function(){this.$el.html(f.render("hovercard",this.serialize())),h.prototype.render.call(this)},updateCounters:function(){this.$el.find("[data-role=counters]").html(f.render("hovercardCounters",this.serialize()))},updateActions:function(){this.$el.find("[data-role=actions]").html(f.render("hovercardActions",this.serialize()))},show:function(){this._fetched||(this._fetched=!0,this.user.fetch({success:b.bind(this.onFetch,this)})),h.prototype.show.call(this)}},{create:function(a){var b=a.user;return h.create(b.id,a,"ProfileCard",j)}});b.extend(j.prototype,g.FollowButtonMixin);var k=h.extend({className:"context-card tooltip-outer",initialize:function(a){var b=this;h.prototype.initialize.call(b,a),b.post=a.post},render:function(){var a=this.post,b=a.toJSON();b.excerpt=d.niceTruncate(b.plaintext,40),this.$el.html(f.render("contextCard",{post:b})),h.prototype.render.call(this)}},{create:function(a){var b=a.post;return h.create(b.id,a,"ContextCard",k)}});return{HoverCard:h,ProfileCard:j,ContextCard:k,UpvotersCard:i}}),define("core/utils/html/toHexColorString",[],function(){"use strict";function a(a){if(a=Number(a),isNaN(a)||a>255)throw new Error("Color components should be numbers less than 256");return a=a.toString(16),1===a.length?"0"+a:String(a)}return function(b){return"#"+a(b.red)+a(b.green)+a(b.blue)}}),define("core/views/SourcelessIframeRichMediaView",["jquery","core/mediaConfig","core/views/RichMediaView"],function(a,b,c){"use strict";return c.extend({createContentNode:function(b){return a("<iframe>").attr({frameBorder:0,scrolling:"no",width:"100%",height:this.model.get("deferredHeight"),"data-src":b,src:'javascript:window.frameElement.getAttribute("data-src");'})},insertContentNode:function(a){c.prototype.insertContentNode.apply(this,arguments);var d=this.model.get("deferredHeight")||b.get("defaultIframeHeight");a.height(d)}})}),define("lounge/views/media",["underscore","stance","core/utils","core/utils/storage","core/utils/html/toHexColorString","core/media","core/mediaConfig","core/models/RichMediaViewModel","core/views/RichMediaLinkView","core/views/RichMediaView","core/views/IframeRichMediaView","core/views/SoundCloudRichMediaView","core/views/AutoplayRichMediaView","core/views/SourcelessIframeRichMediaView","core/views/DynamicHeightRichMediaView","core/views/TwitterRichMediaView","core/views/ImageRichMediaView","core/views/FacebookPhotoRichMediaView","core/views/VineRichMediaView","lounge/common"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){"use strict";function u(){var b=d.get("disqus.collapse-media");return a.isBoolean(b)||(b=c.isMobileUserAgent()),b}return a.extend(j.prototype,{topEdgeOffset:function(){return-t.getLounge().getPosition().height},configureDeferred:function(){this.model.get("deferred")&&!this.model.get("activated")&&this.listenToOnce(b(this),"enter",function(){this.relatedPost&&this.listenToOnce(this,"load error",function(){t.getLounge().postsView.onDeferredViewReady(this.relatedPost)}),this.enterViewport()}),this.listenToOnce(t.getLounge().postsView,"render:end",this.updateDeferredHeight)}}),p.theme=function(){return t.getLounge().config.colorScheme},p.linkColor=function(){return e(t.getLounge().config.anchorColor)},g.set({collapsed:u()}),g.on("change:collapsed",function(a,b){d.set("disqus.collapse-media",b)}),{settings:g,getCollapseDefault:u,getDomain:c.getDomain,RichMediaLinkView:i,RichMediaViewModel:h,RichMediaView:j,IframeRichMediaView:k,SoundCloudRichMediaView:l,AutoplayRichMediaView:m,SourcelessIframeRichMediaView:n,DynamicHeightRichMediaView:o,TwitterRichMediaView:p,ImageRichMediaView:q,FacebookPhotoRichMediaView:r,VineRichMediaView:s,instantiateRichMediaView:f.instantiateRichMediaView,getRichMediaViewConfig:f.getRichMediaViewConfig}}),define("lounge/views/posts/BlacklistView",["jquery","underscore","backbone","core/api","core/utils","common/templates"],function(a,b,c,d,e,f){"use strict";var g=e.preventDefaultHandler,h=c.View.extend({tagName:"form",className:"moderate",events:{submit:"submit","click [data-action=cancel]":"cancel"},initialize:function(){this.model.get("ipAddress")&&this.model.author.get("email")?this.loading=(new a.Deferred).resolve().promise():this.loading=this.model.fetch()},render:function(){var a=this.$el;return a.addClass("loading"),this.loading.done(b.bind(function(){a.removeClass("loading"),a.html(f.render("blacklist",{post:this.model.toJSON()}))},this)),this},cancel:g(function(){this.trigger("cancel")}),submit:g(function(){var a={},c=this;c.$el.find("input").each(function(){var b=this.value&&this.value.trim();(this.checked||"text"===this.type&&b)&&(a[this.name]=b)}),b.isEmpty(a)||(a.forum=c.model.get("forum"),d.call("blacklists/add.json",{method:"POST",data:a,success:function(){c.trigger("success")}}))})});return h}),define("lounge/views/posts/PostEditView",["backbone","core/views/TextareaView","common/templates"],function(a,b,c){"use strict";var d=a.View.extend({tagName:"form",className:"edit",events:{submit:"submitForm","click [data-action=cancel]":"cancel"},initialize:function(a){this.post=a.post,this.session=a.session},cancel:function(){this.trigger("cancel")},render:function(){var a=this.post.toJSON();this.$el.html(c.render("edit",{post:a,user:this.session.toJSON()}));var d=this.textarea=new b({value:a.raw_message});return this.$("[data-role=textarea]").prepend(d.render().el),this},resize:function(){this.textarea.resize()},submitForm:function(a){a&&a.preventDefault()&&a.preventDefault();var b=this,c={raw_message:this.textarea.get()},d=b.post.validate(c);return void 0!==d?window.alert(d):(b.trigger("submitted"),void b.post.save(c,{success:function(){}}))},remove:function(){this.$el.remove()}});return d}),define("lounge/views/posts/TypingUserView",["backbone","core/strings"],function(a,b){"use strict";var c=b.get,d=a.View.extend({initialize:function(a){this.options=a},render:function(){var a,d=this.options.parentView.reply,e=d&&d.typingUser,f=this.model.usersTyping.count(e&&e.id);return 0>=f?void this.$el.hide():(1===f?a=c("One other person is typing…"):(a=c("%(num)s other people are typing…"),a=b.interpolate(a,{num:f})),this.$el.text(a),this.$el.show(),this)}});return d}),define("core/views/Tooltip",["jquery","core/views/common/HoverCard"],function(a,b){"use strict";var c=b.extend({className:"tooltip-outer message-card",initialize:function(a){b.prototype.initialize.call(this,a),this.template=a.template,this.message=a.message},render:function(){if(this.template)this.$el.html(this.template());else{if(!this.message)return;this.$el.html(a("<div>").addClass("tooltip").text(this.message))}b.prototype.render.call(this)},moveTo:function(a){if(a){var b=this.constructor.POSITION_OFFSET,c=a.offset(),d=this.getContainerPosition(),e=this.$el.width();this.$el.css({bottom:d.containerOffset.height-c.top+b,top:"inherit",left:c.left-e/2})}}},{create:function(a){return b.create(a.id,a,"Tooltip",c)},POSITION_OFFSET:10});return c}),define("core/views/ClickTooltip",["underscore","core/views/common/HoverCard","core/views/Tooltip"],function(a,b,c){"use strict";var d=c.extend({target:function(b){b.on("click",a.bind(this.targetClicked,this,b)),b.on("mouseleave",a.bind(this.leave,this))},targetClicked:function(a){a&&(this.$target=a),"in"!==this._hoverState&&(this._hoverState="in",this.show(),c.open[this.uid]=this)}},{create:function(a){return b.create(a.id,a,"ClickTooltip",d)}});return d}),define("lounge/views/post",["jquery","underscore","backbone","stance","core/strings","core/switches","core/utils","core/mixins/withAlert","core/mixins/withRichMedia","core/WindowBus","common/templates","common/urls","common/utils","lounge/common","lounge/mixins","lounge/views/cards","lounge/views/media","lounge/views/posts/BlacklistView","lounge/views/posts/PostEditView","lounge/views/posts/PostReplyView","lounge/views/posts/TypingUserView","core/views/ClickTooltip","core/views/Tooltip"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){"use strict";var x=g.preventDefaultHandler,y=e.get,z=new j,A=c.View.extend({tagName:"li",className:"post",events:{"click > [data-role=post-content] [data-action]":function(c){var d=this,e=a(c.currentTarget).attr("data-action"),f=d.actions[e];return f?(b.isFunction(f)?f:d[f]).call(d,c):void 0},"click [data-role=allstar]":function(){z.broadcast("click:allstar")}},actions:{upvote:x(function(a){this.handleVote(a,1)}),downvote:x(function(a){this.handleVote(a,-1)}),reply:"handleReply",flag:"handleFlag","block-user":"handleBlockUser",edit:"handleEdit","delete":"handleDelete",spam:"handleSpam",blacklist:"handleBlacklist",highlight:"handleHighlight",unhighlight:"handleUnhighlight",collapse:"handleCollapse",reveal:"handleReveal","share:twitter":"_onShare","share:facebook":"_onShare"},initialize:function(a){this.thread=a.thread,this.session=a.session,this.created=Boolean(a.created),this.options=a,this.userSuggestions=a.userSuggestions,this.setAlertSelector("> [role=alert]"),this.listenTo(this.model,{"change:isDeleted spam":this.removeAsDeleted,"change:message":this.stopLoading,"change:points":this.updateVotePoints,"change:userScore":this.updateActiveUserVote,"change:isFlaggedByUser":this.updateUserFlagged,"change:isHighlighted":function(){this.redraw()},change:function(){var a=this.model.changedAttributes();(a.id||a.message)&&this.redraw()}}),this.model.author&&this.listenTo(this.model.author,"change:isBlocked",this.redraw),this.listenTo(this.model.usersTyping,"add remove reset change",this.updateTypingCount),this.listenTo(this.session,"change:id",function(){this.updateFooter(),this.updateMenu(),this.updateSessionClass()}),this.reply=null,this.edit=null,this.parent=a.parent,this.trackPosition=!1,this.offset={top:-1,height:-1},this.dim={height:-1,width:-1},this.listenTo(n.getLounge(),"domReflow",this.calcRect),this.isCollapseAllowed=!0,this.haveSubscribedToRichMediaEvents=!1},calcRect:function(){if(!this.trackPosition||!this.visible)return this.offset={top:-1,height:-1},void(this.dim={height:-1,width:-1});var a=this.contentNode;this.offset=a.offset(),this.dim={height:a.height(),width:a.width()}},createTypingUserView:function(){var a=this.$el.find("[data-role=realtime-notification\\:"+this.model.id+"] .realtime-replies");this.typingUserView=new u({parentView:this,model:this.model,el:a})},updateTypingCount:function(){this.typingUserView||this.createTypingUserView(),this.typingUserView.render()},stopLoading:function(){this.contentNode.find(".loading").removeClass("loading")},updateRelativeTime:function(){this.contentNode.find("[data-role=relative-time]").text(this.model.getRelativeCreatedAt())},updateSessionClass:function(){var a="authored-by-session-user";this.model.isAuthorSessionUser(this.session)?this.contentNode.addClass(a):this.contentNode.removeClass(a)},updateActiveUserVote:function(){var a=this.model,b=this.contentNode.find("[data-action=upvote]"),c=this.contentNode.find("[data-action=downvote]");c.removeClass("downvoted"),b.removeClass("upvoted"),a.get("userScore")>0?b.addClass("upvoted"):a.get("userScore")<0&&c.addClass("downvoted")},updateVotePoints:function(){var c=this.model,d=this.contentNode.find("[data-role=likes], [data-role=dislikes]"),e=this.contentNode.find("[data-action=upvote], [data-action=downvote]"),f=function(a){b.delay(function(){a.addClass("update"),b.delay(function(){a.removeClass("update")},1e3)},500)};b.each(d,function(b,d){b=a(b);var g=b.html(),h=c.get(b.attr("data-role")),i=a(e[d]);h=Math.max(h,0).toString(),g!==h&&(i.removeClass("count-"+g),i.addClass("count-"+h),b.html(h),f(b))})},updateFooter:function(){var a=this.contentNode.find("footer"),b=k.render("postFooter",{post:this.getPostAttributes(),session:this.session.toJSON()});t.open[this.model.cid]&&this.toggleReplyLink(!0),a.html(b),this.initUpvotersCard()},updateMenu:function(){var a=this.contentNode.find("[data-role=menu]"),b=k.render("postMenu",{session:this.session.toJSON(),post:this.getPostAttributes(),isUserBlockingEnabled:f.isFeatureActive("user_blocking")});a.replaceWith(b)},updatePostStateClasses:function(){var a=this.model,b=a.get("isHighlighted")||a.get("isSponsored");this.$el.toggleClass("highlighted",Boolean(b)),this.contentNode.toggleClass("disabled",!a.id)},updateUserFlagged:function(){this.model.get("isFlaggedByUser")?this.contentNode.addClass("user-reported"):this.contentNode.removeClass("user-reported")},getMessageContent:function(){return this.messageContent&&this.messageContent.length||(this.messageContent=this.contentNode.find("[data-role=message-content]")),this.messageContent},manageMessageHeight:function(a){var b=this,c=b.getMessageContent(),d=1.5*b.collapsedHeight,e=c&&c.length&&c.height()||0;e+=a||0,e>d&&!b.$el.hasClass("collapsed")?b.collapse():b.expand(!0)},preventCollapsing:function(a){a.get("deferred")||(this.expand(),this.isCollapseAllowed=!1)},markSeen:function(){function a(){c.contentNode.addClass("seen"),b.delay(function(){c.contentNode.removeClass("seen"),c.contentNode.removeClass("new")},1e4),c.trackPosition=!1}var c=this,e=d(c);e.isVisible()?a():this.listenToOnce(e,"enter",a)},renderMedia:function(){var a=this.model.media;if(a&&a.length){var c=this.$el.find("[data-role=post-media-list]");this.richMediaViews=this.renderRichMedia(a,c,{convertLinkToButton:!0,beforeRender:function(a){this.listenTo(a.model,"change:activated",this.preventCollapsing),a.relatedPost=this.model.cid},normalize:function(a){var b=g.bleachFindUrls(a);return b.length&&(a=b[0].url),a}}),!this.haveSubscribedToRichMediaEvents&&this.richMediaViews.length&&(this.listenTo(q.settings,"change:collapsed",function(a,c){if(c)this.manageMessageHeight();else{var d=b.reduce(this.richMediaViews,function(a,b){return a+(b.model.get("deferredHeight")||0)},0);this.manageMessageHeight(d)}}),this.haveSubscribedToRichMediaEvents=!0)}},getStateByline:function(){var a,b=this.model;return b.get("isHighlighted")?a={icon:"trophy",text:y("Featured by %(forum)s"),style:"default"}:b.get("isSponsored")?a={icon:"trophy",text:y("Sponsored on Disqus"),style:"sponsored"}:b.isAuthorSessionUser(this.session)&&(b.get("isApproved")||(a={icon:"clock",text:y("Hold on, this is waiting to be approved by %(forum)s."),style:"default"})),a&&(a.text=e.interpolate(a.text,{forum:this.thread.forum.get("name")})),a},getTemplate:function(a){return a.isDeleted?"postDeleted":this.model.author&&this.model.author.get("isBlocked")?"postBlocked":this.model.isAuthorSessionUser(this.session)&&!a.isApproved?"post":a.isMinimized?"postMinimized":"post"},getPostAttributes:function(){var a=this.model.toJSON({session:this.session,thread:this.thread}),b=this.model.getParent();return b&&b.get("isSponsored")&&(a.canBeRepliedTo=!1,a.hideViewAllComments=b.get("hideViewAllComments")),a},render:function(){var a=this.$el,b=this.getPostAttributes(),c=n.getLounge(),d=this.thread.forum.get("avatar"),e=this.model.getParent(),g=this.getTemplate(b);return!b.message&&b.raw_message&&m.isPlainText(b.raw_message)&&(b.message=this.model.constructor.formatMessage(b.raw_message)),a.html(k.render(g,{post:b,forumName:this.thread.forum.get("name"),session:this.session.toJSON(),thread:this.thread.toJSON(),created:this.created,parentPost:e&&e.toJSON({session:this.session,thread:this.thread}),defaultAvatarUrl:d?d.large.cache:l.avatar.generic,stateByline:this.getStateByline(),isInHome:n.getLounge().isInHome(),isUserBlockingEnabled:f.isFeatureActive("user_blocking")})),"postMinimized"===g||"postDeleted"===g||"postBlocked"===g?a.addClass("minimized"):a.removeClass("minimized"),!this.options.excludeAnchor&&this.model.id&&a.attr("id","post-"+this.model.id),this.contentNode=a.find("[data-role=post-content]"),this.childrenNode=a.find("[data-role=children]"),this.messageNode=this.contentNode.find("[data-role=message]"),
  5. this.highlightSyntax(),this.processMentions(),this.initCards(),this.updatePostStateClasses(),this.renderMedia(),this.model.get("isRealtime")&&(this.trackPosition=!0,this.listenToOnce(c.postsView,"render:end",this.markSeen)),this.listenToOnce(c.postsView,"render:end",function(){this.markSeen(),this.manageMessageHeight()}),this},highlightSyntax:function(){var a=this.contentNode.find("pre code");a.length&&a.each(function(){m.syntaxHighlighter.highlight(this)})},redraw:function(){var a=window.document.createDocumentFragment();this.childrenNode.children().appendTo(a),this.render(),this.childrenNode.append(a),n.getLounge().postsView.trigger("render:end"),n.getLounge().trigger("domReflow")},processMentions:function(){this.contentNode.find("[data-dsq-mention]").each(function(){var b=a(this),c=b.attr("data-dsq-mention").split(":")[0];b.attr("data-action","profile"),b.attr("data-username",c),b.addClass("mention")})},attachChild:function(a){var b=a.model;b.created||!b.id||b.get("isImmediateReply")?this.childrenNode.prepend(a.el):this.childrenNode.append(a.el)},toggleReply:function(){this.reply&&this.reply.isOpen()?this.hideReply():this.showReply()},toggleReplyLink:function(a){this.contentNode.find("[data-role=reply-link]").toggleClass("active",a)},showReply:function(){this.reply?(this.$el.find("[data-role=reply-form]").first().prepend(this.reply.$el),this.reply.show(),this.reply.focus()):this.getReplyView(),this.toggleReplyLink(!0)},hideReply:function(){this.reply&&(this.reply.hide(),this.toggleReplyLink(!1))},toggleEdit:function(){return this.contentNode.find("[data-role=edit-link]").toggleClass("active"),this.edit?(this.edit.remove(),this.edit=null,void this.messageNode.show()):void this.showEdit()},showEdit:function(){if(this.session.isLoggedOut())return void this.listenToOnce(this.session,"change:id",this.toggleEdit);if(this.model.canBeEdited(this.session,this.thread)&&!this.edit){this.edit=new s({post:this.model,session:this.session}),this.edit.render(),this.listenTo(this.edit,"submitted cancel",this.toggleEdit),this.expand(!0);var a=this.messageNode;a.parent().prepend(this.edit.$el),a.hide(),this.edit.resize();var b=n.getLounge();b&&b.scrollToPost(this.model.id)}},removeAsDeleted:function(){this.redraw()},initCards:function(){var a=this;a.initProfileCard(),a.initContextCard(),a.initUpvotersCard(),a.initAnonVoteCards(),a.initTooltips()},initProfileCard:function(){if(!g.isMobileUserAgent()){var a=this.$el.find(".hovercard");a.length&&(this.profileCard=p.ProfileCard.create({session:this.session,user:this.model.author,targetElement:a}))}},initContextCard:function(){if(!g.isMobileUserAgent()){var a=this.parent&&this.parent.model;a&&!a.get("isDeleted")&&(this.contextCard=p.ContextCard.create({post:a,targetElement:this.$el.find("[data-role=parent-link]")}))}},initUpvotersCard:function(){if(!g.isMobileUserAgent()){var a=this.$el.find("[data-action=upvote]");a.length&&(this.upvotersCard=p.UpvotersCard.create({session:this.session,model:this.model,targetElement:a}))}},initAnonVoteCards:function(){this.session.isLoggedOut()&&!this.thread.forum.get("settings").allowAnonVotes&&(this.anonVoteCards=this.anonVoteCards||{},b.each({upvote:"anonUpvoteCard",downvote:"anonDownvoteCard"},function(a,b){this.anonVoteCards[b]&&(this.anonVoteCards[b].remove(),this.anonVoteCards[b]=null);var c=this.$("[data-action="+b+"]");c.length&&(this.anonVoteCards[b]=v.create({targetElement:c,template:k.getTemplate(a),id:"anon"+b+this.model.id}))},this),this.anonVoteCards.upvote&&this.listenTo(this.anonVoteCards.upvote,"show",this.closeUpvotersCard))},initTooltips:function(){if(!g.isMobileUserAgent()){var b=this.$el.find("[data-toggle=tooltip]");b.length&&b.each(function(b,c){var d=a(c),e=d.attr("title");d.attr("data-original-title",e).attr("title",""),w.create({targetElement:d,message:e,id:e})})}},closeUpvotersCard:function(){this.upvotersCard&&this.upvotersCard.hide()},_onShare:x(function(a){var b=m.extractService(a.target,"share");b&&(n.getLounge().trigger("uiAction:postShare",this.model,b),this.share(b))}),handleBlacklist:x(function(){if(!this.blacklist){var a=this.blacklist=new r({model:this.model});a.render(),this.listenTo(a,"success cancel",function(){this.blacklist.remove(),this.blacklist=null}),this.contentNode.find("[data-role=blacklist-form]").first().append(a.el)}}),toggleCollapse:function(a){this.$el.toggleClass("collapsed",a)},handleCollapse:x(function(){this.toggleCollapse()}),handleHighlight:x(function(){this.model.highlight(),this.alert(k.render("highlightedSuccessMessage"),{safe:!0,type:"success"}),this.thread.set("highlightedPost",this.model);var a=n.getLounge();a&&a.scrollToPost(this.model.id)}),handleUnhighlight:x(function(){this.model.unhighlight(),this.dismissAlert(),this.thread.unset("highlightedPost")}),handleVote:function(a,b){if(!this.thread.forum.get("settings").allowAnonVotes&&this.session.isLoggedOut())return void this.handleLoggedOutVote(a,b);var c=n.getLounge(),d=this.model.get("userScore")===b;d?c.trigger("uiAction:postUnvote",this.model,a):1===b?c.trigger("uiAction:postUpvote",this.model,a):-1===b&&c.trigger("uiAction:postDownvote",this.model,a),this.model.vote(d?0:b)},handleLoggedOutVote:function(a,b){this.listenToOnce(this.session,"change:id",function(){this.session.isLoggedIn()&&this.handleVote(a,b)}),this.session.authenticate("disqusDotcom")},getReplyView:function(){return this.reply?this.reply:(this.reply=new t({parentView:this,parent:this.model,thread:this.thread,session:this.options.session,userSuggestions:this.userSuggestions,shouldShowEmailAlertInForm:!0}),this.reply.render(),this.showReply(),this.reply)},handleReply:x(function(){this.toggleReply()}),handleFlag:x(function(){if(!this.model.get("isFlaggedByUser")){var a=y("Are you sure you want to flag this comment?");window.confirm(a)&&(this.model.report(),this.model.set("isFlaggedByUser",!0))}}),handleBlockUser:x(function(){var a=y("Are you sure you want to block this user?");window.confirm(a)&&this.model.author.block()}),handleEdit:x(function(){this.toggleEdit()}),handleDelete:x(function(){var a=y("Are you sure you want to delete this comment? You cannot undo this action.");(this.session.user.id!==this.model.author.id||window.confirm(a))&&(this.model.get("isHighlighted")&&(this.model.set("isHighlighted",!1),this.thread.unset("highlightedPost")),this.model._delete())}),handleSpam:x(function(){this.model.spam()}),handleReveal:x(function(){this.model.set("isMinimized",!1),this.redraw()}),handleExpandMessage:x(function(){return this.expand()})});return b.extend(A.prototype,o.ShareMixin),h.call(A.prototype),o.asCollapsible.call(A.prototype,{collapsedHeight:374,collapseTargetSelector:"[data-role=message-container]",collapseScope:"contentNode"}),i.call(A.prototype),A}),define("lounge/views/posts/collection",["jquery","underscore","backbone","moment","core/bus","core/strings","common/models","common/utils","lounge/views/posts/PostReplyView","lounge/views/post"],function(a,b,c,d,e,f,g,h,i,j){"use strict";var k=f.get,l=c.View.extend({STREAMING_MAX_VISIBLE:250,events:{"click [data-action=more-posts]":"handleLoadMore"},initialize:function(a){this.lounge=a.lounge,this.thread=a.thread,this.userSuggestions=a.userSuggestions,this.posts=a.posts,this.postsToAppend=[],this.postsToPrepend=[],this.session=a.session,this.subViews={},this.state={nextPassTimeoutId:null,renderedPosts:[],clearDomAfterRender:!1,totalPostsProcessed:0,totalElapsedTime:0},this.addPostsIncremental=b.bind(this.addPostsIncremental,this),this.listenTo(this.posts,{reset:this.redrawPosts,add:this.addPosts,remove:this.removePost}),this.listenTo(this.thread,"change:highlightedPost",this.handleHasHighlightedState),this.listenTo(this.thread,"change:isClosed",this.toggleNoPosts),this.listenTo(this.session,"change:id",this.toggleNoPosts),this.listenTo(this.posts,"reset add",this.toggleNoPosts),this.listenTo(this.posts,"reset add",this.enableTimestampUpdates),this.listenTo(this,"render:end",this.toggleLoadMorePosts),this.listenTo(this,"render:end",this.handleHasHighlightedState)},handleHasHighlightedState:function(){this.$el.toggleClass("has-highlighted-post",this.thread.has("highlightedPost"))},getPostView:function(a){return this.subViews[a]},bootstrap:function(a,c){this.permalinkOptions=c,this.listenTo(this.posts,"reset",b.bind(this.posts.restoreFromCache,this.posts)),this.listenTo(this.posts,"change:isDeleted",b.bind(this.posts.removeFromCache,this.posts)),this.posts.reset(a.posts),b.invoke(this.subViews,"manageMessageHeight")},bindUIUpdateHandlers:function(){var c=this,d=a(window),e=a(window.document.body),f=e.width(),g=b.debounce(function(){var a=e.width();f!==a&&c.subViews&&(f=a,b.each(c.subViews,function(a){a.manageMessageHeight()}))},50);d.on("resize",g)},updateTimestamps:function(){return!this.subViews||b.size(this.subViews)<1?!1:(b.invoke(this.subViews,"updateRelativeTime"),!0)},enableTimestampUpdates:function(){var a=this,c=6e4;if(!a.timestampUpdateTimer){var d=function(){return a.updateTimestamps()?void(a.timestampUpdateTimer=b.delay(d,c)):void(a.timestampUpdateTimer=null)};a.timestampUpdateTimer=b.delay(d,c)}},openReply:function(a){var b=this.posts.get(a);if(b){var c=this.subViews[b.cid];c.showReply()}},openEdit:function(a){var b=this.posts.get(a);if(b){var c=this.subViews[b.cid];c.showEdit()}},toggleLoadMorePosts:function(){var a=this.$el.find("#posts [data-role=more]"),b=this.posts.hasNext();b?a.show():a.hide()},handleLoadMore:function(b){b.preventDefault();var c=this,d=a(b.currentTarget),f=c.posts.currentPage();d.addClass("busy"),c.posts.more({success:function(){c.posts.restoreFromCache(),c.once("render:end",function(){d.removeClass("busy")})},error:function(){d.removeClass("busy")}}),c.lounge.trigger("uiAction:seeMore",f+1),e.frame.sendHostMessage("posts.paginate")},renderLayout:a.noop,toggleNoPosts:function(){var b,c=a("#no-posts");this.posts.models.length?c.hide():(b=k(this.thread.get("isClosed")?"This discussion has been closed.":this.session.get("canReply")?"Be the first to comment.":"Nothing in this discussion yet."),c.text(b),c.show())},handleSort:function(){a("#posts [data-role=more]").hide(),a("#no-posts").hide(),a("#post-list").addClass("loading").empty()},redrawPosts:function(){var a=this;a.subViews={},a.once("render:end",function(){b.each(i.open,function(b,c){var d=a.subViews[c];if(d){var e=d.getReplyView();e.textarea.set(b.textarea.get()),b.isOpen()?e.show():e.hide()}})}),a.posts.setPageFor&&a.permalinkOptions&&a.permalinkOptions.postId&&a.posts.setPageFor(a.permalinkOptions.postId,{silent:!0}),a.addPosts(a.posts,{clearDom:!0})},postsShouldBePrepended:function(a){var b=a.length&&a[0];return Boolean(b&&(b.created||!b.id||b.get("isRealtime")||b.get("isCached")||b.requestedByPermalink))},hasQueuedPosts:function(){return this.postsToAppend.length||this.postsToPrepend.length},addPosts:h.decorate(c.collectionAddNormalizer(c.Collection,g.Post),function(a,c,d){var e=this;if(d.clearDom&&(e.postsToAppend=[],e.postsToPrepend=[],e.postsShouldClearDom=!0),e.postsShouldBePrepended(a)){var f=[];b.each(a,function(a){var b=a.get("parent");b&&e.posts.get(b)?e.postsToPrepend.push(a):f.push(a)}),e.postsToPrepend=f.concat(e.postsToPrepend)}else e.postsToAppend=e.postsToAppend.concat(a);e.state.nextPassTimeoutId||(e.state.nextPassTimeoutId=b.defer(function(){e.trigger("render:start"),e.addPostsIncremental(!0)}))}),onDeferredViewReady:function(a){var b=this.subViews;b.hasOwnProperty(a)&&b[a].manageMessageHeight()},removePost:function(a){if(this.hasQueuedPosts())return void this.once("render:end",b.bind(this.removePost,this,a));var c=this.subViews[a.cid];c&&(c.remove(),delete this.subViews[a.cid])},addPostsIncremental:function(a){this.state.nextPassTimeoutId=null,this.discardRenderProgressIfClearDomRequested();var b=this.getPostModelsForThePass();b.length&&this.renderPass(b,a?l.FIRST_ATTEMPT_TIME_SCALE:void 0),this.finishPass(b),this.scheduleNextPass()},discardRenderProgressIfClearDomRequested:function(){this.postsShouldClearDom&&(this.state.clearDomAfterRender=!0,this.postsShouldClearDom=!1,this.state.renderedPosts=[])},getPostModelsForThePass:function(){return this.postsToAppend.length?this.postsToAppend:this.postsToPrepend},renderPass:function(a,b){var c=l.TARGET_PROCESS_TIME;b&&(c*=b);for(var d=this.calculatePostsForNextRun(c)||l.MINIMUM_POSTS_PER_RUN;d>0;){var e=a.splice(0,d),f=this.timedRenderPosts(e);if(null===f)break;c-=f,d=this.calculatePostsForNextRun(c)}},timedRenderPosts:function(a){if(!a.length)return null;var c=Number(new Date);this.state.renderedPosts=this.state.renderedPosts.concat(b.map(a,this.createPostView,this));var d=Number(new Date)-c;return 0>d&&(d=0),this.state.totalElapsedTime+=d,this.state.totalPostsProcessed+=a.length,d||null},createPostView:function(a){var b,c=a.get("parent");c&&(c=this.posts.get(c),b=c&&this.getPostView(c.cid));var d=new j({parent:b,model:a,thread:this.thread,session:this.session,created:a.created,userSuggestions:this.userSuggestions});return this.subViews[a.cid]=d,d.render(),d},calculatePostsForNextRun:function(a){return 0>=a?0:this.state.totalElapsedTime<=0?this.state.totalPostsProcessed:Math.floor(a*this.state.totalPostsProcessed/this.state.totalElapsedTime)},finishPass:function(b){if(!b.length){if(this.$postList=a("#post-list"),this.state.clearDomAfterRender&&(this.$postList.empty(),this.state.clearDomAfterRender=!1),this.state.renderedPosts.length){this.removeOldPostsIfRealtime(),this.enablePostTracking(this.state.renderedPosts);var c=b===this.postsToAppend;this.insertPostElements(this.state.renderedPosts,c),this.state.renderedPosts=[]}this.$postList.removeClass("loading"),this.postsToPrepend.length||this.postsToAppend.length||this.trigger("render:end")}},removeOldPostsIfRealtime:function(){var a=b.any(this.state.renderedPosts,function(a){return a.model.get("isRealtime")});a&&this.removeOldPosts()},removeOldPosts:function(){var a=b.size(this.subViews)-this.STREAMING_MAX_VISIBLE;if(!(0>=a))for(var c,e=this.posts.sortBy(function(a){return d(a.get("createdAt")).valueOf()}),f=0,g=0;f<e.length&&a>=g;f++)c=this.getPostView(e[f].cid),c&&0===c.childrenNode.children().length&&(this.posts.remove(e[f]),g+=1)},enablePostTracking:function(a){b.each(a,function(a){a.visible=!0})},insertPostElements:function(a,c){var d=b.groupBy(a,function(a){return Boolean(a.parent)});b.each(d["true"],function(a){a.parent.attachChild(a)});var e=b.pluck(d["false"],"$el");c?this.$postList.append(e):this.$postList.prepend(e)},scheduleNextPass:function(){(this.postsToPrepend.length||this.postsToAppend.length)&&(this.state.nextPassTimeoutId=b.defer(this.addPostsIncremental))}});return l.TARGET_PROCESS_TIME=30,l.FIRST_ATTEMPT_TIME_SCALE=.8,l.MINIMUM_POSTS_PER_RUN=2,{PostCollectionView:l}}),define("lounge/views/onboard-alert",["backbone","common/utils","common/templates"],function(a,b,c){"use strict";var d=a.View.extend({events:{"click [data-action=close]":"handleClose","click [data-action=show-home]":"handleShowHome"},initialize:function(a){this.session=a.session,this.forum=a.forum},render:function(){return this.session.isLoggedIn()&&this.shouldShow()&&(this.$el.html(c.render("onboard",{forum:this.forum.toJSON()})),this.trigger("uiAction:onboardAlertShow")),this},shouldShow:function(){var a=this.getCookie();return a?this.session.user.shouldHomeOnboard()&&(a===d.COOKIE_NEW_USER||a===d.COOKIE_POPUP):!1},getCookie:function(){return b.cookies.read(d.COOKIE_NAME)},setInitialCookie:function(){this.session.user.get("joinedRecently")&&this.createCookie(d.COOKIE_NEW_USER)},createCookie:function(a){b.cookies.create(d.COOKIE_NAME,a,{expiresIn:2592e6})},eraseCookie:function(){b.cookies.erase(d.COOKIE_NAME)},handleShowHome:function(){this.remove()},handleClose:function(a){a.preventDefault(),this.remove(),this.trigger("uiAction:onboardAlertDismiss")},remove:function(){this.eraseCookie(),this.session=null,a.View.prototype.remove.call(this)}},{COOKIE_NAME:"disqus.onboarding",COOKIE_NEW_USER:"newUser"});return{OnboardAlert:d}}),define("lounge/views/notification-menu",["jquery","underscore","backbone","stance","core/bus","common/templates","common/utils"],function(a,b,c,d,e,f,g){"use strict";var h=c.View.extend({events:{"click [data-action=home]":"handleShowHome"},initialize:function(c){var e=a.Deferred();this.listenToOnce(d(this),"enter",function(){e.resolveWith(this)});var f=this.session=c.session;this.forum=c.forum,this.language=window.document.documentElement.lang,this.listenTo(f,"change:id",this.render),this.listenTo(f,"change:notificationCount",this.updateCount),this.listenTo(f,"change:id",function(){e.done(b.bind(f.fetchNotificationCount,f)),e.done(this.preloadSidebar)}),this.listenTo(this,{"sidebar:open:start":this.startLoadingAnimation,"sidebar:open:done":this.stopLoadingAnimation})},startLoadingAnimation:function(){this.$el.addClass("notification-loading")},stopLoadingAnimation:function(){this.$el.removeClass("notification-loading")},preloadSidebar:function(){e.trigger("sidebar:preload")},render:function(){return this.forum.get("settings").ssoRequired&&this.session.isLoggedOut()?void this.$el.hide():(this.$el.html(f.render("notificationMenu",{})),this.updateCount(),this.$el.show(),this)},handleShowHome:function(b){if(this.session.set("notificationCount",0),!g.willOpenNewWindow(b)){b.preventDefault();var c=a(b.currentTarget).attr("data-home-path");e.trigger("sidebar:open",c,this)}},updateCount:function(){var a=this.session.get("notificationCount")||0;a>0?(this.$("[data-role=notification-count]").html(a>9?'9<i class="icon icon-plus"></i>':a),this.$el.addClass("unread")):(this.$("[data-role=notification-count]").html(""),this.$el.removeClass("unread"))}});return{NotificationMenuView:h}}),define("lounge/views/highlighted-post",["backbone","underscore","jquery","core/UniqueModel","common/models","common/templates","lounge/views/post"],function(a,b,c,d,e,f,g){"use strict";var h=a.View.extend({template:"highlightedPost",itemViewContainer:".post-list",initialize:function(a){b.extend(this,b.pick(a,["thread","session","userSuggestions"])),this.listenTo(this.thread,"change:highlightedPost",this.reset)},getPost:function(){return this.post?c.Deferred().resolve(this.post):this.getHighlightedPost()},_getHighlightedPost:function(){var a=this.thread.get("highlightedPost");return a?(a instanceof e.Post||(a=new d(e.Post,a)),a.get("isDeleted")?null:a.get("isHighlighted")?a:null):null},getHighlightedPost:function(){var a,d=this.post=this._getHighlightedPost(),f=c.Deferred();return d?(a=d.getParent())&&!a.author?e.Post.fetchContext(a.id,this.thread).always(b.bind(f.resolve,f)):f.resolve():f.reject(),f.promise()},reset:function(){delete this.post,this.getPost().always(b.bind(this.render,this))},createPostView:function(){return this.post?new i({model:this.post,thread:this.thread,session:this.session,userSuggestions:this.userSuggestions,excludeAnchor:!0}).stopListening(this.post.usersTyping):null},render:function(){var a=this.createPostView();return a?(a.render(),this.$el.html(f.render(this.template)),this.$(this.itemViewContainer).append(a.el),this.$el.show(),this):(this.$el.hide(),this)}}),i=g.extend({getPostAttributes:function(){var a=g.prototype.getPostAttributes.apply(this,arguments);return a.canBeRepliedTo=!1,a},getStateByline:function(){return!1}});return{HighlightedPostView:h,FeaturedPostView:i}}),define("lounge/views/realtime",["underscore","backbone","core/utils","common/templates","lounge/common"],function(a,b,c,d,e){"use strict";var f=c.preventDefaultHandler,g=b.View.extend({events:{click:"handleDrain"},initialize:function(a){this.options=a},getDirection:function(a){if(this.offset&&this.dim){var b=a.pageOffset,c=b+a.height,d=this.offset.top+a.frameOffset.top,e=d+this.dim.height;return b>e?1:d>c?-1:0}},setCount:function(a){this.options.count=a},render:function(){return 0===this.options.count?void this.$el.hide():(this.$el.html(d.render("realtimeCommentNotification",{comments:this.options.count})),this.listenTo(e.getLounge(),"domReflow",a.throttle(function(){0!==this.options.count&&(this.offset=this.$el.offset(),this.dim={height:this.$el.height(),width:this.$el.width()})},400)),this.$el.show(),this)},handleDrain:f(function(){this.model.queue.drain(),this.setCount(this.model.queue.counters.comments),this.render()})}),h=g.extend({events:{click:"handleDrain"},getDirection:function(a){if(this.options.postView.visible){this.offset=this.options.postView.offset,this.dim=this.options.postView.dim;var b=g.prototype.getDirection.call(this,a);return delete this.offset,delete this.dim,b}},render:function(){var b=this,c=b.options.postView;return 0===b.options.count?(b.$el.hide(),void(c.trackPosition=!1)):(c.trackPosition=!0,c.calcRect(),b.$el.html(d.render("realtimeReplyNotification",{replies:b.options.count})),b.$el.show(),void a.delay(function(){b.$el.addClass("reveal")},13))},handleDrain:f(function(){var a=this.model.id,b=this.options.postView,c=this.options.thread.queue;c.drain(a),this.setCount(c.counters.replies[a]),b.trackPosition=!1,this.render()})});return{QueuedPostView:g,QueuedReplyView:h}}),define("lounge/views/posts/UserSuggestionsManager",["underscore","jquery","common/collections"],function(a,b,c){"use strict";function d(){this.remotes=[]}return a.extend(d.prototype,{fetch:function(){return this._fetchPromise||(this._fetchPromise=b.when.apply(b,a.chain(this.remotes).filter(function(a){return!a.length}).map(function(a){return a.fetch()}).value())),this._fetchPromise},addRemote:function(a){this.remotes.push(a)},all:function(){var b=new c.UserCollection;return b.add(a.chain(this.remotes).pluck("models").flatten().value()),b},find:function(a,b){if(a&&a.length){var c,d=new RegExp(a.join(" ").replace(/[^\w\s]/,""),"i"),e=5,f=this.all(),g=[],h=0,i=1===a.length&&""===a[0]?function(){return!0}:function(a){return d.test(a.get("name"))||d.test(a.get("username"))};for(h=0;h<f.models.length&&g.length<e;h++)c=f.models[h],c.get("isAnonymous")||b.get(c.cid)||i(c)&&g.push(c);return g}},get:function(a){return this.all().get(a)}}),d}),define("lounge/views/viglink",["jquery","underscore","backbone","core/bus"],function(a,b,c,d){"use strict";var e=c.Model.extend({initialize:function(a){this.handlers={},this.listenTo(d.frame,"viglink:getaffiliatelink:response",this.handleViglinkResponse),d.frame.sendHostMessage("viglink:init",{clientUrl:a.linkAffiliatorClient,apiUrl:a.linkAffiliatorAPI,key:a.viglinkAPI,id:a.forumPk})},handleViglinkResponse:function(a){a=a||{};var b=this.handlers[a.linkId];b&&b(a)},fetchAffiliateLink:function(c,e){var f=a.Deferred();if(!this.shouldFetchAffiliateLink(c))return f.resolve();var g=b.uniqueId("viglink_");return d.frame.sendHostMessage("viglink:getaffiliatelink",{linkId:g,url:e[0].href}),this.handlers[g]=function(a){a=a||{},a.url&&e.attr("href",a.url),f.resolve()},f.promise()},shouldFetchAffiliateLink:function(a){if("_blank"===a.currentTarget.getAttribute("target"))return!1;var b=a.ctrlKey||a.metaKey||a.altKey||a.shiftKey,c=a.which&&1===a.which||0===a.button;return b||!c?!1:"nofollow"!==a.currentTarget.getAttribute("rel")?!1:!0}});return e}),define("lounge/views/sidebar",["underscore","backbone","modernizr","core/bus","core/utils/url/serialize","shared/urls","core/utils","common/views/mixins"],function(a,b,c,d,e,f,g){"use strict";var h=b.View.extend({initialize:function(a){this.forum=a.forum,this.session=a.session,this.language=window.document.documentElement.lang,"en"===this.language&&(this.language=void 0),this.listenTo(this.session,"change:id",this.destroyHome),this.listenTo(d,{"sidebar:open":this.open,"sidebar:preload":this.preload}),this.iframeAlive=!0,this.listenToOnce(d.frame,"home.timeout",this.handleTimeout)},isIE9:function(){return 9===window.document.documentMode},shouldUseIframe:function(){if(this.isIE9()&&!this.session.isSSO())return!1;if(!this.iframeAlive)return!1;var a=g.isMobileUserAgent();return!a||this.session.isSSO()},handleTimeout:function(){this.iframeAlive=!1},open:function(b,c){if(this.shouldUseIframe()){if(this.storeHomeSession(),d.frame.sendHostMessage("home.show",{path:b,language:this.language}),c){c.trigger("sidebar:open:start");var h=a.bind(c.trigger,c,"sidebar:open:done");this.listenToOnce(d.frame,{"home.opened":h,"home.timeout":h})}}else g.openWindow(e(f.apps.home+b,{l:this.language}),"disqushome");d.trigger("uiAction:openHome")},destroyHome:function(){d.frame.sendHostMessage("home.destroy")},preload:function(){this.session.isLoggedOut()||this.shouldUseIframe()&&(this.storeHomeSession(),d.frame.sendHostMessage("home.preload",{language:this.language}))},storeHomeSession:function(){c.sessionstorage&&window.sessionStorage.setItem("home.session",JSON.stringify(this.session.user.toJSON()))}});return h}),define("templates/lounge",["handlebars"],function(a){return a.template({1:function(a,b,c,d,e){var f;return'<div class="follow-btn-wrap">\n'+(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isSession:f,{name:"if",hash:{},fn:a.program(2,e,0),inverse:a.program(5,e,0),data:e}))?f:"")+"</div>\n"},2:function(a,b,c,d,e){var f;return(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isEditable:f,{name:"if",hash:{},fn:a.program(3,e,0),inverse:a.noop,data:e}))?f:"")+"\n"},3:function(a,b,c,d,e){var f,g=a.escapeExpression;return'<a href="'+g(a.lambda(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" data-action="edit-profile" target="_blank" class="btn follow-btn edit-profile">'+g(c.gettext.call(null!=b?b:{},"Edit profile",{name:"gettext",hash:{},data:e}))+"</a>\n"},5:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isPrivate:f,{name:"if",hash:{},fn:a.program(6,e,0),inverse:a.program(8,e,0),data:e}))?f:""},6:function(a,b,c,d,e){return'<span class="btn follow-btn private">\n<i aria-hidden="true" class="icon-lock"></i>\n<span class="btn-text">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Private",{name:"gettext",hash:{},data:e}))+"</span>\n</span>\n"},8:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" class="btn follow-btn '+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.user:b)?f.isFollowing:f,{name:"if",hash:{},fn:a.program(9,e,0),inverse:a.noop,data:e}))?f:"")+'" data-action="follow-user" data-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'">\n<span class="btn-text following-text">'+h(c.gettext.call(i,"Following",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="btn-text follow-text">'+h(c.gettext.call(i,"Follow",{name:"gettext",hash:{},data:e}))+'</span>\n<i aria-hidden="true" class="icon-plus"></i> \n<i aria-hidden="true" class="icon-checkmark"></i>\n</a>\n'},9:function(a,b,c,d,e){return"following"},11:function(a,b,c,d,e){return'<div class="vote-action tooltip">\n'+a.escapeExpression(c.gettext.call(null!=b?b:{},"You must sign in to down-vote this post.",{name:"gettext",hash:{},data:e}))+"\n</div>\n"},13:function(a,b,c,d,e){return'<div class="vote-action tooltip">\n'+a.escapeExpression(c.gettext.call(null!=b?b:{},"You must sign in to up-vote this post.",{name:"gettext",hash:{},data:e}))+"\n</div>\n"},15:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return"<h5>"+h(c.gettext.call(g,"Ban User",{name:"gettext",hash:{},data:e}))+"</h5>\n\n"+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(16,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.email:f,{name:"if",hash:{},fn:a.program(18,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.ipAddress:f,{name:"if",hash:{},fn:a.program(20,e,0),inverse:a.noop,data:e}))?f:"")+'\n<label><input type="checkbox" name="retroactive" value="1"/> '+h(c.gettext.call(g,"Apply to last 30 days of comments",{name:"gettext",hash:{},data:e}))+"</label>\n\n<label>"+h(c.gettext.call(g,"Note",{name:"gettext",hash:{},data:e}))+' <input type="text" class="form-control input-sm" name="notes" maxlength="50" /></label>\n\n<div class="actions">\n<button class="btn btn-small" type="submit">'+h(c.gettext.call(g,"Save",{name:"gettext",hash:{},data:e}))+'</button>\n<button class="btn btn-small" data-action="cancel">'+h(c.gettext.call(g,"Cancel",{name:"gettext",hash:{},data:e}))+"</button>\n</div>\n"},16:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<label><input type="checkbox" name="user" value="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.id:f,b))+'" checked="checked"/> '+h(c.gettext.call(null!=b?b:{},"User",{name:"gettext",hash:{},data:e}))+": "+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.username:f,b))+"</label>\n"},18:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<label><input type="checkbox" name="email" value="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.email:f,b))+'"> '+h(c.gettext.call(null!=b?b:{},"Email",{name:"gettext",hash:{},data:e}))+": "+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.email:f,b))+"</label>\n"},20:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<label><input type="checkbox" name="ip" value="'+h(g(null!=(f=null!=b?b.post:b)?f.ipAddress:f,b))+'"> '+h(c.gettext.call(null!=b?b:{},"IP Address",{name:"gettext",hash:{},data:e}))+": "+h(g(null!=(f=null!=b?b.post:b)?f.ipAddress:f,b))+"</label>\n"},22:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return g(c.gettext.call(f,"We are unable to post your comment because you have been blocked by %(blocker)s.",{name:"gettext",hash:{blocker:null!=b?b.blocker:b},data:e}))+'\n<a target="_blank" href="https://help.disqus.com/customer/portal/articles/466223-who-deleted-or-removed-my-comment-">'+g(c.gettext.call(f,"Find out more.",{name:"gettext",hash:{},data:e}))+"</a>\n"},24:function(a,b,c,d,e){return"<strong>"+a.escapeExpression(a.lambda(null!=b?b.name:b,b))+"</strong>\n"},26:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.lambda,i=a.escapeExpression;return'<div class="tooltip">\n<div class="notch"></div>\n\n'+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isAnonymous:f,{name:"if",hash:{},fn:a.program(27,e,0),inverse:a.program(29,e,0),data:e}))?f:"")+'\n<img src="'+i(h(null!=(f=null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.avatar:f)?f.cache:f,b))+'" class="user" alt="'+i(c.gettext.call(g,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n\n'+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isAnonymous:f,{name:"if",hash:{},fn:a.program(31,e,0),inverse:a.program(33,e,0),data:e}))?f:"")+'\n<div class="content">\n<h3>\n'+(null!=(f=c.unless.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isAnonymous:f,{name:"unless",hash:{},fn:a.program(35,e,0),inverse:a.noop,data:e}))?f:"")+"\n<h3>"+i(h(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.name:f,b))+"</h3>\n\n"+(null!=(f=c.unless.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isAnonymous:f,{name:"unless",hash:{},fn:a.program(33,e,0),inverse:a.noop,data:e}))?f:"")+"</h3>\n\n<p>"+i(h(null!=(f=null!=b?b.post:b)?f.excerpt:f,b))+"</p>\n</div>\n</div>\n"},27:function(a,b,c,d,e){return'<div class="avatar">\n'},29:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.profileUrl:f,b))+'" class="avatar" data-action="profile" data-username="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.username:f,b))+'">\n'},31:function(a,b,c,d,e){return"</div>\n"},33:function(a,b,c,d,e){return"</a>\n"},35:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.profileUrl:f,b))+'" data-action="profile" data-username="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.username:f,b))+'">\n'},37:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<div class="textarea-wrapper" data-role="textarea">\n<div class="post-actions">\n<div class="logged-in">\n<section>\n<div class="temp-post">\n<button class="btn" type="submit">'+g(c.gettext.call(f,"Save Edit",{name:"gettext",
  6. hash:{},data:e}))+'</button>\n<a class="cancel" href="#" data-action="edit">\n'+g(c.gettext.call(f,"Cancel",{name:"gettext",hash:{},data:e}))+"\n</a>\n</div>\n</section>\n</div>\n</div>\n</div>\n"},39:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return h(c.gettext.call(g,"%(forumName)s requires you to verify your email address before posting.",{name:"gettext",hash:{forumName:null!=b?b.forumName:b},data:e}))+'\n<a data-action="verify-email" data-forum="'+h(a.lambda(null!=b?b.forumId:b,b))+'" title="'+h(c.gettext.call(g,"Verify Email",{name:"gettext",hash:{},data:e}))+'" href="/verify">\n'+h(c.gettext.call(g,"Send verification email to %(email)s",{name:"gettext",hash:{email:null!=(f=null!=b?b.user:b)?f.email:f},data:e}))+"\n</a>\n"},41:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isSession:f,{name:"if",hash:{},fn:a.program(42,e,0),inverse:a.program(48,e,0),data:e}))?f:""},42:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isEditable:f,{name:"if",hash:{},fn:a.program(43,e,0),inverse:a.noop,data:e}))?f:""},43:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<a href="'+h(c.urlfor.call(g,"editProfile",{name:"urlfor",hash:{},data:e}))+'"\ntarget="_blank"\nclass="\n'+(null!=(f=c["if"].call(g,null!=b?b.buttonAsLink:b,{name:"if",hash:{},fn:a.program(44,e,0),inverse:a.program(46,e,0),data:e}))?f:"")+'">\n'+h(c.gettext.call(g,"Edit profile",{name:"gettext",hash:{},data:e}))+"\n</a>\n"},44:function(a,b,c,d,e){return"publisher-anchor-color follow-link\n"},46:function(a,b,c,d,e){return"btn btn-small\n"},48:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isPrivate:f,{name:"if",hash:{},fn:a.program(49,e,0),inverse:a.program(51,e,0),data:e}))?f:""},49:function(a,b,c,d,e){return'<span\nclass="btn btn-small follow-btn private">\n<i aria-hidden="true" class="icon-lock"></i>\n<span class="btn-text">\n'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Private",{name:"gettext",hash:{},data:e}))+"\n</span>\n</span>\n"},51:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" class="\n'+(null!=(f=c["if"].call(i,null!=b?b.buttonAsLink:b,{name:"if",hash:{},fn:a.program(44,e,0),inverse:a.program(52,e,0),data:e}))?f:"")+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.user:b)?f.isFollowing:f,{name:"if",hash:{},fn:a.program(9,e,0),inverse:a.noop,data:e}))?f:"")+'"\ndata-action="toggleFollow"\ndata-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'">\n<span class="btn-text following-text">'+h(c.gettext.call(i,"Following",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="btn-text follow-text">'+h(c.gettext.call(i,"Follow",{name:"gettext",hash:{},data:e}))+'</span>\n<i aria-hidden="true" class="icon-checkmark"></i>\n</a>\n'},52:function(a,b,c,d,e){return"btn btn-small follow-btn\n"},54:function(a,b,c,d,e){var f=a.lambda,g=a.escapeExpression;return'<span data-username="'+g(f(null!=b?b.username:b,b))+'" data-role="username">'+g(f(null!=b?b.name:b,b))+"</span>\n"},56:function(a,b,c,d,e){var f,g=null!=b?b:{};return'\n<div class="postbox">\n<div role="alert"></div>\n<div class="avatar">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(57,e,0),inverse:a.program(59,e,0),data:e}))?f:"")+'</div>\n\n<div class="textarea-wrapper" data-role="textarea" dir="auto">\n<div data-role="drag-drop-placeholder" class="media-drag-hover" style="display: none">\n<div class="drag-text">\n&#11015; '+a.escapeExpression(c.gettext.call(g,"Drag and drop your images here to upload them.",{name:"gettext",hash:{},data:e}))+"\n</div>\n</div>\n"+(null!=(f=c["if"].call(g,null!=b?b.displayMediaPreviews:b,{name:"if",hash:{},fn:a.program(61,e,0),inverse:a.noop,data:e}))?f:"")+'<div class="edit-alert" role="postbox-alert"></div>\n<div class="post-actions">\n<ul class="wysiwyg">\n'+(null!=(f=c["if"].call(g,null!=b?b.displayMediaUploadButton:b,{name:"if",hash:{},fn:a.program(63,e,0),inverse:a.noop,data:e}))?f:"")+"</ul>\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(65,e,0),inverse:a.noop,data:e}))?f:"")+'</div>\n</div>\n\n<div data-role="login-form"></div>\n</div>\n'},57:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" class="user" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">\n<img data-role="user-avatar" data-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'" src="'+h(g(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" alt="'+h(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'">\n</a>\n'},59:function(a,b,c,d,e){var f,g=a.escapeExpression;return'<span class="user">\n<img data-role="user-avatar" src="'+g(a.lambda(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" alt="'+g(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'">\n</span>\n'},61:function(a,b,c,d,e){return'<div class="media-preview empty" data-role="media-preview"></div>\n'},63:function(a,b,c,d,e){return'<li data-role="media-uploader"></li>\n'},65:function(a,b,c,d,e){var f;return null!=(f=c.unless.call(null!=b?b:{},null!=b?b.audienceSyncRequired:b,{name:"unless",hash:{},fn:a.program(66,e,0),inverse:a.noop,data:e}))?f:""},66:function(a,b,c,d,e){var f=null!=b?b:{};return'<div class="logged-in">\n<section>\n<div class="temp-post" style="text-align: right">\n<button class="btn">\n'+a.escapeExpression(c.gettext.call(f,"Post as %(name)s",{name:"gettext",hash:{name:c.getPartial.call(f,"formUser",null!=b?b.user:b,{name:"getPartial",hash:{},data:e})},data:e}))+"\n</button>\n</div>\n</section>\n</div>\n"},68:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isAnonymous:f,{name:"if",hash:{},fn:a.program(69,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=b?b.audienceSyncRequired:b,{name:"if",hash:{},fn:a.program(71,e,0),inverse:a.noop,data:e}))?f:"")},69:function(a,b,c,d,e){var f;return'<section class="auth-section logged-out">\n<div class="connect">\n<h6>'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Log in with",{name:"gettext",hash:{},data:e}))+"</h6>\n"+(null!=(f=a.invokePartial(d.loginButtons,b,{name:"loginButtons",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</div>\n"+(null!=(f=a.invokePartial(d.guestForm,b,{name:"guestForm",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</section>\n"},71:function(a,b,c,d,e){var f;return'<section class="auth-section">\n'+(null!=(f=a.invokePartial(d.audienceSync,b,{name:"audienceSync",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</section>\n"},73:function(a,b,c,d,e){var f;return'<ul data-role="login-menu" class="services login-buttons">\n\n'+(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.sso:b)?f.url:f,{name:"if",hash:{},fn:a.program(74,e,0),inverse:a.noop,data:e}))?f:"")+'\n<li class="auth-disqus">\n<button type="button" data-action="auth:disqus" title="Disqus"><i class="icon-disqus"></i></button>\n</li>\n<li class="auth-facebook">\n<button type="button" data-action="auth:facebook" title="Facebook"><i class="icon-facebook-circle"></i></button>\n</li>\n<li class="auth-twitter">\n<button type="button" data-action="auth:twitter" title="Twitter"><i class="icon-twitter-circle"></i></button>\n</li>\n<li class="auth-google">\n<button type="button" data-action="auth:google" title="Google"><i class="icon-google-plus-circle"></i></button>\n</li>\n</ul>\n'},74:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<li class="sso">\n<button type="button" data-action="auth:sso"\ntitle="'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.sso:b)?f.name:f,b))+'"\nclass="'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.sso:b)?f.button:f,{name:"if",hash:{},fn:a.program(75,e,0),inverse:a.program(77,e,0),data:e}))?f:"")+'">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.sso:b)?f.button:f,{name:"if",hash:{},fn:a.program(79,e,0),inverse:a.program(81,e,0),data:e}))?f:"")+"</button>\n</li>\n"},75:function(a,b,c,d,e){return"image"},77:function(a,b,c,d,e){return"no-image"},79:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<img alt="'+h(g(null!=(f=null!=b?b.sso:b)?f.name:f,b))+'" src="'+h(g(null!=(f=null!=b?b.sso:b)?f.button:f,b))+'"/>\n'},81:function(a,b,c,d,e){var f;return a.escapeExpression(a.lambda(null!=(f=null!=b?b.sso:b)?f.name:f,b))+"\n"},83:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression,i=a.lambda;return'<div class="guest">\n<h6 class="guest-form-title">\n<span class="register-text"> '+h(c.gettext.call(g,"or sign up with Disqus",{name:"gettext",hash:{},data:e}))+' </span>\n<span class="guest-text"> '+h(c.gettext.call(g,"or pick a name",{name:"gettext",hash:{},data:e}))+' </span>\n</h6>\n\n<div class="what-is-disqus help-icon">\n<div id="rules" class="tooltip show">\n<h3>'+h(c.gettext.call(g,"Disqus is a discussion network",{name:"gettext",hash:{},data:e}))+"</h3>\n<ul>\n<li><span>"+h(c.gettext.call(g,"Disqus never moderates or censors. The rules on this community are its own.",{name:"gettext",hash:{},data:e}))+"</span></li>\n<li><span>"+h(c.gettext.call(g,"Your email is safe with us. It's only used for moderation and optional notifications.",{name:"gettext",hash:{},data:e}))+"</span></li>\n<li><span>"+h(c.gettext.call(g,"Don't be a jerk or do anything illegal. Everything is easier that way.",{name:"gettext",hash:{},data:e}))+'</span></li>\n</ul>\n<p class="clearfix"><a href="https://docs.disqus.com/kb/terms-and-policies/" class="btn btn-small" target="_blank">'+h(c.gettext.call(g,"Read full terms and conditions",{name:"gettext",hash:{},data:e}))+'</a></p>\n</div>\n</div>\n\n<p class="input-wrapper">\n<input dir="auto" type="text" placeholder="'+h(c.gettext.call(g,"Name",{name:"gettext",hash:{},data:e}))+'" name="display_name" id="'+h(i(null!=b?b.cid:b,b))+'_display_name" maxlength="30">\n</p>\n\n<div class="guest-details '+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.sso:b)?f.url:f,{name:"if",hash:{},fn:a.program(84,e,0),inverse:a.noop,data:e}))?f:"")+'" data-role="guest-details">\n<p class="input-wrapper">\n<input dir="auto" type="email" placeholder="'+h(c.gettext.call(g,"Email",{name:"gettext",hash:{},data:e}))+'" name="email" id="'+h(i(null!=b?b.cid:b,b))+'_email">\n</p>\n\n<p class="input-wrapper">\n<input dir="auto" type="password" class="register-text" placeholder="'+h(c.gettext.call(g,"Password",{name:"gettext",hash:{},data:e}))+'" name="password" id="'+h(i(null!=b?b.cid:b,b))+'_password">\n</p>\n\n<div class="acceptance-wrapper register-text">\n'+h(c.gettext.call(g,"By signing up, you agree to the %(Disqus)s %(basicRules)s, %(serviceTerms)s, and %(privacyPolicy)s.",{name:"gettext",hash:{privacyPolicy:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Privacy Policy",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/466259-privacy-policy"},data:e}),serviceTerms:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Terms of Service",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/466260-terms-of-service"},data:e}),basicRules:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Basic Rules",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/1753105-basic-rules-for-disqus-powered-profiles-and-discussions"},data:e}),Disqus:"Disqus"},data:e}))+'\n</div>\n<div class="acceptance-wrapper guest-text">\n'+h(c.gettext.call(g,"By posting, you agree to the %(Disqus)s %(basicRules)s, %(serviceTerms)s, and %(privacyPolicy)s.",{name:"gettext",hash:{privacyPolicy:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Privacy Policy",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/466259-privacy-policy"},data:e}),serviceTerms:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Terms of Service",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/466260-terms-of-service"},data:e}),basicRules:c.tag.call(g,"a",{name:"tag",hash:{text:c.gettext.call(g,"Basic Rules",{name:"gettext",hash:{},data:e}),target:"_blank",href:"https://help.disqus.com/customer/portal/articles/1753105-basic-rules-for-disqus-powered-profiles-and-discussions"},data:e}),Disqus:"Disqus"},data:e}))+"\n</div>\n\n"+(null!=(f=c["if"].call(g,null!=b?b.allowAnonPost:b,{name:"if",hash:{},fn:a.program(86,e,0),inverse:a.program(88,e,0),data:e}))?f:"")+'\n<div class="proceed" data-role="submit-btn-container">\n'+(null!=(f=c["if"].call(g,null!=b?b.allowAnonPost:b,{name:"if",hash:{},fn:a.program(90,e,0),inverse:a.program(92,e,0),data:e}))?f:"")+"</div>\n</div>\n</div>\n"},84:function(a,b,c,d,e){return"expanded"},86:function(a,b,c,d,e){return'<div class="guest-checkbox">\n<label>\n<input type="checkbox" name="author-guest"/>\n'+a.escapeExpression(c.gettext.call(null!=b?b:{},"I'd rather post as a guest",{name:"gettext",hash:{},data:e}))+"\n</label>\n</div>\n"},88:function(a,b,c,d,e){return'<input type="checkbox" name="author-guest" style="display:none"/>\n'},90:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<button type="submit" class="btn submit" aria-label="'+g(c.gettext.call(f,"Post",{name:"gettext",hash:{},data:e}))+'"><span class="icon-proceed"></span><div class="spinner"></div></button>\n<button type="submit" class="btn next" aria-label="'+g(c.gettext.call(f,"Next",{name:"gettext",hash:{},data:e}))+'"><span class="icon-proceed"></span><div class="spinner"></div></button>\n'},92:function(a,b,c,d,e){return'<button type="submit" class="btn submit" aria-label="'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Next",{name:"gettext",hash:{},data:e}))+'"><span class="icon-proceed"></span><div class="spinner"></div></button>\n'},94:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression,h=a.lambda;return'<div class="audiencesync">\n<h6>'+g(c.gettext.call(f,"Connect with %(forumName)s",{name:"gettext",hash:{forumName:null!=b?b.forumName:b},data:e}))+'</h6>\n<div class="services">\n<div class="icons-container">\n<img class="icon" alt="Disqus"\nsrc="'+g("//a.disquscdn.com/next/embed/assets/img/audiencesync/sync-icon.6569cc4fd4bb29f2cd6568f663ed1009.png")+'">\n<i class="icon-proceed"></i>\n<img class="icon" alt="'+g(h(null!=b?b.forumName:b,b))+'"\nsrc="'+g(c.urlfor.call(f,"root",{name:"urlfor",hash:{},data:e}))+"/api/applications/icons/"+g(h(null!=b?b.apiKey:b,b))+'.png">\n</div>\n<p>\n'+g(c.gettext.call(f,"%(forumName)s needs permission to access your account.",{name:"gettext",hash:{forumName:null!=b?b.forumName:b},data:e}))+'\n</p>\n</div>\n<button type="button" data-action="audiencesync"\nclass="proceed btn submit">'+g(c.gettext.call(f,"Next",{name:"gettext",hash:{},data:e}))+"</button>\n</div>\n"},96:function(a,b,c,d,e){return'<h2 class="highlighted-comment-header">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Featured Comment",{name:"gettext",hash:{},data:e}))+'</h2>\n<ul class="post-list"></ul>\n'},98:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<div class="tooltip">\n<div class="notch"></div>\n<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" class="avatar" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">\n<img data-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'" data-role="user-avatar" src="'+h(g(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" class="user" alt="'+h(c.gettext.call(i,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n</a>\n<div class="content">\n<h3>\n<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" data-action="profile" data-role="username" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">'+h(g(null!=(f=null!=b?b.user:b)?f.name:f,b))+"</a>\n"+(null!=(f=c["if"].call(i,null!=(f=null!=(f=null!=b?b.user:b)?f.thread:f)?f.canModerate:f,{name:"if",hash:{},fn:a.program(99,e,0),inverse:a.noop,data:e}))?f:"")+"\n</h3>\n\n"+(null!=(f=c["if"].call(i,null!=(f=null!=b?b.user:b)?f.about:f,{name:"if",hash:{},fn:a.program(101,e,0),inverse:a.noop,data:e}))?f:"")+'\n\n<p class="stats" data-role="counters">\n'+(null!=(f=c.if_all.call(i,c.notNull.call(i,null!=(f=null!=b?b.user:b)?f.numPosts:f,{name:"notNull",hash:{},data:e}),c.notNull.call(i,null!=(f=null!=b?b.user:b)?f.numLikesReceived:f,{name:"notNull",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(103,e,0),inverse:a.noop,data:e}))?f:"")+'</p>\n</div>\n<footer data-role="actions">\n'+(null!=(f=a.invokePartial(d.hovercardActions,b,{name:"hovercardActions",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</footer>\n</div>\n"},99:function(a,b,c,d,e){return'<span class="badge moderator">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"MOD",{name:"gettext",hash:{},data:e}))+"</span>"},101:function(a,b,c,d,e){var f;return'<p class="bio">'+a.escapeExpression(c.truncate.call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.about:f,80,{name:"truncate",hash:{},data:e}))+"</p>\n"},103:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.hovercardCounters,b,{name:"hovercardCounters",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},105:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c["if"].call(g,c.eq.call(g,null!=(f=null!=b?b.user:b)?f.numPosts:f,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(106,e,0),inverse:a.program(108,e,0),data:e}))?f:"")+'<span class="bullet">•</span>\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=(f=null!=b?b.user:b)?f.numLikesReceived:f,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(110,e,0),inverse:a.program(112,e,0),data:e}))?f:"")},106:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"1 comment",{name:"gettext",hash:{},data:e}))+"\n"},108:function(a,b,c,d,e){var f;return a.escapeExpression(c.gettext.call(null!=b?b:{},"%(numPosts)s comments",{name:"gettext",hash:{numPosts:null!=(f=null!=b?b.user:b)?f.numPosts:f},data:e}))+"\n"},110:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"1 vote",{name:"gettext",hash:{},data:e}))+"\n"},112:function(a,b,c,d,e){var f;return a.escapeExpression(c.gettext.call(null!=b?b:{},"%(numLikesReceived)s votes",{name:"gettext",hash:{numLikesReceived:null!=(f=null!=b?b.user:b)?f.numLikesReceived:f},data:e}))+"\n"},114:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" class="full-profile" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">'+h(c.gettext.call(i,"Full profile",{name:"gettext",hash:{},data:e}))+"</a>\n\n"+(null!=(f=c["if"].call(i,null!=b?b.showFollowButton:b,{name:"if",hash:{},fn:a.program(115,e,0),inverse:a.noop,data:e}))?f:"")+"\n&nbsp;\n"},115:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.followButtonSmall,b,{name:"followButtonSmall",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},117:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<div id="layout" data-tracking-area="layout">\n\n<div id="onboard" data-tracking-area="onboard"></div>\n\n<div id="highlighted-post" data-tracking-area="highlighted" class="highlighted-post"></div>\n\n<div id="global-alert"></div>\n\n'+(null!=(f=c.unless.call(g,null!=b?b.inHome:b,{name:"unless",hash:{},fn:a.program(118,e,0),inverse:a.noop,data:e}))?f:"")+'\n<section id="conversation" data-role="main" data-tracking-area="main">\n'+(null!=(f=a.invokePartial(d.secondaryNavigation,b,{name:"secondaryNavigation",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'\n<div id="posts">\n<div id="form"></div>\n\n<button class="alert realtime" style="display: none" data-role="realtime-notification">\n</button>\n\n<div id="no-posts" style="display:none"></div>\n\n<ul id="post-list" class="post-list loading">\n</ul>\n\n<div class="load-more" data-role="more" style="display:none">\n<a href="#" data-action="more-posts" class="btn">'+a.escapeExpression(c.gettext.call(g,"Load more comments",{name:"gettext",hash:{},data:e}))+'</a>\n</div>\n</div>\n\n</section>\n\n<div id="placement-bottom" data-tracking-area="discovery-south"></div>\n\n'+(null!=(f=c.unless.call(g,null!=b?b.hideFooter:b,{name:"unless",hash:{},fn:a.program(120,e,0),inverse:a.noop,data:e}))?f:"")+"</div>\n"},118:function(a,b,c,d,e){var f;return'<header id="main-nav" data-tracking-area="main-nav">\n'+(null!=(f=a.invokePartial(d.topNavigation,b,{name:"topNavigation",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</header>\n"},120:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<div id="footer" data-tracking-area="footer">\n<ul class="disqus-footer">\n<li class="logo disqus-footer__item"><a href="https://disqus.com" rel="nofollow" title="'+h(c.gettext.call(g,"Powered by Disqus",{name:"gettext",hash:{},data:e}))+'">'+h(c.gettext.call(g,"Powered by Disqus",{name:"gettext",hash:{},data:e}))+'</a></li>\n<li id="thread-subscribe-button" class="email disqus-footer__item"> \n<div class="default">\n<a href="#" rel="nofollow" data-action="subscribe" title="'+h(c.gettext.call(g,"Subscribe and get email updates from this discussion",{name:"gettext",hash:{},data:e}))+'"><i aria-hidden="true" class="icon icon-mail"></i><span class="clip">'+h(c.gettext.call(g,"Subscribe",{name:"gettext",hash:{},data:e}))+'</span> <i aria-hidden="true" class="icon icon-checkmark"></i></a>\n</div>\n<div class="form">\n<div class="input-wrapper"><input id="thread-subscribe-email" type="email" placeholder="'+h(c.gettext.call(g,"yourname@email.com",{name:"gettext",hash:{},data:e}))+'"/></div>\n</div>\n</li>\n<li class="install disqus-footer__item">\n<a href="https://publishers.disqus.com/engage?utm_source='+h(a.lambda(null!=(f=null!=b?b.forum:b)?f.id:f,b))+'&utm_medium=Disqus-Footer" rel="nofollow" target="_blank">\n<i aria-hidden="true" class="icon icon-disqus"></i>\n<span class="clip hidden-sm">'+h(c.gettext.call(g,"Add Disqus to your site",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="clip visible-sm hidden-xs">'+h(c.gettext.call(g,"Add Disqus",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="clip visible-xs">'+h(c.gettext.call(g,"Add",{name:"gettext",hash:{},data:e}))+'</span>\n</a>\n</li>\n<li class="privacy disqus-footer__item">\n<a href="https://help.disqus.com/customer/portal/articles/1657951?utm_source=disqus&utm_medium=embed-footer&utm_content=privacy-btn" rel="nofollow" target="_blank">\n<i aria-hidden="true" class="icon icon-lock"></i>\n<span class="clip">'+h(c.gettext.call(g,"Privacy",{name:"gettext",hash:{},data:e}))+"</span>\n</a>\n</li>\n</ul>\n</div>\n"},122:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<li data-role="post-sort" class="dropdown sorting pull-right">\n<a href="#" class="dropdown-toggle" data-toggle="dropdown">\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"popular",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(123,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"desc",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(125,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"asc",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(127,e,0),inverse:a.noop,data:e}))?f:"")+'\n<span class="caret"></span>\n</a>\n<ul class="dropdown-menu pull-right">\n<li '+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"popular",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(129,e,0),inverse:a.noop,data:e}))?f:"")+'>\n<a href="#" data-action="sort" data-sort="popular">'+h(c.gettext.call(g,"Best",{name:"gettext",hash:{},data:e}))+'<i aria-hidden="true" class="icon-checkmark"></i></a>\n</li>\n\n<li '+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"desc",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(129,e,0),inverse:a.noop,data:e}))?f:"")+'>\n<a href="#" data-action="sort" data-sort="desc">'+h(c.gettext.call(g,"Newest",{name:"gettext",hash:{},data:e}))+'<i aria-hidden="true" class="icon-checkmark"></i></a>\n</li>\n\n<li '+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.order:b,"asc",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(129,e,0),inverse:a.noop,data:e}))?f:"")+'>\n<a href="#" data-action="sort" data-sort="asc">'+h(c.gettext.call(g,"Oldest",{name:"gettext",hash:{},data:e}))+'<i aria-hidden="true" class="icon-checkmark"></i></a>\n</li>\n</ul>\n</li>\n'},123:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Sort by Best",{name:"gettext",hash:{},data:e}))},125:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Sort by Newest",{name:"gettext",hash:{},data:e}))},127:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Sort by Oldest",{name:"gettext",hash:{},data:e}))},129:function(a,b,c,d,e){return'class="selected"'},131:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<a class="publisher-nav-color">\n<span class="comment-count">\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.count:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(106,e,0),inverse:a.program(132,e,0),data:e}))?f:"")+'</span>\n\n<span class="comment-count-placeholder">\n'+a.escapeExpression(c.gettext.call(g,"Comments",{name:"gettext",hash:{},data:e}))+"\n</span>\n</a>\n"},132:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"%(numPosts)s comments",{name:"gettext",hash:{numPosts:null!=b?b.count:b},data:e}))+"\n"},134:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<nav class="nav nav-primary">\n<ul>\n<li class="tab-conversation active" data-role="post-count">\n'+(null!=(f=c.unless.call(g,null!=b?b.inHome:b,{name:"unless",hash:{},fn:a.program(135,e,0),inverse:a.noop,data:e}))?f:"")+"</li>\n"+(null!=(f=c.unless.call(g,null!=b?b.inHome:b,{name:"unless",hash:{},fn:a.program(138,e,0),inverse:a.noop,data:e}))?f:"")+'<li class="dropdown user-menu" data-role="logout">\n<!-- rendered dynamically -->\n</li>\n<li class="notification-menu" data-role="notification-menu">\n<!-- rendered dynamically -->\n</li>\n</ul>\n</nav>\n'},135:function(a,b,c,d,e){var f;return null!=(f=c["with"].call(null!=b?b:{},"count",null!=(f=null!=b?b.thread:b)?f.posts:f,{name:"with",hash:{},fn:a.program(136,e,0),inverse:a.noop,data:e}))?f:""},136:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.postCount,b,{name:"postCount",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},138:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<li class="tab-community">\n<a href="'+h(g(null!=(f=null!=b?b.forum:b)?f.homeUrl:f,b))+'"\nclass="publisher-nav-color"\ndata-action="community-sidebar" data-forum="'+h(g(null!=(f=null!=b?b.forum:b)?f.id:f,b))+'"\nid="community-tab"\n>\n<span class="community-name">\n'+(null!=(f=c["with"].call(i,null!=b?b.forum:b,{name:"with",hash:{},fn:a.program(139,e,0),inverse:a.noop,data:e}))?f:"")+'\n</span>\n\n<strong class="community-name-placeholder">'+h(c.gettext.call(i,"Community",{name:"gettext",hash:{},data:e}))+"</strong>\n</a>\n</li>\n"},139:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.communityForum,b,{name:"communityForum",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},141:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<a href="#" data-action="recommend" title="'+h(c.gettext.call(g,"Recommend this discussion",{name:"gettext",hash:{},data:e}))+'" class="dropdown-toggle '+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.thread:b)?f.userScore:f,{name:"if",hash:{},fn:a.program(142,e,0),inverse:a.noop,data:e}))?f:"")+'">\n<span class="icon-heart"></span>\n<span class="label label-default">'+h(c.gettext.call(g,"Recommend",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="label label-recommended">'+h(c.gettext.call(g,"Recommended",{name:"gettext",hash:{},data:e}))+"</span>\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.thread:b)?f.likes:f,{name:"if",hash:{},fn:a.program(144,e,0),inverse:a.noop,data:e}))?f:"")+'</a>\n<ul class="dropdown-menu coachmark">\n<li>\n'+(null!=(f=c["if"].call(g,null!=b?b.loggedIn:b,{name:"if",hash:{},fn:a.program(146,e,0),inverse:a.program(148,e,0),data:e}))?f:"")+'<a href="'+h(c.urlfor.call(g,"root",{name:"urlfor",hash:{},data:e}))+'/home/?utm_source=disqus_embed&utm_content=recommend_btn" class="btn btn-primary" target="_blank">\n'+(null!=(f=c["if"].call(g,null!=b?b.loggedIn:b,{name:"if",hash:{},fn:a.program(150,e,0),inverse:a.program(152,e,0),data:e}))?f:"")+"\n</a>\n</li>\n</ul>\n"},142:function(a,b,c,d,e){return"upvoted"},144:function(a,b,c,d,e){var f;return'<span class="label label-count">'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.thread:b)?f.likes:f,b))+"</span>\n"},146:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return"<h2>"+g(c.gettext.call(f,"Your 1st recommended discussion!",{name:"gettext",hash:{},data:e}))+"</h2>\n<p>"+g(c.gettext.call(f,"Recommending means this is a discussion worth sharing. It gets shared to your followers' %(Disqus)s feeds if you log in, and gives the creator kudos!",{name:"gettext",hash:{Disqus:"Disqus"},data:e}))+"</p>\n"},148:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return"<h2>"+g(c.gettext.call(f,"Discussion Recommended!",{name:"gettext",hash:{},data:e}))+"</h2>\n<p>"+g(c.gettext.call(f,"Recommending means this is a discussion worth sharing. It gets shared to your followers' %(Disqus)s feeds, and gives the creator kudos!",{name:"gettext",hash:{Disqus:"Disqus"},data:e}))+"</p>\n"},150:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"See Your Feed",{name:"gettext",hash:{},data:e}))+" "},152:function(a,b,c,d,e){return" "+a.escapeExpression(c.gettext.call(null!=b?b:{},"Find More Discussions",{name:"gettext",hash:{},data:e}))+" "},154:function(a,b,c,d,e){var f;return'<div class="nav nav-secondary" data-tracking-area="secondary-nav">\n<ul>\n<li id="recommend-button" class="recommend dropdown">\n</li>\n<li id="thread-share-menu" class="dropdown share-menu hidden-sm">\n</li>\n'+(null!=(f=c.unless.call(null!=b?b:{},null!=b?b.inHome:b,{name:"unless",hash:{},fn:a.program(155,e,0),inverse:a.noop,data:e}))?f:"")+"</ul>\n</div>\n"},155:function(a,b,c,d,e){var f;return null!=(f=a.invokePartial(d.postSort,b,{name:"postSort",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:""},157:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="'+g(c.gettext.call(f,"Share",{name:"gettext",hash:{},data:e}))+'">\n<span class="icon-export"></span>\n<span class="label">'+g(c.gettext.call(f,"Share",{name:"gettext",hash:{},data:e}))+'</span>\n</a>\n<ul class="share-menu dropdown-menu">\n<li class="share">'+g(c.gettext.call(f,"Share this discussion on",{name:"gettext",hash:{},data:e}))+'\n<ul>\n<li class="twitter">\n<a data-action="share:twitter"\nhref="#">Twitter</a>\n</li>\n<li class="facebook">\n<a data-action="share:facebook" href="#">Facebook</a>\n</li>\n</ul>\n</li>\n</ul>\n'},159:function(a,b,c,d,e){return'<a href="'+a.escapeExpression(c.urlfor.call(null!=b?b:{},"homeInbox",{name:"urlfor",hash:{},data:e}))+'" class="notification-container"\ndata-action="home" data-home-path="home/inbox/">\n<span class="notification-icon icon-comment" aria-hidden></span>\n<span class="notification-count" data-role="notification-count"></span>\n</a>\n'},161:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression,i=a.lambda;return'<div class="notice '+(null!=(f=c["if"].call(g,null!=b?b.showHome:b,{name:"if",hash:{},fn:a.program(162,e,0),inverse:a.noop,data:e}))?f:"")+'">\n<div class="notice-wrapper">\n<span class="icon icon-disqus"></span>\n<a data-action="show-home"\nhref="'+h(c.urlfor.call(g,"home",{
  7. name:"urlfor",hash:{},data:e}))+"welcome/?utm_source=embed&utm_medium=onboard_message&utm_content=see_home_msg&forum_id="+h(i(null!=(f=null!=b?b.forum:b)?f.id:f,b))+'"\ntarget="_blank"\nclass="message">\n\n'+h(c.gettext.call(g,"Welcome to %(Disqus)s! Discover more great discussions just like this one. We're a lot more than comments.",{name:"gettext",hash:{Disqus:"Disqus"},data:e}))+'\n</a>\n<a data-action="show-home"\nhref="'+h(c.urlfor.call(g,"home",{name:"urlfor",hash:{},data:e}))+"welcome/?utm_source=embed&utm_medium=onboard_message&utm_content=see_home_btn&forum_id="+h(i(null!=(f=null!=b?b.forum:b)?f.id:f,b))+'"\ntarget="_blank"\nclass="btn btn-primary">\n\n'+h(c.gettext.call(g,"Get Started",{name:"gettext",hash:{},data:e}))+'\n</a>\n</div>\n</div>\n<a class="dismiss" data-action="close" href="#" title=\''+h(c.gettext.call(g,"Dismiss",{name:"gettext",hash:{},data:e}))+'\'>Dismiss <span aria-label="Dismiss" class="cross">×</span></a>\n'},162:function(a,b,c,d,e){return"success"},164:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<div role="alert"></div>\n'+(null!=(f=a.invokePartial(d.postWrapperTop,b,{name:"postWrapperTop",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"\n"+(null!=(f=a.invokePartial(d.postUserAvatar,b,{name:"postUserAvatar",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'<div class="post-body">\n<header>\n<span class="post-byline">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(165,e,0),inverse:a.program(173,e,0),data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=b?b.parentPost:b,{name:"if",hash:{},fn:a.program(175,e,0),inverse:a.noop,data:e}))?f:"")+'</span>\n\n<span class="post-meta">\n<span class="bullet time-ago-bullet" aria-hidden="true">•</span>\n\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.id:f,{name:"if",hash:{},fn:a.program(177,e,0),inverse:a.program(179,e,0),data:e}))?f:"")+"</span>\n\n"+(null!=(f=c["if"].call(g,null!=b?b.stateByline:b,{name:"if",hash:{},fn:a.program(181,e,0),inverse:a.noop,data:e}))?f:"")+'</header>\n\n<div class="post-body-inner">\n<div class="post-message-container" data-role="message-container">\n<div class="publisher-anchor-color" data-role="message-content">\n<div class="post-message '+(null!=(f=c.unless.call(g,null!=(f=null!=b?b.post:b)?f.message:f,{name:"unless",hash:{},fn:a.program(183,e,0),inverse:a.noop,data:e}))?f:"")+'"\ndata-role="message" dir="auto">\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=(f=null!=b?b.post:b)?f.message:f,"",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(185,e,0),inverse:a.program(187,e,0),data:e}))?f:"")+'</div>\n\n<span class="post-media"><ul data-role="post-media-list"></ul></span>\n</div>\n</div>\n<a class="see-more hidden" title="'+h(c.gettext.call(g,"see more",{name:"gettext",hash:{},data:e}))+'" data-action="see-more">'+h(c.gettext.call(g,"see more",{name:"gettext",hash:{},data:e}))+"</a>\n</div>\n\n<footer>\n"+(null!=(f=a.invokePartial(d.postFooter,b,{name:"postFooter",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</footer>\n</div>\n\n"+(null!=(f=a.invokePartial(d.postWrapperBottom,b,{name:"postWrapperBottom",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"\n"},165:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.lambda,i=a.escapeExpression;return(null!=(f=c.if_all.call(g,null!=b?b.isInHome:b,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isPowerContributor:f,{name:"if_all",hash:{},fn:a.program(166,e,0),inverse:a.noop,data:e}))?f:"")+'<span class="author publisher-anchor-color"><a href="'+i(h(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.profileUrl:f,b))+'" data-action="profile" data-username="'+i(h(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.username:f,b))+'" data-role="username">'+i(h(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.name:f,b))+"</a></span>\n"+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.badge:f,{name:"if",hash:{},fn:a.program(168,e,0),inverse:a.program(170,e,0),data:e}))?f:"")},166:function(a,b,c,d,e){return'<a href="#" class="icon__position -inline -allstar" data-toggle="tooltip" data-role="allstar" title="'+a.escapeExpression(c.gettext.call(null!=b?b:{},"All-Star",{name:"gettext",hash:{},data:e}))+'"><span class="icon-allstar allstar__icon"></span></a>'},168:function(a,b,c,d,e){var f;return'<span class="badge" data-type="tracked-badge">'+a.escapeExpression(a.lambda(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.badge:f,b))+"</span>\n"},170:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.thread:f)?f.canModerate:f,{name:"if",hash:{},fn:a.program(171,e,0),inverse:a.noop,data:e}))?f:""},171:function(a,b,c,d,e){return'<span class="badge moderator">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Mod",{name:"gettext",hash:{},data:e}))+"</span>\n"},173:function(a,b,c,d,e){var f;return'<span class="author">'+a.escapeExpression(a.lambda(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.name:f,b))+"</span>\n"},175:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<span><a href="'+h(g(null!=(f=null!=b?b.parentPost:b)?f.permalink:f,b))+'" class="parent-link" data-role="parent-link"><i aria-hidden="true" class="icon-forward" title="in reply to"></i> '+h(g(null!=(f=null!=(f=null!=b?b.parentPost:b)?f.author:f)?f.name:f,b))+"</a></span>\n"},177:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=b?b.post:b)?f.permalink:f,b))+'" data-role="relative-time" class="time-ago" title="'+h(g(null!=(f=null!=b?b.post:b)?f.formattedCreatedAt:f,b))+'">\n'+h(g(null!=(f=null!=b?b.post:b)?f.relativeCreatedAt:f,b))+"\n</a>\n"},179:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<span class="time-ago" data-role="relative-time" title="'+h(g(null!=(f=null!=b?b.post:b)?f.formattedCreatedAt:f,b))+'">\n'+h(g(null!=(f=null!=b?b.post:b)?f.relativeCreatedAt:f,b))+"\n</span>\n"},181:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<span class="state-byline state-byline-'+h(g(null!=(f=null!=b?b.stateByline:b)?f.style:f,b))+'">\n<span class="icon-mobile icon-'+h(g(null!=(f=null!=b?b.stateByline:b)?f.icon:f,b))+'" aria-hidden="true"></span>\n<span class="text">\n'+h(g(null!=(f=null!=b?b.stateByline:b)?f.text:f,b))+"\n</span>\n</span>\n"},183:function(a,b,c,d,e){return"loading"},185:function(a,b,c,d,e){return"<p><i>"+a.escapeExpression(c.gettext.call(null!=b?b:{},"This comment has no content.",{name:"gettext",hash:{},data:e}))+"</i></p>\n"},187:function(a,b,c,d,e){var f;return a.escapeExpression(c.html.call(null!=b?b:{},null!=(f=null!=b?b.post:b)?f.message:f,{name:"html",hash:{},data:e}))+"\n"},189:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<div data-role="post-content" class="post-content\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isRealtime:f,{name:"if",hash:{},fn:a.program(190,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.if_all.call(g,null!=(f=null!=b?b.session:b)?f.isRegistered:f,c.eq.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.id:f,null!=(f=null!=b?b.session:b)?f.id:f,{name:"eq",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(192,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isFlaggedByUser:f,{name:"if",hash:{},fn:a.program(194,e,0),inverse:a.noop,data:e}))?f:"")+'\n">\n'+(null!=(f=a.invokePartial(d.postMenu,b,{name:"postMenu",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'<div class="indicator"></div>\n'},190:function(a,b,c,d,e){return"new"},192:function(a,b,c,d,e){return"authored-by-session-user"},194:function(a,b,c,d,e){return"user-reported"},196:function(a,b,c,d,e){return'<div data-role="blacklist-form"></div>\n<div class="reply-form-container" data-role="reply-form"></div>\n</div>\n\n<ul data-role="children" class="children"/>\n'},198:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.lambda,i=a.escapeExpression;return'<a href="#"\nclass="vote-up '+(null!=(f=c["if"].call(g,c.gt.call(g,null!=(f=null!=b?b.post:b)?f.userScore:f,0,{name:"gt",hash:{},data:e}),{name:"if",hash:{},fn:a.program(142,e,0),inverse:a.noop,data:e}))?f:"")+" count-"+i(h(null!=(f=null!=b?b.post:b)?f.likes:f,b))+'"\ndata-action="upvote"\ntitle="'+(null!=(f=c.unless.call(g,null!=(f=null!=b?b.post:b)?f.likes:f,{name:"unless",hash:{},fn:a.program(199,e,0),inverse:a.noop,data:e}))?f:"")+'">\n\n<span class="updatable count" data-role="likes">'+i(h(null!=(f=null!=b?b.post:b)?f.likes:f,b))+'</span>\n<span class="control"><i aria-hidden="true" class="icon icon-arrow-2"></i></span>\n</a>\n<span role="button"\nclass="vote-down '+(null!=(f=c["if"].call(g,c.lt.call(g,null!=(f=null!=b?b.post:b)?f.userScore:f,0,{name:"lt",hash:{},data:e}),{name:"if",hash:{},fn:a.program(201,e,0),inverse:a.noop,data:e}))?f:"")+" count-"+i(h(null!=(f=null!=b?b.post:b)?f.dislikes:f,b))+'"\ndata-action="downvote"\ntitle="'+i(c.gettext.call(g,"Vote down",{name:"gettext",hash:{},data:e}))+'">\n\n<span class="control"><i aria-hidden="true" class="icon icon-arrow"></i></span>\n</span>\n'},199:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Vote up",{name:"gettext",hash:{},data:e}))},201:function(a,b,c,d,e){return"downvoted"},203:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<ul class="post-menu dropdown" data-role="menu">\n<li class="collapse">\n<a href="#" data-action="collapse" title="'+h(c.gettext.call(g,"Collapse",{name:"gettext",hash:{},data:e}))+'"><span>−</span></a>\n</li>\n<li class="expand">\n<a href="#" data-action="collapse" title="'+h(c.gettext.call(g,"Expand",{name:"gettext",hash:{},data:e}))+'"><span>+</span></a>\n</li>\n\n'+(null!=(f=c.if_all.call(g,null!=(f=null!=b?b.post:b)?f.id:f,c.ne.call(g,null!=(f=null!=b?b.post:b)?f.isMinimized:f,!0,{name:"ne",hash:{},data:e}),c.ne.call(g,null!=(f=null!=b?b.post:b)?f.isDeleted:f,!0,{name:"ne",hash:{},data:e}),c.ne.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isBlocked:f,!0,{name:"ne",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(204,e,0),inverse:a.noop,data:e}))?f:"")+"</ul>\n"},204:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<li class="'+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.session:b)?f.thread:f)?f.canModerate:f,{name:"if",hash:{},fn:a.program(205,e,0),inverse:a.noop,data:e}))?f:"")+'"\nrole="menu">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.session:b)?f.thread:f)?f.canModerate:f,{name:"if",hash:{},fn:a.program(207,e,0),inverse:a.program(218,e,0),data:e}))?f:"")+"</li>\n"},205:function(a,b,c,d,e){return"moderator-menu-options"},207:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<a class="dropdown-toggle" data-toggle="dropdown" href="#"><b\nclass="caret moderator-menu-options"></b></a>\n<ul class="dropdown-menu">\n'+(null!=(f=c.if_all.call(g,null!=b?b.isUserBlockingEnabled:b,c.ne.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.id:f,null!=(f=null!=b?b.session:b)?f.id:f,{name:"ne",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(208,e,0),inverse:a.noop,data:e}))?f:"")+'<li><a href="#" data-action="spam">'+h(c.gettext.call(g,"Mark as Spam",{name:"gettext",hash:{},data:e}))+'</a></li>\n<li><a href="#" data-action="delete">'+h(c.gettext.call(g,"Delete",{name:"gettext",hash:{},data:e}))+'</a> </li>\n<li><a href="#" data-action="blacklist">'+h(c.gettext.call(g,"Ban User",{name:"gettext",hash:{},data:e}))+'</a> </li>\n<li>\n<a href="'+h(c.urlfor.call(g,"moderate",{name:"urlfor",hash:{},data:e}))+"#/approved/search/id:"+h(a.lambda(null!=(f=null!=b?b.post:b)?f.id:f,b))+'"\ntarget="_blank">'+h(c.gettext.call(g,"Moderate",{name:"gettext",hash:{},data:e}))+'</a>\n</li>\n\n<li class="highlight-toggle">\n<a href="#"\ndata-action="'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isHighlighted:f,{name:"if",hash:{},fn:a.program(210,e,0),inverse:a.program(212,e,0),data:e}))?f:"")+'">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isHighlighted:f,{name:"if",hash:{},fn:a.program(214,e,0),inverse:a.program(216,e,0),data:e}))?f:"")+"</a>\n</li>\n</ul>\n"},208:function(a,b,c,d,e){return'<li><a href="#" data-action="block-user">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Block User",{name:"gettext",hash:{},data:e}))+"</a></li>\n"},210:function(a,b,c,d,e){return"unhighlight"},212:function(a,b,c,d,e){return"highlight"},214:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Stop featuring",{name:"gettext",hash:{},data:e}))+"\n"},216:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Feature this comment",{name:"gettext",hash:{},data:e}))+"\n"},218:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c.if_all.call(g,null!=(f=null!=b?b.session:b)?f.isRegistered:f,null!=(f=null!=b?b.post:b)?f.author:f,c.eq.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.id:f,null!=(f=null!=b?b.session:b)?f.id:f,{name:"eq",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(219,e,0),inverse:a.program(221,e,0),data:e}))?f:""},219:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<a class="dropdown-toggle" data-toggle="dropdown"\nhref="#"><b class="caret"></b></a>\n<ul class="dropdown-menu">\n<li><a href="#" data-action="delete">'+g(c.gettext.call(f,"Delete",{name:"gettext",hash:{},data:e}))+'</a></li>\n<li><a href="#" data-action="flag">'+g(c.gettext.call(f,"Flag as inappropriate",{name:"gettext",hash:{},data:e}))+"</a></li>\n</ul>\n"},221:function(a,b,c,d,e){var f;return null!=(f=c.if_all.call(null!=b?b:{},null!=b?b.isUserBlockingEnabled:b,null!=(f=null!=b?b.session:b)?f.isRegistered:f,{name:"if_all",hash:{},fn:a.program(222,e,0),inverse:a.program(224,e,0),data:e}))?f:""},222:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<a class="dropdown-toggle" data-toggle="dropdown"\nhref="#"><b class="caret"></b></a>\n<ul class="dropdown-menu">\n<li><a href="#" data-action="block-user">'+g(c.gettext.call(f,"Block User",{name:"gettext",hash:{},data:e}))+'</a></li>\n<li><a href="#" data-action="flag">'+g(c.gettext.call(f,"Flag as inappropriate",{name:"gettext",hash:{},data:e}))+"</a></li>\n</ul>\n"},224:function(a,b,c,d,e){return'<a class="dropdown-toggle" href="#" data-action="flag"\ndata-role="flag" title="'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Flag as inappropriate",{name:"gettext",hash:{},data:e}))+'">\n<i aria-hidden="true" class="icon icon-flag"></i>\n</a>\n'},226:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<menu>\n\n<li class="voting" data-role="voting">\n'+(null!=(f=a.invokePartial(d.postVotes,b,{name:"postVotes",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'</li>\n<li class="bullet" aria-hidden="true">•</li>\n\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.canBeEdited:f,{name:"if",hash:{},fn:a.program(227,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.canBeRepliedTo:f,{name:"if",hash:{},fn:a.program(229,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isSponsored:f,{name:"if",hash:{},fn:a.program(231,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.canBeShared:f,{name:"if",hash:{},fn:a.program(234,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.unless.call(g,null!=(f=null!=b?b.post:b)?f.isDeleted:f,{name:"unless",hash:{},fn:a.program(236,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.post:b)?f.isSponsored:f,{name:"if",hash:{},fn:a.program(238,e,0),inverse:a.noop,data:e}))?f:"")+"</menu>\n"},227:function(a,b,c,d,e){return'<li class="edit" data-role="edit-link">\n<a href="#" data-action="edit">\n<i class="icon icon-mobile icon-pencil"></i><span class="text">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Edit",{name:"gettext",hash:{},data:e}))+'</span></a></li>\n<li class="bullet" aria-hidden="true">•</li>\n'},229:function(a,b,c,d,e){return'<li class="reply" data-role="reply-link">\n<a href="#" data-action="reply">\n<i class="icon icon-mobile icon-reply"></i><span class="text">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Reply",{name:"gettext",hash:{},data:e}))+'</span></a></li>\n<li class="bullet" aria-hidden="true">•</li>\n'},231:function(a,b,c,d,e){var f;return null!=(f=c.unless.call(null!=b?b:{},null!=(f=null!=b?b.post:b)?f.hideViewAllComments:f,{name:"unless",hash:{},fn:a.program(232,e,0),inverse:a.noop,data:e}))?f:""},232:function(a,b,c,d,e){var f,g=a.escapeExpression,h=null!=b?b:{};return'<li class="thread-link" data-role="thread-link">\n<a href="'+g(a.lambda(null!=(f=null!=b?b.post:b)?f.permalink:f,b))+'" target="_blank" data-action="thread">\n<i class="icon icon-mobile"></i>\n<span class="text">'+g(c.gettext.call(h,"View all comments",{name:"gettext",hash:{},data:e}))+'</span>\n<span class="mobile-text">'+g(c.gettext.call(h,"All Comments",{name:"gettext",hash:{},data:e}))+'</span>\n</a>\n</li>\n<li class="bullet" aria-hidden="true">•</li>\n'},234:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return'<li class="share">\n<a class="toggle"><i class="icon icon-mobile icon-share"></i><span class="text">'+h(c.gettext.call(g,"Share",{name:"gettext",hash:{},data:e}))+' ›</span></a>\n<ul>\n<li class="twitter"><a href="#" data-action="share:twitter">Twitter</a></li>\n<li class="facebook"><a href="#" data-action="share:facebook">Facebook</a></li>\n<li class="link"><a href="'+h(a.lambda(null!=(f=null!=b?b.post:b)?f.shortLink:f,b))+'">'+h(c.gettext.call(g,"Link",{name:"gettext",hash:{},data:e}))+"</a></li>\n</ul>\n</li>\n"},236:function(a,b,c,d,e){var f;return'<li class="realtime" data-role="realtime-notification:'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.post:b)?f.id:f,b))+'">\n<span style="display:none;" class="realtime-replies"></span>\n<a style="display:none;" href="#" class="btn btn-small"></a>\n</li>\n'},238:function(a,b,c,d,e){return'<li class="feedback">\n<button data-action="feedback">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Leave Feedback",{name:"gettext",hash:{},data:e}))+"</button>\n</li>\n"},240:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c.if_all.call(g,null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.isRegistered:f,c.ne.call(g,null!=(f=null!=b?b.post:b)?f.isMinimized:f,!0,{name:"ne",hash:{},data:e}),{name:"if_all",hash:{},fn:a.program(241,e,0),inverse:a.program(243,e,0),data:e}))?f:""},241:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<div class="avatar hovercard">\n<a href="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.profileUrl:f,b))+'" class="user"\ndata-action="profile" data-username="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.username:f,b))+'">\n<img data-role="user-avatar" data-user="'+h(g(null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.id:f,b))+'" src="'+h(g(null!=b?b.defaultAvatarUrl:b,b))+'" data-src="'+h(g(null!=(f=null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.avatar:f)?f.cache:f,b))+'"\nalt="'+h(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/>\n</a>\n</div>\n'},243:function(a,b,c,d,e){var f;return(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.hasSponsoredAvatar:f,{name:"if",hash:{},fn:a.program(244,e,0),inverse:a.program(246,e,0),data:e}))?f:"")+"\n"},244:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<div class="avatar">\n<div class="user"><img src="'+h(g(null!=b?b.defaultAvatarUrl:b,b))+'" data-src="'+h(g(null!=(f=null!=(f=null!=(f=null!=b?b.post:b)?f.author:f)?f.avatar:f)?f.cache:f,b))+'"\nclass="user" alt="'+h(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/></div>\n</div>\n'},246:function(a,b,c,d,e){var f=a.escapeExpression;return'<div class="avatar">\n<div class="user"><img src="'+f(a.lambda(null!=b?b.defaultAvatarUrl:b,b))+'"\nclass="user" alt="'+f(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/></div>\n</div>\n'},248:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"You've featured a comment! This comment will now also appear at the top of the discussion.",{name:"gettext",hash:{},data:e}))+"\n"},250:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return(null!=(f=a.invokePartial(d.postWrapperTop,b,{name:"postWrapperTop",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'\n<div class="avatar">\n<img data-src="'+h(c.urlfor.call(g,"avatar.generic",{name:"urlfor",hash:{},data:e}))+'" class="user" alt="'+h(c.gettext.call(g,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n</div>\n<div class="post-body">\n<div class="post-message">\n<p>'+h(c.gettext.call(g,"This user is blocked.",{name:"gettext",hash:{},data:e}))+"</p>\n</div>\n</div>\n\n"+(null!=(f=a.invokePartial(d.postWrapperBottom,b,{name:"postWrapperBottom",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")},252:function(a,b,c,d,e){var f,g=null!=b?b:{},h=a.escapeExpression;return(null!=(f=a.invokePartial(d.postWrapperTop,b,{name:"postWrapperTop",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'\n<div class="avatar">\n<img data-src="'+h(c.urlfor.call(g,"avatar.generic",{name:"urlfor",hash:{},data:e}))+'" class="user" alt="'+h(c.gettext.call(g,"Avatar",{name:"gettext",hash:{},data:e}))+'" />\n</div>\n<div class="post-body">\n<div class="post-message">\n<p>'+h(c.gettext.call(g,"This comment was deleted.",{name:"gettext",hash:{},data:e}))+"</p>\n</div>\n\n<header>\n"+(null!=(f=a.invokePartial(d.postMenu,b,{name:"postMenu",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</header>\n</div>\n\n"+(null!=(f=a.invokePartial(d.postWrapperBottom,b,{name:"postWrapperBottom",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")},254:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=a.invokePartial(d.postWrapperTop,b,{name:"postWrapperTop",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"\n"+(null!=(f=a.invokePartial(d.postUserAvatar,b,{name:"postUserAvatar",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+'<div class="post-body">\n<div class="post-message publisher-anchor-color">\n'+(null!=(f=c.if_any.call(g,null!=b?b.created:b,null!=(f=null!=b?b.post:b)?f.isApproved:f,{name:"if_any",hash:{},fn:a.program(255,e,0),inverse:a.program(260,e,0),data:e}))?f:"")+'</div>\n\n<header>\n<div class="post-meta">\n'+a.escapeExpression(c.gettext.call(g,"This comment is awaiting moderation.",{name:"gettext",hash:{},data:e}))+"\n</div>\n\n"+(null!=(f=a.invokePartial(d.postMenu,b,{name:"postMenu",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"</header>\n</div>\n\n"+(null!=(f=a.invokePartial(d.postWrapperBottom,b,{name:"postWrapperBottom",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")},255:function(a,b,c,d,e){var f;return null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.post:b)?f.isApproved:f,{name:"if",hash:{},fn:a.program(256,e,0),inverse:a.program(258,e,0),data:e}))?f:""},256:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return"\n<p>"+g(c.gettext.call(f,"Comment score below threshold.",{name:"gettext",hash:{},data:e}))+' <a href="#" data-action="reveal">'+g(c.gettext.call(f,"Show comment.",{name:"gettext",hash:{},data:e}))+"</a></p>\n"},258:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return"\n<p>"+g(c.gettext.call(f,"Your comment is awaiting moderation.",{name:"gettext",hash:{},data:e}))+' <a href="#" data-action="reveal">'+g(c.gettext.call(f,"See your comment.",{name:"gettext",hash:{},data:e}))+'</a> <a href="https://help.disqus.com/customer/portal/articles/466223" class="help-icon" title="'+g(c.gettext.call(f,"Why?",{name:"gettext",hash:{},data:e}))+'" target="_blank"></a> </p>\n'},260:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return"<p>"+g(c.gettext.call(f,"This comment is awaiting moderation.",{name:"gettext",hash:{},data:e}))+' <a href="#" data-action="reveal">'+g(c.gettext.call(f,"Show comment.",{name:"gettext",hash:{},data:e}))+"</a></p>\n"},262:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.comments:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(263,e,0),inverse:a.program(265,e,0),data:e}))?f:""},263:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Show One New Comment",{name:"gettext",hash:{},data:e}))+"\n"},265:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Show %(comments)s New Comments",{name:"gettext",hash:{comments:null!=b?b.comments:b},data:e}))+"\n"},267:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.replies:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(268,e,0),inverse:a.program(270,e,0),data:e}))?f:""},268:function(a,b,c,d,e){return'<span class="indicator"></span>'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Show 1 new reply",{name:"gettext",hash:{},data:e}))+"\n"},270:function(a,b,c,d,e){return'<span class="indicator"></span>'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Show %(replies)s new replies",{name:"gettext",hash:{replies:null!=b?b.replies:b},data:e}))+"\n"},272:function(a,b,c,d,e){return'<!doctype html>\n<style>\nhtml * {\nmargin: 0;\npadding: 0;\ncursor: pointer;\n}\n\ndiv {\ntext-align: center;\nfont-family: "Helvetica Neue", Helvetica, sans-serif;\nborder: 2px solid #ccc;\nbackground: #f4f4f4;\ncolor: #777;\npadding: 7px 0;\nfilter: alpha(opacity=90);\nopacity: 0.9;\nfont-size: 13px;\nline-height: 1;\nz-index: 1000;\n}\n\ndiv.north {\nborder-top: 0;\nborder-radius: 0 0 4px 4px;\n}\n\ndiv.south {\nborder-bottom: 0;\nborder-radius: 4px 4px 0 0;\n}\n</style>\n<div class="'+a.escapeExpression(a.lambda(null!=b?b.orientation:b,b))+'" id="message">-</div>\n'},274:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.orientation:b,"north",{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(275,e,0),inverse:a.program(280,e,0),data:e}))?f:""},275:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.num:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(276,e,0),inverse:a.program(278,e,0),data:e}))?f:""},276:function(a,b,c,d,e){return"<p>"+a.escapeExpression(c.gettext.call(null!=b?b:{},"One new comment above.",{name:"gettext",hash:{},data:e}))+"</p>\n"},278:function(a,b,c,d,e){return"<p>"+a.escapeExpression(c.gettext.call(null!=b?b:{},"%(num)s new comments above.",{name:"gettext",hash:{num:null!=b?b.num:b},data:e}))+"</p>\n"},280:function(a,b,c,d,e){var f,g=null!=b?b:{};return null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.num:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(281,e,0),inverse:a.program(283,e,0),data:e}))?f:""},281:function(a,b,c,d,e){return"<p>"+a.escapeExpression(c.gettext.call(null!=b?b:{},"One new comment below.",{name:"gettext",hash:{},data:e}))+"</p>\n"},283:function(a,b,c,d,e){return"<p>"+a.escapeExpression(c.gettext.call(null!=b?b:{},"%(num)s new comments below.",{name:"gettext",hash:{num:null!=b?b.num:b},data:e}))+"</p>\n"},285:function(a,b,c,d,e){return'<ul class="suggestions">\n<li class="header">\n<h5>'+a.escapeExpression(c.gettext.call(null!=b?b:{},"in this conversation",{name:"gettext",hash:{},data:e}))+"</h5>\n</li>\n</ul>\n"},287:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<li data-cid="'+h(g(null!=b?b.cid:b,b))+'">\n<img src="'+h(g(null!=(f=null!=b?b.avatar:b)?f.cache:f,b))+'" class="avatar" alt="'+h(c.gettext.call(i,"Avatar",{name:"gettext",hash:{},data:e}))+'">\n<span>'+h(c.any.call(i,null!=b?b.name:b,null!=b?b.username:b,{name:"any",hash:{},data:e}))+"</span>\n</li>\n"},289:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<div>\n<div class="avatar">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.author:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(290,e,0),inverse:a.program(292,e,0),data:e}))?f:"")+"</div>\n\n<div>\n<p>\n<strong>\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.author:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(294,e,0),inverse:a.program(296,e,0),data:e}))?f:"")+"</strong>\n&mdash; "+a.escapeExpression(c.html.call(g,null!=b?b.message:b,{name:"html",hash:{},data:e}))+"\n</p>\n</div>\n</div>\n"},290:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=b?b.author:b)?f.profileUrl:f,b))+'" class="user" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.author:b)?f.username:f,b))+'">\n<img data-src="'+h(g(null!=(f=null!=(f=null!=b?b.author:b)?f.avatar:f)?f.cache:f,b))+'" alt="'+h(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/>\n</a>\n'},292:function(a,b,c,d,e){var f,g=a.escapeExpression;return'<div class="user">\n<img data-src="'+g(a.lambda(null!=(f=null!=(f=null!=b?b.author:b)?f.avatar:f)?f.cache:f,b))+'" class="user" alt="'+g(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/>\n</div>\n'},294:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=b?b.author:b)?f.profileUrl:f,b))+'" class="user" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.author:b)?f.username:f,b))+'">\n'+h(c.any.call(null!=b?b:{},null!=(f=null!=b?b.author:b)?f.name:f,null!=(f=null!=b?b.author:b)?f.username:f,{name:"any",hash:{},data:e}))+"</a>\n"},296:function(a,b,c,d,e){var f;return'<span class="user">'+a.escapeExpression(c.any.call(null!=b?b:{},null!=(f=null!=b?b.author:b)?f.name:f,null!=(f=null!=b?b.author:b)?f.username:f,{name:"any",hash:{},data:e}))+"</span>\n"},298:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<li class="top-user">\n<div class="avatar">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(299,e,0),inverse:a.program(301,e,0),data:e}))?f:"")+'</div>\n\n<div class="profile-card-text">\n<h5>\n<span>\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(303,e,0),inverse:a.program(305,e,0),data:e}))?f:"")+'</span>\n</h5>\n\n<span class="post-count">\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=(f=null!=b?b.user:b)?f.numPosts:f,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(106,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,c.ge.call(g,null!=(f=null!=b?b.user:b)?f.numPosts:f,2,{name:"ge",hash:{},data:e}),{name:"if",hash:{},fn:a.program(108,e,0),inverse:a.noop,data:e}))?f:"")+"</span>\n\n"+(null!=(f=a.invokePartial(d.followButtonSmall,b,{name:"followButtonSmall",data:e,helpers:c,partials:d,decorators:a.decorators}))?f:"")+"\n</div>\n</li>\n"},299:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="#" class="user" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">\n<img data-role="user-avatar" data-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'" data-src="'+h(g(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" alt="'+h(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/>\n</a>\n'},301:function(a,b,c,d,e){var f,g=a.escapeExpression;return'<div class="user">\n<img data-src="'+g(a.lambda(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" class="user" alt="'+g(c.gettext.call(null!=b?b:{},"Avatar",{name:"gettext",hash:{},data:e}))+'"/>\n</div>\n'},303:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression;return'<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'" data-role="username">\n'+h(c.any.call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.name:f,null!=(f=null!=b?b.user:b)?f.username:f,{name:"any",hash:{},data:e}))+"</a>\n"},305:function(a,b,c,d,e){var f;return a.escapeExpression(c.any.call(null!=b?b:{},null!=(f=null!=b?b.author:b)?f.name:f,null!=(f=null!=b?b.author:b)?f.username:f,{name:"any",hash:{},data:e}))+"\n"},307:function(a,b,c,d,e){
  8. var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<li data-role="thread-'+h(g(null!=b?b.id:b,b))+'">\n\n\n<h4><span class="publisher-anchor-color"><a class="outbound-link" target="_blank" href="'+h(g(null!=b?b.url:b,b))+'">'+h(c.html.call(i,null!=b?b.title:b,{name:"html",hash:{},data:e}))+'<i aria-hidden="true" class="icon-expand"></i></a></span></h4>\n\n<ul class="meta">\n<li class="likes">\n<a href="'+h(g(null!=b?b.url:b,b))+'">\n<span class="icon-star"></span>\n'+h(c.gettext.call(i,"%(numLikes)s starred this",{name:"gettext",hash:{numLikes:null!=b?b.numLikes:b},data:e}))+"\n</a>\n</li>\n\n"+(null!=(f=c["if"].call(i,c.gt.call(i,null!=b?b.numPosts:b,0,{name:"gt",hash:{},data:e}),{name:"if",hash:{},fn:a.program(308,e,0),inverse:a.noop,data:e}))?f:"")+'\n<li class="bullet">•</li>\n\n<li class="time">'+h(g(null!=b?b.timeAgo:b,b))+'</li>\n</ul>\n\n<div class="top-thread-post" data-role="top-thread-post">\n</div>\n</li>\n'},308:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<li class="bullet">•</li>\n\n<li class="comments">\n<a href="'+a.escapeExpression(a.lambda(null!=b?b.url:b,b))+'">\n'+(null!=(f=c["if"].call(g,c.eq.call(g,null!=b?b.numPosts:b,1,{name:"eq",hash:{},data:e}),{name:"if",hash:{},fn:a.program(106,e,0),inverse:a.program(309,e,0),data:e}))?f:"")+"</a>\n</li>\n"},309:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"%(numPosts)s comments",{name:"gettext",hash:{numPosts:null!=b?b.numPosts:b},data:e}))+"\n"},311:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.user:b)?f.thread:f)?f.canReply:f,{name:"if",hash:{},fn:a.program(312,e,0),inverse:a.noop,data:e}))?f:"")+'<ul class="dropdown-menu">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(317,e,0),inverse:a.program(320,e,0),data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=(f=null!=b?b.user:b)?f.thread:f)?f.canModerate:f,{name:"if",hash:{},fn:a.program(323,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.user:b)?f.isGlobalAdmin:f,{name:"if",hash:{},fn:a.program(330,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.if_all.call(g,null!=(f=null!=b?b.user:b)?f.isRegistered:f,null!=(f=null!=(f=null!=b?b.user:b)?f.thread:f)?f.canReply:f,{name:"if_all",hash:{},fn:a.program(332,e,0),inverse:a.noop,data:e}))?f:"")+"</ul>\n"},312:function(a,b,c,d,e){var f;return'<a href="#" class="dropdown-toggle" data-toggle="dropdown">\n<span class="dropdown-toggle-wrapper">\n\n'+(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.user:b)?f.isRegistered:f,{name:"if",hash:{},fn:a.program(313,e,0),inverse:a.program(315,e,0),data:e}))?f:"")+'\n</span> <span class="caret"></span>\n</a>\n'},313:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<span class="avatar">\n<img data-role="user-avatar" data-user="'+h(g(null!=(f=null!=b?b.user:b)?f.id:f,b))+'" data-src="'+h(g(null!=(f=null!=(f=null!=b?b.user:b)?f.avatar:f)?f.cache:f,b))+'" alt="'+h(c.gettext.call(i,"Avatar",{name:"gettext",hash:{},data:e}))+'">\n</span>\n<span class="username" data-role="username" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">\n'+h(c.any.call(i,null!=(f=null!=b?b.user:b)?f.name:f,null!=(f=null!=b?b.user:b)?f.username:f,{name:"any",hash:{},data:e}))+"\n</span>\n"},315:function(a,b,c,d,e){return"<span>\n"+a.escapeExpression(c.gettext.call(null!=b?b:{},"Login",{name:"gettext",hash:{},data:e}))+"\n</span>\n"},317:function(a,b,c,d,e){var f,g=a.lambda,h=a.escapeExpression,i=null!=b?b:{};return'<li>\n<a href="'+h(g(null!=(f=null!=b?b.user:b)?f.profileUrl:f,b))+'" data-role="user-profile-link" data-action="profile" data-username="'+h(g(null!=(f=null!=b?b.user:b)?f.username:f,b))+'">\n'+h(c.gettext.call(i,"Your Profile",{name:"gettext",hash:{},data:e}))+'\n</a>\n</li>\n<li>\n<a href="#" class="media-toggle-on" data-action="toggle-media">'+h(c.gettext.call(i,"Display Media",{name:"gettext",hash:{},data:e}))+'</a>\n<a href="#" class="media-toggle-off" data-action="toggle-media">'+h(c.gettext.call(i,"Hide Media",{name:"gettext",hash:{},data:e}))+"</a>\n</li>\n"+(null!=(f=c.unless.call(i,null!=(f=null!=b?b.user:b)?f.remote:f,{name:"unless",hash:{},fn:a.program(318,e,0),inverse:a.noop,data:e}))?f:"")},318:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<li>\n<a href="'+g(c.urlfor.call(f,"editProfile",{name:"urlfor",hash:{},data:e}))+'">'+g(c.gettext.call(f,"Edit Settings",{name:"gettext",hash:{},data:e}))+"</a>\n</li>\n"},320:function(a,b,c,d,e){var f;return"\n"+(null!=(f=c["if"].call(null!=b?b:{},null!=(f=null!=b?b.sso:b)?f.url:f,{name:"if",hash:{},fn:a.program(321,e,0),inverse:a.noop,data:e}))?f:"")+'\n<li>\n<a href="#" data-action="auth:disqus">Disqus</a>\n</li>\n<li>\n<a href="#" data-action="auth:facebook">Facebook</a>\n</li>\n<li>\n<a href="#" data-action="auth:twitter">Twitter</a>\n</li>\n<li>\n<a href="#" data-action="auth:google">Google</a>\n</li>\n'},321:function(a,b,c,d,e){var f;return'<li class="sso">\n<a href="#" data-action="auth:sso">'+a.escapeExpression(a.lambda(null!=(f=null!=b?b.sso:b)?f.name:f,b))+"</a>\n</li>\n"},323:function(a,b,c,d,e){var f,g=null!=b?b:{};return'<li data-role="toggle-thread">\n<a href="#" data-action="toggle-thread">\n'+(null!=(f=c["if"].call(g,null!=(f=null!=b?b.thread:b)?f.isClosed:f,{name:"if",hash:{},fn:a.program(324,e,0),inverse:a.program(326,e,0),data:e}))?f:"")+"</a>\n</li>\n\n"+(null!=(f=c.unless.call(g,null!=(f=null!=b?b.user:b)?f.isGlobalAdmin:f,{name:"unless",hash:{},fn:a.program(328,e,0),inverse:a.noop,data:e}))?f:"")+"\n"},324:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Open Thread",{name:"gettext",hash:{},data:e}))+"\n"},326:function(a,b,c,d,e){return a.escapeExpression(c.gettext.call(null!=b?b:{},"Close Thread",{name:"gettext",hash:{},data:e}))+"\n"},328:function(a,b,c,d,e){return'<li>\n<a href="https://docs.disqus.com/kb/2012/">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Help",{name:"gettext",hash:{},data:e}))+"</a>\n</li>\n"},330:function(a,b,c,d,e){var f=null!=b?b:{},g=a.escapeExpression;return'<li>\n<a href="#" data-action="debug">'+g(c.gettext.call(f,"Debug",{name:"gettext",hash:{},data:e}))+'</a>\n</li>\n\n<li>\n<a href="#" data-action="repair">'+g(c.gettext.call(f,"Repair",{name:"gettext",hash:{},data:e}))+"</a>\n</li>\n"},332:function(a,b,c,d,e){return'<li>\n<a href="#" data-action="logout">'+a.escapeExpression(c.gettext.call(null!=b?b:{},"Logout",{name:"gettext",hash:{},data:e}))+"</a>\n</li>\n"},compiler:[7,">= 4.0.0"],main:function(a,b,c,d,e){var f,g=null!=b?b:{};return(null!=(f=c.partial.call(g,"followButton",{name:"partial",hash:{},fn:a.program(1,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"anonDownvoteCard",{name:"partial",hash:{},fn:a.program(11,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"anonUpvoteCard",{name:"partial",hash:{},fn:a.program(13,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"blacklist",{name:"partial",hash:{},fn:a.program(15,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"blacklistErrorMessage",{name:"partial",hash:{},fn:a.program(22,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"communityForum",{name:"partial",hash:{},fn:a.program(24,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"contextCard",{name:"partial",hash:{},fn:a.program(26,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"edit",{name:"partial",hash:{},fn:a.program(37,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"emailVerifyAlert",{name:"partial",hash:{},fn:a.program(39,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"followButtonSmall",{name:"partial",hash:{},fn:a.program(41,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"formUser",{name:"partial",hash:{},fn:a.program(54,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"form",{name:"partial",hash:{},fn:a.program(56,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"loginForm",{name:"partial",hash:{},fn:a.program(68,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"loginButtons",{name:"partial",hash:{},fn:a.program(73,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"guestForm",{name:"partial",hash:{},fn:a.program(83,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"audienceSync",{name:"partial",hash:{},fn:a.program(94,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"highlightedPost",{name:"partial",hash:{},fn:a.program(96,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"hovercard",{name:"partial",hash:{},fn:a.program(98,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"hovercardCounters",{name:"partial",hash:{},fn:a.program(105,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"hovercardActions",{name:"partial",hash:{},fn:a.program(114,e,0),inverse:a.noop,data:e}))?f:"")+"\n\n"+(null!=(f=c.partial.call(g,"layout",{name:"partial",hash:{},fn:a.program(117,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postSort",{name:"partial",hash:{},fn:a.program(122,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postCount",{name:"partial",hash:{},fn:a.program(131,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"topNavigation",{name:"partial",hash:{},fn:a.program(134,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"threadVotes",{name:"partial",hash:{},fn:a.program(141,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"secondaryNavigation",{name:"partial",hash:{},fn:a.program(154,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"threadShareMenu",{name:"partial",hash:{},fn:a.program(157,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"notificationMenu",{name:"partial",hash:{},fn:a.program(159,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"onboard",{name:"partial",hash:{},fn:a.program(161,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"post",{name:"partial",hash:{},fn:a.program(164,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postWrapperTop",{name:"partial",hash:{},fn:a.program(189,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postWrapperBottom",{name:"partial",hash:{},fn:a.program(196,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postVotes",{name:"partial",hash:{},fn:a.program(198,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postMenu",{name:"partial",hash:{},fn:a.program(203,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postFooter",{name:"partial",hash:{},fn:a.program(226,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postUserAvatar",{name:"partial",hash:{},fn:a.program(240,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"highlightedSuccessMessage",{name:"partial",hash:{},fn:a.program(248,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postBlocked",{name:"partial",hash:{},fn:a.program(250,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postDeleted",{name:"partial",hash:{},fn:a.program(252,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"postMinimized",{name:"partial",hash:{},fn:a.program(254,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"realtimeCommentNotification",{name:"partial",hash:{},fn:a.program(262,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"realtimeReplyNotification",{name:"partial",hash:{},fn:a.program(267,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"realtimeIndicator",{name:"partial",hash:{},fn:a.program(272,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"realtimeIndicatorText",{name:"partial",hash:{},fn:a.program(274,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"suggestions",{name:"partial",hash:{},fn:a.program(285,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"suggestedUser",{name:"partial",hash:{},fn:a.program(287,e,0),inverse:a.noop,data:e}))?f:"")+"\n\n"+(null!=(f=c.partial.call(g,"topThreadPost",{name:"partial",hash:{},fn:a.program(289,e,0),inverse:a.noop,data:e}))?f:"")+"\n\n"+(null!=(f=c.partial.call(g,"topUser",{name:"partial",hash:{},fn:a.program(298,e,0),inverse:a.noop,data:e}))?f:"")+"\n\n"+(null!=(f=c.partial.call(g,"topThread",{name:"partial",hash:{},fn:a.program(307,e,0),inverse:a.noop,data:e}))?f:"")+"\n"+(null!=(f=c.partial.call(g,"userMenu",{name:"partial",hash:{},fn:a.program(311,e,0),inverse:a.noop,data:e}))?f:"")},usePartial:!0,useData:!0})}),define("lounge/views",["jquery","underscore","backbone","loglevel","stance","moment","core/analytics/identity","core/api","core/UniqueModel","core/mixins/withAlert","core/models/ThreadVote","core/models/Vote","remote/config","common/models","common/utils","core/bus","core/strings","common/urls","core/analytics/jester","common/views/mixins","common/Session","common/templates","common/keys","core/utils","core/utils/isIframed","core/utils/html/toRGBColorString","core/WindowBus","common/outboundlinkhandler","core/mixins/withEmailVerifyLink","shared/urls","lounge/common","lounge/menu-handler","lounge/mixins","lounge/realtime","lounge/views/posts/PostReplyView","lounge/views/posts/collection","lounge/views/media","lounge/views/onboard-alert","lounge/views/notification-menu","lounge/views/highlighted-post","lounge/views/realtime","lounge/views/posts/UserSuggestionsManager","lounge/views/viglink","lounge/views/sidebar","lounge/views/recommend-button","lounge/tracking","templates/lounge","common/main","common/collections/profile"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V){"use strict";var W=window.document,X=q.get,Y=x.preventDefaultHandler,Z=new A,$=c.View.extend({events:{"click [data-action=subscribe]":"subscribe","keydown #thread-subscribe-email":"subscribeKeypress"},initialize:function(a){this.thread=a.thread,this.session=a.session,this.listenTo(this.thread,"change:userSubscription",this.updateStatus),this.updateStatus(),this._boundDocumentClickHandler=b.bind(this._documentClickHandler,this)},updateStatus:function(){this.thread.get("userSubscription")?this.$el.addClass("subscribed"):this.$el.removeClass("subscribed")},subscribe:Y(function(){var a=this.thread.get("userSubscription");this.session.isLoggedOut()&&!a?this.showForm():this.thread.subscribe(!a)}),showForm:function(){var c=this;this._unbindDocumentClickHandler(),b.defer(function(){a(W.body).on("click",c._boundDocumentClickHandler)}),c.$el.addClass("show-form").find("input")[0].focus()},_documentClickHandler:function(a){"thread-subscribe-email"!==a.target.id&&this.hideForm()},_unbindDocumentClickHandler:function(){a(W.body).off("click",this._boundDocumentClickHandler)},hideForm:function(){this._unbindDocumentClickHandler(),this.$el.removeClass("show-form").find("input")[0].blur()},subscribeKeypress:function(a){var b=this.$el.find("input");if(b.removeClass("alert error"),"Esc"===a.key||27===a.keyCode)return void this.hideForm();if("Enter"===a.key||13===a.keyCode){var c=a.target.value;if(!x.validateEmail(c))return void b.addClass("alert error");this.hideForm(),this.thread.subscribe(!0,c)}}}),_=c.View.extend({topEdgeOffset:function(){return-E.getLounge().getPosition().height},initialize:function(a){this.options=a,this.hasLoaded=null,this.listenToOnce(e(this),"enter",this.loadImage)},loadImage:function(){var a=this;if(!a.hasLoaded){var b=function(b){return function(){a.trigger(b),a.$el.off(".deferredMediaView"),a.relatedPost&&E.getLounge().postsView.onDeferredViewReady(a.relatedPost)}};a.$el.on("load.deferredMediaView",b("load")),a.$el.on("error.deferredMediaView",b("error")),a.$el.attr("src",a.options.url),a.hasLoaded=!0}}}),aa=c.View.extend({tagName:"ul",className:"debug",initialize:function(a){this.values=a},render:function(){return this.$el.html(b.reduce(this.values,function(a,b,c){return a+"<li><strong>"+c+"</strong>: "+b+"</li>"},"")),this}}),ba=c.View.extend({initialize:function(a){b.extend(this,a),this.listenTo(this.session,"change:id",this.render),this.listenTo(K.settings,"change:collapsed",this.onMediaCollapseChange)},render:function(){var a=v.render("userMenu",{user:this.session.toJSON(),thread:this.thread.toJSON(),feedbackUrl:this.getSurveyMonkeyUrl(),sso:this.session.get("sso")});return this.$el.html(a),this.onMediaCollapseChange(),this},onMediaCollapseChange:function(){K.settings.get("collapsed")?this.$el.addClass("media-collapsed"):this.$el.removeClass("media-collapsed")},getSurveyMonkeyUrl:function(){var a,b="https://www.surveymonkey.com/s/5RBPTTZ",c=this.referrerUrl,d=this.session.user.id;a=d?[d,c]:[c];var e="?c="+encodeURIComponent(a.join(";"));return b+e}}),ca=c.View.extend({events:{"click [data-action=share\\:twitter]":"_onShare","click [data-action=share\\:facebook]":"_onShare"},_onShare:Y(function(a){var b=o.extractService(a.target,"share");b&&this.sharers[b]&&(E.getLounge().trigger("uiAction:threadShare",b),this.share(b))}),render:function(){return this.$el.html(v.render("threadShareMenu")),this}});b.extend(ca.prototype,G.ShareMixin);var da=c.View.extend({events:{"click [data-action^=auth\\:]":"handleAuth","click [data-action=logout]":"handleLogout","click [data-action=audiencesync]":"audienceSync","click [data-action=profile]":"handleShowProfile","click [data-action=community-sidebar]":"handleShowCommunitySidebar","click [data-action=sort]":"handleSort","click [data-action=toggle-thread]":"toggleThread","click [data-action=debug]":"renderDebugInfo","click [data-action=repair]":"repairThread","click [data-action=toggle-media]":"toggleMedia","click a":"handleLinkClick"},initialize:function(c){E.setLounge(this),c=c||{};var d=c.jsonData||{};this.language=W.documentElement.lang,this.initialData=d.response||{},this.cleanInitialData(this.initialData),this.onboardWindowName=o.globalUniqueId("disqus_"),this.initialData.forum&&this.initialData.forum.id&&(r.moderate=o.updateURL(r.moderate,{hostname:this.initialData.forum.id+"."})),this.deferredViews=[],this.unsortedDeferredViews=[],u.setDefaults(this.initialData.session),this.session=u.get(),this.forum=new n.Forum,this.forum.set(this.initialData.forum),this.thread=new n.Thread(this.initialData.thread,{forum:this.forum,postCursor:d.cursor,moderators:(this.initialData.thread||{}).moderators,order:d.order}),this.initUserSuggestionsManager(),this.postsView=new J.PostCollectionView({posts:this.thread.posts,thread:this.thread,lounge:this,session:this.session,el:this.el,userSuggestions:this.userSuggestions}),this.states={realtimeIndicatorsCreated:!1,streamingPaused:!1,discoveryLoaded:!1,inViewport:!1},V.timings.loungeStart=a.now();var e=b.bind(this.bootstrap,this);y(window)?this.listenTo(p.frame,"init",e):b.defer(e),this.setAlertSelector("#layout"),this.initResizeHandler(),this.initAlertListeners()},cleanInitialData:function(a){var c=a.thread&&a.thread.highlightedPost;c&&(c.isHighlighted=!0),b.each(a.posts,function(a){c?a.isHighlighted=a.id===c.id:a.isHighlighted=!1})},initAlertListeners:function(){this.listenTo(this.session,"alert",this.alert)},initOnboardAlert:function(){var a=this.onboardAlert=new L.OnboardAlert({session:this.session,forum:this.forum});this.proxyViewEvents(this.onboardAlert),this.listenTo(this.session,"change:id",function(){a.setInitialCookie(),a.render().$el.appendTo("#onboard")})},bootstrap:function(c){var d,e=this,f={};e.config=c=c||o.getConfigFromHash(window),c.discovery||(c.discovery={}),c.experiment||(c.experiment={}),c.apiKey&&(f["X-Disqus-Publisher-API-Key"]=c.apiKey),c.remoteAuthS3&&(f["X-Disqus-Remote-Auth"]=c.remoteAuthS3),b.isEmpty(f)||h.headers(f),e.isForceHttpsAPIEnabled()&&h.defaults({secure:!0}),c.anchorColor&&(d=z(c.anchorColor),o.addStylesheetRules([[".publisher-anchor-color a",["color",d,!0]],["a.publisher-anchor-color",["color",d,!0]],[".publisher-anchor-hover a:hover",["color",d,!0]],["a.publisher-anchor-hover:hover",["color",d,!0]],[".active .publisher-nav-color:after",["background",d,!0]],[".media-preview .active.publisher-border-color",["border-color",d,!0]],[".publisher-color",["color",d,!1]],[".publisher-color:hover",["color",d,!1]],[".publisher-background-color",["background-color",d,!1]],[".publisher-border-color",["border-color",d,!1]]])),c.impressionId&&g.impression.setImpressionId(c.impressionId),o.injectBaseElement(),c.referrer&&(e.thread.currentUrl=c.referrer);var i=this.getPermalinkOptions(c.parentWindowHash);i&&p.frame.once("embed.rendered",b.bind(e.scrollToPost,e,i.postId,i.options)),c.sso&&e.session.set("sso",c.sso),c.initialPosition?e.position=c.initialPosition:e.position=o.calculatePositionFullscreen(),e.updateModeratorText(),e.initUI(),e.bindBusListeners(),e.initHighlightedPost(),e.loadDiscovery();var j=V.timings;j.hostStart=c.timestamp||j.initStart,j.embedLoadTime=c.embedLoadTime,e.listenToOnce(e.postsView,"render:start",function(){j.renderStart=a.now()}),e.listenToOnce(e.postsView,"render:end",e.sendTelemetry),j.bootstrapStart=a.now(),e.postsView.bootstrap(e.initialData,i),e.initAfterPostCreateHandler(),e.initSession(),e.initLinkHandler(),e.initialized=!0,e.trigger("bootstrap:complete",e)},_isInHome:function(a,b){var c=/^(?:https?:)?\/\/(?:www.)?/;return a=a.replace(c,""),b=b.replace(c,""),0===a.indexOf(b)},isInHome:function(){var a=this.config.referrer;if(a)return this._isInHome(a,D.apps.home+"home/")},initSession:function(){var a=this.config;this.session.start({remoteAuthS3:a.remoteAuthS3,sso:a.sso,apiKey:a.apiKey,thread:this.thread}),this.session.shouldFetchSession()?this.session.fetch():this.session.setUser(this.session.getAnonUserInstance())},initAfterPostCreateHandler:function(){this.listenTo(this.thread,"create",function(a){var c=a.toJSON();p.frame.sendHostMessage("posts.create",c),Z.broadcast("posts.create",b.pick(c,"forum","parent","id"))})},isForceHttpsAPIEnabled:function(){var a=m.lounge;return"withCredentials"in new window.XMLHttpRequest&&a&&(b.random(0,100)<100*a.force_https_sample_rate||a.force_https_enabled_forums&&a.force_https_enabled_forums.hasOwnProperty(this.forum.id))},sendTelemetry:function(){if(o.shouldSample(m.lounge.telemetry_sample_percent)){var c=a.now(),d=V.timings,e={embed:d.embedLoadTime,frame:d.initStart-d.hostStart,asset:d.downloadEnd-d.initStart,render:c-d.renderStart,total:c-d.hostStart-(d.renderStart-d.bootstrapStart)},f=window.performance;if(f){var g=f.timing;g.responseStart&&(e.frame_rtt=g.responseStart-g.navigationStart);var h=b.find(f.getEntries&&f.getEntries()||[],function(a){return a.name.indexOf("/next/config.js")>-1});h&&h.responseStart&&(e.config_rtt=h.responseStart-h.startTime)}var i="lounge_"+("static"===this.config.experiment.service?"static":"dynamic");return s.telemetry(i,e)}},initUI:function(){this.applyPublisherClasses(),U(),this.renderLayout(),this.setAlertSelector("#global-alert"),this.bindUIUpdateHandlers(),this.initDeferredViews(),this.postsView.once("render:end",function(){var a=o.getPageHeight();p.frame.sendHostMessage("rendered",{height:a}),this._lastHeight=a,this.initRealtime()},this),b.defer(b.bind(this.initUIComponents,this))},initUIComponents:function(){this.initMainPostBox(),this.updatePostCount(),this.isInHome()||(this.initUserMenu(),this.initOnboardAlert(),this.initNotificationMenu(),this.initRecommendButton(),this.initThreadShareMenu()),this.initThreadSubscribe(),this.bindProfileUIListeners(this.session)},initHighlightedPost:function(){var b=this.thread.get("highlightedPost");b&&this.thread.posts.add(b),this.highlightedPostView=new N.HighlightedPostView({el:a("#highlighted-post"),thread:this.thread,session:this.session,userSuggestions:this.userSuggestions}),this.highlightedPostView.reset()},bindUIUpdateHandlers:function(){var a=this,b=a.thread,c=a.session;a.listenTo(b,{"change:posts":a.updatePostCount}),a.listenTo(b.queue,"add reset",a.toggleRealtimeNotifications),a.postsView.bindUIUpdateHandlers(),a.listenTo(c,"change:id",a.updateThreadSessionData),a.listenTo(a,"scrollOffViewport",function(){this.states.realtimeIndicatorsCreated&&p.frame.sendHostMessage("indicator:hide")}),a.listenTo(a,"scroll",function(a){this.position=a}),a.listenTo(a,"scroll",a.handleRealtimeScroll),a.listenTo(a.postsView,"render:end",a.toggleRealtimeNotifications)},relayScrollToStance:function(a){e.scroll({top:a.pageOffset-a.frameOffset.top,height:a.height})},initDeferredViews:function(){this.listenTo(this,"scroll",this.createDeferredViewsForImages),this.listenTo(this,"domReflow",function(){e.invalidate(),this.position&&(this.createDeferredViewsForImages(),this.relayScrollToStance(this.position))})},bindBusListeners:function(){this.listenTo(p.frame,{"window.hashchange":function(a){var b=this.getPermalinkOptions(a);b&&this.scrollToPost(b.postId,b.options)},"window.scroll":function(a){this.trigger("scroll",a),this.relayScrollToStance(a)},"window.inViewport":function(){this.states.inViewport=!0,this.trigger("inViewport")},"window.scrollOffViewport":function(){this.states.inViewport=!1,this.trigger("scrollOffViewport")},"window.resize":this.resize,"indicator:click":this.handleRealtimeClick}),this.listenToOnce(this.session,"change:id",this.initSidebar)},isLinkAffiliatorEnabled:function(){return this.forum.get("settings").linkAffiliationEnabled&&!this.isInHome()},initLinkHandler:function(){this.outboundLinkHandler=new B,this.outboundLinkHandler.registerBeforeNavigationHandler(this.logLinkClick,this),this.isLinkAffiliatorEnabled()&&!this.initLinkAffiliatorCalled&&(this.viglink=new Q({forumPk:this.forum.get("pk"),linkAffiliatorClient:r.linkAffiliatorClient,linkAffiliatorAPI:r.linkAffiliatorAPI,viglinkAPI:w.viglinkAPI}),this.listenTo(p.frame,"viglink:change:timeout",function(a){this.outboundLinkHandler.timeout=a.timeout}),this.initLinkAffiliatorCalled=!0,this.outboundLinkHandler.registerBeforeNavigationHandler(this.viglink.fetchAffiliateLink,this.viglink))},handleLinkClick:function(a){this.outboundLinkHandler.handleClick(a)},initRealtimeIndicators:function(){if(!this.states.realtimeIndicatorsCreated){var a={contents:v.render("realtimeIndicator",{orientation:"north"})},b={contents:v.render("realtimeIndicator",{orientation:"south"})};p.frame.sendHostMessage("indicator:init",{north:a,south:b}),this.states.realtimeIndicatorsCreated=!0}},insertStreamingComments:b.throttle(function(){var a=this.thread.queue;a.drain(),b.each(a.counters.replies,function(b,c){a.drain(c)})},1e3),updateModeratorText:function(){var a=this.forum.get("settings");a.moderatorText&&(q.translations.Mod=a.moderatorText)},logLinkClick:function(b){var c=a(b.currentTarget);if(o.clickShouldBeLogged(b,c))return s.client.emit({verb:"click",object_type:"link",object_id:c[0].href,area:T.getEventTrackingArea(b)})},handleRealtimeScroll:function(a){if(this.states.inViewport&&this.states.realtimeIndicatorsCreated){var c=b.union([this.queueView],b.values(this.postsView.subViews)),d=0,e=0;b.each(c,function(b){if(b&&!b.getDirection&&(b=b.queueView),b&&!(b.options.count<=0)){var c=b.getDirection(a);1===c?d+=b.options.count:-1===c&&(e+=b.options.count)}});var f,g;g={type:"north"},d>0?(f="indicator:show",g.content=v.render("realtimeIndicatorText",{num:d,orientation:"north"})):f="indicator:hide",p.frame.sendHostMessage(f,g),g={type:"south"},e>0?(g.content=v.render("realtimeIndicatorText",{num:e,orientation:"south"}),f="indicator:show"):f="indicator:hide",p.frame.sendHostMessage(f,g)}},handleRealtimeClick:function(a){var c=this;p.frame.sendHostMessage("indicator:hide",{type:a});var d,e,f,g=b.union([c],b.toArray(c.postsView.subViews));g=b.filter(g,function(b){if(b=b.queueView,!b||b.options.count<=0)return!1;var d="north"===a?1:-1;return b.getDirection(c.position)!==d?!1:!0}),g=b.sortBy(g,function(a){return a===c?0:a.offset.top}),d="north"===a?b.last(g):b.first(g),e=d.queueView,d===c?(f=0,e.handleDrain()):(f=d.offset.top-100,e.handleDrain()),E.getLounge().once("domReflow",b.bind(p.frame.sendHostMessage,p.frame,"scrollTo",{top:f}))},toggleRealtimeNotifications:function(){var c=this,d=c.thread.queue;if(b.defer(function(){p.frame.sendHostMessage("fakeScroll")}),!d.length)return void a("[data-role=realtime-notification]").hide();if(c.thread.get("hasStreaming"))return void c.insertStreamingComments();if(d.counters.comments){var e=c.queueView||new O.QueuedPostView({model:c.thread,el:c.$el.find("button[data-role=realtime-notification]")});c.queueView=e,e.setCount(d.counters.comments),e.render()}b.each(d.counters.replies,function(a,b){var d=c.thread.posts.get(b);if(d){var e=c.postsView.getPostView(d.cid);if(e){var f=e.queueView;f||(f=new O.QueuedReplyView({thread:c.thread,postView:e,model:d,el:e.$el.find("[data-role=realtime-notification\\:"+b+"] a")}),e.queueView=f),f.setCount(a),f.render()}}})},renderDebugInfo:Y(function(){if(this.session.user.get("isGlobalAdmin")){var a=new aa({Shortname:this.thread.get("forum"),"Thread ID":this.thread.get("id"),"Thread slug":this.thread.get("slug"),"Anchor color":z(this.config.anchorColor)});a.render();var b=W.body;b.insertBefore(a.el,b.firstChild)}}),repairThread:Y(function(){this.session.user.get("isGlobalAdmin")&&h.call("internal/threads/repair.json",{method:"GET",data:{thread:this.thread.get("id")},success:b.bind(this.alert,this,"Thread repair has been queued. Refresh in a few seconds."),error:b.bind(this.alert,this,"An error occurred while repairing thread. Please try again.",{type:"error"})})}),getPermalinkOptions:function(a){var b=a&&a.match(/(comment|reply|edit)\-([0-9]+)/);if(b)return{postId:b[2],options:{highlight:!0,openReply:"reply"===b[1],openEdit:"edit"===b[1]}}},scrollToPost:function(a,c){c=c||{},c.padding=c.padding||90;var d=this,e=d.$el.find("#post-"+a);return e.length?(c.highlight&&(d.$el.find(".post-content.target").removeClass("target"),e.find(".post-content").first().addClass("target")),c.openReply&&d.postsView.openReply(a),c.openEdit&&d.postsView.openEdit(a),void p.frame.sendHostMessage("scrollTo",{top:e.offset().top-c.padding,force:c.force||null})):void n.Post.fetchContext(a,d.thread,{requestedByPermalink:!0}).done(function(){p.frame.once("embed.resized",b.bind(d.scrollToPost,d,a,c))})},updateThreadSessionData:function(a){if(a){a.get("thread")&&this.thread.set(a.get("thread"));var c=a.get("votes");c&&"object"==typeof c&&b.each(c,function(a,b){var c=this.postsView.posts.get(b);c&&c.set("userScore",a)},this)}},initSidebar:function(){this.sidebar=new R({session:this.session,forum:this.forum})},initNotificationMenu:function(){var a=this.notificationMenu=new M.NotificationMenuView({el:this.$el.find("[data-role=notification-menu]")[0],session:this.session,forum:this.forum});a.render()},initUserMenu:function(){var a=this.userMenu=new ba({el:this.$el.find("[data-role=logout]")[0],session:this.session,thread:this.thread,referrerUrl:this.config.referrer});a.render()},initThreadShareMenu:function(){var b=this.threadShareMenu=new ca({el:a("#thread-share-menu")[0],model:this.thread});b.render()},loadDiscovery:function(){var a=this;a.config.discoveryDisabled||(!a.config.discovery||!a.config.discovery.disable_all||a.forum.get("settings").discoveryLocked&&!a.isInHome())&&(a.states.discoveryLoaded||(a.states.discoveryLoaded=!0,V.loadCss("rtl"===W.documentElement.dir?"//a.disquscdn.com/next/embed/styles/discovery_rtl.6f57ebca1d85ff1f9033753e1067f97d.css":"//a.disquscdn.com/next/embed/styles/discovery.ec9371c4ef39ecee074c2acf24d5e0e2.css"),require(["discovery/main"],function(b){a.initDiscovery(b)},function(){s.logStat("lounge.discovery.module_load_fail")})))},initDiscovery:function(a){var b=this.config.experiment||{},c=a.init(this.thread,{experiment:b.experiment,variant:b.variant,service:b.service});return c?c:void d.debug("Discovery seems not enabled. Check switches or forum settings.")},isRealtimeEnabled:function(){
  9. var a=f.unix(this.initialData.lastModified);return!this.thread.get("isClosed")&&f().diff(a,"days")<=7},realtimeHandlers:{Post:function(a){var b=a.data,c=this.thread;if(!this.thread.get("hasStreaming")||!this.states.streamingPaused){if(!b.id)return void d.warn("RT: no post ID");if(!b.author||!b.author.id)return void d.warn("RT: no author or author ID");if(!b.author.name)return void d.warn("RT: no author name or email hash");if(!b.post||!b.post.message)return void d.warn("RT: no post message");if(c.posts.get(b.id)||c.queue.get(b.id))return void d.info("RT: duplicate: ",b.id);if("approved"!==b.type)return void d.info("RT: unnaproved: ",b.id);if(b.type===b.type_prev)return void d.info("RT: Post change message, ignoring for now ",b.id);this.thread.incrementPostCount(1);var e=b.post.parent_post.id;if("0"===e&&(e=null),e&&!c.posts.get(e)&&!c.queue.get(e))return void d.info("RT: parent is not on this page: ",b.id);var f=b.author.name,g=b.author.avatar,h=b.author.id;"0"===h&&(h=void 0);var j=new i(n.User,{id:h,name:f,profileUrl:r.root+"/by/"+f+"/",isAnonymous:!h,avatar:{cache:g,permalink:g}});if(j.get("isBlocked"))return void d.info("RT: blocked: ",b.id);c.users.add(j,{merge:!0}),c.queue.add({id:b.id,user:j,parentId:e,message:b.post.message,createdAt:b.date,media:b.post.media})}},Vote:function(a){var b=a.data;if(b.id&&b.vote){var c=this.thread,e=c.posts.get(b.vote.recipient_post_id);if(e){d.debug("RT: Vote for post ",e.id);var f=e.votes.get(b.id);f||(d.debug("RT: Creating new vote with id ",b.id),f=new l({id:b.id}),e.votes.add(f));var g=e._vote(b.vote.vote,f.get("score"),b.voter);0!==g&&f.set("score",g)}}},ThreadVote:function(a){var b=a.data,c=this.thread;if(b.id&&b.vote&&(!this.session.user.id||b.vote.voter_id!==this.session.user.id)){var d=c.votes.get(b.id);if(d||(d=new k({id:b.id}),c.votes.add(d)),!d.get("currentUser")){var e=c._vote(b.vote.vote,d.get("score"));0!==e&&d.set("score",e)}}},typing:function(a){var c=a.data,d=this.thread,e=c.typing,f=c.post;if(c.thread===d.id&&f){var g=d.posts.get(f);g&&(g.usersTyping.count()<=0&&!e||g.usersTyping.add(n.TypingUser.make(b.extend({client_context:a.lastEventId},c))))}}},initRealtime:function(){var a=H.Manager;if(!a.pipe&&this.isRealtimeEnabled()){this.initRealtimeIndicators(),a.initialize("thread/"+this.thread.id,void 0,this.realtimeHandlers,this);var b=function(a){return"POST"===a.method&&!a.secure},c=0;this.listenTo(h,"call",function(d){b(d)&&(c+=1,a.pause())}),this.listenTo(h,"complete",function(d){b(d)&&(0>=c||(c-=1,c||a.resume()))})}},initRecommendButton:function(){this.recommendButton&&this.recommendButton.remove();var c=this.recommendButton=new S({thread:this.thread,session:this.session});this.listenTo(c,{"vote:like":b.bind(this.trigger,this,"uiAction:threadLike"),"vote:unlike":b.bind(this.trigger,this,"uiAction:threadUnlike")}),c.render(),a("#recommend-button").append(c.el)},initThreadSubscribe:function(){this.threadSubscribeButton=new $({session:this.session,thread:this.thread,el:a("#thread-subscribe-button")[0]})},updatePostCount:function(){var a=this.thread.get("posts");this.isInHome()||(this.$postCountContainer=this.$postCountContainer||this.$("li[data-role=post-count]"),this.$postCountContainer.html(v.render("postCount",{count:a}))),p.frame.sendHostMessage("posts.count",a)},renderLayout:function(){this.addFeatureDetectionClasses(),F.init();var b=this.isInHome(),c=this.config.experiment,d=a(v.render("layout",{thread:this.thread.toJSON(),forum:this.forum.toJSON(),order:this.thread.posts.getOrder(),inHome:b,hideFooter:b||c&&"adsapart"===c.experiment&&"force_gamma_nofooter"===c.variant}));d.appendTo(this.$el),this.postsView.renderLayout(),m.readonly&&this.alert(X("The Disqus comment system is temporarily in maintenance mode. You can still read comments during this time, however posting comments and other actions are temporarily delayed."),{type:"info"})},addFeatureDetectionClasses:function(){var b=a(W.documentElement);(this.config.forceMobile||x.isMobileUserAgent())&&b.addClass("mobile"),x.isMobileUserAgent()||b.addClass("use-opacity-transitions")},initMainPostBox:function(){if(this.dismissAlert(),this.form&&(this.form.remove(),this.form=null),this.thread.get("isClosed"))return void this.alert(X("Comments for this thread are now closed."));if(!this.session.get("canReply"))return void this.session.once("change:id",this.initMainPostBox,this);var b=this.form=new I({thread:this.thread,userSuggestions:this.userSuggestions,session:this.session});b.render(),a("#form").prepend(b.$el),b.resize()},initUserSuggestionsManager:function(){this.userSuggestions=new P,this.userSuggestions.addRemote(this.thread.users),this.listenTo(this.session,"change:id",function(){this.session.isLoggedIn()&&(this.session.user.getFollowing(),this.session.user.following.PER_PAGE=100,this.userSuggestions.addRemote(this.session.user.following))})},handleShowProfile:function(b){if(!o.willOpenNewWindow(b)){b.preventDefault();var c=a(b.currentTarget).attr("data-username");this.isInHome()?p.frame.sendHostMessage("home.open",D.apps.home+"by/"+c+"/"):this.showProfileSidebar(c)}},handleShowCommunitySidebar:function(b){if(!o.willOpenNewWindow(b)){b.preventDefault();var c=a(b.currentTarget).attr("data-forum");p.trigger("sidebar:open","home/forums/"+c+"/")}},handleSort:Y(function(b){var c=a(b.currentTarget).attr("data-sort");this.$el.find('[data-role="post-sort"]').replaceWith(v.render("postSort",{order:c})),this.thread.posts.setOrder(c),this.thread.posts.fetch({reset:!0}),p.frame.sendHostMessage("change:sort",c),this.postsView.handleSort()}),toggleThread:Y(function(){var a=this.thread.get("isClosed"),c=X(a?"An error occurred while opening the thread. Please try again.":"An error occurred while closing the thread. Please try again."),d={success:function(){window.location.reload(!0)},error:b.bind(this.alert,this,c,{type:"error"})};a?this.thread.open(d):this.thread.close(d)}),createDeferredViewsForImages:function(){a("img[data-src]").each(function(b,c){var d=a(c),e=new _({el:c,url:d.attr("data-src")});e.relatedPost=d.attr("data-post"),d.removeAttr("data-src")})},getPosition:function(){return this.position},showProfileSidebar:function(a){p.trigger("sidebar:open","by/"+a+"/")},initResizeHandler:function(){var a,b=this;if(window.MutationObserver)new window.MutationObserver(function(){a||(a=window.requestAnimationFrame(function(){a=null,b.resize()}))}).observe(W.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["class","style"]});else{var c=function d(){b.resize(),window.requestAnimationFrame(d)};window.requestAnimationFrame(c)}},resize:function(){var a=o.getPageHeight();this._lastHeight!==a&&(this._lastHeight=a,this.trigger("domReflow"),p.frame.sendHostMessage("resize",{height:a}))},handleAuth:Y(function(a){this.session.authenticate(o.extractService(a.target,"auth"))}),handleLogout:Y(function(){this.session.logout()}),audienceSync:Y(function(){this.session.audienceSync()}),toggleMedia:Y(function(){var a=K.settings,b=!a.get("collapsed");a.set("collapsed",b)})});return b.extend(da.prototype,G.ShareMixin),j.call(da.prototype),o.mixin(da,t.UiActionEventProxy),t.appliesPublisherClasses.call(da.prototype),o.mixin(da,t.ProfileHtmlHelpers),C.call(da.prototype),{Lounge:da,UserMenuView:ba,ThreadSubscribeButton:$,DeferredMediaView:_,DebugInfoView:aa}}),define("lounge/main",["jquery","core/utils/getEmbeddedData","lounge/tracking","lounge/views"],function(a,b,c,d){"use strict";return{init:function(){var e=b("threadData");if(!e)return{code:"no_thread_data"};if(e.code)return 2===e.code?"Endpoint resource not valid."===e.response&&(e.code="invalid_endpoint_resource"):15===e.code&&"Thread creations from embed disabled."===e.response&&(e.code="thread_creations_disabled"),e;a.extend(e.response,b("forumData")),a("#postCompatContainer").remove();var f=new d.Lounge({jsonData:e,el:window.document.body});c.init(f)}}}),define("lounge.bundle",function(){});