import{L as e,N as t,a as n,b as r,c as i,d as a,f as o,i as s,rt as c,s as l,tt as u,u as d,v as f}from"./runtime-core.esm-bundler.-wy0QUpZ.js";import{h as p,m,o as h,s as g}from"./index.CzQRfW04.js";var _={class:`tw-p-4`},v={key:0,class:`tw-h-12 tw-w-12 is-loading`},y={key:1,class:`tw-flex tw-flex-col tw-gap-2`},b={class:`tw-text-12`},x=[`href`],S={class:`flex-text-block`},C={class:`issue-title tw-font-semibold tw-break-anywhere`},w={class:`index`},T={key:0},E=[`innerHTML`],D={key:2},O=o({__name:`ContextPopup`,props:{repoLink:{},loadIssueInfoUrl:{}},setup(o){let O=o,k=t(!1),A=t(null),j=t(``),M=t(``),N=s(()=>A?.value?new Date(A.value.created_at).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`}):``),P=s(()=>{if(!A?.value)return``;let e=A.value.body.replace(/\n+/g,` `);return e.length>85?`${e.substring(0,85)}…`:e});return f(async()=>{k.value=!0,M.value=``;try{let e=await m(O.loadIssueInfoUrl);if(!e.ok){M.value=e.status?e.statusText:`Unknown network error`;return}let t=await e.json();A.value=t.convertedIssue,j.value=t.renderedLabels}finally{k.value=!1}}),(t,s)=>(r(),i(`div`,_,[k.value?(r(),i(`div`,v)):A.value?(r(),i(`div`,y,[n(`div`,b,[n(`a`,{href:o.repoLink,class:`muted`},c(A.value.repository.full_name),9,x),d(` on `+c(N.value),1)]),n(`div`,S,[a(e(p),{name:e(g)(A.value),class:u(e(h)(A.value))},null,8,[`name`,`class`]),n(`span`,C,[d(c(A.value.title)+` `,1),n(`span`,w,`#`+c(A.value.number),1)])]),P.value?(r(),i(`div`,T,c(P.value),1)):l(``,!0),A.value.labels.length?(r(),i(`div`,{key:1,innerHTML:j.value},null,8,E)):l(``,!0)])):(r(),i(`div`,D,c(M.value),1))]))}});export{O as default};
//# sourceMappingURL=ContextPopup.BCCo7Eyb.js.map