PageSourceSearch

https://miku.gg/assets/SearchPage-1950ee51.js

js miku.gg collected 2026-10-02 05:33:39 UTC 10,295 bytes, 2 lines download raw bytes

1import{r as m,j as a,N as Se,e as y,a as t,g as Te,d as q,I as z,A as Ie,F as fe,t as Oe,b as Pe,c as j,f as Be,T as Me,i,u as ye,h as Ce,k as Y,l as Re,S as De,m as be,P as Ve,n as Ue,o as Fe,p as we,C as J,q as K,M as Q,s as ke,L as Ge,v as xe,w as He,x as We,y as $e,G as qe,z as ze,B as je,D as Ye,E as Je,H as Ke,J as Qe,K as X}from"./index-285e482f.js";import"./CollectiblesModal-0908081e.js";import{L as se}from"./Loading-a2d31e7c.js";import{T as Z}from"./Tag-c24e06eb.js";import{q as B}from"./base-416abc16.js";/* empty css                */const ee=(s=5)=>s<=3?"#ff8a5b":s<=4?"#f5c76a":"#ffd54a",Xe=({bot:s,highlightNSFW:l})=>{const[d,_]=m.useState(!1),r=m.useMemo(()=>{const c=s.tags.slice(0,3);return s.nsfw&&l&&c.push("NSFW"),s.premiumOnly&&c.push("Premium"),c.reverse()},[s.tags,s.nsfw,l,s.premiumOnly]);return a(Se,{to:`/novel-preview/${s.id}`,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onClick:()=>{if(s.chat){y.continueNarrativeClick({name:s.name});return}y.novelClick({name:s.name,isPremiumNovel:s.premiumOnly})},children:a("article",{className:"BotAdV2",children:t("div",{className:"BotAdV2__media",children:[a("img",{className:"BotAdV2__bg-image",src:Te(s.adPic||s.profilePic||"default_ad.jpg",s.adPic?q.AssetDisplayPrefix.NOVEL_AD_SMALL:q.AssetDisplayPrefix.NOVEL_PIC),alt:s.name}),a("div",{className:"BotAdV2__overlay",children:a("div",{className:"BotAdV2__media-gradient"})}),t("div",{className:`BotAdV2__body ${d&&!z?"BotAdV2__body--expanded":""}`,children:[t("div",{className:"BotAdV2__summary",children:[d&&!z?a(Ie,{text:s.name,textClassName:"BotAdV2__animated-text",speed:70}):a("h3",{className:"BotAdV2__name",children:s.name}),t("div",{className:"BotAdV2__score-inline",children:[a(fe,{size:12,color:ee(s.score)}),a("span",{style:{color:ee(s.score)},children:(s.score??0).toFixed(2)})]})]}),t("div",{className:"BotAdV2__details",children:[t("div",{className:"BotAdV2__header",children:[t("p",{className:"BotAdV2__author",children:["@",s.author.username]}),a("span",{className:"BotAdV2__updated-at",children:Oe(s.updatedAt)})]}),a("p",{className:"BotAdV2__description",children:s.description}),t("div",{className:"BotAdV2__stats",children:[t("div",{className:"BotAdV2__stat",children:[a(Pe,{className:"BotAdV2__dialogue-icon"}),a("span",{children:j(s.totalInteractions)})]}),t("div",{className:"BotAdV2__stat BotAdV2__stat--favorites",children:[a(Be,{size:12}),a("span",{children:j(s.totalFavorites)})]})]}),a("div",{className:"BotAdV2__tags",children:r.length>0&&r.map((c,A)=>a("div",{className:`BotAdV2__tag BotAdV2__tag--${c}`,children:c},`tag-${c}-${A}`))})]})]})]})})})},Ze=({title:s,bots:l,loading:d,highlightNSFW:_})=>l.length===0&&d?a("div",{className:"BotList",children:a("div",{className:"BotList__bots","aria-busy":"true",children:Array.from({length:8},(r,c)=>a("div",{className:"BotList__skeleton"},c))})}):l.length>0?t("div",{className:"BotList",children:[s?a("div",{className:"BotList__header",children:a(Me,{className:"BotList__header__title",size:"h2",children:s})}):null,t("div",{className:"BotList__bots",children:[l.map(r=>a(Xe,{bot:r,highlightNSFW:_},`bot-ad-${r.id}`)),d?a("div",{className:"BotList__loading",children:a(se,{})}):null]})]}):a("div",{className:"BotList__empty",children:a("p",{className:"BotList__empty__message",children:i("NO_NOVELS_FOUND")})}),ea=(s,l=500)=>{const[d,_]=m.useState(s);return m.useEffect(()=>{const r=setTimeout(()=>{_(s)},l);return()=>clearTimeout(r)},[s,l]),d};var te=(s=>(s.POPULAR="POPULAR",s.NEW="NEW",s.ENGAGING="ENGAGING",s.MULTI="MULTI",s.MAPS="MAPS",s.MALE="MALE",s.FEMALE="FEMALE",s.HIGHEST_RATED="HIGHEST_RATED",s.LAST_UPDATED="LAST_UPDATED",s.MOST_FAVORITED="MOST_FAVORITED",s.OLDEST="OLDEST",s.TRENDING="TRENDING",s.FOLLOWING="FOLLOWING",s.MOST_NARRATIONS="MOST_NARRATIONS",s))(te||{});const aa={MOST_POPULAR:"POPULAR"},sa=new Set(Object.values(te)),ta=new Map([["POPULAR",{visibility:"PUBLIC",orderBy:"totalInteractions"}],["HIGHEST_RATED",{visibility:"PUBLIC",orderBy:"score"}],["LAST_UPDATED",{visibility:"PUBLIC",orderBy:"lastReleaseAt"}],["MOST_FAVORITED",{visibility:"PUBLIC",orderBy:"totalFavorites"}],["NEW",{visibility:"PUBLIC",orderBy:"createdAt"}],["ENGAGING",{visibility:"PUBLIC",orderBy:"totalInteractions"}],["MULTI",{visibility:"PUBLIC",orderBy:"totalInteractions",tags:["Multi"]}],["MAPS",{visibility:"PUBLIC",orderBy:"totalInteractions",tags:["Maps"]}],["MALE",{visibility:"PUBLIC",orderBy:"totalInteractions",tags:["Male"]}],["FEMALE",{visibility:"PUBLIC",orderBy:"totalInteractions",tags:["Female"]}],["OLDEST",{visibility:"PUBLIC",orderBy:"createdAt",orderDirection:"asc"}],["FOLLOWING",{visibility:"PUBLIC",orderBy:"totalInteractions",following:!0}],["TRENDING",{}],["MOST_NARRATIONS",{visibility:"PUBLIC",orderBy:"totalChats"}]]),ae=[{id:"POPULAR",label:i("MOST_POPULAR_LABEL"),icon:a(Ge,{})},{id:"NEW",label:i("LATEST_LABEL"),icon:a(xe,{})},{id:"MOST_FAVORITED",label:i("FAVORITES_LABEL"),icon:a(He,{})},{id:"LAST_UPDATED",label:i("LAST_UPDATED_LABEL"),icon:a(We,{})},{id:"MULTI",label:i("MULTI_CHARACTER_LABEL"),icon:a($e,{})},{id:"MAPS",label:i("MAPS_LABEL"),icon:a(qe,{})},{id:"MALE",label:i("MALE_LABEL"),icon:a(ze,{})},{id:"FEMALE",label:i("FEMALE_LABEL"),icon:a(je,{})},{id:"OLDEST",label:i("OLDEST_LABEL"),icon:a(Ye,{})},{id:"TRENDING",label:i("TRENDING_LABEL"),icon:a(Je,{})},{id:"FOLLOWING",label:i("FOLLOWING_LABEL"),icon:a(Ke,{})},{id:"MOST_NARRATIONS",label:i("MOST_NARRATIONS_LABEL"),icon:a(Qe,{})}],ia=10,oa="allowCommunityNovels",M=25,ie="#9747ff",na="#ff4e67",la=ie;function ha(){var W;const[s,l]=m.useState(0),{user:d,isModerator:_}=ye(),[r,c]=m.useState(!1),A=B.parse(window.location.search),{getItem:oe,setItem:ne}=Ce(oa),g=A.q?A.q.toString():"",S=(W=A.sort)==null?void 0:W.toString(),T=S?aa[S]??S:void 0,C=T&&sa.has(T)?T:"POPULAR",h=C==="FOLLOWING"&&!d?"POPULAR":C,L=A.tags?A.tags.toString().split(",").filter(
1Boolean):[],N=ta.get(h),I=ea(g),f=oe()===!0,{data:R,refetch:le}=Y({defaultData:[],params:void 0,fetch:()=>X.getApprovedTags()}),D=R.slice(0,ia),p=h==="TRENDING"&&!I,re=(N==null?void 0:N.tags)??[],b=Array.from(new Set([...re,...L])),{bots:ce,loading:de,refetch:V}=Re(I?{author:void 0,visibility:r&&_?void 0:"PUBLIC",search:I,take:M,approved:f?void 0:!0,tags:L.length>0?L:void 0}:{...N,take:M,approved:f?void 0:!0,tags:b.length>0?b:void 0,...r&&_?{visibility:void 0}:{}},p),{data:_e,loading:Le}=Y({defaultData:[],params:void 0,fetch:()=>X.getTrendingBots(),skip:!p}),v=p?_e:ce,u=p?Le:de,U=m.useRef(null),O=v.length>0&&v.length%M===0,F=m.useCallback(()=>{!u&&O&&V(!0)},[u,O,V]);m.useEffect(()=>{const e=new IntersectionObserver(o=>{o[0].isIntersecting&&F()},{threshold:.1}),n=U.current;return n&&e.observe(n),()=>{n&&e.unobserve(n)}},[F]);const P=e=>{var $;const o={...B.parse(window.location.search),...e,tags:($=e.tags)!=null&&$.length?e.tags.join(","):void 0};o.q||delete o.q,o.sort||delete o.sort,o.tags||delete o.tags;const E=B.stringify(o);window.history.replaceState({},"",`${window.location.pathname}${E?`?${E}`:""}`),l(Ee=>Ee+1)},me=e=>{P({q:e||void 0,sort:e?void 0:h||void 0,tags:L})},Ae=e=>{e!==h&&(y.novelFilterClick({name:e}),P({sort:e,tags:L,q:g||void 0}))},w=e=>{const n=L.includes(e)?L.filter(o=>o!==e):[...L,e];P({sort:h||void 0,tags:n,q:g||void 0})},he=e=>{const n=e.target.checked;ne(n),l(o=>o+1)},ge=(d?ae:ae.filter(e=>e.id!=="FOLLOWING")).map(e=>({kind:"sort",id:`sort-${e.id}`,label:e.label,icon:e.icon,selected:h===e.id,onClick:()=>Ae(e.id)})),pe=new Map(R.map(e=>[e.name,e.isApproved])),ve=D.map(e=>({kind:"tag",id:`tag-${e.name}`,label:e.name,selected:L.includes(e.name),isApproved:e.isApproved,onClick:()=>w(e.name)})),ue=L.filter(e=>!D.some(n=>n.name===e)).map(e=>({kind:"tag",id:`tag-${e}`,label:e,selected:!0,isApproved:pe.get(e)??!1,onClick:()=>w(e)})),k=[...ge,...ue,...ve],G=k.filter(e=>e.selected),Ne=k.filter(e=>!e.selected),x=u||g.length>0,H=(e,n)=>{const o=n==="selected"?"SearchPage__filter-tag--from-right":"SearchPage__filter-tag--from-left";if(e.kind==="sort")return a(Z,{className:o,text:e.label,icon:e.icon,selected:e.selected,onSelectTag:e.onClick,backgroundColor:la,hideApprove:!0,disabled:x},e.id);const E=e.isApproved?ie:na;return a(Z,{className:o,text:e.label,selected:e.selected,onSelectTag:e.onClick,backgroundColor:E,isApproved:e.isApproved,onApprove:()=>le(),disabled:x},e.id)};return t("div",{className:"SearchPage",children:[a(De,{title:"Explore AI Visual Novels | miku.gg",description:"Browse and search AI-powered visual novels and characters. Filter by tags, popularity and language on miku.gg.",path:"/search"}),a(be,{}),a(Ve,{}),a(Ue,{}),a("h2",{children:i("SEARCH_NOVELS_TITLE")}),t("section",{className:"SearchPage__browse-novels",children:[t("div",{className:"SearchPage__filters",children:[a("div",{className:"SearchPage__query-box",children:t("span",{className:"SearchPage__search",children:[a(Fe,{}),a(we,{className:"SearchPage__search-bar",placeHolder:i("SEARCH_PLACEHOLDER"),onChange:e=>{me(e.target.value)},value:g})]})}),a("div",{className:"SearchPage__sorts-container",children:t("div",{className:"SearchPage__filter-list",children:[G.map(e=>H(e,"selected")),G.length>0&&a("div",{className:"SearchPage__filter-separator","aria-hidden":!0}),Ne.map(e=>H(e,"available"))]})}),t("div",{className:"SearchPage__tooltip",children:[a(J,{label:i("SHOW_ALL_NOVELS_LABEL"),name:"community novels",value:f,onChange:he}),a("div",{className:"SearchPage__info-icon","data-tooltip-id":"info-tooltip-nsfw","data-tooltip-content":i("COMMUNITY_NOVELS_TOOLTIP"),"data-tooltip-varaint":"info",children:a(K,{size:"small",fill:"gray"})}),a(Q,{id:"info-tooltip-nsfw",place:"top",className:"MetricBox__tooltip"})]}),_&&t("div",{className:"SearchPage__tooltip",children:[a(J,{label:i("MOD_VIEW_LABEL"),name:"mod view",value:r,onChange:e=>{c(e.target.checked)}}),a("div",{className:"SearchPage__info-icon","data-tooltip-id":"info-tooltip-mod-view","data-tooltip-content":i("MOD_VIEW_TOOLTIP"),"data-tooltip-varaint":"info",children:a(K,{size:"small",fill:"gray"})}),a(Q,{id:"info-tooltip-mod-view",place:"top",className:"MetricBox__tooltip"})]})]}),t("div",{children:[a(Ze,{bots:v,loading:u&&v.length===0,highlightNSFW:ke()}),!p&&O&&a("div",{ref:U,className:"SearchPage__load-more-sentinel",children:u&&v.length>0&&a(se,{})})]})]})]})}export{ha as default};
2//# sourceMappingURL=SearchPage-1950ee51.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.