(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[6205],{32836:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>n});vars=a(2e4),i=(a(73718),a(74692));constn={components:{Autocomplete:s.default},data:function(){return{config:window.App.config,loaded:!1,profile:{},page:"browse",pages:["browse","add","read"],tab:"inbox",tabs:["inbox","sent","filtered"],inboxPage:1,sentPage:1,filteredPage:1,threads:[],thread:!1,threadIndex:!1,replyText:"",composeUsername:"",ctxContext:null,ctxIndex:null,uploading:!1,uploadProgress:null,messages:{inbox:[],sent:[],filtered:[]},newType:"select",composeLoading:!1}},mounted:function(){vart=this;this.fetchProfile();vare=this;axios.get("/api/direct/browse",{params:{a:"inbox"}}).then((function(a){e.loaded=!0,t.threads=a.data,t.messages.inbox=a.data}))},updated:function(){i('[data-toggle="tooltip"]').tooltip()},methods:{fetchProfile:function(){vart=this;axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(e){t.profile=e.data,window._sharedData.curUser=e.data,window.App.util.navatar()}))},goto:function(){vart=arguments.length>0&&void0!==arguments[0]?arguments[0]:"browse";this.page=t},loadMessage:function(t){vare="/account/direct/t/"+t;window.location.href=e},truncate:function(t){return_.truncate(t)},switchTab:function(t){vare=this;switch(t){case"inbox":this.messages.inbox.length;break;case"sent":0==this.messages.sent.length&&axios.get("/api/direct/browse",{params:{a:"sent"}}).then((function(t){e.loaded=!0,e.threads=t.data,e.messages.sent=t.data}));break;case"filtered":0==this.messages.filtered.length&&axios.get("/api/direct/browse",{params:{a:"filtered"}}).then((function(t){e.loaded=!0,e.threads=t.data,e.messages.filtered=t.data}))}this.tab=t},composeSearch:function(t){if(t.length<1)return[];returnaxios.post("/api/direct/lookup",{q:t}).then((function(t){returnt.data}))},getTagResultValue:function(t){returnt.local?"@"+t.name:t.name},onTagSubmitLocation:function(t){this.composeLoading=!0,window.location.href="/account/direct/t/"+t.id},messagePagination:function(t,e){vara=this;"inbox"==t&&(this.inboxPage="prev"==e?this.inboxPage-1:this.inboxPage+1,axios.get("/api/direct/browse",{params:{a:"inbox",page:this.inboxPage}}).then((function(t){self.loaded=!0,a.threads=t.data,a.messages.inbox=t.data}))),"sent"==t&&(this.sentPage="prev"==e?this.sentPage-1:this.sentPage+1,axios.get("/api/direct/browse",{params:{a:"sent",page:this.sentPage}}).then((function(t){self.loaded=!0,a.threads=t.data,a.messages.sent=t.data}))),"filtered"==t&&(this.filteredPage="prev"==e?this.filteredPage-1:this.filteredPage+1,axios.get("/api/direct/browse",{params:{a:"filtered",page:this.filteredPage}}).then((function(t){self.loaded=!0,a.threads=t.data,a.messages.filtered=t.data})))}}}},27943:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>r});vars=a(74692);functioni(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(t){if("string"==typeoft)returnn(t,e);vara={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(t,e):void0}}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(vara=0,s=Array(e);a<e;a++)s[a]=t[a];returns}constr={props:["accountId"],data:function(){return{config:window.App.config,hideAvatars:!0,hideTimestamps:!1,largerText:!1,autoRefresh:!1,mutedNotifications:!1,blocked:!1,loaded:!1,profile:{},page:"read",pages:["browse","add","read"],threads:[],thread:!1,threadIndex:!1,replyText:"",composeUsername:"",ctxContext:null,ctxIndex:null,uploading:!1,uploadProgress:null,min_id:null,max_id:null,loadingMessages:!1,showLoadMore:!0}},mounted:function(){vart=this;this.fetchProfile();vare=this;axios.get("/api/direct/thread",{pa