1import{C as e,E as t,Gt as n,I as r,Lt as i,O as a,Ot as o,S as s,T as c,Z as l,a as u,an as d,bt as f,d as ee,et as p,g as m,ht as te,j as h,k as g,m as ne,mt as re,p as ie,pt as _,un as v,ut as ae,w as y,wt as oe}from"./CD9tcrLv.js";import{d as b,p as se}from"./BWBLu-CU.js";import{t as x}from"./CY1ECJ41.js";import{n as S,r as ce}from"./Dv4YJgCc.js";import{d as le,o as ue,p as de,v as C}from"#entry";import{t as w}from"./BDNMzG2s.js";import{n as fe}from"./CX9jU_ls.js";import{t as pe}from"./C1ABKsil.js";import{t as me}from"./BIv8KzXY.js";import{c as T,f as he,r as ge,t as _e}from"./Cyfa5kIC.js";r(),f(),n(),u();var ve={class:`page-pt relative overflow-hidden pb-10 md:pb-12`},ye={class:`relative mx-auto max-w-[1200px] px-4`},be={class:`mb-5 inline-flex items-center gap-2 rounded-full border border-border/70 bg-background/80 px-3 py-1 text-xs font-medium text-muted-foreground backdrop-blur`},xe={class:`text-[2.35rem] font-semibold leading-[1.12] tracking-tight text-foreground md:text-[3.25rem]`},Se={class:`mt-1 block text-primary`},E={class:`mt-4 max-w-xl text-[15px] leading-7 text-muted-foreground md:text-base`},D={key:0,class:`mt-4 text-sm text-muted-foreground`},O={class:`pb-16 md:pb-24`},k={class:`mx-auto max-w-[1200px] px-4`},A={class:`sticky top-[4.5rem] z-40 -mx-4 mb-8 border-y border-border/60 bg-background/80 px-4 py-3 backdrop-blur-md md:mx-0 md:rounded-2xl md:border md:px-5`},j={class:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`},Ce={key:0,class:`flex flex-wrap items-center gap-1.5`},we=[`onClick`],Te={class:`ml-1 opacity-60`},Ee={key:1,class:`text-xs text-muted-foreground`},De={class:`font-medium text-foreground`},M={class:`relative w-full lg:w-72`},Oe=[`placeholder`,`onKeydown`],ke=[`title`],Ae={key:0,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},je={key:1,class:`py-20 text-center`},Me={class:`mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-muted`},Ne={class:`mb-2 text-lg font-semibold text-foreground`},Pe={class:`mb-6 text-sm text-muted-foreground`},Fe={key:2,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},Ie={key:3,class:`mt-12 flex items-center justify-center gap-1.5`},Le=[`disabled`],Re={key:0,class:`px-2 text-sm text-muted-foreground`},ze=[`onClick`],Be=[`disabled`],Ve={key:4,class:`mt-5 text-center text-xs text-muted-foreground`},N=12,P=w(h({__name:`index`,async setup(n){let r,u,{t:f,locale:h}=de(),w=le(),P=se(),F=s(()=>{let e=parseInt(P.query.page);return isNaN(e)||e<1?1:e}),I=o(P.query.category||``),L=o(P.query.keyword||``),R=s(()=>F.value>1?T(f(`blog.seoPage`,{page:F.value})):T(f(`blog.pageTitle`))),z=s(()=>f(`blog.pageDescription`)),B=s(()=>he(w(`/blog`))),V=s(()=>F.value===1?B.value:`${B.value}?page=${F.value}`);ce({title:R,description:z,author:_e.author,ogType:`website`,ogTitle:R,ogDescription:z,ogImage:`https://ducafecat.com/social-card.png`,ogUrl:V,twitterCard:`summary_large_image`,twitterTitle:R,twitterDescription:z,twitterImage:`https://ducafecat.com/social-card.png`}),S({link:[{rel:`canonical`,href:V},F.value>1?{rel:`prev`,href:F.value===2?B.value:`${B.value}?page=${F.value-1}`}:void 0].filter(Boolean)});let{data:H,pending:U,refresh:He}=([r,u]=_(()=>C(`blog-articles`,()=>x(`/api/portal/blog/list`,{params:{page:F.value,limit:N,category_code:I.value,keyword:L.value.trim(),locale:h.value}}),{watch:[F,I,L,h],server:!0,lazy:!1})),r=await r,u(),r),{data:W}=([r,u]=_(()=>C(`blog-categories`,()=>x(`/api/portal/blog/categories`,{params:{locale:h.value}}),{watch:[h],server:!0})),r=await r,u(),r),G=s(()=>{if(!H.value)return[];let e=H.value;return e&&typeof e==`object`&&e.data&&Array.isArray(e.data.contents)?e.data.contents:[]}),K=s(()=>H.value&&H.value?.data?.pagination?.total||0),q=s(()=>{if(!W.value)return[];let e=W.value;return e&&typeof e==`object`&&e.data&&Array.isArray(e.data)?e.data.filter(e=>e.article_count>0):[]}),J=s(()=>Math.ceil(K.value/N)),Y=e=>[`rounded-full px-3.5 py-1.5 text-xs font-medium transition-colors`,e?`bg-foreground text-background`:`text-muted-foreground hover:bg-muted hover:text-foreground`],Ue=s(()=>{let e=[];
1if(J.value<=7)for(let t=1;t<=J.value;t++)e.push(t);else{e.push(1),F.value>4&&e.push(`...`);let t=Math.max(2,F.value-2),n=Math.min(J.value-1,F.value+2);for(let r=t;r<=n;r++)e.push(r);F.value<J.value-2-1&&e.push(`...`),e.push(J.value)}return e}),We=e=>{e.uri?b(w(`/blog/${e.uri}`)):b(w(`/blog/${e._id}`))},Ge=()=>{let e=L.value.trim();e?b(w({path:`/blog`,query:{keyword:e,...I.value&&{category:I.value}}})):(F.value!==1||P.query.keyword)&&b(w({path:`/blog`,...I.value&&{query:{category:I.value}}}))},Ke=()=>{Ge()},X=()=>{L.value=``,I.value=``,b(w(`/blog`))},Z=e=>{I.value=e,b(w({path:`/blog`,query:{...e&&{category:e},...L.value.trim()&&{keyword:L.value.trim()}}}))},Q=e=>{if(typeof e==`string`||e===F.value)return;let t={};e>1&&(t.page=String(e)),I.value&&(t.category=I.value),L.value.trim()&&(t.keyword=L.value.trim()),b(w({path:`/blog`,...Object.keys(t).length&&{query:t}})),window.scrollTo({top:0,behavior:`smooth`})};ae(()=>P.query,()=>{I.value=P.query.category||``,L.value=P.query.keyword||``},{deep:!0});let $=s(()=>{let e=[];return G.value&&G.value.length>0&&e.push(ge({articles:G.value,total:K.value,page:F.value,pageSize:N,category:I.value,keyword:L.value.trim()})),e});return S(()=>{let e={script:[],link:[]};return $.value&&$.value.length>0&&e.script.push({type:`application/ld+json`,innerHTML:JSON.stringify($.value),key:`structured-data`}),F.value<J.value&&e.link.push({rel:`next`,href:`https://ducafecat.com/blog?page=${F.value+1}`,key:`next-page`}),e}),(n,r)=>{let o=ue,s=pe,u=fe,h=me;return l(),t(`main`,null,[e(`section`,ve,[r[5]||=e(`div`,{class:`pointer-events-none absolute inset-0 opacity-30 dark:opacity-20 [background-image:linear-gradient(to_right,var(--border)_1px,transparent_1px),linear-gradient(to_bottom,var(--border)_1px,transparent_1px)] [background-size:56px_56px] [mask-image:radial-gradient(ellipse_at_center,black_38%,transparent_72%)]`},null,-1),r[6]||=e(`div`,{class:`pointer-events-none absolute top-10 right-[8%] h-72 w-72 rounded-full bg-primary/12 blur-3xl`},null,-1),e(`div`,ye,[e(`p`,be,[r[4]||=e(`span`,{class:`h-1.5 w-1.5 rounded-full bg-primary`},null,-1),a(` Blog · `+v(i(K))+` `+v(i(f)(`blog.articlesCount`)),1)]),e(`h1`,xe,[a(v(i(f)(`blog.heroTitle`))+` `,1),e(`span`,Se,v(i(f)(`blog.heroHighlight`)),1)]),e(`p`,E,v(i(f)(`blog.subtitle`)),1),i(F)>1?(l(),t(`p`,D,v(i(f)(`blog.page`))+` `+v(i(F)),1)):c(``,!0)])]),e(`section`,O,[e(`div`,k,[e(`div`,A,[e(`div`,j,[i(L).trim()?(l(),t(`p`,Ee,[a(v(i(f)(`blog.searchResultsFor`))+` `,1),e(`span`,De,v(i(L).trim()),1),a(` · `+v(i(K))+` `+v(i(f)(`blog.articlesCount`))+` `,1),e(`button`,{type:`button`,class:`ml-2 text-primary hover:underline`,onClick:X},v(i(f)(`blog.clearSearch`)),1)])):(l(),t(`div`,Ce,[e(`button`,{type:`button`,class:d(Y(i(I)===``)),onClick:r[0]||=e=>Z(``)},v(i(f)(`blog.all`)),3),(l(!0),t(m,null,p(i(q),n=>(l(),t(`button`,{key:n.code,type:`button`,class:d(Y(i(I)===n.code)),onClick:e=>
1Z(n.code)},[a(v(n.title)+` `,1),e(`span`,Te,`(`+v(n.article_count||0)+`)`,1)],10,we))),128))])),e(`div`,M,[g(o,{name:`heroicons:magnifying-glass`,class:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),te(e(`input`,{"onUpdate:modelValue":r[1]||=e=>oe(L)?L.value=e:null,type:`text`,placeholder:i(f)(`blog.searchPlaceholder`),class:`h-9 w-full rounded-full border border-border bg-background pr-9 pl-9 text-sm text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring`,onKeydown:ie(ne(Ke,[`prevent`]),[`enter`])},null,40,Oe),[[ee,i(L)]]),i(L)?(l(),t(`button`,{key:0,type:`button`,class:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,title:i(f)(`blog.clearSearch`),onClick:X},[g(o,{name:`heroicons:x-mark`,class:`h-4 w-4`})],8,ke)):c(``,!0)])])]),i(U)&&i(G).length===0?(l(),t(`div`,Ae,[(l(),t(m,null,p(6,e=>g(s,{key:e})),64))])):!i(U)&&i(G).length===0?(l(),t(`div`,je,[e(`div`,Me,[g(o,{name:`heroicons:document-text`,class:`h-8 w-8 text-muted-foreground`})]),e(`h3`,Ne,v(i(L).trim()?i(f)(`blog.noSearchResults`):i(f)(`blog.noArticles`)),1),e(`p`,Pe,v(i(L).trim()?i(f)(`blog.noSearchResultsDescription`):i(f)(`blog.noArticlesDescription`)),1),i(L).trim()?(l(),y(u,{key:0,class:`rounded-full px-6`,onClick:X},{default:re(()=>[a(v(i(f)(`blog.clearSearch`)),1)]),_:1})):c(``,!0)])):(l(),t(`div`,Fe,[(l(!0),t(m,null,p(i(G),e=>(l(),y(h,{key:e._id,article:e,categories:i(q),"on-navigate":We},null,8,[`article`,`categories`]))),128))])),!i(U)&&i(J)>1?(l(),t(`div`,Ie,[e(`button`,{type:`button`,disabled:i(F)===1,class:`flex h-9 w-9 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,onClick:r[2]||=e=>Q(i(F)-1)},[g(o,{name:`heroicons:chevron-left`,class:`h-4 w-4`})],8,Le),(l(!0),t(m,null,p(i(Ue),(e,n)=>(l(),t(m,{key:n},[e===`...`?(l(),t(`span`,Re,`...`)):(l(),t(`button`,{key:1,type:`button`,class:d([`h-9 min-w-9 rounded-full px-3 text-sm font-medium transition-colors`,i(F)===e?`bg-foreground text-background`:`text-muted-foreground hover:bg-muted hover:text-foreground`]),onClick:t=>Q(e)},v(e),11,ze))],64))),128)),e(`button`,{type:`button`,disabled:i(F)===i(J),class:`flex h-9 w-9 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,onClick:r[3]||=e=>Q(i(F)+1)},[g(o,{name:`heroicons:chevron-right`,class:`h-4 w-4`})],8,Be)])):c(``,!0),!i(U)&&i(G).length>0?(l(),t(`p`,Ve,v(i(f)(`blog.showing`))+` `+v((i(F)-1)*N+1)+` - `+v(Math.min(i(F)*N,i(K)))+` `+v(i(f)(`blog.of`))+` `+v(i(K))+` `+v(i(f)(`blog.articlesCount`)),1)):c(``,!0)])])])}}}),[[`__scopeId`,`data-v-bc172ad8`]]);export{P 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.