github-issue-tower-defence-management 2.58.0 → 2.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,6 +79,10 @@ const rateLimited = (error) => ({
79
79
  statusCode: 429,
80
80
  body: { error: error.message },
81
81
  });
82
+ const upstreamError = (error) => ({
83
+ statusCode: 502,
84
+ body: { error: error instanceof Error ? error.message : String(error) },
85
+ });
82
86
  const serializeComments = (comments) => comments.map((comment) => ({
83
87
  author: comment.author,
84
88
  body: comment.body,
@@ -103,7 +107,7 @@ const handleItemBody = async (issueRepository, url) => {
103
107
  if (isGitHubRateLimitError(error)) {
104
108
  return rateLimited(error);
105
109
  }
106
- throw error;
110
+ return upstreamError(error);
107
111
  }
108
112
  };
109
113
  exports.handleItemBody = handleItemBody;
@@ -119,7 +123,7 @@ const handleComments = async (issueRepository, url) => {
119
123
  if (isGitHubRateLimitError(error)) {
120
124
  return rateLimited(error);
121
125
  }
122
- throw error;
126
+ return upstreamError(error);
123
127
  }
124
128
  };
125
129
  exports.handleComments = handleComments;
@@ -138,7 +142,7 @@ const handlePrFiles = async (issueRepository, url) => {
138
142
  if (isGitHubRateLimitError(error)) {
139
143
  return rateLimited(error);
140
144
  }
141
- throw error;
145
+ return upstreamError(error);
142
146
  }
143
147
  };
144
148
  exports.handlePrFiles = handlePrFiles;
@@ -154,7 +158,7 @@ const handlePrCommits = async (issueRepository, url) => {
154
158
  if (isGitHubRateLimitError(error)) {
155
159
  return rateLimited(error);
156
160
  }
157
- throw error;
161
+ return upstreamError(error);
158
162
  }
159
163
  };
160
164
  exports.handlePrCommits = handlePrCommits;
@@ -187,7 +191,7 @@ const handleRelatedPrs = async (issueRepository, url) => {
187
191
  if (isGitHubRateLimitError(error)) {
188
192
  return rateLimited(error);
189
193
  }
190
- throw error;
194
+ return upstreamError(error);
191
195
  }
192
196
  };
193
197
  exports.handleRelatedPrs = handleRelatedPrs;
@@ -212,7 +216,7 @@ const handleIssueTitle = async (issueRepository, cache, url) => {
212
216
  }
213
217
  return rateLimited(error);
214
218
  }
215
- throw error;
219
+ return upstreamError(error);
216
220
  }
217
221
  };
218
222
  exports.handleIssueTitle = handleIssueTitle;
@@ -250,7 +254,7 @@ const handlePullRequestStatus = async (issueRepository, cache, url) => {
250
254
  }
251
255
  return rateLimited(error);
252
256
  }
253
- throw error;
257
+ return upstreamError(error);
254
258
  }
255
259
  };
256
260
  exports.handlePullRequestStatus = handlePullRequestStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"consoleReadApi.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":";;;AAKA,wFAAqF;AACrF,wDAG8B;AAGjB,QAAA,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAC;AAEtC,QAAA,gCAAgC,GAAG,EAAE,GAAG,IAAI,CAAC;AAWnD,MAAM,qBAAqB,GAAG,CACnC,SAAwB,EACP,EAAE;IACnB,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAVW,QAAA,qBAAqB,yBAUhC;AA0BF,MAAa,oBAAoB;IAG/B,YAA6B,QAAsB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QAAtC,UAAK,GAAL,KAAK,CAAiC;QAFlD,YAAO,GAAG,IAAI,GAAG,EAAgC,CAAC;QAInE,QAAG,GAAG,CAAC,GAAW,EAAkC,EAAE;YACpD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC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,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,GAAG;QACf,IAAI,EAAE;YACJ,2BAA2B,EAAE,MAAM,CAAC,2BAA2B,IAAI,IAAI;SACxE;KACF,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,yBAAyB,6BAyCpC"}
1
+ {"version":3,"file":"consoleReadApi.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":";;;AAKA,wFAAqF;AACrF,wDAG8B;AAGjB,QAAA,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAC;AAEtC,QAAA,gCAAgC,GAAG,EAAE,GAAG,IAAI,CAAC;AAWnD,MAAM,qBAAqB,GAAG,CACnC,SAAwB,EACP,EAAE;IACnB,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAVW,QAAA,qBAAqB,yBAUhC;AA0BF,MAAa,oBAAoB;IAG/B,YAA6B,QAAsB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QAAtC,UAAK,GAAL,KAAK,CAAiC;QAFlD,YAAO,GAAG,IAAI,GAAG,EAAgC,CAAC;QAInE,QAAG,GAAG,CAAC,GAAW,EAAkC,EAAE;YACpD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBACvB,OAAO,KAAK,CAAC,KAAK,CAAC;YACrB,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,gCAAwB,EAAE,CAA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OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC1E,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO;YACL,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,EAAE,2BAA2B,EAAE,IAAI,EAAE;SAC5C,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,wCAAwB,EAAC,MAAM,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,GAAG;QACf,IAAI,EAAE;YACJ,2BAA2B,EAAE,MAAM,CAAC,2BAA2B,IAAI,IAAI;SACxE;KACF,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,yBAAyB,6BAyCpC"}
@@ -85,4 +85,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
85
85
  `)}),o+=1,r=[])};for(let e of t){if(a){r.push(e),Ll(e)&&(a=!1);continue}if(i===null&&Q(e)){s(),i=[];continue}if(i!==null){if(Ll(e)){n.push({kind:`mermaid`,key:`mermaid:${o}`,code:i.join(`
