PageSourceSearch

https://cinobo.com/_nuxt/sdW7uTFl.js

js cinobo.com collected 2026-09-24 20:03:51 UTC 3,229 bytes, 1 lines download raw bytes

1import{_ as E}from"./D2CBYQ1k.js";import{a as z,_ as D}from"./CyNpjGmx.js";import{Q as C,R as H,v as p,t as I,r as P,aj as V,aN as A,au as J,Z as M,g as o,m as f,j as v,h as e,p as N,i as y,F as j,w as T,a2 as Q,a3 as F,a4 as R,q as Z,f as a,k as G}from"./pP0UU-Sk.js";import"./BjOy7TZs.js";import"./CcGNT1fO.js";const B=24,U=L=>{const{locale:n,t:x}=C(),l=P(!1),t=P(!1),s=p(()=>(I(L)||"").trim()),{data:c,pending:m,error:k,refresh:$}=H(()=>`journal-search-${n.value}-${s.value}`,()=>(t.value=!1,s.value?$fetch("/api/journal/search",{query:{q:s.value,locale:n.value,limit:B,offset:0}}):{results:[],estimatedTotalHits:0}),{server:!0,lazy:!1,watch:[n,s]}),i=p(()=>c.value?.results||[]),_=p(()=>i.value.length<(c.value?.estimatedTotalHits||0)),d=async()=>{if(l.value||!_.value)return;t.value=!1,l.value=!0;const u=i.value.length,b=s.value,S=n.value,r=()=>b!==s.value||S!==n.value;try{const h=await $fetch("/api/journal/search",{query:{q:s.value,locale:n.value,limit:B,offset:u}});if(r())return;c.value=h?.results?.length?{...h,results:[...i.value,...h.results]}:{...c.value,estimatedTotalHits:i.value.length}}catch{if(r())return;t.value=!0,V().show(x("blog.load_more_error"),"error")}finally{l.value=!1}},g=async(u=!1)=>{u&&await d()},q=()=>(t.value=!1,d()),w=p(()=>m.value||l.value);return{posts:i,isLoading:w,hasNextPage:_,hasError:t,fetchPosts:g,retry:q,refresh:$,error:k}},K={class:"container-fluid py-6 lg:pt-10 lg:pb-20 flex flex-col gap-4 lg:gap-12"},O={key:0,class:"flex flex-col gap-4 lg:max-w-[740px] animate-pulse"},W={key:1,class:"flex flex-col gap-4 lg:max-w-[740px]"},X={class:"text-display-2xs lg:text-display-sm text-ink"},Y={key:2,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-4 gap-y-6"},ee={key:3,class:"text-center py-20 text-ink-light text-sm"},se={key:4,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-4 gap-y-6"},te={key:5,class:"flex justify-center py-10"},ce={__name:"[q]",setup(L){const{t:n}=C(),x=A(),l=p(()=>x.params.q),{posts:t,isLoading:s,hasNextPage:c,hasError:m,fetchPosts:k,retry:$}=U(l),{loadingTrigger:i}=J({fetchMore:k,isLoading:s,hasNextPage:c}),_=p(()=>s.value&&!t.value.length);return M({title:()=>n("blog.search.results",{query:l.value}),noindex:!0}),(d,g)=>{const q=E,w=D,u=z,b=R,S=Z;return a(),o(j,null,[f(q),v("div",K,[e(_)?(a(),o("section",O,[...g[1]||(g[1]=[v("div",{class:"bg-surface-xLight h-8 lg:h-11 w-2/3 max-w-80 rounded"},null,-1)])])):e(l)?(a(),o("section",W,[v("h1",X,N(d.$t("blog.search.results",{query:e(l)})),1)])):y("",!0),e(t).length>0?(a(),o("div",Y,[(a(!0),o(j,null,T(e(t),r=>(a(),G(w,{key:r.id,post:r},null,8,["post"]))),128))])):e(s)?y("",!0):(a(),o("div",ee,N(d.$t("blog.not_found")),1)),e(s)&&e(t).length===0?(a(),o("div",se,[f(u,{orientation:"horizontal",class:"lg:col-span-full col-span-1"}),f(u,{class:"lg:hidden"}),(a(),o(j,null,T(6,r=>f(u,{key:r})),64))])):y("",!0),Q(v("div",{ref_key:"loadingTrigger",ref:i,class:"flex justify-center py-10"},[f(b,{name:"ci-notch",size:32,class:"animate-spin"})],512),[[F,e(c)&&!e(m)]]),e(m)&&e(t).length?(a(),o("div",te,[f(S,{variant:"secondary",size:"sm",label:d.$t("try_again_cta"),loading:e(s),onClick:g[0]||(g[0]=r=>e($)())},null,8,["label","loading"])])):y("",!0)])],64)}}};export{ce 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.