(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[6279],{38945:(t,e,s)=>{"use strict";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,i=newArray(e);s<e;s++)i[s]=t[s];returni}s.r(e),s.d(e,{default:()=>r});constr={props:{pid:{type:String},selfProfile:{type:Object},redirectUrl:{type:String,default:"/"}},data:function(){return{loading:!0,profile:null,account:{local:!1},owner:!1,stories:[],username:"loading...",avatar:"/storage/avatars/default.jpg",storyIndex:0,progress:0,constInterval:383,progressInterval:void0,composeText:null,paused:!1,muted:!0,reactionEmoji:["❤️","🔥","💯","😂","😎","👀"],activeReactionEmoji:!1,activeReply:!1,showProgress:!1,redirectOnEnd:"/",viewerSid:!1,viewerPage:1,loadingViewers:!1,viewersHasMore:!0,viewers:[],viewWarning:!1,showingPollResults:!1,loadingPollResults:!1,pollResults:[],pollTotalVotes:0}},watch:{composeText:function(t){0==t.length?this.paused&&this.pause():this.paused||this.pause(),event.currentTarget.focus()}},beforeMount:function(){this.redirectOnEnd=this.redirectUrl},mounted:function(){vart=this,e=newURLSearchParams(window.location.search);if(e.has("t"))switch(e.get("t")){case"1":this.redirectOnEnd="/";break;case"2":this.redirectOnEnd="/timeline/public";break;case"3":this.redirectOnEnd="/timeline/network";break;case"4":this.redirectOnEnd="/"+window.location.pathname.split("/").slice(-1).pop()}elsethis.viewWarning=!0;this.selfProfile&&this.selfProfile.hasOwnProperty("avatar")?this.profile=this.selfProfile:axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(e){t.profile=e.data,t.fetchStories()}));vars=document.querySelector("body");s.style.width="100%",s.style.height="100vh !important",s.style.overflow="hidden",s.style.backgroundColor="#262626"},methods:{init:function(){vart=this;clearInterval(this.progressInterval),this.loading=!1,this.constInterval=Math.ceil(38.3*this.stories[this.storyIndex].duration),this.progressInterval=setInterval((function(){t.do()}),this.constInterval)},do:function(){this.loading=!1,100!=this.stories[this.storyIndex].progress?this.stories[this.storyIndex].progress=this.stories[this.storyIndex].progress+4:(clearInterval(this.progressInterval),this.next())},prev:function(){0!=this.storyIndex&&(this.pollResults=[],this.progress=0,this.gotoSlide(this.storyIndex-1))},next:function(){if(axios.post("/api/web/stories/v1/viewed",{id:this.stories[this.storyIndex].id}),this.stories[this.storyIndex].progress=100,this.storyIndex!=this.stories.length-1)this.pollResults=[],this.progress=0,this.muted=!0,this.storyIndex=this.storyIndex+1,this.init();else{if(this.composeText&&this.composeText.length)return;window.location.href=this.redirectOnEnd}},pause:function(){if(event&&event.currentTarget.blur(),this.paused){if(this.paused=!1,"video"==this.stories[this.storyIndex].type)document.getElementById("playr").play();this.init()}else{if(clearInterval(this.progressInterval),"video"==this.stories[this.storyIndex].type)document.getElementById("playr").pause();this.paused=!0}},toggleMute:function(){(event&&event.currentTarget.blur(),"video"==this.stories[this.storyIndex].type)&&(this.muted=!this.muted,document.getElementById("playr").muted=this.muted)},gotoSlide:function(t){this.paused=!1,clearInterval(this.progressInterval),this.progressInterval=null,this.stories=this.stories.map((function(e,s){returne.progress=s<t?100:0,e})),this.storyIndex=t,this.stories[t].progr