diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index c07c3a5dd..ae8a45ef3 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -121,6 +121,7 @@ class InternalApiController extends Controller return response()->json($notifications, 200, [], JSON_PRETTY_PRINT); } + // deprecated public function discover(Request $request) { $profile = Auth::user()->profile; @@ -176,6 +177,83 @@ class InternalApiController extends Controller ]; return response()->json($res, 200, [], JSON_PRETTY_PRINT); } + + public function discoverPeople(Request $request) + { + $profile = Auth::user()->profile; + $pid = $profile->id; + $following = Cache::remember('feature:discover:following:'.$pid, 60, function() use ($pid) { + return Follower::whereProfileId($pid)->pluck('following_id')->toArray(); + }); + $filters = Cache::remember("user:filter:list:$pid", 60, function() use($pid) { + return UserFilter::whereUserId($pid) + ->whereFilterableType('App\Profile') + ->whereIn('filter_type', ['mute', 'block']) + ->pluck('filterable_id')->toArray(); + }); + $following = array_merge($following, $filters); + + $people = Profile::select('id', 'name', 'username') + ->with('avatar') + ->orderByRaw('rand()') + ->whereHas('statuses') + ->whereNull('domain') + ->whereNotIn('id', $following) + ->whereIsPrivate(false) + ->take(3) + ->get(); + + $res = [ + 'people' => $people->map(function($profile) { + return [ + 'id' => $profile->id, + 'avatar' => $profile->avatarUrl(), + 'name' => $profile->name, + 'username' => $profile->username, + 'url' => $profile->url(), + ]; + }) + ]; + return response()->json($res, 200, [], JSON_PRETTY_PRINT); + } + + public function discoverPosts(Request $request) + { + $profile = Auth::user()->profile; + $pid = $profile->id; + $following = Cache::remember('feature:discover:following:'.$pid, 60, function() use ($pid) { + return Follower::whereProfileId($pid)->pluck('following_id')->toArray(); + }); + $filters = Cache::remember("user:filter:list:$pid", 60, function() use($pid) { + return UserFilter::whereUserId($pid) + ->whereFilterableType('App\Profile') + ->whereIn('filter_type', ['mute', 'block']) + ->pluck('filterable_id')->toArray(); + }); + $following = array_merge($following, $filters); + + $posts = Status::select('id', 'caption', 'profile_id') + ->whereNull('in_reply_to_id') + ->whereNull('reblog_of_id') + ->whereIsNsfw(false) + ->whereVisibility('public') + ->whereNotIn('profile_id', $following) + ->with('media') + ->orderBy('created_at', 'desc') + ->take(21) + ->get(); + + $res = [ + 'posts' => $posts->map(function($post) { + return [ + 'url' => $post->url(), + 'thumb' => $post->thumb(), + ]; + }) + ]; + return response()->json($res); + } + public function directMessage(Request $request, $profileId, $threadId) { $profile = Auth::user()->profile; diff --git a/public/js/components.js b/public/js/components.js index 83390dd02..71a2c8f6a 100644 --- a/public/js/components.js +++ b/public/js/components.js @@ -1 +1 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=2)}({"+d1y":function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("section",{staticClass:"mb-5 section-people"},[n("p",{staticClass:"lead text-muted font-weight-bold mb-0"},[t._v("Discover People")]),t._v(" "),t._m(0),t._v(" "),n("div",{staticClass:"row d-none"},t._l(t.people,function(e){return n("div",{staticClass:"col-4 p-0 p-sm-2 p-md-3"},[n("div",{staticClass:"card card-md-border-0"},[n("div",{staticClass:"card-body p-4 text-center"},[n("div",{staticClass:"avatar pb-3"},[n("a",{attrs:{href:e.url}},[n("img",{staticClass:"img-thumbnail rounded-circle",attrs:{src:e.avatar,width:"64px"}})])]),t._v(" "),n("p",{staticClass:"lead font-weight-bold mb-0 text-truncate"},[n("a",{staticClass:"text-dark",attrs:{href:e.url}},[t._v(t._s(e.username))])]),t._v(" "),n("p",{staticClass:"text-muted text-truncate"},[t._v(t._s(e.name))]),t._v(" "),n("button",{staticClass:"btn btn-primary font-weight-bold px-4 py-0",on:{click:function(n){t.followUser(e.id,n)}}},[t._v("Follow")])])])])}))]),t._v(" "),n("section",{staticClass:"mb-5 section-explore"},[n("p",{staticClass:"lead text-muted font-weight-bold mb-0"},[t._v("Explore")]),t._v(" "),n("div",{staticClass:"profile-timeline"},[t._m(1),t._v(" "),n("div",{staticClass:"row d-none"},t._l(t.posts,function(t){return n("div",{staticClass:"col-4 p-0 p-sm-2 p-md-3"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:t.url}},[n("div",{staticClass:"square filter_class"},[n("div",{staticClass:"square-content",style:{"background-image":"url("+t.thumb+")"}})])])])}))])]),t._v(" "),t._m(2)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"loader text-center"},[e("div",{staticClass:"lds-ring"},[e("div"),e("div"),e("div"),e("div")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"loader text-center"},[e("div",{staticClass:"lds-ring"},[e("div"),e("div"),e("div"),e("div")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("section",{staticClass:"mb-5"},[e("p",{staticClass:"lead text-center"},[this._v("To view more posts, check the "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/"}},[this._v("home")]),this._v(" or "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/timeline/public"}},[this._v("local")]),this._v(" timelines.")])])}]}},"/7en":function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r1&&($(".section-people .loader").hide(),$(".section-people .row.d-none").removeClass("d-none")),t.posts.length>1&&($(".section-explore .loader").hide(),$(".section-explore .row.d-none").removeClass("d-none"))})},slowTimeout:function(){setTimeout(function(){var t=$("

