import{c as e,e as a}from"./vendor-BJZ6tUoe.js";import{R as t,E as o,a as s}from"./souav-BTAG2baT.js";import{d as l}from"./vendor-CB_mu4eO.js";import{v as i}from"./vendor-BAqn-6d_.js";import{r as n,ag as r,q as c,x as d,a4 as u,a5 as v,aL as p,v as f,bf as m,ad as g,a2 as h,bH as x,i as j,aW as w,K as y,b1 as b}from"./vendor-BXdGExd0.js";import{_ as I}from"./vendor-DKh56KT7.js";import{_ as k}from"./vendor-DJUGQ7Dr.js";import{_ as L}from"./vendor-C9gRq-hs.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DN37M9Hi.js";import"./vendor-DBhUxCDU.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-BCo6x5W8.js";import"./vendor-bo_0oRCG.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";const E=l("stars",()=>{const e=n({contentId:0,title:"",author:"",starsImg:"",description:""}),a=n([]),s=n(!1),l=n(t.loading),r=n(!1),c=n(!1),d=n(0);async function u(s=!1){s||(d.value=0);const n={topicId:e.value.contentId,page:d.value};try{l.value=t.loading;const e=await i.topicVideos(n),{code:r,data:d}=e;if(r==o.Success){const e=(null==d?void 0:d.topicVideoIdList)??[];s?(a.value.push(...e),e.length<20&&(c.value=!0)):(a.value=e,l.value=0===e.length?t.EmptyData:t.success,c.value=e.length<20)}else s||(l.value=t.NetError),c.value=!0}catch(u){s||(l.value=t.NetError),c.value=!0}finally{r.value=!1}}return{starModel:e,topicVideoList:a,collapseStatus:s,refreshStatus:l,loading:r,finished:c,initData:function(o){Object.assign(e.value,o),a.value=[],d.value=0,l.value=t.loading,c.value=!1,s.value=!1,u()},onLoadMore:async function(){r.value||c.value||(r.value=!0,d.value++,await u(!0))},onRefresh:async function(){r.value||c.value||(r.value=!0,d.value=0,await u(!1))},setCollapseStatus:function(e){s.value=e}}}),S={class:"min-h-dvh bg-[#0E0F12] flex flex-col"},V={class:"text-lg font-medium text-white truncate max-w-[200px]"},M={class:"relative w-full h-[380px]"},_={class:"absolute bottom-0 left-0 right-0 pt-8 pb-3 px-4 bg-gradient-to-b from-black/5 to-black/50 flex flex-col items-center justify-end min-h-[100px]"},R={class:"text-white text-[13px] leading-5 text-center line-clamp-8"},C={class:"flex-1 overflow-y-auto p-[15px]"},D={key:0},N={class:"grid grid-cols-2 gap-x-2 gap-y-[10px]"},U={class:"relative w-full aspect-[9/16]"},q={class:"p-2"},z={class:"text-xs text-gray-300 line-clamp-2"},F=r({__name:"index",props:{video:{}},emits:["ppw-close"],setup(o){const l=o,i=E(),r=n(!1),F=n(!1),H=async()=>{r.value=!0,await i.onRefresh(),r.value=!1},K=async()=>{F.value=!0,await i.onLoadMore(),F.value=!1},O=()=>{i.onRefresh()},T=()=>{const e=window.scrollY||document.documentElement.scrollTop;i.setCollapseStatus(e>230)};return c(()=>{var e;const a={contentId:l.video.contentId,title:l.video.title??"",author:l.video.author??"",starsImg:(null==(e=l.video.extra)?void 0:e.coverImg)??"",description:l.video.description??""};i.initData(a),window.addEventListener("scroll",T)}),d(()=>{window.removeEventListener("scroll",T)}),(o,l)=>{const n=s,c=a,d=e;return w(),u("div",S,[v("header",{class:p(["fixed top-0 left-0 right-0 z-50 h-[56px] flex items-center px-4 transition-colors duration-300",f(i).collapseStatus?"bg-[#0f0f0f]":"bg-transparent"])},[v("button",{onClick:l[0]||(l[0]=e=>o.$emit("ppw-close")),class:"mr-4 active:opacity-70"},[...l[3]||(l[3]=[v("i",{class:"icon-sprite icon-back"},null,-1)])]),v("div",{class:p(["flex-1 flex justify-center transition-opacity duration-300",f(i).collapseStatus?"opacity-100":"opacity-0"])},[v("span",V,m(f(i).starModel.author||f(i).starModel.title),1)],2),l[4]||(l[4]=v("div",{class:"w-6"},null,-1))],2),v("div",M,[g(n,{src:f(i).starModel.starsImg,class:"w-full h-full object-cover"},null,8,["src"]),v("div",_,[v("p",R,m(f(i).starModel.description),1)])]),v("main",C,[0===f(i).topicVideoList.length?(w(),u("div",D,[f(i).refreshStatus===f(t).loading?(w(),h(I,{key:0})):(w(),h(k,{key:1}))])):f(i).refreshStatus==f(t).NetError?(w(),h(L,{key:1,onClick:O})):(w(),h(d,{key:2,modelValue:f(r),"onUpdate:modelValue":l[2]||(l[2]=e=>j(r)?r.value=e:null),onRefresh:H,class:"min-h-full"},{default:x(()=>[g(c,{loading:f(F),"onUpdate:loading":l[1]||(l[1]=e=>j(F)?F.value=e:null),finished:f(i).finished,onLoad:K},{default:x(()=>[v("div",N,[(w(!0),u(y,null,b(f(i).topicVideoList,e=>(w(),u("div",{key:e.contentId,class:"flex flex-col bg-[#1a1a1a] rounded overflow-hidden"},[v("div",U,[g(n,{src:e.coverImg,class:"w-full h-full object-cover"},null,8,["src"])]),v("div",q,[v("p",z,m(e.title),1)])]))),128))])]),_:1},8,["loading","finished"])]),_:1},8,["modelValue"]))])])}}});export{F as default};
