import{d as Q,o as G,a as n,c as a,b as o,F as w,t as c,e as h,f as p,w as f,g as W,r as D,h as l,i as M,j as x,u as Y,k as J,s as X,l as R,n as I}from"./index-CK-9TfWb.js";import{g as Z,a as ee,_ as te}from"./_plugin-vue_export-helper-D4DENoBS.js";const se={class:"home-page"},oe={class:"hero-section"},ne=["src","alt"],ae={key:1,class:"logo-text"},ie={class:"search-box"},ce={key:1,class:"quote-section"},le={class:"quote-text"},re={class:"quote-author"},ue={class:"content-section"},de={key:0,class:"rankings-grid"},_e={class:"panel-header"},he={class:"panel-title"},pe={class:"panel-tabs"},ve=["onClick"],ge=["onClick"],fe={class:"panel-body"},me=["onClick"],ye={class:"rank-name"},ke={class:"rank-cnt"},Ce=["onClick"],be={class:"panel-footer"},we={key:0},xe={key:1},Ie={key:2},qe={key:3},Se={class:"footer-time"},Ae={key:0,class:"site-footer"},Te={class:"footer-inner"},Ne={class:"footer-actions"},E=8,Ve=Q({__name:"HomePage",setup($e){const q=Y(),m=l(""),u=l([]),d=M({}),_=M({}),v=l(""),y=l(""),k=l(""),S=l(!1),C=l(""),A=l(""),T=["学而时习之，不亦说乎。","温故而知新，可以为师矣。","三人行，必有我师焉。","学而不思则罔，思而不学则殆。","博学之，审问之，慎思之，明辨之，笃行之。","千里之行，始于足下。","不积跬步，无以至千里。","知之为知之，不知为不知，是知也。","工欲善其事，必先利其器。","玉不琢，不成器；人不学，不知道。","学以致用，知行合一。","学海无涯，勤作舟。","书山有路，勤为径。","宝剑锋从磨砺出，梅花香自苦寒来。","锲而不舍，金石可镂。","业精于勤，荒于嬉。","读书破万卷，下笔如有神。","路漫漫其修远兮，吾将上下而求索。","采菊东篱下，悠然见南山。","海内存知己，天涯若比邻。","长风破浪会有时，直挂云帆济沧海。","会当凌绝顶，一览众山小。","山重水复疑无路，柳暗花明又一村。"],N=l(""),F={movie:"🎬",western_movie:"🎥",western_tv:"🌍",donghua:"🐉",global_anime:"🌐",tv:"📺",niche:"💎",hotsite:"🏆"};function L(e){return F[e]||"📋"}function O(e){const t=[];if(e.rating&&t.push(`⭐${e.rating}`),e.searchCount>0){const i=e.searchCount;i>=1e8?t.push(`${(i/1e8).toFixed(1)}亿`):i>=1e4?t.push(`${(i/1e4).toFixed(0)}万`):t.push(String(i))}return t.join(" ")||""}function V(e){return(_[e.category]||"hot")==="hot"?e.hot||[]:e.newest||[]}function U(e){const t=V(e);return d[e.category]?t:t.slice(0,E)}function H(e){return V(e).length>E&&!d[e.category]}function P(e){d[e]=!0}function $(e,t){_[e]=t,d[e]=!1}function j(){window.open("/disclaimer/","_blank")}G(async()=>{const e=T[Math.floor(Math.random()*T.length)];C.value=e,A.value="古籍经典";try{const[t,i]=await Promise.all([Z(),ee()]);t.fetchedAt?(N.value=t.fetchedAt,u.value=t.categories||[]):u.value=Array.isArray(t)?t:[];for(const g of u.value)_[g.category]="hot",d[g.category]=!1;i.site_logo&&(v.value=i.site_logo),i.site_name&&(y.value=i.site_name),i.site_disclaimer&&(k.value=i.site_disclaimer),S.value=!0}catch(t){console.error("加载首页数据失败",t)}});function z(){const e=m.value.trim();e&&q.push("/search?q="+encodeURIComponent(e))}function K(e){q.push("/search?q="+encodeURIComponent(e))}return(e,t)=>{const i=x("el-icon"),g=x("el-input"),B=x("el-button");return n(),a("div",se,[o("div",oe,[S.value?(n(),a(w,{key:0},[v.value?(n(),a("img",{key:0,src:v.value,alt:y.value||"CloudSearch",class:"logo-img",onError:t[0]||(t[0]=s=>{s.target.style.display="none",v.value=""})},null,40,ne)):(n(),a("div",ae,c(y.value||"CloudSearch"),1))],64)):h("",!0),o("div",ie,[p(g,{modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=s=>m.value=s),placeholder:"搜索网盘资源，或粘贴视频/网盘链接...",size:"large",clearable:"",onKeyup:W(z,["enter"])},{prefix:f(()=>[p(i,null,{default:f(()=>[p(J(X))]),_:1})]),_:1},8,["modelValue"]),p(B,{type:"primary",size:"large",onClick:z,class:"search-btn"},{default:f(()=>[...t[2]||(t[2]=[R(" 搜 索 ",-1)])]),_:1})]),C.value?(n(),a("div",ce,[o("span",le,"「 "+c(C.value)+" 」",1),o("span",re,"---"+c(A.value),1)])):h("",!0)]),o("div",ue,[u.value.length>0?(n(),a("div",de,[(n(!0),a(w,null,D(u.value,s=>(n(),a("div",{key:s.category,class:"rank-panel"},[o("div",_e,[o("span",he,c(L(s.category))+" "+c(s.label),1),o("div",pe,[o("span",{class:I(["panel-tab",{active:_[s.category]==="hot"}]),onClick:r=>$(s.category,"hot")},"热榜",10,ve),o("span",{class:I(["panel-tab",{active:_[s.category]==="newest"}]),onClick:r=>$(s.category,"newest")},"最新",10,ge)])]),o("div",fe,[(n(!0),a(w,null,D(U(s),(r,b)=>(n(),a("div",{key:s.category+"-"+b,class:"rank-item",onClick:ze=>K(r.keyword)},[o("span",{class:I(["rank-idx",{"top-three":b<3}])},c(b+1),3),o("span",ye,c(r.keyword),1),o("span",ke,c(O(r)),1)],8,me))),128)),H(s)?(n(),a("div",{key:0,class:"rank-expand",onClick:r=>P(s.category)}," 展开全部 ▼ ",8,Ce)):h("",!0)]),o("div",be,[s.category==="hotsite"?(n(),a("span",we,"基于本站搜索数据")):s.category==="donghua"||s.category==="global_anime"?(n(),a("span",xe,"数据来源：Bilibili")):s.category==="movie"||s.category==="tv"?(n(),a("span",Ie,"数据来源：百度")):(n(),a("span",qe,"数据来源：TMDB")),o("span",Se,c(N.value),1)])]))),128))])):h("",!0)]),k.value?(n(),a("div",Ae,[o("div",Te,c(k.value),1),o("div",Ne,[p(B,{class:"footer-disclaimer-btn",size:"small",onClick:j},{default:f(()=>[...t[3]||(t[3]=[R("📜 免责声明",-1)])]),_:1})])])):h("",!0)])}}}),Me=te(Ve,[["__scopeId","data-v-c48c836b"]]);export{Me as default};