").addClass("font-weight-bold").text("This is taking longer than expected to load. Please try reloading the page if this does not load after 30 seconds.");$(".section-people .loader").append(t),$(".section-explore .loader").append(t)},5e3)}}}},"0mse":function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._m(0),t._v(" "),n("div",{staticClass:"postCommentsContainer d-none"},[n("p",{staticClass:"mb-1 text-center load-more-link d-none"},[n("a",{staticClass:"text-muted",attrs:{href:"#"},on:{click:t.loadMore}},[t._v("Load more comments")])]),t._v(" "),n("div",{staticClass:"comments",attrs:{"data-min-id":"0","data-max-id":"0"}},t._l(t.results,function(e,i){return n("p",{key:e.id,staticClass:"mb-1",attrs:{"data-id":e.id}},[n("span",{staticClass:"d-flex justify-content-between align-items-center"},[n("span",{staticClass:"pr-3",staticStyle:{overflow:"hidden"}},[n("div",{staticClass:"font-weight-bold pr-1"},[n("bdi",[n("a",{staticClass:"text-dark",attrs:{href:e.account.url,title:e.account.username}},[t._v(t._s(t.l(e.account.username)))])])]),t._v(" "),n("div",{staticClass:"read-more",staticStyle:{overflow:"hidden"}},[n("span",{staticClass:"comment-text",staticStyle:{overflow:"hidden"},domProps:{innerHTML:t._s(e.content)}})])]),t._v(" "),n("b-dropdown",{staticClass:"float-right",attrs:{id:e.uri,variant:"link","no-caret":"",right:""}},[n("template",{slot:"button-content"},[n("i",{staticClass:"fas fa-ellipsis-v text-muted"}),n("span",{staticClass:"sr-only"},[t._v("Options")])]),t._v(" "),n("b-dropdown-item",{staticClass:"font-weight-bold",on:{click:function(n){t.reply(e)}}},[t._v("Reply")]),t._v(" "),n("b-dropdown-item",{staticClass:"font-weight-bold",attrs:{href:e.url}},[t._v("Permalink")]),t._v(" "),n("b-dropdown-item",{staticClass:"font-weight-bold",on:{click:function(n){t.embed(e)}}},[t._v("Embed")]),t._v(" "),n("b-dropdown-item",{staticClass:"font-weight-bold",attrs:{href:e.account.url}},[t._v("Profile")]),t._v(" "),n("b-dropdown-divider"),t._v(" "),n("b-dropdown-item",{staticClass:"font-weight-bold",attrs:{href:"/i/report?type=post&id="+e.id}},[t._v("Report")]),t._v(" "),e.account.id==t.user.id?n("b-dropdown-item",{staticClass:"font-weight-bold",on:{click:function(n){t.deleteComment(e.id,i)}}},[t._v("Delete")]):t._e()],2)],1)])}))])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"postCommentsLoader text-center"},[e("div",{staticClass:"lds-ring"},[e("div"),e("div"),e("div"),e("div")])])}]}},"1/oy":function(t,e,n){var i=n("eAYY");"string"==typeof i&&(i=[[t.i,i,""]]);var r={transform:void 0};n("MTIv")(i,r);i.locals&&(t.exports=i.locals)},"162o":function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n("mypn"),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n("DuR2"))},"1MO9":function(t,e,n){(t.exports=n("FZ+f")(!1)).push([t.i,"input.form-control[type=color],input.form-control[type=range]{height:2.25rem}input.form-control.form-control-sm[type=color],input.form-control.form-control-sm[type=range]{height:1.9375rem}input.form-control.form-control-lg[type=color],input.form-control.form-control-lg[type=range]{height:3rem}input.form-control[type=color]{padding:.25rem}input.form-control.form-control-sm[type=color]{padding:.125rem}",""])},"1zu+":function(t,e,n){(t.exports=n("FZ+f")(!1)).push([t.i,"",""])},2:function(t,e,n){t.exports=n("Tkmu")},"20cu":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{tokens:[]}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getTokens()},getTokens:function(){var t=this;axios.get("/oauth/tokens").then(function(e){t.tokens=e.data})},revoke:function(t){var e=this;axios.delete("/oauth/tokens/"+t.id).then(function(t){e.getTokens()})}}}},"3G5u":function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",[n("div",{staticClass:"card card-default mb-4"},[n("div",{staticClass:"card-header font-weight-bold bg-white"},[n("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[n("span",[t._v("\n Personal Access Tokens\n ")]),t._v(" "),n("a",{staticClass:"action-link",attrs:{tabindex:"-1"},on:{click:t.showCreateTokenForm}},[t._v("\n Create New Token\n ")])])]),t._v(" "),n("div",{staticClass:"card-body"},[0===t.tokens.length?n("p",{staticClass:"mb-0"},[t._v("\n You have not created any personal access tokens.\n ")]):t._e(),t._v(" "),t.tokens.length>0?n("table",{staticClass:"table table-borderless mb-0"},[t._m(0),t._v(" "),n("tbody",t._l(t.tokens,function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link text-danger",on:{click:function(n){t.revoke(e)}}},[t._v("\n Delete\n ")])])])}))]):t._e()])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-create-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(1),t._v(" "),n("div",{staticClass:"modal-body"},[t.form.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(2),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.form.errors,function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])}))]):t._e(),t._v(" "),n("form",{attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.store(e)}}},[n("div",{staticClass:"form-group row"},[n("label",{staticClass:"col-md-4 col-form-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-6"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"form-control",attrs:{id:"create-token-name",type:"text",name:"name",autocomplete:"off"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}})])]),t._v(" "),t.scopes.length>0?n("div",{staticClass:"form-group row"},[n("label",{staticClass:"col-md-4 col-form-label"},[t._v("Scopes")]),t._v(" "),n("div",{staticClass:"col-md-6"},t._l(t.scopes,function(e){return n("div",[n("div",{staticClass:"checkbox"},[n("label",[n("input",{attrs:{type:"checkbox"},domProps:{checked:t.scopeIsAssigned(e.id)},on:{click:function(n){t.toggleScope(e.id)}}}),t._v("\n\n "+t._s(e.id)+"\n ")])])])}))]):t._e()])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-secondary font-weight-bold",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:t.store}},[t._v("\n Create\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-access-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(3),t._v(" "),n("div",{staticClass:"modal-body"},[n("p",[t._v("\n Here is your new personal access token. This is the only time it will be shown so don't lose it!\n You may now use this token to make API requests.\n ")]),t._v(" "),n("textarea",{staticClass:"form-control",attrs:{rows:"10"}},[t._v(t._s(t.accessToken))])]),t._v(" "),t._m(4)])])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Name")]),this._v(" "),e("th")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("h4",{staticClass:"modal-title"},[this._v("\n Create Token\n ")]),this._v(" "),e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"mb-0"},[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("h4",{staticClass:"modal-title"},[this._v("\n Personal Access Token\n ")]),this._v(" "),e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-footer"},[e("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[this._v("Close")])])}]}},"3H+/":function(t,e,n){var i,r;!function(o,a){i=[n("/7en"),n("h803")],void 0===(r=function(t,e){return a(o,t,e)}.apply(e,i))||(t.exports=r)}(window,function(t,e,n){var i=t.jQuery,r={};function o(t,e){var a=n.getQueryElement(t);if(a){if((t=a).infiniteScrollGUID){var s=r[t.infiniteScrollGUID];return s.option(e),s}this.element=t,this.options=n.extend({},o.defaults),this.option(e),i&&(this.$element=i(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(a||t))}o.defaults={},o.create={},o.destroy={};var a=o.prototype;n.extend(a,e.prototype);var s=0;a.create=function(){var t=this.guid=++s;if(this.element.infiniteScrollGUID=t,r[t]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath())for(var e in this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit(),o.create)o.create[e].call(this);else console.error("Disabling InfiniteScroll")},a.option=function(t){n.extend(this.options,t)},a.callOnInit=function(){var t=this.options.onInit;t&&t.call(this,this)},a.dispatchEvent=function(t,e,n){this.log(t,n);var r=e?[e].concat(n):n;if(this.emitEvent(t,r),i&&this.$element){var o=t+=".infiniteScroll";if(e){var a=i.Event(e);a.type=t,o=a}this.$element.trigger(o,n)}};var l={initialized:function(t){return"on "+t},request:function(t){return"URL: "+t},load:function(t,e){return(t.title||"")+". URL: "+e},error:function(t,e){return t+". URL: "+e},append:function(t,e,n){return n.length+" items. URL: "+e},last:function(t,e){return"URL: "+e},history:function(t,e){return"URL: "+e},pageIndex:function(t,e){return"current page determined to be: "+t+" from "+e}};a.log=function(t,e){if(this.options.debug){var n="[InfiniteScroll] "+t,i=l[t];i&&(n+=". "+i.apply(this,e)),console.log(n)}},a.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},a.updateScroller=function(){var e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:n.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e}else this.scroller=t},a.updateGetPath=function(){var t=this.options.path;if(t){var e=typeof t;if("function"!=e)"string"==e&&t.match("{{#}}")?this.updateGetPathTemplate(t):this.updateGetPathSelector(t);else this.getPath=t}else console.error("InfiniteScroll path option required. Set as: "+t)},a.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace("{{#}}","(\\d\\d?\\d?)"),n=new RegExp(e),i=location.href.match(n);i&&(this.pageIndex=parseInt(i[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var c=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return a.updateGetPathSelector=function(t){var e=document.querySelector(t);if(e){for(var n,i,r=e.getAttribute("href"),o=0;r&&o=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},n.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},n.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e})},"99Qu":function(t,e,n){var i,r;!function(o,a){i=[n("3H+/"),n("h803")],void 0===(r=function(t,e){return a(o,t,e)}.apply(e,i))||(t.exports=r)}(window,function(t,e,n){var i=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var t=this.options.scrollThreshold;(t||0===t)&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},i.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},i.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},i.bindScrollWatchEvents=function(e){var n=e?"addEventListener":"removeEventListener";this.scroller[n]("scroll",this.pageScrollHandler),t[n]("resize",this.resizeHandler)},i.onPageScroll=e.throttle(function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),i.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},i.getWindowBottomDistance=function(){return this.top+this.element.clientHeight-(t.pageYOffset+this.windowHeight)},i.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},i.onResize=function(){this.updateMeasurements()},n.debounceMethod(e,"onResize",150),e})},"A/e+":function(t,e,n){var i=n("VU/8")(n("5m3O"),n("ITff"),!1,function(t){n("SZtu")},"data-v-6c5fc404",null);t.exports=i.exports},AHQe:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"postComponent"},[n("div",{staticClass:"container px-0 mt-md-4"},[n("div",{staticClass:"card card-md-rounded-0 status-container orientation-unknown"},[n("div",{staticClass:"row mx-0"},[n("div",{staticClass:"d-flex d-md-none align-items-center justify-content-between card-header bg-white w-100"},[n("a",{staticClass:"d-flex align-items-center status-username text-truncate",attrs:{href:t.statusProfileUrl,"data-toggle":"tooltip","data-placement":"bottom",title:t.statusUsername}},[n("div",{staticClass:"status-avatar mr-2"},[n("img",{staticStyle:{"border-radius":"12px"},attrs:{src:t.statusAvatar,width:"24px",height:"24px"}})]),t._v(" "),n("div",{staticClass:"username"},[n("span",{staticClass:"username-link font-weight-bold text-dark"},[t._v(t._s(t.statusUsername))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("div",{staticClass:"post-actions d-none"},[n("div",{staticClass:"dropdown"},[t._m(0),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:t.reportUrl()}},[t._v("Report")]),t._v(" "),n("div",{staticClass:"dropdown-divider"}),t._v(" "),t._m(1),t._v(" "),t._m(2)])])])])]),t._v(" "),t._m(3),t._v(" "),n("div",{staticClass:"col-12 col-md-4 px-0 d-flex flex-column border-left border-md-left-0"},[n("div",{staticClass:"d-md-flex d-none align-items-center justify-content-between card-header py-3 bg-white"},[n("a",{staticClass:"d-flex align-items-center status-username text-truncate",attrs:{href:t.statusProfileUrl,"data-toggle":"tooltip","data-placement":"bottom",title:t.statusUsername}},[n("div",{staticClass:"status-avatar mr-2"},[n("img",{staticStyle:{"border-radius":"12px"},attrs:{src:t.statusAvatar,width:"24px",height:"24px"}})]),t._v(" "),n("div",{staticClass:"username"},[n("span",{staticClass:"username-link font-weight-bold text-dark"},[t._v(t._s(t.statusUsername))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("div",{staticClass:"post-actions d-none"},[n("div",{staticClass:"dropdown"},[t._m(4),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:t.reportUrl()}},[t._v("Report")]),t._v(" "),n("div",{staticClass:"dropdown-divider"}),t._v(" "),t._m(5),t._v(" "),t._m(6)])])])])]),t._v(" "),n("div",{staticClass:"d-flex flex-md-column flex-column-reverse h-100"},[n("div",{staticClass:"card-body status-comments"},[n("div",{staticClass:"status-comment"},[n("p",{staticClass:"mb-1 read-more",staticStyle:{overflow:"hidden"}},[n("span",{staticClass:"font-weight-bold pr-1"},[t._v(t._s(t.statusUsername))]),t._v(" "),n("span",{staticClass:"comment-text"})]),t._v(" "),n("post-comments",{attrs:{user:this.user,"post-id":t.statusId,"post-username":t.statusUsername}})],1)]),t._v(" "),n("div",{staticClass:"card-body flex-grow-0 py-1"},[n("div",{staticClass:"reactions my-1"},[n("form",{staticClass:"d-inline-flex pr-3 like-form",staticStyle:{display:"inline"},attrs:{method:"post",action:"/i/like","data-id":t.statusId,"data-action":"like"}},[n("input",{attrs:{type:"hidden",name:"_token",value:""}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"item"},domProps:{value:t.statusId}}),t._v(" "),t._m(7)]),t._v(" "),n("h3",{staticClass:"far fa-comment pr-3 m-0",attrs:{title:"Comment"},on:{click:t.commentFocus}}),t._v(" "),n("form",{staticClass:"d-inline-flex share-form pr-3",staticStyle:{display:"inline"},attrs:{method:"post",action:"/i/share","data-id":"11todo","data-action":"share","data-count":"status.favourite_count"}},[n("input",{attrs:{type:"hidden",name:"_token",value:""}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"item"},domProps:{value:t.statusId}}),t._v(" "),t._m(8)]),t._v(" "),n("span",{staticClass:"float-right"},[n("form",{staticClass:"d-inline-flex",staticStyle:{display:"inline"},attrs:{method:"post",action:"/i/bookmark","data-id":"#","data-action":"bookmark",onclick:"this.preventDefault()"}},[n("input",{attrs:{type:"hidden",name:"_token",value:""}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"item"},domProps:{value:t.statusId}}),t._v(" "),t._m(9)])])]),t._v(" "),n("div",{staticClass:"likes font-weight-bold mb-0"},[n("span",{staticClass:"like-count"},[t._v(t._s(t.status.favourites_count||0))]),t._v(" likes\n ")]),t._v(" "),n("div",{staticClass:"timestamp"},[n("a",{staticClass:"small text-muted",attrs:{href:t.statusUrl}},[t._v("\n "+t._s(t.timestampFormat())+"\n ")])])])]),t._v(" "),n("div",{staticClass:"card-footer bg-white sticky-md-bottom"},[t._m(10),t._v(" "),n("form",{staticClass:"comment-form d-none",attrs:{method:"post",action:"/i/comment","data-id":t.statusId,"data-truncate":"false"}},[n("input",{attrs:{type:"hidden",name:"_token",value:""}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"item"},domProps:{value:t.statusId}}),t._v(" "),n("input",{staticClass:"form-control",attrs:{name:"comment",placeholder:"Add a comment...",autocomplete:"off"}})])])])])])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark no-caret dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Post options"}},[e("span",{staticClass:"fas fa-ellipsis-v text-muted"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("form",{attrs:{method:"post",action:"/i/mute"}},[e("input",{attrs:{type:"hidden",name:"_token",value:""}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"type",value:"user"}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"item",value:""}}),this._v(" "),e("button",{staticClass:"dropdown-item btn btn-link font-weight-bold",attrs:{type:"submit"}},[this._v("Mute this user")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("form",{attrs:{method:"post",action:"/i/block"}},[e("input",{attrs:{type:"hidden",name:"_token",value:""}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"type",value:"user"}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"item",value:""}}),this._v(" "),e("button",{staticClass:"dropdown-item btn btn-link font-weight-bold",attrs:{type:"submit"}},[this._v("Block this user")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"col-12 col-md-8 status-photo px-0"},[e("div",{staticClass:"postPresenterLoader text-center"},[e("div",{staticClass:"lds-ring"},[e("div"),e("div"),e("div"),e("div")])]),this._v(" "),e("div",{staticClass:"postPresenterContainer d-none"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark no-caret dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Post options"}},[e("span",{staticClass:"fas fa-ellipsis-v text-muted"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("form",{attrs:{method:"post",action:"/i/mute"}},[e("input",{attrs:{type:"hidden",name:"_token",value:""}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"type",value:"user"}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"item",value:""}}),this._v(" "),e("button",{staticClass:"dropdown-item btn btn-link font-weight-bold",attrs:{type:"submit"}},[this._v("Mute this user")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("form",{attrs:{method:"post",action:"/i/block"}},[e("input",{attrs:{type:"hidden",name:"_token",value:""}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"type",value:"user"}}),this._v(" "),e("input",{attrs:{type:"hidden",name:"item",value:""}}),this._v(" "),e("button",{staticClass:"dropdown-item btn btn-link font-weight-bold",attrs:{type:"submit"}},[this._v("Block this user")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark p-0 border-0",attrs:{type:"submit",title:"Like!"}},[e("h3",{staticClass:"status-heart m-0 far fa-heart text-dark"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark p-0",attrs:{type:"submit",title:"Share"}},[e("h3",{staticClass:"m-0 far fa-share-square"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark p-0 border-0",attrs:{type:"submit",title:"Save"}},[e("h3",{staticClass:"m-0 far fa-bookmark"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"comment-form-guest"},[e("a",{attrs:{href:"/login"}},[this._v("Login")]),this._v(" to like or comment.\n ")])}]}},BXHd:function(t,e){$(document).ready(function(){$(document).on("submit",".bookmark-form",function(t){t.preventDefault();var e=$(this).data("id");axios.post("/i/bookmark",{item:e})})})},"Bx+d":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),pixelfed.postComponent={},pixelfed.presenter={show:{image:function(t,e){$(".status-container").removeClass("orientation-unknown").addClass("orientation-"+e[0].orientation);var n=$("

");n.addClass(e[0].filter_class);var i=$("");i.attr("src",e[0].url),i.attr("title",e[0].description),n.append(i),t.append(n)},video:function(t,e){var n=$("
");n.addClass("embed-responsive embed-responsive-4by3");var i=$("