1import{d as I,T as J,E as L,B as f,J as R,g as l,h as u,w as q,j as n,n as c,F as C,r as P,k as r,p as N,t as p,f as a,z as j,m as H,A as m,C as O}from"./CT5bnZVn.js";import{_ as Q}from"./CD0g_28T.js";import{_ as G}from"./DBKR9Oh7.js";import{P as K}from"./C2U5ePl3.js";import{P as W}from"./CYNzpMEt.js";import{P as X}from"./CyCYo6JB.js";import{P as Y}from"./P6M8VL11.js";import{u as Z}from"./1aU9hW5e.js";import{u as S}from"./BEx0xS7t.js";import{u as ee}from"./338o--IA.js";import"./fosP2mMz.js";import"./LqOT5zyH.js";const te={class:"diaries-page"},se={key:0,class:"page-container diaries__rubrics-row"},oe={key:1,class:"page-container diaries__writers-strip lg:hidden"},ae=["src","alt"],ne={class:"page-container diaries__layout"},le={key:0,class:"diaries__skeleton","aria-hidden":"true"},re={key:2,class:"diaries__empty"},ie={key:3,class:"diaries__more-wrap"},ue=["disabled"],ce={class:"diaries__aside hidden lg:block"},_e={key:0,class:"diaries__box"},de={class:"diaries__writers"},pe=["src","alt"],me={class:"diaries__writer-name"},he={class:"diaries__writer-count"},ge={key:1,class:"diaries__box"},ve={class:"diaries__rubric-list"},fe=["onClick"],ye=I({__name:"diaries",async setup(ke){let y,B;const k=J(),A=L(),h=f(k.query.tag||""),_=f(k.query.q||""),b=f(1),d=f([]),g=f(!1),{data:M,pending:T}=([y,B]=R(()=>Z("diaries-feed",()=>S().fetchArticles({content_type:"diary",page:1,tag:h.value||void 0,search:_.value||void 0,ordering:"-published_at"}),{default:()=>null,watch:[h,_]})),y=await y,B(),y),$=m(()=>M.value?.results??[]),v=m(()=>[...$.value,...d.value]),z=m(()=>!!M.value?.next&&d.value.length<200),x=m(()=>{const t=new Map;for(const s of v.value){const o=s.author_person;if(!o?.slug)continue;const i=t.get(o.slug);i?i.count+=1:t.set(o.slug,{slug:o.slug,full_name:o.full_name,photo:o.photo,count:1})}return[...t.values()].sort((s,o)=>o.count-s.count)}),w=m(()=>{const t=new Map;for(const s of v.value)for(const o of s.tags??[]){const i=t.get(o.slug);i?i.count+=1:t.set(o.slug,{slug:o.slug,name:o.name,count:1})}return[...t.values()].sort((s,o)=>o.count-s.count).slice(0,12)}),D=m(()=>[{value:"",label:"вÑе запиÑи"},...w.value.map(t=>({value:t.slug,label:t.name,count:t.count}))]);function V(t){h.value=t,d.value=[],b.value=1,A.replace({query:{...k.query,tag:t||void 0}})}function E(t){const s=t.trim();s!==_.value&&(d.value=[],b.value=1,_.value=s,A.replace({query:{...k.query,q:s||void 0}}))}async function U(){if(!g.value){g.value=!0;try{b.value+=1;const t=await S().fetchArticles({content_type:"diary",page:b.value,tag:h.value||void 0,search:_.value||void 0,ordering:"-published_at"});d.value=[...d.value,...t.results??[]]}finally{g.value=!1}}}return ee({title:"ÐвÑоÑÑкие дневники",description:"ÐапиÑи авÑоÑов издаÑелÑÑÑва «ÐикеÑ»: о ÑабоÑе над книгами, оÑвеÑÑ ÑиÑаÑелÑм, замеÑки из аÑÑ
ива.",path:"/authors/diaries"}),(t,s)=>{const o=j,i=Q,F=G;return a(),l("div",te,[u(K,{crumbs:[{label:"ÐÑÑнал",to:"/blog"}],title:"ÐвÑоÑÑкие дневники",description:"ÐапиÑи авÑоÑов издаÑелÑÑÑва: о ÑабоÑе над книгами, оÑвеÑÑ ÑиÑаÑелÑм и замеÑки из аÑÑ
ива"}),u(W,null,{default:q(()=>[u(X,{"model-value":n(_),placeholder:"ÐоиÑк по запиÑÑм","onUpdate:modelValue":E},null,8,["model-value"])]),_:1}),n(w).length?(a(),l("div",se,[u(Y,{options:n(D),"model-value":n(h),scroll:"always",label:"Ð ÑбÑики","onUpdate:modelValue":s[0]||(s[0]=e=>V(e))},null,8,["options","model-value"])])):c("",!0),n(x).length?(a(),l("div",oe,[(a(!0),l(C,null,P(n(x),e=>(a(),N(o,{key:e.slug,to:`/authors/${e.slug}`,class:"diaries__writer-chip"},{default:q(()=>[e.photo?(a(),l("img",{key:0,src:e.photo,alt:e.full_name,loading:"lazy"},null,8,ae)):c("",!0),r("span",null,p(e.full_name),1)]),_:2},1032,["to"]))),128))])):c("",!0),r("div",ne,[r("section",null,[n(T)&&!n(v).length?(a(),l("div",le,[(a(),l(C,null,P(3,e=>r("div",{key:e,class:"diaries__skeleton-row"},[u(i,{width:"40%",height:"1.25rem",class:"mb-3"}),u(i,{width:"100%",height:"0.9rem",class:"mb-2"}),u(i,{width:"70%",height:"0.9rem"})])),64))])):n(v).length?(a(),N(F,{key:1,entries:n(v),"show-author":""},null,8,["entries"])):(a(),l("p",re," ÐапиÑей пока неÑ. ÐаглÑниÑе позже â авÑоÑÑ Ð¿Ð¸ÑÑÑ Ð² дневник неÑаÑÑо, но по делÑ. ")),n(z)?(a(),l("div",ie,[r("button",{type:"button",class:"diaries__more",disabled:n(g),onClick:U},p(n(g)?"ÐагÑÑжаемâ¦":"ÐоказаÑÑ Ð±Ð¾Ð»ÑÑе запиÑей"),9,ue)])):c("",!0)]),r("aside",ce,[n(x).length?(a(),l("div",_e,[s[1]||(s[1]=r("p",{class:"diaries__box-title"},"ÐÑо ведÑÑ Ð´Ð½ÐµÐ²Ð½Ð¸Ðº",-1)),r("ul",de,[(a(!0),l(C,null,P(n(x),e=>(a(),l("li",{key:e.slug},[u(o,{to:`/authors/${e.slug}`,class:"diaries__writer"},{default:q(()=>[e.photo?(a(),l("img",{key:0,src:e.photo,alt:e.full_name,loading:"lazy"},null,8,pe)):c("",!0),r("span",me,p(e.full_name),1),r("span",he,p(e.count),1)]),_:2},1032,["to"])]))),128))])])):c("",!0),n(w).length?(a(),l("div",ge,[s[2]||(s[2]=r("p",{class:"diaries__box-title"},"Ð ÑбÑики",-1)),r("ul",ve,[(a(!0),l(C,null,P(n(w),e=>(a(),l("li",{key:e.slug},[r("button",{type:"button",onClick:be=>V(e.slug)},[H(p(e.name),1),r("span",null,p(e.count),1)],8,fe)]))),128))])])):c("",!0)])])])}}}),$e=O(ye,[["__scopeId","data-v-7951d41a"]]);export{$e 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.