(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[9089],{35859:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});vara=s(19755);consti={data:function(){return{announcements:[],announcement:{},cursor:0,showNext:!0,showPrev:!1}},mounted:function(){this.fetchAnnouncements()},updated:function(){a('[data-toggle="tooltip"]').tooltip()},methods:{fetchAnnouncements:function(){vart=this,e=JSON.parse(window.localStorage.getItem("metro-tips-closed"));axios.get("/api/pixelfed/v1/newsroom/timeline").then((function(s){t.announcements=s.data.filter((function(t){return!e||-1==e.indexOf(t.id)})),t.announcement=t.announcements[0],1==t.announcements.length&&(t.showNext=!1)}))},loadNext:function(){this.showNext&&(this.cursor+=1,this.announcement=this.announcements[this.cursor],this.cursor+1==this.announcements.length&&(this.showNext=!1),this.cursor>=1&&(this.showPrev=!0))},loadPrev:function(){this.showPrev&&(this.cursor-=1,this.announcement=this.announcements[this.cursor],0==this.cursor&&(this.showPrev=!1),this.cursor<this.announcements.length&&(this.showNext=!0))},closeNewsroomPost:function(t,e){vars="metro-tips-closed",a=[],i=window.localStorage.getItem(s);i&&(a=JSON.parse(i)),a.push(t),window.localStorage.setItem(s,JSON.stringify(a)),this.newsroomPosts=this.newsroomPosts.filter((function(e){returne.id!==t})),0==this.newsroomPosts.length?this.showTips=!1:this.newsroomPost=[this.newsroomPosts[0]]},close:function(){window.localStorage.setItem("metro-tips",!1),this.$emit("show-tips",!1)},markAsRead:function(){vart=this;axios.post("/api/pixelfed/v1/newsroom/markasread",{id:this.announcement.id}).then((function(e){vars=t.cursor;t.announcements.splice(s,1),t.announcement=t.announcements[0],t.cursor=0,t.showPrev=!1,t.showNext=t.announcements.length>1})).catch((function(t){swal("Oops, Something went wrong","There was a problem with your request, please try again later.","error")}))}}}},68065:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});vara=s(19755);functioni(t){returnfunction(t){if(Array.isArray(t))returno(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returno(t,e);vars=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)returnArray.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))returno(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functiono(t,e){(null==e||e>t.length)&&(e=t.length);for(vars=0,a=newArray(e);s<e;s++)a[s]=t[s];returna}constn={data:function(){return{loading:!0,notifications:{},notificationCursor:2,notificationMaxId:0,profile:{locked:!1},followRequests:null,showRefresh:!1,attemptedRefresh:!1}},mounted:function(){vart=this;this.fetchNotifications(),setTimeout((function(){t.profile=window._sharedData.curUser,t.fetchFollowRequests()}),1500)},updated:function(){},methods:{fetchNotifications:function(){vart=this;axios.get("/api/pixelfed/v1/notifications?pg=true").then((function(e){vars=e.data.filter((function(t){return!("share"==t.type&&!t.status)&&(!("comment"==t.type&&!t.status)&&(!("mention"==t.type&&!t.status)&&(!("favourite"==t.type&&!t.status)&&!("follow"==t.type&&!t.account))))})),a=s.map((function(t){returnt.id}));t.notificationMaxId=Math.min.apply(Math,i(a)),t.notifications=s,t.loading=!1,0!=s.length||t.attemptedRefresh||(t.showRefresh=!0)}))},infiniteNotifications:function(t){vare=this;this.notificationCursor>5?t.complete():axios.get("/api/pixelfed/v1/notifications",{params:{max_id:this.notificationMaxId}}).then((function(s){if(s.data.length){vara,o=s.data.filter((function(t){return!("share"==t.type&&!t.status)&&(!("comment"==t.type&&!t.status)&&(!("mention"==t.type&&!t.status)&&(!("favourite"==t.type&&!t.status)&&(!("follow"==t.type&&!t.account)&&!_.find(e.notifications,{id:t.id})))))})),n=o.map((function(t){returnt.id}