(()=>{return(e,i)=>{const a=`
`;i.applyStyleFromText(`.home-video .cards{display:flex;flex-wrap:wrap;align-items:center}.home-video .cards .home-video-card{display:grid;grid-template-columns:200px 1fr;grid-template-rows:3fr 2fr 3fr;grid-template-areas:"cover title" "cover description" "cover up";height:var(--card-height);width:var(--card-width);color:#000;border-radius:16px;box-shadow:0 2px 6px 0 #0002;margin-right:var(--card-margin);margin-bottom:var(--card-margin)}body.dark .home-video .cards .home-video-card{background-color:#282828;color:#fff}.home-video .cards .home-video-card>*{justify-self:self-start;align-self:center}.home-video .cards .home-video-card:hover{transform:scale(1.02);transition:.1s cubic-bezier(.39,.58,.57,1)}.home-video .cards .home-video-card:hover .duration,.home-video .cards .home-video-card:hover .watchlater{opacity:1}.home-video .cards .home-video-card .duration,.home-video .cards .home-video-card .watchlater{opacity:0}.home-video .cards .home-video-card .cover-container{grid-area:cover;position:relative}.home-video .cards .home-video-card .cover-container .cover{border-radius:16px 0 0 16px;object-fit:cover}.home-video .cards .home-video-card .cover-container>:not(.cover){position:absolute}.home-video .cards .home-video-card .cover-container .duration,.home-video .cards .home-video-card .cover-container .watchlater{bottom:6px;padding:4px 8px;background-color:#000a;color:#fff;border-radius:14px;height:24px}.home-video .cards .home-video-card .cover-container .duration .mdi,.home-video .cards .home-video-card .cover-container .watchlater .mdi{font-size:12pt;line-height:1;margin-right:4px}.home-video .cards .home-video-card .cover-container .duration{left:6px}.home-video .cards .home-video-card .cover-container .watchlater{right:6px;display:flex;align-items:center;padding-left:4px}.home-video .cards .home-video-card .title{grid-area:title;font-size:12pt;font-weight:700;color:inherit;padding:0 12px;white-space:nowrap;overflow:hidden;justify-self:stretch;text-overflow:ellipsis}.home-video .cards .home-video-card .topics{grid-area:description;display:flex;align-items:center;margin-left:12px}.home-video .cards .home-video-card .topics .topic{color:inherit;padding:4px 8px;background-color:#8882;margin-right:8px;border-radius:14px}.home-video .cards .home-video-card .description{grid-area:description;color:inherit;overflow:auto;align-self:stretch;justify-self:stretch;margin:0 12px;white-space:pre-wrap;line-height:1.5;scrollbar-width:none!important}.home-video .cards .home-video-card .description::-webkit-scrollbar{width:0!important}.home-video .cards .home-video-card .description.single-line{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.home-video .cards .home-video-card .stats,.home-video .cards .home-video-card .up{grid-area:up}.home-video .cards .home-video-card .up{margin-left:12px;display:flex;align-items:center;padding:2px;background-color:#8882;border-radius:14px;color:inherit}.home-video .cards .home-video-card .up .face{border-radius:50%}.home-video .cards .home-video-card .up .name{margin:0 8px}.home-video .cards .home-video-card .up:hover .name{color:var(--theme-color)}.home-video .cards .home-video-card .stats{justify-self:self-end;margin-right:12px;display:flex;align-items:center;opacity:.5}.home-video .cards .home-video-card .stats .be-icon{font-size:12pt;margin:0 4px 0 12px}`,"home-video-style");return{export:Object.assign({template:a},{components:{"dpi-img":()=>i.importAsync("dpi-img.vue"),Icon:()=>i.importAsync("icon.vue")},data(){return{cards:[],loading:true}},methods:{async watchlater(e){const a=this.cards.find(i=>i.id===e);try{a.watchlater=!a.watchlater;const{toggleWatchlater:e}=await i.importAsync("watchlater-api");e(a.aid.toString(),a.watchlater)}catch(e){a.watchlater=!a.watchlater;Toast.error(e.message,"稍后再看操作失败",3e3)}}},async mounted(){try{const e=await Ajax.getJsonWithCredentials(`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${getUID()}&type_list=8`);const{getWatchlaterList:a}=await i.importAsync("watchlater-api");const o=await a();if(e.code!==0){throw new Error(e.message)}this.cards=e.data.cards.map(e=>{const i=JSON.parse(e.card);const a=_.get(e,"display.topic_info.topic_details",[]).map(e=>{return{id:e.topic_id,name:e.topic_name}});return{id:e.desc.dynamic_id_str,aid:i.aid,title:i.title,upID:e.desc.user_profile.info.uid,upName:e.desc.user_profile.info.uname,upFaceUrl:e.desc.user_profile.info.face,coverUrl:i.pic,description:i.desc,timestamp:e.timestamp,time:new Date(e.timestamp*1e3),topics:a,dynamic:i.dynamic,like:formatCount(e.desc.like),duration:i.duration,durationText:formatDuration(i.duration,0),playCount:formatCount(i.stat.view),danmakuCount:formatCount(i.stat.danmaku),watchlater:o.includes(i.aid)}})}catch(e){Toast.error(e.message,"视频动态",3e3)}finally{this.loading=false}}})}}})();