"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[5762],{7018:function(e,n,l){l.r(n),l.d(n,{default:function(){return w}});var t=l(6252),s=l(3577);const a={class:"header"},i={class:"banner"},r=["src"],c={class:"row"},o=["href"],h={class:"image"},u=["src"],d={class:"info"},g=["href"],p={class:"description"};function f(e,n,l,f,_,m){const y=(0,t.up)("Loading"),k=(0,t.up)("Results");return(0,t.wg)(),(0,t.iD)("div",{class:"media-youtube-channel",onScroll:n[3]||(n[3]=(...e)=>m.onScroll&&m.onScroll(...e))},[_.loading?((0,t.wg)(),(0,t.j4)(y,{key:0})):_.channel?((0,t.wg)(),(0,t.iD)("div",{key:1,class:"channel",onScroll:n[2]||(n[2]=(...e)=>m.onScroll&&m.onScroll(...e))},[(0,t._)("div",a,[(0,t._)("div",i,[_.channel?.banner?.length?((0,t.wg)(),(0,t.iD)("img",{key:0,src:_.channel.banner},null,8,r)):(0,t.kq)("",!0)]),(0,t._)("div",c,[(0,t._)("a",{href:_.channel.url,target:"_blank",rel:"noopener noreferrer"},[(0,t._)("div",h,[_.channel?.image?.length?((0,t.wg)(),(0,t.iD)("img",{key:0,src:_.channel.image},null,8,u)):(0,t.kq)("",!0)])],8,o),(0,t._)("div",d,[(0,t._)("a",{class:"title",href:_.channel.url,target:"_blank",rel:"noopener noreferrer"},(0,s.zw)(_.channel?.name),9,g),(0,t._)("div",p,(0,s.zw)(_.channel?.description),1)])])]),(0,t.Wm)(k,{results:_.channel.items,filter:l.filter,"selected-result":_.selectedResult,ref:"results",onSelect:n[0]||(n[0]=e=>_.selectedResult=e),onPlay:n[1]||(n[1]=n=>e.$emit("play",n))},null,8,["results","filter","selected-result"])],32)):(0,t.kq)("",!0)],32)}l(560);var _=l(6791),m=l(4612),y=l(8637),k={emits:["play"],mixins:[y.Z],components:{Loading:_.Z,Results:m.Z},props:{id:{type:String,required:!0},filter:{type:String,default:null}},data(){return{channel:null,loading:!1,loadingNextPage:!1,selectedResult:null}},computed:{itemsByUrl(){return this.channel?.items.reduce(((e,n)=>(e[n.url]=n,e)),{})}},methods:{async loadChannel(){this.loading=!0;try{this.channel=await this.request("youtube.get_channel",{id:this.id})}finally{this.loading=!1}},async loadNextPage(){if(this.channel?.next_page_token&&!this.loadingNextPage)try{const e=await this.request("youtube.get_channel",{id:this.id,next_page_token:this.channel.next_page_token});this.channel.items.push(...e.items.filter((e=>!this.itemsByUrl[e.url]))),this.channel.next_page_token=e.next_page_token,this.$refs.results.maxResultIndex+=this.$refs.results.resultIndexStep}finally{this.loadingNextPage=!1}},onScroll(e){const n=e.target;if(!n)return;const l=n.scrollHeight-n.scrollTop<=n.clientHeight+150;l&&this.loadNextPage()}},mounted(){this.loadChannel()}},x=l(3744);const v=(0,x.Z)(k,[["render",f],["__scopeId","data-v-21b0d859"]]);var w=v}}]);
//# sourceMappingURL=5762.5ca2e7fa.js.map