86
86
  `)}),o+=1,i=null;continue}i.push(e);continue}if(Il(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},zl=({code:e,label:t=`Copy code`})=>(0,x.jsx)(Nn,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Bl=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Vl=null,Hl=0,Ul=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),Wl=()=>Vl===null?window.mermaid===void 0?(Vl=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Bl,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(Ul(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Vl):(Vl=Promise.resolve(Ul(window.mermaid)),Vl):Vl,Gl=async e=>{let t=await Wl();Hl+=1;let n=`console-mermaid-${Hl}`,{svg:r}=await t.render(n,e);return Bs.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},Kl=.5,ql=e=>Number.isNaN(e)||e<1?1:e>6?6:e,Jl=e=>ql(ql(e)+Kl),Yl=e=>ql(ql(e)-Kl),Xl=e=>ql(e)<=1,Zl=e=>ql(e)>=6,Ql=e=>`${Math.round(ql(e)*100)}%`,$l=e=>`${ql(e)*100}%`,eu=({svg:e,onClose:t})=>{let[n,r]=(0,y.useState)(1),i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;if(t===null)return;t.innerHTML=e;let n=t.querySelector(`svg`);n!==null&&(n.style.removeProperty(`max-width`),n.style.setProperty(`width`,`100%`),n.style.setProperty(`height`,`auto`))},[e]),(0,y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t]),(0,x.jsxs)(`div`,{className:`console-mermaid-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Enlarged diagram`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-modal-bar`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom out`,disabled:Xl(n),onClick:()=>r(Yl(n)),children:`−`}),(0,x.jsx)(`span`,{className:`console-mermaid-modal-scale`,children:Ql(n)}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom in`,disabled:Zl(n),onClick:()=>r(Jl(n)),children:`+`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-close`,"aria-label":`Close enlarged diagram`,onClick:t,children:`✕`})]}),(0,x.jsx)(`div`,{className:`console-mermaid-modal-viewport`,children:(0,x.jsx)(`div`,{ref:i,className:`console-mermaid-modal-canvas`,style:{width:$l(n)}})})]})},tu=({code:e})=>{let[t,n]=(0,y.useState)({status:`loading`}),[r,i]=(0,y.useState)(!1),a=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=!1;return n({status:`loading`}),Gl(e).then(e=>{t||n({status:`ready`,svg:e})}).catch(e=>{t||n({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]),(0,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=t.status===`ready`?t.svg:``)},[t]),t.status===`loading`?(0,x.jsx)(`div`,{className:`console-mermaid-loading`,children:`Rendering diagram...`}):t.status===`error`?(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-error`,children:[`Mermaid render error: `,t.message]}),(0,x.jsx)(`pre`,{className:`console-mermaid-source`,children:(0,x.jsx)(`code`,{children:e})})]}):(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsx)(`div`,{ref:a,className:`console-mermaid-rendered`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-enlarge`,onClick:()=>i(!0),children:`Enlarge diagram`}),r&&(0,x.jsx)(eu,{svg:t.svg,onClose:()=>i(!1)})]})},nu=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(W(r)===null)return;let i=e.textContent??r,a=document.createElement(`span`);a.className=`console-markdown-reference-host`,e.replaceWith(a),n.push({key:`${t}:${r}`,host:a,href:r,fallbackText:i})}),n},ru=e=>{let t=e.querySelectorAll(`pre > code`),n=[];return t.forEach((e,t)=>{let r=e.parentElement;if(r===null)return;let i=e.textContent??``,a=document.createElement(`div`);a.className=`console-markdown-code-block`;let o=document.createElement(`div`);o.className=`console-markdown-code-copy-host`,r.replaceWith(a),a.append(o,r),n.push({key:`code:${t}`,host:o,code:i})}),n},iu=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>{let n=Z(e,r);return t===void 0?n:go(n,t)},[e,t,r]),a=(0,y.useRef)(null),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)([]);return(0,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(ru(e)),s(n===void 0?[]:nu(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,E.createPortal)((0,x.jsx)(zl,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,E.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},au=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>Rl(e),[e]);return e.trim()===``?(0,x.jsx)(`p`,{className:`console-markdown-empty`,children:`No description provided.`}):(0,x.jsx)(`div`,{className:`console-markdown-view`,children:i.map(e=>e.kind===`mermaid`?(0,x.jsx)(tu,{code:e.code},e.key):(0,x.jsx)(iu,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},ou=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,y.useState)(n),s=t===null?e:`${e} (${t})`;return(0,x.jsxs)(`section`,{className:`console-panel`,children:[(0,x.jsxs)(`header`,{className:`console-panel-header`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-panel-toggle`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-panel-caret`,children:a?`▸`:`▾`}),(0,x.jsx)(`span`,{className:`console-panel-title`,children:s})]}),r!==void 0&&(0,x.jsx)(`div`,{className:`console-panel-action`,children:r})]}),!a&&(0,x.jsx)(`div`,{className:`console-panel-body`,children:i})]})},su=e=>{switch(e){case`added`:return{label:`A`,color:`#3fb950`};case`modified`:return{label:`M`,color:`#d29922`};case`removed`:return{label:`D`,color:`#f85149`};case`renamed`:return{label:`R`,color:`#a371f7`};case`changed`:return{label:`M`,color:`#d29922`};default:return{label:`?`,color:`#8b949e`}}},cu=()=>({directories:new Map,files:[]}),lu=e=>e.split(`/`).filter(e=>e!==``),uu=(e,t)=>e.name.localeCompare(t.name),du=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:du(e,i)})}),n.sort(uu);let r=e.files.map(e=>({kind:`file`,name:lu(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(uu),[...n,...r]},fu=e=>{let t=cu();for(let n of e){let e=lu(n.path);if(e.length===0){t.files.push(n);continue}let r=e.slice(0,-1),i=t;for(let e of r){let t=i.directories.get(e);if(t===void 0){let t=cu();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return du(t,``)},pu=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,mu=e=>{let t=[],n=0,r=0;for(let i of e.split(`
87
87
  `)){if(i.startsWith(`@@`)){let e=i.match(pu);e!==null&&(n=Number(e[1]),r=Number(e[2])),t.push({kind:`hunk`,oldLineNumber:null,newLineNumber:null,content:i});continue}if(i.startsWith(`+`)){t.push({kind:`add`,oldLineNumber:null,newLineNumber:r,content:i}),r+=1;continue}if(i.startsWith(`-`)){t.push({kind:`del`,oldLineNumber:n,newLineNumber:null,content:i}),n+=1;continue}t.push({kind:`ctx`,oldLineNumber:n,newLineNumber:r,content:i}),n+=1,r+=1}return t},hu=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],gu=e=>{let t=e.toLowerCase();return hu.some(e=>t.endsWith(e))},_u=e=>e.kind===`add`||e.kind===`ctx`?e.newLineNumber===null?null:{line:e.newLineNumber,side:`RIGHT`}:e.kind===`del`?e.oldLineNumber===null?null:{line:e.oldLineNumber,side:`LEFT`}:null,vu=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,yu=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)({kind:`idle`}),s=async()=>{let n=r.trim();if(n.length!==0&&a.kind!==`posting`){o({kind:`posting`});try{await t(e.path,e.line,e.side,n),i(``),o({kind:`posted`})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}};return(0,x.jsxs)(`div`,{className:`console-diff-composer`,children:[(0,x.jsxs)(`div`,{className:`console-diff-composer-anchor`,children:[`commenting on line `,e.line,` (`,e.side,`)`]}),a.kind===`posted`?(0,x.jsx)(`p`,{className:`console-diff-composer-posted`,children:`Comment saved.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`textarea`,{className:`console-diff-composer-input`,rows:3,placeholder:`Leave a review comment on this line…`,value:r,onChange:e=>i(e.target.value)}),(0,x.jsxs)(`div`,{className:`console-diff-composer-controls`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-submit`,disabled:a.kind===`posting`,onClick:()=>{s()},children:`Comment`}),(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-cancel`,onClick:n,children:`Cancel`}),a.kind===`posting`&&(0,x.jsx)(`span`,{className:`console-diff-composer-status`,children:`Posting…`}),a.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-diff-composer-status console-diff-composer-error`,children:[`Failed: `,a.message]})]})]})]})},bu=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(null);if(e===null||e===``){if(t!==void 0&&n!=null){if(n.startsWith(`data:image/`))return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:n,alt:t})});if(gu(t)&&r!==void 0)return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:r(n),alt:t})})}return(0,x.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`})}let s=mu(e),c=i!==void 0&&t!==void 0&&t.length>0,l=c?4:3;return(0,x.jsx)(`table`,{className:`console-file-diff`,children:(0,x.jsx)(`tbody`,{children:s.map(e=>{let n=vu(e),r=c?_u(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,x.jsxs)(y.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`console-diff-row console-diff-${e.kind}`,children:[c&&(0,x.jsx)(`td`,{className:`console-diff-comment-cell`,children:r!==null&&t!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-diff-comment-button`,"aria-label":`Comment on line ${r.line} (${r.side})`,"aria-expanded":s,onClick:()=>o(s?null:{path:t,line:r.line,side:r.side}),children:`+`})}),(0,x.jsx)(`td`,{className:`console-diff-ln`,children:e.oldLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-ln`,children:e.newLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-code`,children:e.content})]}),s&&i!==void 0&&a!==null&&(0,x.jsx)(`tr`,{className:`console-diff-composer-row`,children:(0,x.jsx)(`td`,{colSpan:l,children:(0,x.jsx)(yu,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},xu=e=>({paddingLeft:`${e*16}px`}),Su=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(!1),s=su(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:xu(t),"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-file-caret`,children:a?`▾`:`▸`}),(0,x.jsx)(`span`,{className:`console-file-badge`,style:{color:s.color,borderColor:s.color},children:s.label}),(0,x.jsx)(`span`,{className:`console-file-path`,children:n}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-add`,children:[`+`,e.additions]}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-del`,children:[`-`,e.deletions]})]}),a&&(0,x.jsx)(bu,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},Cu=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(Su,{file:e.file,depth:t,name:e.name,buildImageProxyUrl:n,onAddInlineComment:r}):(0,x.jsxs)(`li`,{className:`console-file-tree-dir`,children:[(0,x.jsxs)(`div`,{className:`console-file-tree-dir-name`,style:xu(t),children:[(0,x.jsx)(`span`,{className:`console-file-tree-dir-icon`,"aria-hidden":`true`,children:`📁`}),e.name]}),(0,x.jsx)(`ul`,{className:`console-file-tree-children`,children:e.children.map(e=>(0,x.jsx)(Cu,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),wu=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{if(n!==null)return(0,x.jsx)(`p`,{className:`console-files-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`});let a=fu(e);return(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:a.map(e=>(0,x.jsx)(Cu,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))})},Tu=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o,workflowImprovementIssueUrl:s=null})=>{let[c,l]=(0,y.useState)(!1);if(n!==null)return(0,x.jsx)(`p`,{className:`console-comment-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-comment-loading`,children:`Loading comments...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-comment-empty`,children:`No comments.`});let u=c?e:e.slice(-1);return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[!c&&e.length>1&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>l(!0),children:[`Show all `,e.length]}),u.map(e=>(0,x.jsxs)(`article`,{className:`console-comment`,children:[(0,x.jsxs)(`header`,{className:`console-comment-header`,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:he(e.createdAt,r)}),s!==null&&e.url!==null&&(0,x.jsx)(`a`,{href:fo(s,e.url),target:`_blank`,rel:`noreferrer`,className:`console-comment-report-link`,"aria-label":`Create workflow incident report for this comment`,children:`⚡`})]}),(0,x.jsx)(au,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},Eu=e=>e.slice(0,7),Du=e=>e.split(`
88
- `)[0],Ou=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:Du(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:Eu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:he(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),ku=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Nn,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Au=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},ju=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,Mu=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Au(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,ju(e.sections),`:`,` `,e.message]},e.message))}),Nu={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},Pu=({mergeableStatus:e})=>{let t=Nu[e],n=se(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},Fu=e=>{let t=se(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},Iu=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:Fu(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:Fu(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},Lu=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=W(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(Pu,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(Iu,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(ku,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(ou,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(au,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(ou,{title:`Changed files`,count:g,children:(0,x.jsx)(wu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(ou,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(Ou,{commits:o,isLoading:s,error:c,now:l})})]})},Ru=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:E,buildImageProxyUrl:ee,renderReferenceLink:D,onAddInlineComment:te,workflowImprovementIssueUrl:ne=null})=>{let re=a?.state??`open`,ie=a?.merged??!1,O=!e.isPr&&re===`closed`?`Closed`:null,ae=lo(e.nameWithOwner)??void 0,oe=se(n),k=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,A=k===null?null:se(k.color),j=p||m!==null?null:f.length,ce=u||d!==null?null:l.length,le=g||_!==null?null:h.length,M=!u&&d===null&&l.length>0,N=e=>{let t=W(e);return t===null?e:`PR #${t.number}`},P=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${N(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${N(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),F=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(ye,{isPr:e.isPr,state:re,merged:ie,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[k!==null&&A!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:A.fg,borderColor:A.border,backgroundColor:A.bg},children:k.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:oe.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(Iu,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:N(e.pullRequest.url)}),(0,x.jsx)(Iu,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(Pu,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),F.map(e=>(0,x.jsx)(Pu,{mergeableStatus:e.mergeableStatus},e.url)),O!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:O})]}),(0,x.jsx)(Mu,{failures:P}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:ge(e.createdAt),children:[`opened `,he(e.createdAt,w)]}),(0,x.jsx)(ku,{url:e.url}),ne!==null&&(0,x.jsx)(`a`,{href:fo(ne,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(ou,{title:`Description`,defaultCollapsed:M,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(au,{body:o,buildImageProxyUrl:ee,renderReferenceLink:D,repoContext:ae}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},M?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(ou,{title:`Changed files`,count:j,children:(0,x.jsx)(wu,{files:f,isLoading:p,error:m,onAddInlineComment:te})}),(0,x.jsx)(ou,{title:`Comments`,count:ce,defaultCollapsed:e.isPr,children:(0,x.jsx)(Tu,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:ee,renderReferenceLink:D,repoContext:ae,workflowImprovementIssueUrl:ne})}),e.isPr&&(0,x.jsx)(ou,{title:`Commits`,count:le,defaultCollapsed:!0,children:(0,x.jsx)(Ou,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(Lu,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:ee,renderReferenceLink:D,onAddInlineComment:te},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:E})]})]})},zu=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},Bu=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(zu,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Vu=({onClose:e})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),Hu=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async()=>{if(t){c(!0),u(null);try{await t()}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field? Open tasks assigned to this story will be closed.`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},Uu=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),Wu=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],Gu=`Reject needs an inline comment on the diff.`,Ku=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:Gu}),Wu.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),qu=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},Ju=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Yu=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=ue.map(t=>({name:t,option:Ju(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=se(r.color),a=e===P;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},Xu=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(zu,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Zu=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Ku,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(Uu,{isManualTriage:de(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Yu,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),(0,x.jsx)(Xu,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(Bu,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(0,x.jsx)(qu,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(Hu,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(Vu,{onClose:c.onClose})]})]}),Qu=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},$u=[],ed=[],td=[],nd=[],rd={state:`open`,merged:!1,isPullRequest:!1,title:``},id={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},ad=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Qu(e.body,r,i,``),s=Qu(e.state,r,i,rd),c=Qu(e.comments,r,i,$u),l=Qu(e.files,a?r:null,a?i:null,ed),u=Qu(e.commits,a?r:null,a?i:null,td),d=Qu(e.prStatus,a?r:null,a?i:null,id),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Qu(e.relatedPrs,f?r:null,f?i:null,nd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:ed,filesAreLoading:!0,filesError:null,commits:td,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},od=e=>JSON.stringify([e.author,e.createdAt,e.body]),sd=(e,t)=>{let n=new Set(e.map(od));return[...e,...t.filter(e=>!n.has(od(e)))]},cd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=W(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ye,{...uo(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},ld=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},ud=({cache:e,href:t,fallbackText:n})=>{let r=ld(e,t);return(0,x.jsx)(cd,{href:t,fallbackText:n,state:r})},dd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),fd=(e,t,n,r,i)=>({...dd(t),apiPath:na,requestBody:aa(e,t,n,r,i)}),pd=(e,t,n,r)=>({...dd(t),apiPath:ra,requestBody:oa(e,t,n,r)}),md=(e,t)=>({...dd(t),apiPath:ia,requestBody:sa(e,t)}),hd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=ad(n,t,e),b=(0,y.useCallback)(e=>ho(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(ud,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),E=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[ee,D]=(0,y.useState)([]),te=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return D(e=>[...e,n]),n},[t,r]),ne={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:fd(i,t,n,e,a)})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:pd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:pd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:pd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:pd(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:md(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:pd(i,t,e)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},re=a.find(e=>e.name===`Awaiting Workspace`)??null,ie=re===null?void 0:async e=>(p?.(``),ne.onSetStatus(re),te(e)),ae=l??(t.story.trim()===``?null:t.story),oe=ae===null?null:O(c,ae);return(0,x.jsx)(Ru,{item:t,storyName:ae,storyColorEnum:oe,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:sd(v.comments,ee),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:E,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(so,{initiallyOpen:!0,initialDraft:f,onSubmit:te,onDraftChange:p,onOkAndAwaitingWorkspace:re===null?void 0:()=>ne.onOkAndAwaitingWorkspace(re),onSubmitAndMoveToAwaitingWorkspace:ie,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Zu,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:ae,agentOptions:s,currentAgentName:t.agent,handlers:ne,storyNameForDeletion:g})})},gd=()=>{let e={};for(let t of ee)e[t.name]=0;return e},_d=`console`,vd=()=>{let e=ha(),t=Bi(),n=br(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=Ga(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=Za(),{pjcodes:v,workflowImprovementIssueUrl:b,isLoading:C}=ga(),{isTimerExpired:w}=ya(e),E=pa(e??_d),D=va(e),te=(0,y.useMemo)(()=>{let e=gd();for(let t of ee){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Zi(n.items,$i(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]),ie=qi(e,te),{activeTab:O,selectedItemKey:oe,openItem:A,closeItem:se,selectTab:j}=ie,ce=(0,y.useRef)(new Map),le=(0,y.useCallback)(e=>{oe!==null&&(e?ce.current.set(oe,e):ce.current.delete(oe))},[oe]),M=Mi(r),N=la(e,O,E,M,(0,y.useCallback)(()=>s(`queued`),[s])),P=Ai(),[F,ue]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{ue(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[de,fe]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>fe(!0),t=()=>fe(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[I,pe]=(0,y.useState)(new Map),[L,me]=(0,y.useState)(new Map),[he,ge]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!de||P.offlineActions.length===0))for(let e of P.offlineActions)I.has(e.id)||he.has(e.id)||(pe(t=>new Map(t).set(e.id,null)),M.client.fetchIssueState(e.itemUrl).then(t=>{pe(n=>new Map(n).set(e.id,t)),e.isPr&&(me(t=>new Map(t).set(e.id,null)),M.client.fetchPullRequestStatus(e.itemUrl).then(t=>{me(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),ge(t=>new Set(t).add(e.id))}))},[de,P.offlineActions,M.client,I,he]);let[_e,ve]=(0,y.useState)(!1),ye=(0,y.useCallback)(async e=>{ve(!0);try{await P.confirmOfflineAction(e)}finally{ve(!1)}},[P]),be=(0,y.useMemo)(()=>P.offlineActions.map(e=>{let t=I.get(e.id)??null,n=L.get(e.id)??null,r=he.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[P.offlineActions,I,L,he]),xe=i[O],we=(0,y.useMemo)(()=>xe===null?[]:Qi(xe.items,$i(E.overlay,xe.generatedAt),O),[xe,E.overlay,O]),[Te,De]=(0,y.useState)(null),Oe=(0,y.useMemo)(()=>{if(O!==`prs`)return{};let e={};for(let t of we)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[we,O]);(0,y.useEffect)(()=>{O===`prs`&&Te!==null&&(Oe[Te]??0)===0&&De(null)},[Oe,Te,O]);let ke=(0,y.useMemo)(()=>O!==`prs`||Te===null?we:we.filter(e=>e.agent===Te),[we,O,Te]),Ae=(0,y.useMemo)(()=>ke.map(e=>Yi(e)),[ke]),je=xe?.storyOrder??[],Me=(0,y.useMemo)(()=>k(ke,E.overlay,je,xe?.generatedAt??null),[ke,E.overlay,je,xe]),Ne=xe?.storyColors??{},Pe=xe?.statusOptions??[],Fe=xe?.agentOptions??[],Ie=xe?.storyOptions??[],Le=xe?.generatedAt??null,Re=xe?.fromCache??!1,[ze,Be]=(0,y.useState)(null),Ve=(0,y.useMemo)(()=>oe===null||xe===null?null:xe.items.find(e=>e.projectItemId===oe)??null,[oe,xe]);Ri(M,Ve,we),(0,y.useEffect)(()=>{oe!==null&&window.scrollTo({top:0})},[oe]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=Xa(v,null,l);e!==null&&Qa(`/projects/${e}`)}},[e,c,v,l]);let He=te[O],Ue=(0,y.useRef)({tab:O,count:He});(0,y.useEffect)(()=>{let e=Ue.current;if(Ue.current={tab:O,count:He},e.tab===O&&e.count>0&&He===0){let e=Vi(O,te);e!==null&&(j(e),se())}},[O,He,te,j,se]);let We=Ve===null?null:ea(E.overlay,Ve,i[O]?.generatedAt??null),Ge=Ve===null?null:ae(Ve,E.overlay,i[O]?.generatedAt??null),Ke=(0,y.useCallback)(e=>{let t=eo(Ae,e);t===null?se():A(t)},[Ae,A,se]),qe=(0,y.useCallback)(t=>{if(n.status===`on`){P.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Yi(t.item);P.enqueue({message:yi(t.kind,t.item,O),color:_i(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&vi(t.kind,O)){if(c&&w(l[e??``]??0)){let t=Xa(v,e,l);t!==null&&$a(`/projects/${t}`)}else Ke(r)}}})},[P,O,Ke,n.status,c,w,l,e,v]),Je=Aa((0,y.useCallback)(e=>{if(oe===null||e===null)return;let t=e===`next`?to(Ae,oe):no(Ae,oe);t!==null&&A(t)},[oe,Ae,A])),[Ye,Xe]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),Ze=(0,y.useCallback)(()=>{Xe(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),Qe=i.stories,$e=Qe?.stories??[],et=ze!==null&&ze.generatedAt===Qe?.generatedAt?ze.stories:$e,tt=Qe?.defaultNameWithOwner??null,nt=(0,y.useMemo)(()=>Ve===null||!Ve.labels.includes(`story`)?null:et.find(e=>e.storyName===Ve.story)??null,[Ve,et]),rt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(tt===null)throw Error(`No repository configured for this project.`);await Qr({pjcode:e,title:n,storyOptionId:t,nameWithOwner:tt})},[e,tt]),it=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await ei({pjcode:e,storyOptionId:t,direction:n});let r=et.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<et.length){let t=[...et],n=t[r];t[r]=t[e],t[e]=n,Be({generatedAt:Qe?.generatedAt,stories:t})}}},[e,et,Qe?.generatedAt]),at=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Kr({pjcode:e,storyName:t})},[e]),[ot,st]=(0,y.useState)({}),[ct,lt]=(0,y.useState)(null),[ut,dt]=(0,y.useState)({}),ft=(0,y.useCallback)((t,n)=>{let r=et.find(e=>e.storyOptionId===t)?.color;if(lt(t),st(e=>({...e,[t]:n})),dt(e=>{let n={...e};return delete n[t],n}),e===null||tt===null){st(e=>r===void 0?e:{...e,[t]:r}),dt(e=>({...e,[t]:`No project or repository configured.`})),lt(e=>e===t?null:e);return}Zr({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:tt}).catch(e=>{st(e=>r===void 0?e:{...e,[t]:r}),dt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{lt(e=>e===t?null:e)})},[e,tt,et]),pt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await ii({pjcode:e,storyOptionId:t}),Be({generatedAt:Qe?.generatedAt,stories:et.filter(e=>e.storyOptionId!==t)})},[e,et,Qe?.generatedAt]),mt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await oi({pjcode:e,storyOptionId:t,newName:n});let r=et.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Be({generatedAt:Qe?.generatedAt,stories:r})},[e,et,Qe?.generatedAt]),ht=Ea(we,M.comments,O===`prs`),gt=(0,y.useCallback)((e,t)=>{qe({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>N.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{E.patchOverlay(Yi(e),{done:!0,status:{name:t.name,color:t.color}},O)},revertAdvance:()=>{E.patchOverlay(Yi(e),{done:!1},O)}})},[qe,N,E,O]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[P.pending!==null&&(0,x.jsx)(qn,{message:P.pending.message,color:P.pending.color,remainingSeconds:P.pending.remainingSeconds,progress:P.pending.progress,onUndo:P.undo}),P.error!==null&&(0,x.jsx)(Jn,{title:P.error.message,message:`Operation failed: ${P.error.reason}`,onDismiss:P.dismissError}),(0,x.jsx)(Kn,{actions:be,isOnline:de,isConfirming:_e,onConfirm:ye,onDiscard:P.discardOfflineAction}),D.isOpen&&(0,x.jsx)(S,{value:D.inputValue,onChange:D.changeInput,isLoading:D.isLoading,isSaving:D.isSaving,error:D.error,onSave:D.save,onClose:D.close}),(0,x.jsx)(ne,{activeTab:O,counts:te,pjcode:e,pjcodes:v,generatedAt:Le,fromCache:Re,tabHref:ie.tabHref,onSelectTab:ie.selectTab,onSelectProject:e=>$a(`/projects/${e}`),settingsButton:(0,x.jsxs)(x.Fragment,{children:[e!==null&&(0,x.jsx)(`button`,{type:`button`,className:`console-tab-settings-button`,"aria-label":`Open project settings`,onClick:D.open,children:`⚙`}),(0,x.jsx)(re,{isOpen:u,timerMode:d,projectMinutes:f,pjcodes:v,isLoadingPjcodes:C,onOpen:p,onToggleTimerMode:g,onChangeMinutes:_,onSave:h,onClose:m})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,workflowImprovementIssueUrl:b}),(0,x.jsx)(T,{timerEndsAt:xe?.timerEndsAt??null,timerTotalSeconds:xe?.timerTotalSeconds??null,now:F}),O===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Vn,{stories:et,isLoading:a,error:o,showGray:Ye,onCreateIssue:rt,onAddStory:at,onSelectColor:ft,onToggleGray:Ze,onReorderStory:it,onDeleteStory:pt,onRenameStory:mt,optimisticColors:ot,colorChangeInFlight:ct,colorErrors:ut})}):Ve===null?O===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ee,{rows:Me,storyColors:Ne,statusOptions:Pe,agentOptions:Fe,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId)})}):O===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(Ce,{agentOptions:Fe,agentCounts:Oe,selectedAgent:Te,onAgentChange:De}),(0,x.jsx)(Se,{rows:Me,storyColors:Ne,statusOptions:Pe,activeItemId:null,now:F,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId),executiveSummaries:ht,onOkAndAwaitingWorkspace:gt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Se,{rows:Me,storyColors:Ne,statusOptions:Pe,activeItemId:null,now:F,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:Je,children:(0,x.jsx)(hd,{tab:O,item:Ve,caches:M,operations:N,pjcode:e,statusOptions:Pe,storyOptions:Ie,agentOptions:Fe,storyColors:Ne,storyName:Ge,overlayStatus:We,now:F,initialCommentDraft:ce.current.get(Ve.projectItemId)??``,onCommentDraftChange:le,onQueueAction:qe,onDeleteStory:nt===null?null:async()=>{await pt(nt.storyOptionId),se()},storyNameForDeletion:nt?.storyName??null,workflowImprovementIssueUrl:b},Ve.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var $=document.getElementById(`root`);if($===null)throw Error(`Root container #root not found`);(0,b.createRoot)($).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(vd,{})}));
88
+ `)[0],Ou=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:Du(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:Eu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:he(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),ku=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Nn,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Au=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},ju=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,Mu=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Au(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,ju(e.sections),`:`,` `,e.message]},e.message))}),Nu={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},Pu=({mergeableStatus:e})=>{let t=Nu[e],n=se(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},Fu=e=>{let t=se(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},Iu=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:Fu(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:Fu(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},Lu=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=W(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(Pu,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(Iu,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(ku,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(ou,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(au,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(ou,{title:`Changed files`,count:g,children:(0,x.jsx)(wu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(ou,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(Ou,{commits:o,isLoading:s,error:c,now:l})})]})},Ru=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:E,buildImageProxyUrl:ee,renderReferenceLink:D,onAddInlineComment:te,workflowImprovementIssueUrl:ne=null})=>{let re=a?.state??`open`,ie=a?.merged??!1,O=!e.isPr&&re===`closed`?`Closed`:null,ae=lo(e.nameWithOwner)??void 0,oe=se(n),k=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,A=k===null?null:se(k.color),j=p||m!==null?null:f.length,ce=u||d!==null?null:l.length,le=g||_!==null?null:h.length,M=!u&&d===null&&l.length>0,N=e=>{let t=W(e);return t===null?e:`PR #${t.number}`},P=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${N(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${N(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),F=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(ye,{isPr:e.isPr,state:re,merged:ie,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[k!==null&&A!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:A.fg,borderColor:A.border,backgroundColor:A.bg},children:k.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:oe.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(Iu,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:N(e.pullRequest.url)}),(0,x.jsx)(Iu,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(Pu,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),F.map(e=>(0,x.jsx)(Pu,{mergeableStatus:e.mergeableStatus},e.url)),O!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:O})]}),(0,x.jsx)(Mu,{failures:P}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:ge(e.createdAt),children:[`opened `,he(e.createdAt,w)]}),(0,x.jsx)(ku,{url:e.url}),ne!==null&&(0,x.jsx)(`a`,{href:fo(ne,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(ou,{title:`Description`,defaultCollapsed:M,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(au,{body:o,buildImageProxyUrl:ee,renderReferenceLink:D,repoContext:ae}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},M?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(ou,{title:`Changed files`,count:j,children:(0,x.jsx)(wu,{files:f,isLoading:p,error:m,onAddInlineComment:te})}),(0,x.jsx)(ou,{title:`Comments`,count:ce,defaultCollapsed:e.isPr,children:(0,x.jsx)(Tu,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:ee,renderReferenceLink:D,repoContext:ae,workflowImprovementIssueUrl:ne})}),e.isPr&&(0,x.jsx)(ou,{title:`Commits`,count:le,defaultCollapsed:!0,children:(0,x.jsx)(Ou,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(Lu,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:ee,renderReferenceLink:D,onAddInlineComment:te},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:E})]})]})},zu=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},Bu=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(zu,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Vu=({onClose:e})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),Hu=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async()=>{if(t){c(!0),u(null);try{await t()}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field? Open tasks assigned to this story will be closed.`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},Uu=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),Wu=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],Gu=`Reject needs an inline comment on the diff.`,Ku=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:Gu}),Wu.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),qu=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},Ju=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Yu=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=ue.map(t=>({name:t,option:Ju(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=se(r.color),a=e===P;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},Xu=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(zu,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Zu=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>{let[u,d]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Ku,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(Uu,{isManualTriage:de(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Yu,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),u&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Xu,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(Bu,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>d(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(qu,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(Hu,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(Vu,{onClose:c.onClose})]})]})},Qu=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},$u=[],ed=[],td=[],nd=[],rd={state:`open`,merged:!1,isPullRequest:!1,title:``},id={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},ad=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Qu(e.body,r,i,``),s=Qu(e.state,r,i,rd),c=Qu(e.comments,r,i,$u),l=Qu(e.files,a?r:null,a?i:null,ed),u=Qu(e.commits,a?r:null,a?i:null,td),d=Qu(e.prStatus,a?r:null,a?i:null,id),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Qu(e.relatedPrs,f?r:null,f?i:null,nd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:ed,filesAreLoading:!0,filesError:null,commits:td,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},od=e=>JSON.stringify([e.author,e.createdAt,e.body]),sd=(e,t)=>{let n=new Set(e.map(od));return[...e,...t.filter(e=>!n.has(od(e)))]},cd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=W(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ye,{...uo(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},ld=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},ud=({cache:e,href:t,fallbackText:n})=>{let r=ld(e,t);return(0,x.jsx)(cd,{href:t,fallbackText:n,state:r})},dd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),fd=(e,t,n,r,i)=>({...dd(t),apiPath:na,requestBody:aa(e,t,n,r,i)}),pd=(e,t,n,r)=>({...dd(t),apiPath:ra,requestBody:oa(e,t,n,r)}),md=(e,t)=>({...dd(t),apiPath:ia,requestBody:sa(e,t)}),hd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=ad(n,t,e),b=(0,y.useCallback)(e=>ho(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(ud,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),E=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[ee,D]=(0,y.useState)([]),te=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return D(e=>[...e,n]),n},[t,r]),ne={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:fd(i,t,n,e,a)})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:pd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:pd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:pd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:pd(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:md(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:pd(i,t,e)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},re=a.find(e=>e.name===`Awaiting Workspace`)??null,ie=re===null?void 0:async e=>(p?.(``),ne.onSetStatus(re),te(e)),ae=l??(t.story.trim()===``?null:t.story),oe=ae===null?null:O(c,ae);return(0,x.jsx)(Ru,{item:t,storyName:ae,storyColorEnum:oe,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:sd(v.comments,ee),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:E,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(so,{initiallyOpen:!0,initialDraft:f,onSubmit:te,onDraftChange:p,onOkAndAwaitingWorkspace:re===null?void 0:()=>ne.onOkAndAwaitingWorkspace(re),onSubmitAndMoveToAwaitingWorkspace:ie,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Zu,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:ae,agentOptions:s,currentAgentName:t.agent,handlers:ne,storyNameForDeletion:g})})},gd=()=>{let e={};for(let t of ee)e[t.name]=0;return e},_d=`console`,vd=()=>{let e=ha(),t=Bi(),n=br(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=Ga(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=Za(),{pjcodes:v,workflowImprovementIssueUrl:b,isLoading:C}=ga(),{isTimerExpired:w}=ya(e),E=pa(e??_d),D=va(e),te=(0,y.useMemo)(()=>{let e=gd();for(let t of ee){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Zi(n.items,$i(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]),ie=qi(e,te),{activeTab:O,selectedItemKey:oe,openItem:A,closeItem:se,selectTab:j}=ie,ce=(0,y.useRef)(new Map),le=(0,y.useCallback)(e=>{oe!==null&&(e?ce.current.set(oe,e):ce.current.delete(oe))},[oe]),M=Mi(r),N=la(e,O,E,M,(0,y.useCallback)(()=>s(`queued`),[s])),P=Ai(),[F,ue]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{ue(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[de,fe]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>fe(!0),t=()=>fe(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[I,pe]=(0,y.useState)(new Map),[L,me]=(0,y.useState)(new Map),[he,ge]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!de||P.offlineActions.length===0))for(let e of P.offlineActions)I.has(e.id)||he.has(e.id)||(pe(t=>new Map(t).set(e.id,null)),M.client.fetchIssueState(e.itemUrl).then(t=>{pe(n=>new Map(n).set(e.id,t)),e.isPr&&(me(t=>new Map(t).set(e.id,null)),M.client.fetchPullRequestStatus(e.itemUrl).then(t=>{me(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),ge(t=>new Set(t).add(e.id))}))},[de,P.offlineActions,M.client,I,he]);let[_e,ve]=(0,y.useState)(!1),ye=(0,y.useCallback)(async e=>{ve(!0);try{await P.confirmOfflineAction(e)}finally{ve(!1)}},[P]),be=(0,y.useMemo)(()=>P.offlineActions.map(e=>{let t=I.get(e.id)??null,n=L.get(e.id)??null,r=he.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[P.offlineActions,I,L,he]),xe=i[O],we=(0,y.useMemo)(()=>xe===null?[]:Qi(xe.items,$i(E.overlay,xe.generatedAt),O),[xe,E.overlay,O]),[Te,De]=(0,y.useState)(null),Oe=(0,y.useMemo)(()=>{if(O!==`prs`)return{};let e={};for(let t of we)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[we,O]);(0,y.useEffect)(()=>{O===`prs`&&Te!==null&&(Oe[Te]??0)===0&&De(null)},[Oe,Te,O]);let ke=(0,y.useMemo)(()=>O!==`prs`||Te===null?we:we.filter(e=>e.agent===Te),[we,O,Te]),Ae=(0,y.useMemo)(()=>ke.map(e=>Yi(e)),[ke]),je=xe?.storyOrder??[],Me=(0,y.useMemo)(()=>k(ke,E.overlay,je,xe?.generatedAt??null),[ke,E.overlay,je,xe]),Ne=xe?.storyColors??{},Pe=xe?.statusOptions??[],Fe=xe?.agentOptions??[],Ie=xe?.storyOptions??[],Le=xe?.generatedAt??null,Re=xe?.fromCache??!1,[ze,Be]=(0,y.useState)(null),Ve=(0,y.useMemo)(()=>oe===null||xe===null?null:xe.items.find(e=>e.projectItemId===oe)??null,[oe,xe]);Ri(M,Ve,we),(0,y.useEffect)(()=>{oe!==null&&window.scrollTo({top:0})},[oe]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=Xa(v,null,l);e!==null&&Qa(`/projects/${e}`)}},[e,c,v,l]);let He=te[O],Ue=(0,y.useRef)({tab:O,count:He});(0,y.useEffect)(()=>{let e=Ue.current;if(Ue.current={tab:O,count:He},e.tab===O&&e.count>0&&He===0){let e=Vi(O,te);e!==null&&(j(e),se())}},[O,He,te,j,se]);let We=Ve===null?null:ea(E.overlay,Ve,i[O]?.generatedAt??null),Ge=Ve===null?null:ae(Ve,E.overlay,i[O]?.generatedAt??null),Ke=(0,y.useCallback)(e=>{let t=eo(Ae,e);t===null?se():A(t)},[Ae,A,se]),qe=(0,y.useCallback)(t=>{if(n.status===`on`){P.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Yi(t.item);P.enqueue({message:yi(t.kind,t.item,O),color:_i(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&vi(t.kind,O)){if(c&&w(l[e??``]??0)){let t=Xa(v,e,l);t!==null&&$a(`/projects/${t}`)}else Ke(r)}}})},[P,O,Ke,n.status,c,w,l,e,v]),Je=Aa((0,y.useCallback)(e=>{if(oe===null||e===null)return;let t=e===`next`?to(Ae,oe):no(Ae,oe);t!==null&&A(t)},[oe,Ae,A])),[Ye,Xe]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),Ze=(0,y.useCallback)(()=>{Xe(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),Qe=i.stories,$e=Qe?.stories??[],et=ze!==null&&ze.generatedAt===Qe?.generatedAt?ze.stories:$e,tt=Qe?.defaultNameWithOwner??null,nt=(0,y.useMemo)(()=>Ve===null||!Ve.labels.includes(`story`)?null:et.find(e=>e.storyName===Ve.story)??null,[Ve,et]),rt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(tt===null)throw Error(`No repository configured for this project.`);await Qr({pjcode:e,title:n,storyOptionId:t,nameWithOwner:tt})},[e,tt]),it=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await ei({pjcode:e,storyOptionId:t,direction:n});let r=et.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<et.length){let t=[...et],n=t[r];t[r]=t[e],t[e]=n,Be({generatedAt:Qe?.generatedAt,stories:t})}}},[e,et,Qe?.generatedAt]),at=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Kr({pjcode:e,storyName:t})},[e]),[ot,st]=(0,y.useState)({}),[ct,lt]=(0,y.useState)(null),[ut,dt]=(0,y.useState)({}),ft=(0,y.useCallback)((t,n)=>{let r=et.find(e=>e.storyOptionId===t)?.color;if(lt(t),st(e=>({...e,[t]:n})),dt(e=>{let n={...e};return delete n[t],n}),e===null||tt===null){st(e=>r===void 0?e:{...e,[t]:r}),dt(e=>({...e,[t]:`No project or repository configured.`})),lt(e=>e===t?null:e);return}Zr({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:tt}).catch(e=>{st(e=>r===void 0?e:{...e,[t]:r}),dt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{lt(e=>e===t?null:e)})},[e,tt,et]),pt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await ii({pjcode:e,storyOptionId:t}),Be({generatedAt:Qe?.generatedAt,stories:et.filter(e=>e.storyOptionId!==t)})},[e,et,Qe?.generatedAt]),mt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await oi({pjcode:e,storyOptionId:t,newName:n});let r=et.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Be({generatedAt:Qe?.generatedAt,stories:r})},[e,et,Qe?.generatedAt]),ht=Ea(we,M.comments,O===`prs`),gt=(0,y.useCallback)((e,t)=>{qe({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>N.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{E.patchOverlay(Yi(e),{done:!0,status:{name:t.name,color:t.color}},O)},revertAdvance:()=>{E.patchOverlay(Yi(e),{done:!1},O)}})},[qe,N,E,O]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[P.pending!==null&&(0,x.jsx)(qn,{message:P.pending.message,color:P.pending.color,remainingSeconds:P.pending.remainingSeconds,progress:P.pending.progress,onUndo:P.undo}),P.error!==null&&(0,x.jsx)(Jn,{title:P.error.message,message:`Operation failed: ${P.error.reason}`,onDismiss:P.dismissError}),(0,x.jsx)(Kn,{actions:be,isOnline:de,isConfirming:_e,onConfirm:ye,onDiscard:P.discardOfflineAction}),D.isOpen&&(0,x.jsx)(S,{value:D.inputValue,onChange:D.changeInput,isLoading:D.isLoading,isSaving:D.isSaving,error:D.error,onSave:D.save,onClose:D.close}),(0,x.jsx)(ne,{activeTab:O,counts:te,pjcode:e,pjcodes:v,generatedAt:Le,fromCache:Re,tabHref:ie.tabHref,onSelectTab:ie.selectTab,onSelectProject:e=>$a(`/projects/${e}`),settingsButton:(0,x.jsxs)(x.Fragment,{children:[e!==null&&(0,x.jsx)(`button`,{type:`button`,className:`console-tab-settings-button`,"aria-label":`Open project settings`,onClick:D.open,children:`⚙`}),(0,x.jsx)(re,{isOpen:u,timerMode:d,projectMinutes:f,pjcodes:v,isLoadingPjcodes:C,onOpen:p,onToggleTimerMode:g,onChangeMinutes:_,onSave:h,onClose:m})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,workflowImprovementIssueUrl:b}),(0,x.jsx)(T,{timerEndsAt:xe?.timerEndsAt??null,timerTotalSeconds:xe?.timerTotalSeconds??null,now:F}),O===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Vn,{stories:et,isLoading:a,error:o,showGray:Ye,onCreateIssue:rt,onAddStory:at,onSelectColor:ft,onToggleGray:Ze,onReorderStory:it,onDeleteStory:pt,onRenameStory:mt,optimisticColors:ot,colorChangeInFlight:ct,colorErrors:ut})}):Ve===null?O===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ee,{rows:Me,storyColors:Ne,statusOptions:Pe,agentOptions:Fe,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId)})}):O===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(Ce,{agentOptions:Fe,agentCounts:Oe,selectedAgent:Te,onAgentChange:De}),(0,x.jsx)(Se,{rows:Me,storyColors:Ne,statusOptions:Pe,activeItemId:null,now:F,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId),executiveSummaries:ht,onOkAndAwaitingWorkspace:gt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Se,{rows:Me,storyColors:Ne,statusOptions:Pe,activeItemId:null,now:F,isLoading:a,error:o,onSelectItem:e=>ie.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:Je,children:(0,x.jsx)(hd,{tab:O,item:Ve,caches:M,operations:N,pjcode:e,statusOptions:Pe,storyOptions:Ie,agentOptions:Fe,storyColors:Ne,storyName:Ge,overlayStatus:We,now:F,initialCommentDraft:ce.current.get(Ve.projectItemId)??``,onCommentDraftChange:le,onQueueAction:qe,onDeleteStory:nt===null?null:async()=>{await pt(nt.storyOptionId),se()},storyNameForDeletion:nt?.storyName??null,workflowImprovementIssueUrl:b},Ve.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var $=document.getElementById(`root`);if($===null)throw Error(`Root container #root not found`);(0,b.createRoot)($).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(vd,{})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>TDPM Console</title>
7
- <script type="module" crossorigin src="/assets/index-C4kJ_-eH.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-D22qGjf6.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-DYBYa71J.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "2.58.0",
3
+ "version": "2.59.1",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- {"version":3,"file":"consoleReadApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,6DAA6D,CAAC;AAMrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,eAAO,MAAM,wBAAwB,QAAa,CAAC;AAEnD,eAAO,MAAM,gCAAgC,QAAY,CAAC;AAE1D,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AAEtE,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,GAAG,IAAI,KACvB,eAQF,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAClC,CAAC;AAYF,qBAAa,oBAAoB;IAGnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2C;g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AE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC;CACV,CAAC;AAsBF,eAAO,MAAM,cAAc,GACzB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAahC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAahC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAgBhC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAahC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAoChC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,OAAO,oBAAoB,EAC3B,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAuBhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,iBAAiB,eAAe,EAChC,OAAO,sBAAsB,EAC7B,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAoChC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,gBAAgB,sBAAsB,GAAG,IAAI,EAC7C,aAAa,MAAM,GAAG,IAAI,EAC1B,QAAQ,MAAM,GAAG,IAAI,KACpB,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAqC/C,CAAC"}
1
+ {"version":3,"file":"consoleReadApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":"AAAA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