1import{h as S,o as i,k as l,d as V,z as $,B as k,c as f,n as T,j as b,w as n,G as j,l as A,a as o,b as H,t as d,A as K,v as U,Y,e as Z,Z as J,Q as P,r as O,C as W,E as X,f as q,y as ee,i as a,$ as ae,D as x,K as te,_ as re,L as se}from"./D3IHV_n4.js";import{I as oe}from"./BQnyj7_1.js";import{_ as le}from"./CHhmta2J.js";import{_ as ne}from"./CyIlwzAR.js";import{_ as ie}from"./DW3SeO9g.js";import{_ as ue,a as M}from"./lt3g0A_Y.js";import{u as ce}from"./BM00tGkJ.js";import{_ as de}from"./Bm4GsBCU.js";import"./V3hL2Mq5.js";import"./CfK59ch4.js";import"./CXc2TbNq.js";import"./x8UUOa5g.js";import"./BCR_VEWT.js";import"./8-NfZhEz.js";import"./f0nlLGPb.js";import"./DdQC4siD.js";import"./BW-8UcK_.js";import"./C7eeP2UR.js";import"./DCR2YoBr.js";import"./DVCZs4nf.js";import"./QOseDANg.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c8e73e2b-c6ca-4491-b351-6fae4d8bbde2",t._sentryDebugIdIdentifier="sentry-dbid-c8e73e2b-c6ca-4491-b351-6fae4d8bbde2")}catch{}function fe(t,e){return i(),S("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})])}const pe={viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};function me(t,e){return i(),S("svg",pe,e[0]||(e[0]=[l("rect",{width:"24",height:"24",fill:"none"},null,-1)]))}const _e={render:me},ge={class:"col-span-full flex flex-wrap justify-center gap-3"},he=V({__name:"popular-tags-page-grid",props:{data:{}},setup(t){const e=t,p=$(` 2 fragment PopularTagsPageGrid_QueryFragment on Query { 3 tags( 4 first: $tagHubFirst 5 filterBy: { tagType: [Demographic, Genre, Meta, Theme] } 6 orderBy: [{ field: Popularity, direction: Desc }] 7 ) { 8 nodes { 9 id 10 ...TagChip_TagFragment 11 } 12 } 13 } 14`),m=k(()=>ce(p,e.data));return(v,w)=>{var _,g;return(g=(_=m.value)==null?void 0:_.tags)!=null&&g.nodes.length?(i(),f(b,{key:0},{title:n(()=>[o(ie,{locale:null},{default:n(()=>[H(d(v.$t("web.popularTags")),1)]),_:1})]),default:n(()=>{var h,r;return[l("div",ge,[(i(!0),S(A,null,j((r=(h=m.value)==null?void 0:h.tags)==null?void 0:r.nodes,s=>(i(),f(ue,{key:s.id,data:s,size:"sm",variant:"tonal"},null,8,["data"]))),128))])]}),_:1})):T("",!0)}}}),ye={class:"col-span-full flex justify-center"},be=["action"],ve={id:"search-label",class:"sr-only",for:"search-input"},we={type:"submit",class:"sr-only"},$e={class:"col-span-full"},ke=20,Ke=V({__name:"search",async setup(t){let e,p;const m=$(` 15 query Search_Query($q: String!, $locale: Locale!, $first: Int!) { 16 books( 17 first: $first 18 filterBy: { query: $q } 19 orderBy: [ 20 { field: _Top, direction: Desc } 21 { field: ReleasedDate, direction: Desc } 22 { field: _Shuffle, direction: Desc } 23 ] 24 ) { 25 totalCount 26 ...TitlesHubPageGrid_TitleConnectionFragment 27 } 28 serieses(first: $first, filterBy: { query: $q }) { 29 totalCount 30 ...TitlesHubPageGrid_TitleConnectionFragment 31 } 32 } 33`),v=$(` 34 query SearchSupplemental_Query($locale: Locale!, $tagHubFirst: Int!) { 35 ...PopularTagsPageGrid_QueryFragment 36 } 37`),w=K(),_=U(),g=Y(),h=Z("view_search_results"),r=J(P.SearchQuery,"",{mode:"replace"}),s=O(),E=ae(()=>{r.value!==s.value&&(r.value=s.value)},300),[{data:c,error:G,fetching:L},R]=([e,p]=W(()=>Promise.all([x({query:m,variables:k(()=>({q:r.value??"",locale:w.value,first:ke}))}),x({query:v,variables:k(()=>({locale:w.value,tagHubFirst:16}))})])),e=await e,p(),e),z=()=>{r.value=void 0};return X(()=>s.value,E),q(()=>{s.value=r.value}),q(()=>{r.value&&h({search_term:r.value})}),ee({ogType:void 0,title:()=>r.value??_.t("web.search")}),(u,y)=>(i(),f(de,{error:a(G),data:a(c)},{default:n(()=>{var C,Q,I,B,D,F;return[o(b,{"flush-t":""},{default:n(()=>[l("div",ye,[l("form",{action:a(g),class:"relative w-full md:w-3/4",onSubmit:y[1]||(y[1]=te(()=>{},["prevent"]))},[l("label",ve,d(u.$t("web.search")),1),o(ne,{id:"search-input",modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=N=>s.value=N),"aria-labelledby":"search-label","icon-left":a(oe),"icon-right":a(_e),loading:a(L),name:a(P).SearchQuery,placeholder:u.$t("web.search"),autofocus:"",class:"shadow-sm","icon-right-no-loading":"",size:"lg",type:"search"},null,8,["modelValue","icon-left","icon-right","loading","name","placeholder"]),s.value?(i(),f(re,{key:0,class:se([s.value?"opacity-100":"opacity-0","absolute top-1/2 right-0 -translate-x-1/3 -translate-y-1/2"]),icon:a(fe),size:"sm",variant:"text",onClick:z},null,8,["class","icon"])):T("",!0),l("button",we,d(u.$t("web.search")),1)],40,be)])]),_:1}),o(b,null,{pageTitle:n(()=>[o(le,{locale:null},{default:n(()=>[H(d(u.$t("web.discover")),1)]),_:1})]),_:1}),!((Q=(C=a(c))==null?void 0:C.serieses)!=null&&Q.totalCount)&&!((B=(I=a(c))==null?void 0:I.books)!=null&&B.totalCount)?(i(),f(b,{key:0},{default:n(()=>[l("div",$e,d(u.$t("web.emptySearchResultMessage")),1)]),_:1})):T("",!0),o(M,{data:(D=a(c))==null?void 0:D.serieses,title:u.$t("web.series",2)},null,8,["data","title"]),o(M,{data:(F=a(c))==null?void 0:F.books,title:u.$t("web.book",2)},null,8,["data","title"]),o(he,{data:a(R).data.value},null,8,["data"])]}),_:1},8,["error","data"]))}});
37export{Ke as default};
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.