PageSourceSearch

https://bigplay.gg/_nuxt/BTMxpBtz.js

js bigplay.gg collected 2026-10-08 16:08:18 UTC 25,805 bytes, 11 lines download raw bytes

1import{H as re,d as ae,E as d,x as $,M as le,b as l,c as u,h as t,t as v,j as f,w as ye,S as ne,z as fe,y as D,L as we,ab as Je,_ as Le,P as Ce,O as Ie,I as Me,o as Se,aq as De,a3 as Ue,f as Fe,l as Te,e as Ee,v as qe,F as Z,p as $e,g as je,i as K,J as He,an as Ve,G as ze,Y as Ae,ao as We,$ as Ke,A as Ge,ap as Ye,al as xe,aJ as Xe,dg as Qe,aL as Ze}from"./tuBi7bMb.js";import{w as et}from"./Cl78Jm4q.js";import{u as Ne,_ as tt,N as st,a as ot}from"./DqfI51vI.js";import{u as nt}from"./CChnEUFh.js";import{A as Pe}from"./BWLvtRfu.js";import"./Ct6eWqVY.js";import"./Dhfh2mMW.js";const at=re("/share-arrow-icon.svg"),lt=re("/hyperlink.svg"),it=re("/telegram-news-icon.svg"),rt=re("/whatsapp-news-icon.svg"),ct=re("/vk-news-icon.svg"),ut=ae({name:"ContentRenderer",props:{content:{type:[String,Object],required:!0},debug:{type:Boolean,default:!1}},setup(o){const p=d(null);let r;try{r=typeof o.content=="string"?JSON.parse(o.content):o.content}catch(i){console.error("Error parsing JSON:",i),p.value=i,r=null}const b=$(()=>r&&typeof r=="object"&&("time"in r||"blocks"in r)),N=$(()=>!b.value||!(r!=null&&r.blocks)?"":r.blocks.map(i=>{switch(i.type){case"header":return`<h${i.data.level} class="editor-header editor-header-${i.data.level}">${i.data.text}</h${i.data.level}>`;case"paragraph":return`<p>${i.data.text}</p>`;case"image":return`
2              <figure>
3                <img
4                  src="${i.data.file.url}"
5                  alt="${i.data.caption||""}"
6                  loading="lazy"
7                  class="${i.data.stretched?"stretched":""} ${i.data.withBackground?"with-background":""} ${i.data.withBorder?"with-border":""}"
8                >
9                ${i.data.caption?`<figcaption>${i.data.caption}</figcaption>`:""}
10              </figure>
11            `;case"list":const T=i.data.style==="ordered"?"ol":"ul",P=i.data.items.map(R=>`<li>${R}</li>`).join("");return`<${T}>${P}</${T}>`;case"quote":return`<blockquote>${i.data.text}${i.data.caption?`<footer>${i.data.caption}</footer>`:""}</blockquote>`;case"delimiter":return"<hr />";case"linkTool":return`<a href="${i.data.link}"  target="_blank" rel="noopener noreferrer">${i.data.link}</a>`;default:return console.warn(`Unsupported block type: ${i.type}`),""}}).join("")),w=$(()=>typeof o.content=="string"?o.content:JSON.stringify(o.content,null,2)),a=$(()=>({contentType:typeof o.content,isEditorJSContent:b.value,parsedContent:r,renderedContent:N.value,fallbackContent:w.value,parseError:p.value?p.value.message:null}));return{isEditorJSContent:b,renderedEditorJSContent:N,fallbackRenderedContent:w,debugInfo:a}}}),dt={class:"news-content"},mt=["innerHTML"],pt=["innerHTML"],vt={key:2};function _t(o,p,r,b,N,w){return l(),u("div",dt,[o.isEditorJSContent?(l(),u("div",{key:0,innerHTML:o.renderedEditorJSContent,class:"editor-content"},null,8,mt)):(l(),u("div",{key:1,innerHTML:o.fallbackRenderedContent,class:"editor-content sun-editor-content"},null,8,pt)),o.debug?(l(),u("div",vt,[p[0]||(p[0]=t("h3",null,"Debug Info:",-1)),t("pre",null,v(o.debugInfo),1)])):f("",!0)])}const ht=le(ut,[["render",_t],["__scopeId","data-v-ea2259c3"]]),gt=ae({name:"ActionTooltip",props:{show:{type:Boolean,required:!0},text:{type:String,required:!0},iconSrc:{type:String,default:"/checkmark-telegram-password-icon.svg"},iconAlt:{type:String,default:"Action Icon"}},emits:["hidden"],setup(o,{emit:p}){ye(()=>o.show,r=>{r&&setTimeout(()=>{p("hidden")},3e3)})}}),kt={key:0,class:"action-tooltip"};function ft(o,p,r,b,N,w){const a=Le;return l(),ne(Je,{name:"fade"},{default:fe(()=>[o.show?(l(),u("div",kt,[D(a,{src:o.iconSrc,alt:o.iconAlt,width:"20",height:"20"},null,8,["src","alt"]),we(" "+v(o.text),1)])):f("",!0)]),_:1})}const wt=le(gt,[["render",ft],["__scopeId","data-v-682b21c0"]]),yt={class:"comment"},$t={class:"comment__row"},bt=["aria-label"],Ct={class:"comment__main"},Lt={class:"comment__head"},It={class:"comment__date"},Mt={class:"comment__text"},St={class:"comment__actions"},Tt=["src"],Et=["aria-label"],Nt={key:0,class:"options-tooltip"},Ot={key:0,class:"comment__reply"},Rt=["placeholder"],Ut={class:"comment__reply-buttons"},At=["disabled"],Dt={key:1,class:"comment__replies"},Ft=ae({__name:"CommentItem",props:{comment:{type:Object,required:!0},postId:{type:Number,required:!0},openLikesModal:{type:Function,required:!0},commentCount:{type:Number}},emits:["reply","delete","commentDeleted"],setup(o,{emit:p}){var ee;const r=d(null),b=d(!1),N=d(!1),w=d(!1);Ce(()=>{typeof window<"u"&&(w.value=!!localStorage.getItem("user"))});const a=o,i=p,{t:T}=Ie(),{handleLikeComment:P,handleUnlikeComment:R,handleDeleteComment:H}=Ne(),g=d(!1),I=d(""),F=Me(),q=$(()=>r.value===a.comment.id),M=d(!1),O=$(()=>I.value.trim().length===0),U=d(null),V=$(()=>U.value==="admin"),J=d(!!localStorage.getItem("authToken")),z=d(null);try{z.value=((ee=JSON.parse(localStorage.getItem("user")||"null"))==null?void 0:ee.id)??null}catch{z.value=null}const G=$(()=>{var _;return z.value===((_=a.comment.user)==null?void 0:_.id)||V.value}),Y=()=>{F.push(`/user/${a.comment.user.slug}`)},x=()=>{g.value=!g.value,g.value||(I.value="")},X=()=>{g.value=!1,I.value=""},W=()=>{if(!J.value){M.value=!0;return}O.value||(i("reply",I.value,a.comment.id),X())},Q=(_,h)=>
11{if(!J.value){M.value=!0;return}i("reply",_,h)},n=async()=>{if(!J.value){M.value=!0;return}const _={...a.comment};try{a.comment.user_liked=!a.comment.user_liked,a.comment.like_counts+=a.comment.user_liked?1:-1,a.comment.user_liked?await P(a.comment.id):await R(a.comment.id)}catch(h){console.error("Error toggling comment like:",h),Object.assign(a.comment,_)}},m=()=>{r.value===a.comment.id?r.value=null:r.value=a.comment.id},k=_=>{r.value=null},E=_=>{const h=_.target;!h.closest(".options-tooltip")&&!h.closest(".three-dots-button")&&k()};Se(()=>{U.value=localStorage.getItem("roleName"),document.addEventListener("click",E)}),De(()=>{document.removeEventListener("click",E)});const be=async()=>{try{i("commentDeleted",a.comment.id),await H(a.postId,a.comment.id),b.value=!0}catch(_){console.error("Failed to delete comment:",_)}},ce=_=>{const h=T("news.invalid_date","Некорректная дата");if(!_)return h;const te=_.replace(" ","T"),B=new Date(te);return isNaN(B.getTime())?h:new Intl.DateTimeFormat("ru-RU",{day:"2-digit",month:"2-digit",year:"numeric"}).format(B)};return ye(()=>a.comment,(_,h)=>{(!_||_.id!==h.id)&&(N.value=!0)},{deep:!0}),(_,h)=>{var ie,se,ue,de,me,pe,ve,_e,he,oe,ge;const te=Le,B=Ue("CommentItem",!0),S=Ue("AuthModal");return l(),u(Z,null,[t("div",yt,[t("div",$t,[t("button",{type:"button",class:"comment__avatar","aria-label":(se=(ie=o.comment)==null?void 0:ie.user)==null?void 0:se.username,onClick:Y},[D(te,{src:((de=(ue=o.comment.user)==null?void 0:ue.avatar)==null?void 0:de.original_url)||((pe=(me=o.comment.user)==null?void 0:me.avatar)==null?void 0:pe.small_webp)||((_e=(ve=o.comment.user)==null?void 0:ve.avatar)==null?void 0:_e.webp)||"/default-avatar.png",alt:"",class:"comment__avatar-img"},null,8,["src"])],8,bt),t("div",Ct,[t("div",Lt,[t("button",{type:"button",class:"comment__author",onClick:Y},v((oe=(he=o.comment)==null?void 0:he.user)==null?void 0:oe.username),1),t("span",It,v(ce(((ge=o.comment)==null?void 0:ge.created_at)||"")),1)]),t("p",Mt,v(o.comment.content),1),t("div",St,[t("div",{class:Fe(["comment-metric",{"comment-metric--liked":o.comment.user_liked&&w.value}]),onClick:n},[t("img",{src:o.comment.user_liked&&w.value?"/post-like-filled.svg":"/post-like.svg",alt:"",class:"comment-metric__icon"},null,8,Tt),t("span",{class:"comment-metric__count",onClick:h[0]||(h[0]=Te(j=>a.openLikesModal(o.comment.id),["stop"]))},v(o.comment.like_counts),1)],2),o.comment.parent_id?f("",!0):(l(),u("button",{key:0,type:"button",class:"comment__reply-btn",onClick:x},v(_.$t("news.reply")),1)),G.value?(l(),u("button",{key:1,type:"button",class:"three-dots-button","aria-label":_.$t("news.delete"),onClick:m},[...h[3]||(h[3]=[t("span",{class:"dot"},null,-1),t("span",{class:"dot"},null,-1),t("span",{class:"dot"},null,-1)])],8,Et)):f("",!0)]),G.value&&q.value?(l(),u("div",Nt,[t("button",{type:"button",class:"options-tooltip__item",onClick:be},[D(te,{src:"/trash-icon.svg",alt:"",width:"18",height:"18"}),we(" "+v(_.$t("news.delete")),1)])])):f("",!0)])]),g.value?(l(),u("div",Ot,[Ee(t("textarea",{"onUpdate:modelValue":h[1]||(h[1]=j=>I.value=j),placeholder:_.$t("news.replyPlaceholder"),class:"comment__reply-input"},null,8,Rt),[[qe,I.value]]),t("div",Ut,[t("button",{type:"button",class:"comment__reply-cancel",onClick:X},v(_.$t("news.cancelButton")),1),t("button",{type:"button",class:"comment__reply-send",disabled:O.value,onClick:W},v(_.$t("news.sendButton")),9,At)])])):f("",!0),o.comment.replies&&o.comment.replies.length>0?(l(),u("div",Dt,[(l(!0),u(Z,null,$e(o.comment.replies,j=>(l(),ne(B,{key:j.id,comment:j,"post-id":o.postId,"open-likes-modal":o.openLikesModal,onReply:Q},null,8,["comment","post-id","open-likes-modal"]))),128))])):f("",!0)]),D(S,{show:M.value,"onUpdate:show":h[2]||(h[2]=j=>M.value=j)},null,8,["show"])],64)}}}),qt=le(Ft,[["__scopeId","data-v-f51867cf"]]),Pt=ae({name:"LikesModal",props:{show:{type:Boolean,required:!0},itemId:{type:Number,required:!0},itemType:{type:String,required:!0,validator:o=>["post","comment"].includes(o)},fetchLikes:{type:Function,required:!0},preloadedLikes:{type:Object,default:null}},emits:["close","loadMore"],setup(o,{emit:p}){const r=Me(),b=d([]),N=d(!0),w=d(1),a=d(!1),i=d(0),T=async()=>{try{const g=await o.fetchLikes(o.itemId,w.value,o.itemType);b.value=w.value===1?g.users:[...b.value,...g.users],a.value=g.pagination.total>b.value.length,i.value=g.pagination.total}
11catch(g){console.error("Error fetching likes:",g)}finally{N.value=!1}},P=()=>{w.value++,p("loadMore"),T()},R=()=>{p("close")},H=g=>{r.push(`/user/${g}`),R()};return ye(()=>o.show,g=>{g&&(w.value=1,N.value=!0,T())}),{users:b,isLoading:N,hasMoreLikes:a,loadMore:P,close:R,totalLikes:i,navigateToUserProfile:H}}}),Bt={key:0,class:"likes-modal","aria-labelledby":"likes-modal-title",role:"dialog","aria-modal":"true"},Jt={class:"likes-modal__window"},jt={class:"likes-modal__head"},Ht={id:"likes-modal-title",class:"likes-modal__title"},Vt=["aria-label"],zt={class:"likes-modal__body"},Wt={key:0,class:"likes-modal__loader"},Kt={key:1,class:"likes-modal__list"},Gt=["onClick"],Yt=["src","alt"],xt={class:"likes-modal__name"},Xt={key:0,class:"likes-modal__foot"};function Qt(o,p,r,b,N,w){return o.show?(l(),u("div",Bt,[t("div",{class:"likes-modal__backdrop","aria-hidden":"true",onClick:p[0]||(p[0]=(...a)=>o.close&&o.close(...a))}),t("div",Jt,[t("header",jt,[t("h3",Ht,v(o.totalLikes)+" "+v(o.$t("news.likes")),1),t("button",{type:"button",class:"likes-modal__close","aria-label":o.$t("news.close","Закрыть"),onClick:p[1]||(p[1]=(...a)=>o.close&&o.close(...a))},[...p[3]||(p[3]=[t("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Vt)]),t("div",zt,[o.isLoading?(l(),u("div",Wt,[...p[4]||(p[4]=[t("span",{class:"loader"},null,-1)])])):(l(),u("ul",Kt,[(l(!0),u(Z,null,$e(o.users,a=>{var i;return l(),u("li",{key:a.id,class:"likes-modal__user",onClick:T=>o.navigateToUserProfile(a.slug)},[t("img",{src:((i=a==null?void 0:a.avatar)==null?void 0:i.original_url)||"/default-avatar.png",alt:a.username,class:"likes-modal__avatar"},null,8,Yt),t("span",xt,v(a.username),1)],8,Gt)}),128))]))]),o.hasMoreLikes?(l(),u("footer",Xt,[t("button",{type:"button",class:"likes-modal__more",onClick:p[2]||(p[2]=(...a)=>o.loadMore&&o.loadMore(...a))},v(o.$t("news.loadMoreLikes")),1)])):f("",!0)])])):f("",!0)}const Be=le(Pt,[["render",Qt],["__scopeId","data-v-d0ff09db"]]),Zt={class:"comments"},es={class:"comments__title"},ts={class:"comments__form"},ss=["disabled","placeholder","onKeydown"],os=["disabled"],ns={key:0,class:"comments__error"},as={key:1,class:"comments__list"},ls={key:2,class:"comments__empty"},is=ae({__name:"Comment",props:{postId:{type:Number,required:!0},commentCount:{type:Number,required:!0}},emits:["update:commentCount"],setup(o,{emit:p}){const r=o,{t:b}=Ie(),{fetchComments:N,handleAddComment:w,handleFetchCommentLikes:a,handleWebSocketCommentDeletion:i,comments:T}=Ne(),{isConnected:P,setOnMessageCallback:R,subscribeToPostComments:H}=nt(),g=$(()=>{var m;return((m=T.value[r.postId])==null?void 0:m.data)||[]}),I=d(!1),F=d(null),q=d(""),M=d(!1),O=d(""),U=d(!1),V=$(()=>q.value.trim().length===0),J=$(()=>!!localStorage.getItem("authToken")),z=p,G=async()=>{if(!J.value){U.value=!0;return}if(!(V.value||M.value)){M.value=!0,O.value="";try{await w(r.postId,q.value),q.value="",z("update:commentCount",r.commentCount+1)}catch(m){console.error("Error posting comment:",m),O.value=b("news.comment_send_error","Не удалось отправить комментарий. Пожалуйста, попробуйте ещё раз.")}finally{M.value=!1}}},Y=async(m,k)=>{if(!J.value){U.value=!0;return}try{await w(r.postId,m,k)}catch(E){console.error("Error posting reply:",E),O.value=b("news.reply_send_error","Не удалось отправить ответ. Пожалуйста, попробуйте ещё раз.")}},x=$(()=>[...g.value].sort((m,k)=>new Date(k.created_at).getTime()-new Date(m.created_at).getTime())),X=m=>{if(console.log("Received WebSocket message:",m),m.channel===`posts.${r.postId}`)if(m.event==="posts.comment.deleted"){const k=m.data.default_data_key;i(k)}else m.data.post_comment&&console.log("New comment received:",m.data.post_comment)},W=m=>{F.value=m,I.value=!0},Q=()=>{I.value=!1};Se(async()=>{await N(r.postId),R(X),P.value&&H(r.postId)}),ye(P,m=>{m&&H(r.postId)});const n=m=>{var k;T.value.data=(k=T.value.data)==null?void 0:k.filter(E=>E.id!==m),z("update:commentCount",r.commentCount-1)};return(m,k)=>(l(),u(Z,null,[t("section",Zt,[t("h2",es,v(o.commentCount??0)+" "+v(m.$t("news.comments")),1),k[2]||(k[2]=t("hr",{class:"h-0.5 border-2 mt-2 mb-5 border-accent w-16"},null,-1)),t("div",ts,[Ee(t("textarea",{"onUpdate:modelValue":k[0]||(k[0]=E=>q.value=E),disabled:M.value,placeholder:m.$t("news.commentPlaceholder"),class:"comments__input",onKeydown:je(Te(G,["ctrl","prevent"]),["enter"])},null,40,ss),[[qe,q.value]]),V.value?f("",!0):(l(),u("button",{key:0,t
11ype:"button",onClick:G,disabled:M.value,class:"comments__send"},v(M.value?m.$t("news.commentSending"):m.$t("news.commentSend")),9,os))]),O.value?(l(),u("p",ns,v(O.value),1)):f("",!0),g.value.length>0?(l(),u("div",as,[(l(!0),u(Z,null,$e(x.value,E=>(l(),ne(qt,{key:E.id,comment:E,"post-id":o.postId,commentCount:o.commentCount,"open-likes-modal":W,onReply:Y,onCommentDeleted:n},null,8,["comment","post-id","commentCount"]))),128))])):(l(),u("p",ls,v(m.$t("news.noComments")),1))]),D(Pe,{show:U.value,"onUpdate:show":k[1]||(k[1]=E=>U.value=E)},null,8,["show"]),D(Be,{show:I.value,itemId:F.value,itemType:"comment",fetchLikes:K(a),onClose:Q,onLoadMore:m.loadMoreLikes},null,8,["show","itemId","fetchLikes","onLoadMore"])],64))}}),rs=le(is,[["__scopeId","data-v-06d00d4e"]]),cs={class:"post-progress","aria-hidden":"true"},us={key:0,class:"flex justify-center mx-auto my-auto h-[300px] items-center"},ds=["aria-label"],ms={class:"post__head"},ps={class:"post__title"},vs={class:"post__meta"},_s=["datetime"],hs={key:1,class:"post__meta-dot","aria-hidden":"true"},gs={key:2},ks={key:0,class:"post__cover"},fs={key:1,class:"post__lead"},ws={class:"post__actions"},ys={class:"post__actions-group"},$s=["src"],bs={class:"likes-count"},Cs={class:"post-metric"},Ls={class:"post__share"},Is=["aria-expanded","aria-label"],Ms={class:"post__share-label"},Ss={key:0,class:"post__share-menu"},Ts={class:"post__share-nets"},Es={key:1,class:"post-similar"},Ns={class:"post-similar__title"},Os={class:"post-similar__grid"},Rs=1,Us=ae({__name:"[slug]",async setup(o){var Re;let p,r;const{showBlog:b,isLoading:N,handleLikePost:w,handleUnlikePost:a,indexBlog:i,handleFetchPostLikes:T,handleFetchCommentLikes:P}=Ne(),{locale:R,t:H}=Ie(),g=Me(),I=He(),F=d(null),q=d(1),M=d(!1),O=d(!1),U=d(!1),V=d(!1),J=d([]),z=d(I.query.category||"popular"),G=Ve().public.API_BASE_URL,Y=d(null),x=d(0),X=d(!1),{data:W,status:Q}=([p,r]=et(()=>{var e;return Ye(G+"/blog/post/"+((e=I.params)==null?void 0:e.slug),{headers:{currentlang:I.params.locale}},"$JGJrJ98Bhr")}),p=await p,r(),p),n=$(()=>{var e;return(e=W==null?void 0:W.value)==null?void 0:e.post});if(!((Re=W.value)!=null&&Re.post))throw ze({statusCode:404,statusMessage:"News post not found",fatal:!0});const m=$(()=>{var e,s,c,y,C,L;return((s=(e=n.value)==null?void 0:e.logo)==null?void 0:s.original_url)||((y=(c=n.value)==null?void 0:c.logo)==null?void 0:y.webp)||((L=(C=n.value)==null?void 0:C.logo)==null?void 0:L.small_webp)||""}),k=$(()=>J.value.filter(e=>{var s;return(e==null?void 0:e.slug)!==((s=I.params)==null?void 0:s.slug)}));Ce(()=>{n.value&&Ae({title:Object.values(n.value.title)[0]||"",description:Object.values(n.value.meta_description)[0]||""})});const E=e=>{e.target.closest(".likes-count")?me():ge()},be=$(()=>!!localStorage.getItem("authToken"));let ce=0;const ee=d(!1),_=async()=>{const e=Date.now();if(!(!n.value||ee.value||e-ce<500)){ce=e,ee.value=!0;try{const s=await T(n.value.id,q.value);q.value===1?F.value=s:(F.value.users=[...F.value.users,...s.users],F.value.pagination=s.pagination)}catch(s){console.error("Error fetching post likes:",s)}finally{ee.value=!1}}},h=async()=>{q.value++,await _()},te=e=>{g.push({path:"/news",query:{category:e}})},B=()=>{const e=Y.value;if(!e)return;const s=e.offsetTop,c=e.offsetHeight-window.innerHeight;if(c<=0){x.value=0;return}const y=(window.scrollY-s)/c;x.value=Math.min(1,Math.max(0,y))};Se(async()=>{var e,s;B(),window.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B);try{const c=await i({page:1,per_page:3}),y=c.data.posts.filter(C=>{var L;return(C==null?void 0:C.slug)==((L=I.params)==null?void 0:L.slug)});(e=n.value)!=null&&e.likes_data&&((s=y[0])!=null&&s.likes_data)&&(n.value.likes_data.user_liked=y[0].likes_data.user_liked),J.value=c.data.posts.filter(C=>{var L;return C.id!==((L=n.value)==null?void 0:L.id)}).slice(0,3)}catch(c){console.error("Error fetching similar news:",c)}}),De(()=>{window.removeEventListener("scroll",B),window.removeEventListener("resize",B)});const S=e=>e&&(e[R.value]||e.ru)||"",ie=$(()=>!n.value||!n.value.description?"":S(n.value.description)),se=$(()=>{const e=ie.value;if(!e)return 0;const c=String(typeof e=="string"?e:JSON.stringify(e)).replace(/<[^>]+>/g," ").replace(/https?:\/\/\S+/g," ").replace(/["'{}\[\],:]/g," ").split(/\s+/).filter(y=>y.length>1).length;return c?Math.max(1,Math.round(c/180)):0}),ue=()=>U.value=!U.value,de=()=>U.value=!1,me=async()=>{O.value=!O.value,O.value&&F.value===null&&await _()},pe=()=>O.value=!1,ve=()=>{const e=window.location.href;navigator.clipboard.writeText(e).then(()=>{V.value=!0}
11).catch(s=>{console.error("Failed to copy: ",s)})},_e=()=>{V.value=!1},he=e=>{if(!e)return"";const s=new Date(String(e).replace(" ","T"));return Number.isNaN(s.getTime())?(console.warn("Invalid date string:",e),""):new Intl.DateTimeFormat("ru-RU",{day:"2-digit",month:"long",year:"numeric"}).format(s)},oe=e=>{var C,L;const s=encodeURIComponent(window.location.href),c=encodeURIComponent(((L=(C=n.value)==null?void 0:C.title)==null?void 0:L.ru)||"");let y="";switch(e){case"telegram":y=`https://t.me/share/url?url=${s}&text=${c}`;break;case"whatsapp":y=`https://api.whatsapp.com/send?text=${c}%20${s}`;break;case"vk":y=`https://vk.com/share.php?url=${s}&title=${c}`;break}window.open(y,"_blank")},ge=async()=>{if(!n.value)return;if(!be.value){M.value=!0;return}const e={...n.value.likes_data};try{n.value.likes_data.user_liked=!n.value.likes_data.user_liked,n.value.likes_data.count+=n.value.likes_data.user_liked?1:-1,n.value.likes_data.user_liked?await w(n.value.id):await a(n.value.id)}catch(s){console.error("Error liking/unliking post:",s),n.value.likes_data=e}},j={mounted(e,s){e.clickOutsideEvent=c=>{e===c.target||e.contains(c.target)||s.value(c)},document.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent)}},ke=We(),Oe=$(()=>{var s;return`${`${ke.protocol}//${ke.host}`}/og/news/${(s=n.value)==null?void 0:s.slug}~v${Rs}.png`});return Ce(()=>{var s;if(!((s=n.value)!=null&&s.slug))return;const e={title:S(n.value.title),description:S(n.value.meta_description),ogTitle:S(n.value.title),ogDescription:S(n.value.meta_description),ogImage:Oe.value,ogImageWidth:1200,ogImageHeight:630,ogImageAlt:S(n.value.title),ogType:"article",twitterCard:"summary_large_image",twitterTitle:S(n.value.title),twitterDescription:S(n.value.meta_description),twitterImage:Oe.value};if(n.value.created_at)try{const c=new Date(n.value.created_at);isNaN(c.getTime())||(e.articlePublishedTime=c.toISOString())}catch{console.warn("Invalid created_at date:",n.value.created_at)}if(n.value.updated_at||n.value.created_at)try{const c=new Date(n.value.updated_at||n.value.created_at);isNaN(c.getTime())||(e.articleModifiedTime=c.toISOString())}catch{console.warn("Invalid updated_at date:",n.value.updated_at||n.value.created_at)}Ae(e)}),Ke(()=>{var C,L,A;const e=n.value;if(!(e!=null&&e.slug))return{};const s=`${ke.protocol}//${ke.host}`,c=`/news/${e.slug}`,y=S(e.title);return{script:[{key:"news-jsonld",type:"application/ld+json",innerHTML:JSON.stringify(Xe([Qe({origin:s,locale:R.value,path:c,post:{title:y,description:S(e.meta_description),image:{original_url:((C=e.logo)==null?void 0:C.original_url)||((L=e.logo)==null?void 0:L.webp)||((A=e.logo)==null?void 0:A.small_webp)},created_at:e.created_at,updated_at:e.updated_at}}),Ze({origin:s,items:[{name:"Главная",path:"/"},{name:H("SEO.title_news")||"Новости",path:"/news"},{name:y||"",path:c}]})]))}]}}),(e,s)=>{const c=xe,y=Le;return l(),ne(ot,{currentFilter:z.value,"show-hero":!1,"show-filters":!1,onFilterChanged:te},{default:fe(()=>{var C,L;return[t("div",cs,[t("span",{class:"post-progress__bar",style:Ge({transform:`scaleX(${x.value})`})},null,4)]),t("article",{ref_key:"articleRef",ref:Y,class:"post"},[K(Q)==="pending"?(l(),u("div",us,[...s[6]||(s[6]=[t("span",{class:"loader"},null,-1)])])):n.value?(l(),u(Z,{key:1},[t("nav",{class:"post__crumbs","aria-label":e.$t("news.breadcrumbs","Навигация")},[D(c,{to:`/${K(R)}`},{default:fe(()=>[we(v(e.$t("news.breadcrumb_home","Главная")),1)]),_:1},8,["to"]),s[7]||(s[7]=t("span",{"aria-hidden":"true"},"/",-1)),D(c,{to:`/${K(R)}/news`},{default:fe(()=>[we(v(e.$t("news.title","Блог")),1)]),_:1},8,["to"])],8,ds),t("header",ms,[t("h1",ps,v(S(n.value.title)),1),t("div",vs,[n.value.created_at?(l(),u("time",{key:0,datetime:n.value.created_at},v(he(n.value.created_at)),9,_s)):f("",!0),se.value?(l(),u("span",hs,"•")):f("",!0),se.value?(l(),u("span",gs,v(se.value)+" "+v(e.$t("news.reading_minutes","мин чтения")),1)):f("",!0)])]),m.value&&!X.value?(l(),u("figure",ks,[D(y,{src:m.value,alt:S(n.value.title),format:"webp",sizes:"100vw md:900px",loading:"eager",onError:s[0]||(s[0]=A=>X.value=!0)},null,8,["src","alt"])])):f("",!0),S(n.value.preview)?(l(),u("p",f
11s,v(S(n.value.preview)),1)):f("",!0),D(ht,{content:ie.value,class:"post__content"},null,8,["content"]),t("footer",ws,[t("div",ys,[t("div",{class:Fe(["post-metric post-metric--action",{"post-metric--liked":n.value.likes_data.user_liked}]),onClick:Te(E,["stop"])},[t("img",{src:n.value.likes_data.user_liked?"/post-like-filled.svg":"/post-like.svg",alt:"",class:"post-metric__icon"},null,8,$s),t("span",bs,v(n.value.likes_data.count||0),1)],2),t("span",Cs,[s[8]||(s[8]=t("img",{src:tt,alt:"",class:"post-metric__icon"},null,-1)),t("span",null,v(n.value.comments_count.count||0),1)])]),Ee((l(),u("div",Ls,[t("button",{type:"button",class:"post-metric post-metric--action","aria-expanded":U.value,"aria-label":e.$t("news.share","Поделиться"),onClick:ue},[s[9]||(s[9]=t("img",{src:at,alt:"",class:"post-metric__icon"},null,-1)),t("span",Ms,v(e.$t("news.share","Поделиться")),1)],8,Is),U.value?(l(),u("div",Ss,[t("button",{type:"button",class:"post__share-copy",onClick:ve},[s[10]||(s[10]=t("img",{src:lt,alt:"",class:"w-5 h-5"},null,-1)),t("span",null,v(e.$t("news.copyLink")),1)]),t("div",Ts,[t("button",{type:"button",onClick:s[1]||(s[1]=A=>oe("telegram")),"aria-label":"Telegram"},[...s[11]||(s[11]=[t("img",{src:it,alt:"Telegram",class:"w-6 h-6"},null,-1)])]),t("button",{type:"button",onClick:s[2]||(s[2]=A=>oe("whatsapp")),"aria-label":"WhatsApp"},[...s[12]||(s[12]=[t("img",{src:rt,alt:"WhatsApp",class:"w-6 h-6"},null,-1)])]),t("button",{type:"button",onClick:s[3]||(s[3]=A=>oe("vk")),"aria-label":"VK"},[...s[13]||(s[13]=[t("img",{src:ct,alt:"VK",class:"w-6 h-6"},null,-1)])])])])):f("",!0)])),[[j,de]])])],64)):f("",!0)],512),K(Q)!=="pending"&&n.value&&n.value.id?(l(),ne(rs,{key:0,commentCount:((C=n.value.comments_count)==null?void 0:C.count)??0,postId:n.value.id,"onUpdate:commentCount":s[4]||(s[4]=A=>n.value.comments_count.count=A),handleFetchCommentLikes:K(P)},null,8,["commentCount","postId","handleFetchCommentLikes"])):f("",!0),D(wt,{show:V.value,onHidden:_e,text:e.$t("news.link_copy")},null,8,["show","text"]),K(Q)!=="pending"&&k.value.length>0?(l(),u("section",Es,[t("h2",Ns,v(e.$t("news.similarNews")),1),s[14]||(s[14]=t("hr",{class:"h-0.5 border-2 mt-2 mb-5 border-accent w-16"},null,-1)),t("div",Os,[(l(!0),u(Z,null,$e(k.value,A=>(l(),ne(st,{key:A.id,data:A},null,8,["data"]))),128))])])):f("",!0),D(Pe,{show:M.value,"onUpdate:show":s[5]||(s[5]=A=>M.value=A)},null,8,["show"]),D(Be,{show:O.value,"item-id":(L=n.value)==null?void 0:L.id,"item-type":"post",fetchLikes:K(T),preloadedLikes:F.value,onClose:pe,onLoadMore:h},null,8,["show","item-id","fetchLikes","preloadedLikes"])]}),_:1},8,["currentFilter"])}}}),js=le(Us,[["__scopeId","data-v-a2ae23b6"]]);export{js 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.