1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BlogAttachedVideo-CoEge9H5.js","assets/vendor-vue-Bu-KQjoC.js","assets/rolldown-runtime-hePW80VL.js","assets/preload-helper-Czpn1I53.js","assets/index-BE2-dWra.js","assets/apiResponse-C8fEm_-L.js","assets/zh-CN-ylOr0fuO.js","assets/storage-ChBPOZmh.js","assets/index-CvSfWnUs.css","assets/danmakuApi-I3LatYNp.js","assets/useMdBreakpoint-sp9hdkzY.js","assets/videoDetailApi-GjJVd2Xr.js","assets/commentApi-CZfXaEOY.js","assets/blogMeta-BvgcPzkT.js","assets/videoMeta-BsFx8V72.js","assets/videoStaffApi-BM5KDgOf.js","assets/BlogEmbeddedVideoCard-DJLVVUV_.js","assets/VideoCard-D1Kl4hUn.js","assets/detailNavPrefetch-DTSBBnp1.js","assets/useWindowWidth-BPOgIc3r.js","assets/videoFormat-eMkACp59.js","assets/BlogForwardCard-qsJzciuN.js","assets/BlogContentRenderer-qER_0Wwh.js","assets/contentLinks-CQnY9Bwv.js","assets/BlogCachedImage-DqWEj00t.js","assets/GoreBadge-BvRTN-pY.js","assets/BlogForwardCard-BShVp1MS.css","assets/BlogDetailCommentsPanel-COyv59qg.js","assets/CommentReplyThread-nFtxr0fG.js","assets/useUsernameMatchSuggest-B2gsM2St.js","assets/imageApi-DfRzG9lf.js","assets/detailSeo-DAA_xaZS.js","assets/mediaMeta-CYd0ph1V.js"])))=>i.map(i=>d[i]); 2import{$ as e,A as t,C as n,D as r,E as i,F as a,H as o,J as s,K as c,M as l,N as u,O as d,P as f,S as p,T as m,W as h,Z as g,c as _,ct as v,it as y,j as b,k as x,n as ee,q as S,s as C,st as w,ut as T,x as E,z as D}from"./vendor-vue-Bu-KQjoC.js";import{t as O}from"./preload-helper-Czpn1I53.js";import{a as k,c as te,f as ne,h as re,p as ie,r as ae,s as oe,t as se,u as ce}from"./commentApi-CZfXaEOY.js";import{rt as A,s as j,st as le}from"./index-BE2-dWra.js";import{a as ue,i as M,n as de,r as fe,t as N}from"./useMdBreakpoint-sp9hdkzY.js";import{n as P}from"./blogMeta-BvgcPzkT.js";import{t as F}from"./BlogContentRenderer-qER_0Wwh.js";import{t as pe}from"./detailNavPrefetch-DTSBBnp1.js";import{i as I,t as me}from"./detailSeo-DAA_xaZS.js";import{t as L}from"./GoreBadge-BvRTN-pY.js";import{t as R}from"./ProfileFollowButton-C9xTYVX0.js";import{t as z}from"./ReportReasonModal-ADCZOTUx.js";import{a as he,i as ge,n as _e,o as ve,r as B,s as ye,t as be}from"./blogDetailApi-D0XtLdwF.js";import{a as xe}from"./blogApi-ZKHvcSlV.js";var Se={},V={class:`detail-skeleton animate-pulse`},H={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_minmax(280px,36%)] lg:grid-cols-[minmax(0,1fr)_minmax(320px,34%)]`},U={class:`min-w-0 overflow-hidden rounded-[var(--radius-default)] border border-border bg-surface md:max-h-[calc(100dvh-var(--app-header-height,5.8125rem)-1.5rem)]`},Ce={class:`space-y-4 px-3 py-3`};function we(e,t){return h(),x(`div`,V,[i(`div`,H,[t[2]||(t[2]=b(`<article class="min-w-0 overflow-hidden rounded-[var(--radius-default)] border border-border bg-surface"><header class="flex items-center gap-3 border-b border-border px-3 py-2.5"><div class="h-9 w-9 shrink-0 rounded-full detail-skeleton-block"></div><div class="min-w-0 flex-1 space-y-1.5"><div class="h-4 w-32 max-w-[60%] rounded detail-skeleton-block"></div><div class="h-3 w-48 max-w-full rounded detail-skeleton-block"></div></div><div class="h-8 w-16 shrink-0 rounded-[var(--radius-default)] detail-skeleton-block"></div></header><div class="px-3 py-3"><div class="h-6 w-2/3 max-w-lg rounded detail-skeleton-block"></div><div class="mt-3 overflow-hidden rounded-[var(--radius-default)] border border-border bg-reader"><div class="flex items-center justify-between px-3 py-2"><div class="h-4 w-36 rounded detail-skeleton-block"></div><div class="h-4 w-4 rounded detail-skeleton-block"></div></div></div><div class="mt-3 aspect-video rounded-[var(--radius-default)] detail-skeleton-block"></div><div class="mt-4 space-y-2"><div class="h-3 w-full rounded detail-skeleton-block"></div><div class="h-3 w-full rounded detail-skeleton-block"></div><div class="h-3 w-full rounded detail-skeleton-block"></div><div class="h-3 w-4/5 rounded detail-skeleton-block"></div><div class="h-3 w-2/3 rounded detail-skeleton-block"></div></div><div class="mt-4 flex flex-wrap gap-1.5">
2<div class="h-6 w-14 rounded-[var(--radius-default)] detail-skeleton-block"></div><div class="h-6 w-16 rounded-[var(--radius-default)] detail-skeleton-block"></div><div class="h-6 w-12 rounded-[var(--radius-default)] detail-skeleton-block"></div></div><div class="mt-4 flex items-center justify-between border-t border-border pt-3"><div class="flex gap-4"><div class="h-4 w-10 rounded detail-skeleton-block"></div><div class="h-4 w-10 rounded detail-skeleton-block"></div><div class="h-4 w-10 rounded detail-skeleton-block"></div></div><div class="h-4 w-12 rounded detail-skeleton-block"></div></div></div></article>`,1)),i(`section`,U,[t[1]||(t[1]=b(`<div class="space-y-1.5 border-b border-border px-3 py-2.5"><div class="h-4 w-16 rounded detail-skeleton-block"></div><div class="h-3 w-28 rounded detail-skeleton-block"></div></div><div class="border-b border-border px-3 py-3"><div class="h-[72px] rounded-[var(--radius-default)] detail-skeleton-block"></div></div>`,2)),i(`div`,Ce,[(h(),x(n,null,c(4,e=>i(`div`,{key:e,class:`flex gap-2`},[...t[0]||(t[0]=[b(`<div class="h-8 w-8 shrink-0 rounded-full detail-skeleton-block"></div><div class="min-w-0 flex-1 space-y-1.5"><div class="h-3 w-24 rounded detail-skeleton-block"></div><div class="h-3 w-full rounded detail-skeleton-block"></div><div class="h-3 w-4/5 rounded detail-skeleton-block"></div></div>`,2)])])),64))])])])])}var Te=A(Se,[[`render`,we]]),Ee={class:`flex items-center gap-3 border-b border-border px-3 py-2.5`},De=[`href`],Oe=[`src`,`alt`],ke={key:1,class:`flex h-9 w-9 items-center justify-center rounded-full border border-border bg-elevated text-muted`},W={class:`min-w-0 flex-1`},G=[`href`],Ae={class:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted`},je={"data-no-select":``},Me={class:`px-3 py-3`},Ne={key:0,class:`mt-2`},Pe={key:1,class:`mt-3 overflow-hidden rounded-[var(--radius-default)] border border-border bg-reader`,"data-no-select":``},Fe={key:0,class:`border-t border-border px-2 py-2`},K={class:`max-h-64 space-y-1 overflow-y-auto`},q=[`href`,`onClick`],J={class:`mt-4`},Ie={key:2,class:`mt-4 flex flex-wrap gap-1.5`},Y=[`href`,`onClick`],X={class:`mt-4 flex items-center justify-between border-t border-border pt-3`,"data-no-select":``},Le={class:`flex items-center gap-4 text-[13px]`},Re=[`disabled`],ze=[`disabled`],Be={class:`inline-flex items-center gap-1 text-secondary`},Ve={class:`flex items-center gap-3`},Z=[`disabled`],He=[`disabled`],Ue=[`href`],We={class:`h-10 w-10 shrink-0 overflow-hidden rounded-[var(--radius-default)] bg-elevated`},Ge=[`src`,`alt`],Ke={key:1,class:`flex h-full items-center justify-center text-[10px] text-muted`},qe={class:`min-w-0 flex-1`},Je={class:`truncate text-[13px] font-semibold text-primary`},Ye={class:`truncate text-[11px] text-muted`},Xe=a({__name:`BlogDetailTimelineCard`,props:{detail:{},collection:{},selected:{type:Boolean},liked:{type:Boolean},favorited:{type:Boolean},likeCount:{},favoriteCount:{},viewCount:{},actionLoading:{type:Boolean},canForward:{type:Boolean}},emits:[`select`,`like`,`favorite`,`forward`,`report`],setup(e,{emit:t}){let a=f(()=>O(()=>import(`./BlogAttachedVideo-CoEge9H5.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),o=f(()=>O(()=>import(`./BlogEmbeddedVideoCard-DJLVVUV_.js`).then(e=>e.n),__vite__mapDeps([16,2,1,17,5,6,3,4,7,8,13,18,19,20]))),m=f(()=>O(()=>import(`./BlogForwardCard-qsJzciuN.js`).then(e=>e.n),__vite__mapDeps([21,2,1,4,5,6,3,7,8,13,22,23,18,24,25,26]))),g=t,{t:b}=ee(),C=_(),D=y(!1);function k(e,t){j(e,C,t)}function te(e){e.target.closest(`a, button, input, textarea, [data-no-select]`)||g(`select`)}return(t,f)=>{let _=s(`MaterialIcon`);return h(),x(`article`,{role:`button`,tabindex:`0`,class:v([`min-w-0 cursor-pointer overflow-hidden rounded-[var(--radius-default)] border bg-surface transition-colors`,e.selected?`border-accent ring-1 ring-accent/30`:`border-border hover:border-accent/50`]),onClick:te,onKeydown:f[9]||(f[9]=E(p(e=>g(`select`),[`prevent`]),[`enter`]))}
2,[i(`header`,Ee,[i(`a`,{href:`/u/${e.detail.uid}`,class:`shrink-0`,onClick:f[0]||(f[0]=t=>k(t,`/u/${e.detail.uid}`))},[e.detail.avatarUrl?(h(),x(`img`,{key:0,src:e.detail.avatarUrl,alt:e.detail.username||e.detail.uid,class:`h-9 w-9 rounded-full border border-border object-cover`},null,8,Oe)):(h(),x(`div`,ke,[u(_,{name:`person`,size:18})]))],8,De),i(`div`,W,[i(`a`,{href:`/u/${e.detail.uid}`,class:`block truncate text-[14px] font-bold text-primary hover:text-accent`,onClick:f[1]||(f[1]=t=>k(t,`/u/${e.detail.uid}`))},T(e.detail.username||`UID ${e.detail.uid}`),9,G),i(`p`,Ae,[i(`span`,null,T(w(I)(e.detail.time)),1),f[10]||(f[10]=i(`span`,null,`·`,-1)),i(`span`,null,`OB`+T(e.detail.bid),1),f[11]||(f[11]=i(`span`,null,`·`,-1)),i(`span`,null,T(w(P)(e.detail.isGore)),1)])]),i(`div`,je,[u(R,{"profile-uid":e.detail.uid},null,8,[`profile-uid`])])]),i(`div`,Me,[u(F,{variant:`title`,content:e.detail.title||w(b)(`blog.untitled`,{bid:e.detail.bid})},null,8,[`content`]),e.detail.isGore===1?(h(),x(`div`,Ne,[u(L)])):d(``,!0),e.collection?(h(),x(`section`,Pe,[i(`button`,{type:`button`,class:`flex w-full items-center justify-between px-3 py-2 text-left text-[13px] font-semibold text-primary`,onClick:f[2]||(f[2]=p(e=>D.value=!D.value,[`stop`]))},[i(`span`,null,T(w(b)(`blog.collectionTitle`,{name:e.collection.name})),1),u(_,{name:D.value?`expand_less`:`expand_more`,size:18},null,8,[`name`])]),D.value?(h(),x(`div`,Fe,[i(`div`,K,[(h(!0),x(n,null,c(e.collection.items,t=>(h(),x(`a`,{key:t.bid,href:`/b/${t.bid}`,class:v([`block truncate rounded-[var(--radius-default)] px-2 py-1.5 text-[12px] transition-colors`,t.bid===e.detail.bid?`bg-accent-muted font-semibold text-accent`:`text-secondary hover:bg-elevated`]),onClick:e=>k(e,`/b/${t.bid}`)},` OB`+T(t.bid)+` · `+T(t.title),11,q))),128))])])):d(``,!0)])):d(``,!0),i(`div`,J,[u(F,{content:e.detail.content,"author-styles-active":e.selected},null,8,[`content`,`author-styles-active`])]),e.detail.tags.length>0?(h(),x(`div`,Ie,[(h(!0),x(n,null,c(e.detail.tags,e=>(h(),x(`a`,{key:e,href:`/search?q=${encodeURIComponent(e)}&t=blog`,class:`nico-btn nico-btn-sm border border-border bg-reader px-2 text-[11px] text-secondary hover:border-accent hover:text-accent`,onClick:t=>k(t,`/search?q=${encodeURIComponent(e)}&t=blog`)},` #`+T(e),9,Y))),128))])):d(``,!0),e.detail.attachedVideo&&!e.detail.forward?(h(),r(w(o),{key:3,class:`mt-4`,video:e.detail.attachedVideo},null,8,[`video`])):e.detail.attachedVid&&!e.detail.forward?(h(),r(w(a),{key:4,class:`mt-4`,"attached-vid":e.detail.attachedVid},null,8,[`attached-vid`])):d(``,!0),e.detail.forward?(h(),r(w(m),{key:5,class:`mt-4`,forward:e.detail.forward},null,8,[`forward`])):d(``,!0),e.detail.forward?.attachedVideo?(h(),r(w(o),{key:6,class:`mt-4`,video:e.detail.forward.attachedVideo},null,8,[`video`])):d(``,!0),i(`footer`,X,[i(`div`,Le,[i(`button`,{type:`button`,class:v([`nico-engage-btn inline-flex items-center gap-1 disabled:opacity-50`,e.liked?`text-accent`:`text-secondary`]),disabled:e.actionLoading,onClick:f[3]||(f[3]=p(e=>g(`like`),[`stop`]))},[u(_,{name:`thumb_up`,variant:e.liked?`filled`:`outlined`,size:18},null,8,[`variant`]),i(`span`,null,T(e.likeCount),1)],10,Re),i(`button`,{type:`button`,class:v([`nico-engage-btn inline-flex items-center gap-1 disabled:opacity-50`,e.favorited?`text-accent`:`text-secondary`]),disabled:e.actionLoading,onClick:f[4]||(f[4]=p(e=>g(`favorite`),[`stop`]))},[u(_,{name:`kitchen`,variant:e.favorited?`filled`:`outlined`,size:18},null,8,[`variant`]),i(`span`,null,T(e.favoriteCount),1)],10,ze),i(`span`,Be,[u(_,{name:`bar_chart`,size:18}),i(`span`,null,T(e.viewCount),1)])]),i(`div`,Ve,[e.canForward?(h(),x(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-[12px] text-muted hover:text-accent`,disabled:e.actionLoading,onClick:f[5]||(f[5]=p(e=>g(`forward`),[`stop`]))},[u(_,{name:`repeat`,size:16}),l(` `+T(w(b)(`blog.forward`)),1)],8,Z)):d(``,!0),i(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[12px] text-muted hover:text-danger`,disabled:e.actionLoading,onClick:f[6]||(f[6]=p(e=>g(`report`),[`stop`]))},[u(_,{name:`flag`,size:16}),l(` `+T(w(b)(`blog.report`)),1)],8,He)])]),e.detail.channelDetail?(h(),x(`a`,{key:7,href:`/channel/${e.detail.channelDetail.channelId}`,class:`mt-4 flex items-center gap-3 rounded-[var(--radius-default)] border border-border bg-reader px-3 py-2 transition-colors hover:border-accent`,onClick:f[7]||(f[7]=t=>
2k(t,`/channel/${e.detail.channelDetail.channelId}`))},[i(`div`,We,[e.detail.channelDetail.channelCoverUrl?(h(),x(`img`,{key:0,src:e.detail.channelDetail.channelCoverUrl,alt:e.detail.channelDetail.channelTitle,class:`h-full w-full object-cover`},null,8,Ge)):(h(),x(`div`,Ke,T(w(b)(`blog.noCover`)),1))]),i(`div`,qe,[i(`p`,Je,T(e.detail.channelDetail.channelTitle),1),i(`p`,Ye,`@`+T(e.detail.channelDetail.channelName),1)]),u(_,{name:`chevron_right`,size:18,class:`shrink-0 text-muted`})],8,Ue)):d(``,!0)]),t.$slots.comments?(h(),x(`div`,{key:0,"data-no-select":``,onClick:f[8]||(f[8]=p(()=>{},[`stop`]))},[S(t.$slots,`comments`)])):d(``,!0)],34)}}}),Q=[],$=-1;function Ze(e){let t=String(e||``).trim();if(!t||$>=0&&Q[$]===t)return;let n=Q.lastIndexOf(t);if(n>=0){$=n;return}Q.splice($+1),Q.push(t),$=Q.length-1}var Qe=new Map;function $e(e){return Qe.get(String(e))??null}function et(e,t){Qe.set(String(e),t)}var tt=`otto-blog-comment-page-size-v1`,nt=6,rt=10;function it(){if(typeof window>`u`)return rt;try{let e=window.localStorage.getItem(tt),t=Number(e);if(t===5||t===10||t===20)return t}catch{}return rt}function at(e){try{window.localStorage.setItem(tt,String(e))}catch{}}function ot(e){let t=e.toLowerCase();return t.includes(`failed to fetch`)||t.includes(`networkerror`)||t.includes(`network`)||t.includes(`ç½å
³`)||t.includes(`ææ¶ä¸å¯ç¨`)||t.includes(`ç¨åéè¯`)||t.includes(`gateway`)||t.includes(`unavailable`)}function st(){let e=C(),t=_(),n=le(),r=m(()=>String(e.params.bid??``)),i=y([]),a=y(``),s=y(!0),c=y(null),l=y(null),u=y(!1),d=0,f=!1,p=y(null),h=y(null),v=y(!1),b=y(!1),x=y(0),ee=y(0),S=y(0),w=y(!1),T=y(null),E=y([]),D=y([]),O=y(!1),A=y(1),j=y(`asc`),N=y(it()),P=y({}),F=y({}),I=y(!1),L=y(null),R=y(!1),z=m(()=>a.value||r.value),Se=m(()=>p.value?.uid),V=m(()=>p.value?.parentCommentCount??0);function H(e){p.value=e.detail,h.value=e.collection,v.value=e.liked,b.value=e.favorited,x.value=e.likeCount,ee.value=e.favoriteCount,S.value=e.viewCount}async function U(){if(!z.value)return;let e=n.activeAccount?.token,t=se(z.value,{parentBcid:0,offset:0,num:10,includePinned:!0,token:e}),r=await k(t,`è·å置顶è¯è®ºå¤±è´¥`);r.ok&&(D.value=oe(r.data).map(e=>B(e)).filter(e=>e.isPinned))}let{pinningCommentId:Ce,canManagePins:we,sortedPinnedComments:Te,parentTotalPages:Ee,toggleCommentPin:De,movePinnedComment:Oe}=fe({authorUid:Se,parentPage:A,parentCommentCount:V,pageSize:N,pinnedComments:D,fetchPinnedComments:U,refreshParentComments:()=>q(A.value),pinComment:te,unpinComment:re,sortPinComment:ie,getCommentId:e=>e.bcid}),ke=m(()=>de(A.value,Te.value,E.value,e=>e.bcid));function W(e){Ze(e)}function G(e,t){let n=i.value.findIndex(t=>t.detail.bid===e);if(n<0)return;let r=i.value[n],o={...r,...t,detail:t.detail??r.detail};i.value=[...i.value.slice(0,n),o,...i.value.slice(n+1)],a.value===e&&H(o)}async function Ae(e){let t=n.activeAccount?.token,r=null;for(let n=0;n<=2;n++)try{let n=await _e(e,t);if(n.ok||n.reason===`not_found`||n.reason===`too_many_request`)return n;throw Error(n.message)}catch(e){if(r=e instanceof Error?e:Error(String(e)),ot(r.message)&&n<2)continue;return{ok:!1,reason:`error`,message:r.message||`ç½ç»é误ï¼è¯·ç¨åéè¯`}}return{ok:!1,reason:`error`,message:r?.message||`ç½ç»é误ï¼è¯·ç¨åéè¯`}}async function je(e){let t=await Ae(e);if(!t.ok)return t;let n=t.detail;return{ok:!0,entry:{detail:n,collection:null,liked:n.ifLike,favorited:n.ifFavorite,likeCount:n.likeCount,favoriteCount:n.favoriteCount,viewCount:n.viewCount}}}async function Me(e){try{G(e,{collection:await be(e)})}catch{G(e,{collection:null})}}async function Ne(e){let t=n.activeAccount?.token;if(!t){u.value=!1;return}let r=++d;u.value=!0;try{let n=$e(e);if(n||(n=await xe(t,e),n&&et(e,n)),r!==d||!n||i.value.some(e=>e.detail.bid===n.bid))return;pe();let a=await je(n.bid);if(r!==d||!a.ok||i.value.some(e=>e.detail.bid===a.entry.detail.bid))return;i.value=[...i.value,a.entry],M(()=>void Me(a.entry.detail.bid),80)}finally{r===d&&(u.value=!1)}}async function Pe(e,n){if(!e)return;let o=i.value.find(t=>t.detail.bid===e);o&&a.value!==e&&(a.value=e,H(o),W(e),me(o.detail),J(),ue(()=>void Y()),n?.replaceRoute!==!1&&r.value!==e&&(f=!0,pe(),await t.replace(`/b/${e}`)),i.value[i.value.length-1]?.detail.bid===e&&M(()=>void Ne(e),120))}async function Fe(){if(!r.value||!n.isReady)return;if(f){f=!1;return}let e=i.value.find(e=>e.detail.bid===r.value);if(e){a.value=r.value,H(e),W(r.value),me(e.detail),J(),ue(()=>void Y());return}s.value=!0,c.value=null,l.value=null,d+=1,u.value=!1,i.value=[],a.value=``,p.value=null,h.value=null,W(r.value);let o=r.value,m=await je(o);if(r.value===o){if(!m.ok){if(m.reason===`not_found`){t.replace(`/blog`);return}c.value=m.message,l.value=m.reason===`too_many_request`?`too_many_request`:ot(m.message)?`fetch_failed`:null,s.value=!1;return}i.value=[m.entry],a.value=m.entry.detail.bid,H(m.entry),me(m.entry.detail),s.value=!1,ue(()=>void Y()),M(()=>void Me(m.entry.detail.bid),60),M(()=>void Ne(m.entry.detail.bid),200)}}let K=0;async function q(e=A.value){if(!z.value)return;let t=++K;O.value=!0;try{let r=n.activeAccount?.token,i=(e-1)*N.value,a=se(z.value,{parentBcid:0,offset:i,num:N.value,cidAsc:j.value===`asc`,includePinned:!1,token:r}),o=await k(a,`è·åè¯è®ºå¤±è´¥`);
2if(t!==K)return;if(!o.ok){T.value=o.message,e===1&&(E.value=[]);return}E.value=oe(o.data).map(e=>B(e)).filter(e=>!e.isPinned),A.value=e,T.value=null}finally{t===K&&(O.value=!1)}}function J(){K+=1,E.value=[],D.value=[],A.value=1,T.value=null,O.value=!0,P.value={},F.value={}}function Ie(){K+=1,E.value=[],A.value=1,T.value=null,O.value=!0,P.value={},F.value={},Y()}async function Y(){await q(1),await U()}function X(e){return E.value.find(t=>t.bcid===e)??D.value.find(t=>t.bcid===e)}async function Le(e,t=!1){let r=P.value[e];if(!t&&(r?.loading||r?.hasMore===!1))return;let i=t?X(e)?.childComments??[]:[],a=K,o=t?i.length:r?.comments.length??0,s=t?i:r?.comments??[];P.value={...P.value,[e]:{comments:s,loading:!0,hasMore:t?!0:r?.hasMore??!0,initialized:!0}};let c=n.activeAccount?.token,l=se(z.value,{parentBcid:e,offset:o,num:nt,cidAsc:j.value===`asc`,token:c}),u=await k(l,`è·ååå¤å¤±è´¥`);if(a!==K)return;if(!u.ok){T.value=u.message,P.value={...P.value,[e]:{comments:P.value[e]?.comments??[],loading:!1,hasMore:!1,initialized:!0}};return}let d=oe(u.data).map(e=>B(e)),f=t?[...i,...d]:[...r?.comments??[],...d],p=X(e)?.childCommentNum??f.length;P.value={...P.value,[e]:{comments:f,loading:!1,hasMore:f.length<p&&d.length===nt,initialized:!0}}}function Re(){j.value=j.value===`desc`?`asc`:`desc`}function ze(e){N.value=e,at(e),Ie()}function Be(e){e<1||e>Ee.value||q(e)}function Ve(e){if(F.value={...F.value,[e]:!0},!P.value[e]?.initialized){let t=X(e),n=t?.childComments??[];if(t&&n.length>0&&n.length>=t.childCommentNum){P.value={...P.value,[e]:{comments:n,loading:!1,hasMore:!1,initialized:!0}};return}Le(e,!0)}}function Z(){return n.isAuthenticated?!0:(n.openAuth(`login`),!1)}async function He(e){if(!Z())return;let t=n.activeAccount?.token,r=e||a.value;if(!(!t||!r||w.value)){w.value=!0;try{let e=await ye(r,t);e&&G(r,{liked:e.ifLike,likeCount:e.likeCount})}finally{w.value=!1}}}async function Ue(e){if(!Z())return;let t=n.activeAccount?.token,r=e||a.value;if(!(!t||!r||w.value)){w.value=!0;try{let e=await ve(r,t);e&&G(r,{favorited:e.ifFavorite,favoriteCount:e.favoriteCount})}finally{w.value=!1}}}async function We(e){let t=n.activeAccount?.token;if(!t)return n.openAuth(`login`),!1;if(!z.value)return!1;w.value=!0,T.value=null;try{let r=await ce({bid:z.value,token:t,parentBcid:0,content:e});if(!r.ok)return T.value=r.message,!1;let i=n.activeAccount,a={bcid:`temp-${Date.now()}`,parentBcid:`0`,uid:String(i?.uid??``),content:e,time:new Date().toISOString(),childCommentNum:0,ifMyComment:!0,username:i?.email?.split(`@`)[0]??`UID ${i?.uid}`,avatarUrl:i?.avatarUrl,isPinned:!1,pinOrder:0};return E.value=j.value===`asc`?[...E.value,a]:[a,...E.value],ne(()=>void q(A.value),e),!0}catch{return T.value=`åéè¯è®ºå¤±è´¥ï¼è¯·ç¨åéè¯`,!1}finally{w.value=!1}}async function Ge(e,t){let r=n.activeAccount?.token;if(!r)return n.openAuth(`login`),!1;if(!z.value)return!1;w.value=!0,T.value=null;try{let n=await ce({bid:z.value,token:r,parentBcid:e,content:t});if(!n.ok)return T.value=n.message,!1;F.value={...F.value,[e]:!0},ne(()=>void Le(e,!0),t);let i=E.value.find(t=>t.bcid===e);return i&&(i.childCommentNum+=1),!0}catch{return T.value=`åéåå¤å¤±è´¥ï¼è¯·ç¨åéè¯`,!1}finally{w.value=!1}}async function Ke(e,t){if(!Z())return;let r=n.activeAccount?.token;if(r&&window.confirm(`ç¡®å®è¦å é¤è¿æ¡è¯è®ºåï¼`)){w.value=!0;try{let n=await ae(e,r);if(!n.ok){T.value=n.message;return}if(t===`0`)E.value=E.value.filter(t=>t.bcid!==e),D.value=D.value.filter(t=>t.bcid!==e);else{let n=P.value[t];n&&(P.value={...P.value,[t]:{...n,comments:n.comments.filter(t=>t.bcid!==e)}});let r=X(t);r&&(r.childCommentNum>0&&--r.childCommentNum,r.childComments?.length&&(r.childComments=r.childComments.filter(t=>t.bcid!==e)))}}finally{w.value=!1}}}async function qe(e){let t=n.activeAccount?.token;if(t){R.value=!0;try{let n=!1;n=L.value?await he(L.value,t,e):await ge(z.value,t,e),n&&(I.value=!1,L.value=null)}finally{R.value=!1}}}function Je(){Z()&&(L.value=null,I.value=!0)}function Ye(e){Z()&&(L.value=e,I.value=!0)}function Xe(){I.value=!1,L.value=null}return g([r,()=>n.isReady,()=>n.activeAccount?.token??``],([e,t,n],r)=>
2{if(!(!t||!e)){if(f){f=!1;return}if(r!=null&&r[2]!==n){i.value=[],a.value=``,p.value=null,h.value=null,J(),Fe();return}i.value.some(t=>t.detail.bid===e)||(p.value=null,h.value=null,J()),Fe()}},{immediate:!0}),g(j,()=>{Ie()}),o(()=>{N.value=it()}),{routeBid:r,selectedBid:a,timeline:i,detail:p,collection:h,loading:s,error:c,errorType:l,liked:v,favorited:b,likeCount:x,favoriteCount:ee,viewCount:S,actionLoading:w,commentError:T,parentComments:E,displayedParentComments:ke,pinnedComments:D,parentLoading:O,parentPage:A,parentOrder:j,parentTotalPages:Ee,parentCommentCount:V,pageSize:N,childCommentsByParent:P,openParents:F,canManagePins:we,pinningCommentId:Ce,sortedPinnedComments:Te,reportBlogOpen:I,reportCommentBcid:L,reportSubmitting:R,nextBlogLoading:u,selectTimelineCard:Pe,loadDetail:Fe,fetchChildComments:Le,toggleParentOrder:Re,setCommentPageSize:ze,goParentPage:Be,openReplies:Ve,handleToggleLike:He,handleToggleFavorite:Ue,submitParentComment:We,submitReplyComment:Ge,handleDeleteComment:Ke,toggleCommentPin:De,movePinnedComment:Oe,submitReport:qe,openReportBlog:Je,openReportComment:Ye,closeReport:Xe,ensureAuthed:Z}}var ct={class:`space-y-3 pb-8`},lt={class:`flex items-center gap-1.5 text-[12px] text-muted`},ut={class:`truncate text-primary`},dt={key:1,class:`nico-panel px-4 py-10 text-center`},ft={class:`text-[13px] text-secondary`},pt={class:`min-w-0 space-y-3`},mt={key:0,class:`overflow-hidden rounded-[var(--radius-default)] border border-border bg-surface px-3 py-6`},ht={class:`text-center text-[12px] text-muted`},gt=a({__name:`BlogDetailView`,setup(a){let o=f(()=>O(()=>import(`./BlogDetailCommentsPanel-COyv59qg.js`),__vite__mapDeps([27,1,2,4,5,6,3,7,8,28,29,30,22,23,18,31,32]))),{t:p}=ee(),g=_(),y=le(),{isMd:b}=N(),{selectedBid:S,timeline:C,detail:E,loading:k,error:te,errorType:ne,actionLoading:re,commentError:ie,displayedParentComments:ae,parentLoading:oe,parentPage:se,parentOrder:ce,parentTotalPages:A,parentCommentCount:j,pageSize:ue,childCommentsByParent:M,openParents:de,canManagePins:fe,pinningCommentId:P,sortedPinnedComments:F,reportBlogOpen:pe,reportCommentBcid:I,reportSubmitting:me,nextBlogLoading:L,selectTimelineCard:R,loadDetail:he,fetchChildComments:ge,toggleParentOrder:_e,setCommentPageSize:ve,goParentPage:B,openReplies:ye,handleToggleLike:be,handleToggleFavorite:xe,submitParentComment:Se,submitReplyComment:V,handleDeleteComment:H,toggleCommentPin:U,movePinnedComment:Ce,submitReport:we,openReportBlog:Ee,openReportComment:De,closeReport:Oe,ensureAuthed:ke}=st(),W=m(()=>I.value?p(`blog.reportCommentTitle`):p(`blog.reportTitle`));function G(e){let t=y.activeAccount?.uid;return!(!y.isAuthenticated||t==null||e.forwardBid>0||Number(e.uid)===t)}function Ae(e){ke()&&g.push({path:`/creator/blog/new`,query:{forward_bid:e.bid}})}async function je(e){await R(e)}function Me(e){R(e).then(()=>Ee())}let Ne=[5,10,20],Pe=m(()=>({commentCount:E.value?.commentCount??0,commentError:ie.value,displayedParentComments:ae.value,parentLoading:oe.value,parentPage:se.value,parentOrder:ce.value,parentTotalPages:A.value,parentCommentCount:j.value,pageSize:ue.value,pageSizeOptions:Ne,childCommentsByParent:M.value,openParents:de.value,canManagePins:fe.value,pinningCommentId:P.value,sortedPinnedComments:F.value,actionLoading:re.value,submitParentComment:Se,submitReplyComment:V,ensureAuthed:ke}));return(a,f)=>{let m=s(`RouterLink`),g=s(`MaterialIcon`);return h(),x(`div`,ct,[i(`nav`,lt,[u(m,{to:`/blog`,class:`text-secondary hover:text-accent`},{default:e(()=>[l(T(w(p)(`nav.blog`)),1)]),_:1}),u(g,{name:`chevron_right`,size:14}),i(`span`,ut,T(w(E)?.title||w(p)(`blog.detail`)),1)]),w(k)&&w(C).length===0?(h(),r(Te,{key:0})):w(te)&&w(C).length===0?(h(),x(`div`,dt,[i(`p`,ft,T(w(te)),1),w(ne)===`fetch_failed`||w(ne)===`too_many_request`?(h(),x(`button`,{key:0,type:`button`,class:`nico-btn nico-btn-primary mt-4 px-4 text-[13px]`,onClick:f[0]||(f[0]=(...e)=>w(he)&&w(he)(...e))},T(w(p)(`blog.retry`)),1)):d(``,!0)])):w(C).length>0?(h(),x(`div`,{key:2,class:v([`grid grid-cols-1 items-start gap-3`,w(b)?`md:grid-cols-[minmax(0,1fr)_minmax(280px,36%)] lg:grid-cols-[minmax(0,1fr)_minmax(320px,34%)]`:``])},[i(`div`,pt,[(h(!0),x(n,null,c(w(C),n=>(h(),r(Xe,{key:n.detail.bid,detail:n.detail,collection:n.collection,selected:n.detail.bid===w(S),liked:n.liked,favorited:n.favorited,"like-count":n.likeCount,"favorite-count":n.favoriteCount,"view-count":n.viewCount,"action-loading":w(re),"can-forward":G(n.detail),onSelect:e=>je(n.detail.bid),onLike:e=>
2w(be)(n.detail.bid),onFavorite:e=>w(xe)(n.detail.bid),onForward:e=>Ae(n.detail),onReport:e=>Me(n.detail.bid)},t({_:2},[!w(b)&&n.detail.bid===w(S)?{name:`comments`,fn:e(()=>[u(w(o),D({ref_for:!0},Pe.value,{embedded:``,"onUpdate:commentError":f[1]||(f[1]=e=>ie.value=e),onToggleParentOrder:w(_e),onOpenReplies:w(ye),onOpenReportComment:w(De),onDeleteComment:f[2]||(f[2]=(e,t)=>w(H)(e,t)),onFetchChildComments:f[3]||(f[3]=e=>w(ge)(e)),onToggleCommentPin:w(U),onMovePinnedComment:f[4]||(f[4]=(e,t)=>w(Ce)(e,t)),onChangePage:w(B),onChangePageSize:w(ve)}),null,16,[`onToggleParentOrder`,`onOpenReplies`,`onOpenReportComment`,`onToggleCommentPin`,`onChangePage`,`onChangePageSize`])]),key:`0`}:void 0]),1032,[`detail`,`collection`,`selected`,`liked`,`favorited`,`like-count`,`favorite-count`,`view-count`,`action-loading`,`can-forward`,`onSelect`,`onLike`,`onFavorite`,`onForward`,`onReport`]))),128)),w(L)?(h(),x(`div`,mt,[i(`p`,ht,T(w(p)(`blog.loadingNextBlog`)),1)])):d(``,!0)]),w(b)?(h(),r(w(o),D({key:0},Pe.value,{"onUpdate:commentError":f[5]||(f[5]=e=>ie.value=e),onToggleParentOrder:w(_e),onOpenReplies:w(ye),onOpenReportComment:w(De),onDeleteComment:f[6]||(f[6]=(e,t)=>w(H)(e,t)),onFetchChildComments:f[7]||(f[7]=e=>w(ge)(e)),onToggleCommentPin:w(U),onMovePinnedComment:f[8]||(f[8]=(e,t)=>w(Ce)(e,t)),onChangePage:w(B),onChangePageSize:w(ve)}),null,16,[`onToggleParentOrder`,`onOpenReplies`,`onOpenReportComment`,`onToggleCommentPin`,`onChangePage`,`onChangePageSize`])):d(``,!0)],2)):d(``,!0),u(z,{open:w(pe),title:W.value,submitting:w(me),onClose:w(Oe),onSubmit:w(we)},null,8,[`open`,`title`,`submitting`,`onClose`,`onSubmit`])])}}});export{gt 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.