import{S as t,i as e,s as a,r as n,a as r,e as c,m as s,K as i,f as o,c as l,b as d,d as m,n as u,g as h,h as f,p,j as g,t as D,k as v,l as E,o as $,L as w,I as T,A as b,q as A,u as L,v as S,w as _,x as O,y,z as M}from"./client.46c3afd9.js";import{c as x,a as C,h as H,L as I}from"./createOctokit.7de7e31d.js";function R(t,e,a){const n=t.slice();return n[9]=e[a],n}function N(t){let e,a,i,g,D,v=t[4].title+"",E=("closed"===t[4].state?t[4].metadata.start?n.i18n.incidentCompleted:n.i18n.incidentFixed:t[4].metadata.start?n.i18n.incidentScheduled:n.i18n.incidentOngoing)+"";return{c(){e=s(v),a=r(),i=c("span"),g=s(E),this.h()},l(t){e=u(t,v),a=l(t),i=d(t,"SPAN",{class:!0});var n=m(i);g=u(n,E),n.forEach(o),this.h()},h(){h(i,"class",D=T("tag ".concat(t[4].state))+" svelte-4o16l6")},m(t,n){f(t,e,n),f(t,a,n),f(t,i,n),p(i,g)},p(t,a){16&a&&v!==(v=t[4].title+"")&&b(e,v),16&a&&E!==(E=("closed"===t[4].state?t[4].metadata.start?n.i18n.incidentCompleted:n.i18n.incidentFixed:t[4].metadata.start?n.i18n.incidentScheduled:n.i18n.incidentOngoing)+"")&&b(g,E),16&a&&D!==(D=T("tag ".concat(t[4].state))+" svelte-4o16l6")&&h(i,"class",D)},d(t){t&&o(e),t&&o(a),t&&o(i)}}}function U(t){let e,a=n.i18n.incidentDetails+"";return{c(){e=s(a)},l(t){e=u(t,a)},m(t,a){f(t,e,a)},p:A,d(t){t&&o(e)}}}function V(t){let e,a,i,g,D,v,E,$,w,T,b,_=n.i18n.incidentViewOnGitHub+"";function O(t,e){return t[4].metadata.start?B:k}let y=O(t),M=y(t);function x(t,e){return t[4].metadata.start&&t[4].metadata.end?P:t[4].closed_at?F:void 0}let C=x(t),H=C&&C(t),I=t[3],N=[];for(let e=0;e").concat(new Date(t[9].created_at).toLocaleString(),"")).replace(/\$AUTHOR/g,"@").concat(t[9].user.login,""))+"";return{c(){e=c("article"),a=c("p"),s=r(),i=c("div"),u=r(),this.h()},l(t){e=d(t,"ARTICLE",{});var n=m(e);a=d(n,"P",{class:!0}),m(a).forEach(o),s=l(n),i=d(n,"DIV",{}),m(i).forEach(o),u=l(n),n.forEach(o),this.h()},h(){h(a,"class","svelte-4o16l6")},m(t,n){f(t,e,n),p(e,a),a.innerHTML=g,p(e,s),p(e,i),i.innerHTML=D,p(e,u)},p(t,e){8&e&&g!==(g=t[5](t[9].body)+"")&&(a.innerHTML=g),8&e&&D!==(D=n.i18n.incidentCommentSummary.replace(/\$DATE/g,"").concat(new Date(t[9].created_at).toLocaleString(),"")).replace(/\$AUTHOR/g,"@").concat(t[9].user.login,""))+"")&&(i.innerHTML=D)},d(t){t&&o(e)}}}function z(t){let e,a,$,w,T,b,A,L,S,_,O,y,M=n.i18n.incidentBack+"";function x(t,e){return t[2]?U:N}document.title=e=n.i18n.incidentTitle.replace("$NUMBER",t[0]);let C=x(t),H=C(t);const I=[j,V],R=[];function k(t,e){return t[1]?0:1}return b=k(t),A=R[b]=I[b](t),{c(){a=r(),$=c("h2"),H.c(),w=r(),T=c("section"),A.c(),L=r(),S=c("footer"),_=c("a"),O=s(M),this.h()},l(t){i("svelte-slinv8",document.head).forEach(o),a=l(t),$=d(t,"H2",{class:!0});var e=m($);H.l(e),e.forEach(o),w=l(t),T=d(t,"SECTION",{});var n=m(T);A.l(n),n.forEach(o),L=l(t),S=d(t,"FOOTER",{class:!0});var r=m(S);_=d(r,"A",{href:!0});var c=m(_);O=u(c,M),c.forEach(o),r.forEach(o),this.h()},h(){h($,"class","svelte-4o16l6"),h(_,"href",n.path),h(S,"class","svelte-4o16l6")},m(t,e){f(t,a,e),f(t,$,e),H.m($,null),f(t,w,e),f(t,T,e),R[b].m(T,null),f(t,L,e),f(t,S,e),p(S,_),p(_,O),y=!0},p(t,a){let[r]=a;(!y||1&r)&&e!==(e=n.i18n.incidentTitle.replace("$NUMBER",t[0]))&&(document.title=e),C===(C=x(t))&&H?H.p(t,r):(H.d(1),H=C(t),H&&(H.c(),H.m($,null)));let c=b;b=k(t),b===c?R[b].p(t,r):(g(),D(R[c],1,1,(()=>{R[c]=null})),v(),A=R[b],A?A.p(t,r):(A=R[b]=I[b](t),A.c()),E(A,1),A.m(T,null))},i(t){y||(E(A),y=!0)},o(t){D(A),y=!1},d(t){t&&o(a),t&&o($),H.d(),t&&o(w),t&&o(T),R[b].d(),t&&o(L),t&&o(S)}}}function G(t,e,a){let{number:r}=e,c=w,s=!0,i=!0;const o=x(),l=n.owner,d=n.repo;let m=[],u={};return $((async()=>{try{if(a(4,u=(await C("issue-".concat(l,"-").concat(d,"-").concat(r),(()=>o.issues.get({owner:l,repo:d,issue_number:r,sort:"created",direction:"desc"})))).data),a(4,u.metadata={},u),u.body.includes("\x3c!--")){const t=u.body.split("\x3c!--")[1].split("--\x3e")[0];t.split("\n").filter((t=>t.trim())).filter((t=>t.includes(":"))).forEach((t=>{a(4,u.metadata[t.split(/:(.+)/)[0].trim()]=t.split(/:(.+)/)[1].trim(),u)}))}}catch(t){H(t)}a(2,i=!1);try{a(3,m=(await C("issue-comments-".concat(l,"-").concat(d,"-").concat(r),(()=>o.issues.listComments({owner:l,repo:d,issue_number:r})))).data.reverse())}catch(t){H(t)}a(1,s=!1)})),t.$$set=t=>{"number"in t&&a(0,r=t.number)},[r,s,i,m,u,c]}class K extends t{constructor(t){super(),e(this,t,G,z,a,{number:0})}}function J(t){let e,a;return e=new K({props:{number:t[0]}}),{c(){_(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){y(e,t,n),a=!0},p(t,a){let[n]=a;const r={};1&n&&(r.number=t[0]),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){D(e.$$.fragment,t),a=!1},d(t){M(e,t)}}}async function Q(t){const{number:e}=t.params;return{number:e}}function W(t,e,a){let{number:n}=e;return t.$$set=t=>{"number"in t&&a(0,n=t.number)},[n]}class X extends t{constructor(t){super(),e(this,t,W,J,a,{number:0})}}export{X as default,Q as preload};