azdiffs 1.0.0 → 1.1.0

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.
Files changed (62) hide show
  1. package/README.md +17 -3
  2. package/dist/cli.js +211 -84
  3. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-BfEZAJVI.js +1 -0
  4. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DvqTmFzX.js +1 -0
  5. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
  6. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-DV0pCnK1.js +1 -0
  7. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-Mr-AIHvi.js +1 -0
  8. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-DoV2Gs7F.js +1 -0
  9. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-ChLX3uCr.js +1 -0
  10. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-DXZcIPBR.js +1 -0
  11. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
  12. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-DkEZ314x.js +1 -0
  13. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-N3xJdxPo.js +1 -0
  14. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-Dt7ItZCC.js +1 -0
  15. package/dist/web/assets/_organization.index-DVTzM87W.js +1 -0
  16. package/dist/web/assets/commit-diff-view-BNA-1iz5.js +1 -0
  17. package/dist/web/assets/commits-view-Cq3oHLFX.js +13 -0
  18. package/dist/web/assets/conflicts-view-Bca0Tnmk.js +8 -0
  19. package/dist/web/assets/dev.diff-jb6X8hTd.js +1 -0
  20. package/dist/web/assets/file-header-B2S9b0sl.js +49 -0
  21. package/dist/web/assets/files-view-C2YnVYtG.js +1460 -0
  22. package/dist/web/assets/grammars-B3laSCck.js +2 -0
  23. package/dist/web/assets/{highlights-BJb1-tzP.js → highlights-C-SBVYal.js} +1 -1
  24. package/dist/web/assets/home-page-BUnNaCN6.js +1 -0
  25. package/dist/web/assets/inbox-D8-BBgQT.js +1 -0
  26. package/dist/web/assets/index-DsrXp1aY.js +11 -0
  27. package/dist/web/assets/overview-view-B9qPTEMk.js +2 -0
  28. package/dist/web/assets/pull-request-layout-R9F6zMxd.js +35 -0
  29. package/dist/web/assets/routes-D2t0cGUy.js +1 -0
  30. package/dist/web/assets/shiki-mTy6Inae.js +1 -0
  31. package/dist/web/assets/shortcut-help-D99FihA2.js +1 -0
  32. package/dist/web/assets/{stream-tokenizer-B5Ok5N3S.js → stream-tokenizer-CKeNSKPz.js} +2 -2
  33. package/dist/web/index.html +1 -1
  34. package/package.json +1 -1
  35. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-D7saE-jO.js +0 -1
  36. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DOwGbBTQ.js +0 -1
  37. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
  38. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-Cjr34xFt.js +0 -1
  39. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-BjjJ4Yb8.js +0 -1
  40. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-iY62N_zR.js +0 -1
  41. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-CrHRklAE.js +0 -1
  42. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-WC7fEryq.js +0 -1
  43. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
  44. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-BhUkafpV.js +0 -1
  45. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-_RVmv4sD.js +0 -1
  46. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-BJrgfbSD.js +0 -1
  47. package/dist/web/assets/_organization.index-hKcWlBrk.js +0 -1
  48. package/dist/web/assets/commit-diff-view-CQeZylif.js +0 -1
  49. package/dist/web/assets/commits-view-B_TQ6AnD.js +0 -13
  50. package/dist/web/assets/conflicts-view-CnGEkjaP.js +0 -8
  51. package/dist/web/assets/dev.diff-DH1qvnWe.js +0 -1
  52. package/dist/web/assets/file-header-keBlejWu.js +0 -49
  53. package/dist/web/assets/files-view-Bu3bjrNf.js +0 -1460
  54. package/dist/web/assets/grammars-DmFYBwmS.js +0 -2
  55. package/dist/web/assets/home-page-Y5jGxOav.js +0 -1
  56. package/dist/web/assets/inbox-jP8QPtzZ.js +0 -1
  57. package/dist/web/assets/index-B297yCgq.js +0 -11
  58. package/dist/web/assets/overview-view-cEOsI9TY.js +0 -2
  59. package/dist/web/assets/pull-request-layout-DsDKURcq.js +0 -35
  60. package/dist/web/assets/routes-BruvNNp9.js +0 -1
  61. package/dist/web/assets/shiki-DueA5xDi.js +0 -1
  62. package/dist/web/assets/shortcut-help-Cb0be4f3.js +0 -1
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-anBMbNY-.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/css-CBDjU9xM.js","assets/scss-DC8XIxmG.js","assets/html-Cyo-BRss.js","assets/xml-Bz5Z3pZJ.js","assets/java-r7y4bhRH.js","assets/properties-CHTuaqAW.js","assets/ini-B5eOa1yu.js","assets/fsharp-D13ZGOAj.js","assets/markdown-BYOwaDjH.js","assets/razor-3kKIP6Di.js","assets/csharp-dmMxLVLW.js","assets/php-DTciGFRO.js","assets/sql-CEbI0hMM.js","assets/json-qhed-kSA.js","assets/c-B0t_Dlza.js","assets/cpp-DGR_3gb-.js","assets/lua-mGgFNKt2.js","assets/graphql-Br4JsJsw.js","assets/typescript-bsJCZSQ-.js","assets/jsx-Bz0zcwM4.js","assets/tsx-udAQXfEw.js","assets/vue-Dz_q6gML.js","assets/svelte-iJTmbwM3.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-BLXQ4ufn.js";import{p as t}from"./index-B297yCgq.js";var n=e({bundledLanguages:()=>r}),r=Object.fromEntries([[[`typescript`,`ts`,`cts`,`mts`],()=>t(()=>import(`./typescript-bsJCZSQ-.js`),[])],[[`tsx`],()=>t(()=>import(`./tsx-udAQXfEw.js`),[])],[[`javascript`,`js`,`cjs`,`mjs`],()=>t(()=>import(`./javascript-anBMbNY-.js`).then(e=>e.n),__vite__mapDeps([0,1]))],[[`jsx`],()=>t(()=>import(`./jsx-Bz0zcwM4.js`),[])],[[`json`],()=>t(()=>import(`./json-qhed-kSA.js`),[])],[[`jsonc`],()=>t(()=>import(`./jsonc-CYpm1nAK.js`),[])],[[`json5`],()=>t(()=>import(`./json5-BR5RXkoi.js`),[])],[[`css`],()=>t(()=>import(`./css-CBDjU9xM.js`).then(e=>e.n),__vite__mapDeps([2,1]))],[[`scss`],()=>t(()=>import(`./scss-DC8XIxmG.js`),__vite__mapDeps([3,2,1]))],[[`less`],()=>t(()=>import(`./less-DVTAwKKz.js`),[])],[[`html`],()=>t(()=>import(`./html-Cyo-BRss.js`),__vite__mapDeps([4,0,1,2]))],[[`xml`],()=>t(()=>import(`./xml-Bz5Z3pZJ.js`),__vite__mapDeps([5,6,1]))],[[`markdown`,`md`],()=>t(()=>import(`./markdown-BYOwaDjH.js`),[])],[[`yaml`,`yml`],()=>t(()=>import(`./yaml-rwi0_p6S.js`),[])],[[`toml`],()=>t(()=>import(`./toml-CcmNWLt0.js`),[])],[[`ini`],()=>t(()=>import(`./ini-B5eOa1yu.js`),[])],[[`properties`],()=>t(()=>import(`./properties-CHTuaqAW.js`),__vite__mapDeps([7,8]))],[[`dotenv`],()=>t(()=>import(`./dotenv-CuH5my32.js`),[])],[[`shellscript`,`bash`,`sh`,`shell`,`zsh`],()=>t(()=>import(`./shellscript-CLZ0U2zV.js`),[])],[[`powershell`,`ps`,`ps1`],()=>t(()=>import(`./powershell-QtSnmXcu.js`),[])],[[`bat`,`batch`,`cmd`],()=>t(()=>import(`./bat-qdxAdBWQ.js`),[])],[[`csharp`,`c#`,`cs`],()=>t(()=>import(`./csharp-dmMxLVLW.js`),[])],[[`fsharp`,`f#`,`fs`],()=>t(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([9,10]))],[[`vb`],()=>t(()=>import(`./vb-DOwzaHZ0.js`),[])],[[`razor`],()=>t(()=>import(`./razor-3kKIP6Di.js`),__vite__mapDeps([11,4,0,1,2,12]))],[[`java`],()=>t(()=>import(`./java-r7y4bhRH.js`).then(e=>e.n),__vite__mapDeps([6,1]))],[[`kotlin`,`kt`,`kts`],()=>t(()=>import(`./kotlin-DhhofPvG.js`),[])],[[`groovy`],()=>t(()=>import(`./groovy-CacY0gHj.js`),[])],[[`scala`],()=>t(()=>import(`./scala-BiFt_7mu.js`),[])],[[`go`],()=>t(()=>import(`./go-rLFTqkRN.js`),[])],[[`rust`,`rs`],()=>t(()=>import(`./rust-DpiIf5JO.js`),[])],[[`python`,`py`],()=>t(()=>import(`./python-gzcpVVnB.js`),[])],[[`php`],()=>t(()=>import(`./php-DTciGFRO.js`),__vite__mapDeps([13,4,0,1,2,5,6,14,15]))],[[`c`],()=>t(()=>import(`./c-B0t_Dlza.js`).then(e=>e.n),__vite__mapDeps([16,1]))],[[`cpp`,`c++`],()=>t(()=>import(`./cpp-DGR_3gb-.js`),__vite__mapDeps([17,16,1]))],[[`swift`],()=>t(()=>import(`./swift-CyEgAFGc.js`),[])],[[`dart`],()=>t(()=>import(`./dart-CHZY9Xhz.js`),[])],[[`lua`],()=>t(()=>import(`./lua-mGgFNKt2.js`),__vite__mapDeps([18,16,1]))],[[`sql`],()=>t(()=>import(`./sql-CEbI0hMM.js`),[])],[[`graphql`,`gql`],()=>t(()=>import(`./graphql-Br4JsJsw.js`),__vite__mapDeps([19,0,1,20,21,22]))],[[`protobuf`,`proto`],()=>t(()=>import(`./proto-DB4EqR-F.js`),[])],[[`dockerfile`,`docker`],()=>t(()=>import(`./docker-IyjqRm3v.js`),[])],[[`makefile`,`make`],()=>t(()=>import(`./makefile-Dixweg8N.js`),[])],[[`cmake`],()=>t(()=>import(`./cmake-Bj61d0ZC.js`),[])],[[`hcl`],()=>t(()=>import(`./hcl-Dh228itO.js`),[])],[[`terraform`,`tf`,`tfvars`],()=>t(()=>import(`./terraform-DswuEJGm.js`),[])],[[`bicep`],()=>t(()=>import(`./bicep-CUHmPFLl.js`),[])],[[`vue`],()=>t(()=>import(`./vue-Dz_q6gML.js`),__vite__mapDeps([23,2,1,0,20,15,4]))],[[`svelte`],()=>t(()=>import(`./svelte-iJTmbwM3.js`),__vite__mapDeps([24,0,1,20,2]))],[[`diff`],()=>t(()=>import(`./diff-woXpYk--.js`),[])]].flatMap(([e,t])=>e.map(e=>[e,t])));export{n,r as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,Bn as n,L as r,Ln as i,Rn as a,_n as o,at as s,bt as c,dt as l,h as u,ht as d,m as f,st as p,tt as m,ut as h,vt as g,xn as _,zn as v}from"./index-B297yCgq.js";import{n as y,t as b}from"./inbox-jP8QPtzZ.js";var x=e(n(),1),S=v(),C=`https://dev.azure.com/contoso/Payments/_git/payments-api/pullrequest/1234`;function w({onOpen:e}){let n=l(p()),r=h(n.data?.id),a=_(s()).data?.organizations??[],o=a.length>0;return(0,S.jsx)(t,{sidebarLabel:`Inbox`,sidebar:(0,S.jsx)(b,{organizations:a.map(({name:e,project:t})=>({name:e,project:t})),linkOrganizations:!0}),topBar:(0,S.jsx)(T,{title:`Inbox`}),children:(0,S.jsxs)(E,{title:o?`Select a pull request`:`Open a pull request`,text:o?`Pick one from the sidebar, press ${u} to search, or paste a link.`:`Paste an Azure DevOps pull request link to review it.`,children:[(0,S.jsx)(D,{onOpen:e}),r.data!==void 0&&r.data.length>0&&(0,S.jsxs)(`section`,{"aria-labelledby":`organizations-heading`,className:`space-y-2 pt-2`,children:[(0,S.jsx)(`h2`,{id:`organizations-heading`,className:`text-xs font-medium text-muted`,children:`Your organizations`}),(0,S.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:r.data.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(i,{to:`/$organization`,params:{organization:e},className:`flex h-7 items-center rounded-[7px] border border-border bg-surface px-2.5 text-[13px] text-fg hover:border-border-strong hover:bg-hover`,children:e})},e))})]}),n.isError&&d(n.error)&&(0,S.jsx)(y,{variant:`inline`,error:n.error,organization:null,onRetry:()=>void n.refetch()})]})})}function T({title:e}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(m,{children:(0,S.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e})}),(0,S.jsx)(`div`,{className:`ml-auto flex items-center gap-2`,children:(0,S.jsx)(f,{})})]})}function E({title:e,text:t,children:n,aside:i}){return(0,S.jsx)(`div`,{className:`azd-scrollbar min-h-0 flex-1 overflow-auto`,children:(0,S.jsxs)(`div`,{className:`mx-auto w-full max-w-[34rem] space-y-5 px-6 pt-[16vh] pb-16`,children:[(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-[10px] border border-border bg-surface text-muted`,children:(0,S.jsx)(r,{className:`size-5`})}),i,(0,S.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg-strong`,children:e}),(0,S.jsx)(`p`,{className:`text-[14px] text-muted`,children:t})]}),n]})})}function D({onOpen:e}){let t=a(),[n,r]=(0,x.useState)(``),[i,s]=(0,x.useState)(!1),l=(0,x.useId)(),u=(0,x.useId)(),d=e??(e=>{let n=g(e);return n!==null&&(t({href:c(n)}),!0)});return(0,S.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),s(!d(n))},className:`space-y-1.5`,noValidate:!0,children:[(0,S.jsx)(`label`,{htmlFor:l,className:`block text-xs font-medium text-muted`,children:`Pull request URL`}),(0,S.jsxs)(`div`,{className:`flex gap-2`,children:[(0,S.jsx)(`input`,{id:l,type:`url`,value:n,onChange:e=>{r(e.target.value),s(!1)},placeholder:C,"aria-invalid":i,"aria-describedby":i?u:void 0,autoComplete:`off`,spellCheck:!1,className:`h-9 min-w-0 flex-1 rounded-[8px] border border-border bg-surface px-3 font-mono text-xs text-fg placeholder:text-muted hover:border-border-strong focus:border-[var(--azd-focus)] focus:outline-none aria-[invalid=true]:border-danger`}),(0,S.jsx)(`button`,{type:`submit`,className:`${o} h-9`,children:`Open`})]}),i&&(0,S.jsxs)(`p`,{id:u,className:`text-xs text-danger`,children:[`That is not an Azure DevOps pull request URL. Example: `,C]})]})}export{D as i,w as n,T as r,E as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Bn as t,G as n,Ln as r,P as i,Rn as a,W as o,_ as s,b as c,bn as l,dt as u,g as d,ht as f,it as p,lt as m,mt as h,nt as g,ot as _,rt as v,un as y,v as b,x,xn as S,y as C,yn as w,zn as T}from"./index-B297yCgq.js";var E=e(t(),1),D=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],O=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`,style:`long`});function k(e,t=Date.now()){if(e===null)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=Math.round((n-t)/1e3);for(let[e,t]of D)if(Math.abs(r)>=t)return O.format(Math.round(r/t),e);return`just now`}function A(e){if(e===null)return``;let t=Date.parse(e);return Number.isNaN(t)?``:new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var ee=[[`y`,31536e3],[`mo`,2592e3],[`w`,604800],[`d`,86400],[`h`,3600],[`m`,60]];function j(e,t=Date.now()){if(e===null)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));for(let[e,t]of ee)if(r>=t)return`${Math.floor(r/t)}${e}`;return`now`}var M=T();function N({title:e,testId:t,aside:n,children:r}){let i=`rail-${t}`;return(0,M.jsxs)(`section`,{"aria-labelledby":i,"data-testid":t,children:[(0,M.jsxs)(`div`,{className:`mb-2.5 flex items-baseline gap-2`,children:[(0,M.jsx)(`h2`,{id:i,className:`text-[13px] font-medium text-muted`,children:e}),n!==void 0&&(0,M.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted`,children:n})]}),r]})}function P({label:e,lines:t=3}){return(0,M.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":e,className:`space-y-2 py-0.5`,children:Array.from({length:t},(e,t)=>(0,M.jsx)(`div`,{className:`azd-pulse h-2.5 rounded-full bg-raised`,style:{width:`${[78,62,70,54][t%4]}%`}},t))})}function te(e){return f(e)?`Not signed in to Azure DevOps.`:e instanceof Error&&e.message.length>0?e.message:`Azure DevOps returned an unexpected response.`}function F({what:e,error:t,onRetry:n}){return(0,M.jsxs)(`div`,{role:`alert`,className:`space-y-1.5 text-[13px]`,children:[(0,M.jsxs)(`p`,{className:`text-fg`,children:[(0,M.jsx)(U,{className:`mr-1 inline size-3.5 align-[-2px] text-danger`}),e]}),(0,M.jsx)(`p`,{className:`break-words text-xs text-muted`,children:te(t)}),(0,M.jsx)(`button`,{type:`button`,onClick:n,className:w,children:`Try again`})]})}function ne({children:e}){return(0,M.jsx)(`p`,{className:`text-[13px] text-muted`,children:e})}function I({className:e=`size-3.5`,children:t}){return(0,M.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:`shrink-0 ${e}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function L(e){return(0,M.jsx)(I,{...e,children:(0,M.jsx)(`path`,{d:`M3.5 8.5l3 3 6-7`})})}function R(e){return(0,M.jsx)(I,{...e,children:(0,M.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`})})}function z(e){return(0,M.jsxs)(I,{...e,children:[(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,M.jsx)(`path`,{d:`M8 5v3.2l2 1.3`})]})}function B(e){return(0,M.jsxs)(I,{...e,children:[(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,M.jsx)(`path`,{d:`M8 2.5a5.5 5.5 0 0 1 0 11z`,fill:`currentColor`,stroke:`none`})]})}function V(e){return(0,M.jsx)(I,{...e,children:(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5`,strokeDasharray:`2 2`})})}function H(e){return(0,M.jsxs)(I,{...e,children:[(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,M.jsx)(`path`,{d:`M4.2 11.8l7.6-7.6`})]})}function U(e){return(0,M.jsxs)(I,{...e,children:[(0,M.jsx)(`path`,{d:`M8 2.5l6 11H2z`}),(0,M.jsx)(`path`,{d:`M8 6.5v3M8 11.5v.01`})]})}function W(e){return(0,M.jsxs)(I,{...e,children:[(0,M.jsx)(`circle`,{cx:`6`,cy:`6`,r:`2.2`}),(0,M.jsx)(`circle`,{cx:`11`,cy:`6.5`,r:`1.8`}),(0,M.jsx)(`path`,{d:`M2.5 13c0-2 1.6-3.5 3.5-3.5s3.5 1.5 3.5 3.5M10 9.6c1.9 0 3.5 1.4 3.5 3.4`})]})}function G(e){return(0,M.jsx)(I,{...e,children:(0,M.jsx)(`path`,{d:`M9.5 3.5h3v3M12.5 3.5L7.5 8.5M11 9.5v3h-7.5v-7.5h3`})})}function K({command:e}){let[t,n]=(0,E.useState)(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1500)}catch{n(!1)}};return(0,M.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,M.jsx)(`code`,{className:`block flex-1 select-all overflow-x-auto whitespace-pre rounded-[7px] border border-border bg-raised px-3 py-2 font-mono text-xs text-fg`,children:e}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void r(),className:`shrink-0 rounded-[7px] border border-border bg-raised px-3 text-xs font-medium text-fg hover:border-border-strong hover:bg-hover`,children:t?`Copied`:`Copy`})]})}function q({onRetry:e}){return(0,M.jsx)(`button`,{type:`button`,onClick:e,className:`inline-flex h-8 items-center rounded-[7px] border border-border bg-raised px-3 text-[13px] font-medium text-fg hover:border-border-strong hover:bg-hover`,children:`Try again`})}function J({variant:e=`page`,...t}){return(0,M.jsx)(Y.Provider,{value:e,children:(0,M.jsx)(X,{...t})})}var Y=(0,E.createContext)(`page`);function X({error:e,organization:t,onRetry:n}){if(f(e))switch(e.kind){case`no-launch-key`:case`launch-key-refused`:return(0,M.jsxs)(Q,{title:`Open azdiffs from your terminal`,onRetry:n,children:[(0,M.jsx)(`p`,{children:`This page needs to be opened by the azdiffs command, which signs it in.`}),(0,M.jsx)(K,{command:`npx azdiffs`})]});case`az-not-logged-in`:return(0,M.jsxs)(Q,{title:`Azure CLI session ended`,onRetry:n,children:[(0,M.jsx)(`p`,{children:`Run az login in a terminal, then try again.`}),(0,M.jsx)(K,{command:`az login`})]});case`az-not-installed`:return(0,M.jsxs)(Q,{title:`Azure CLI not found`,onRetry:n,children:[(0,M.jsx)(`p`,{children:`Install the Azure CLI (https://aka.ms/azure-cli), run az login, then try again.`}),(0,M.jsx)(K,{command:`az login`})]});case`az-failed`:return(0,M.jsx)(Q,{title:`The Azure CLI could not sign in`,onRetry:n,children:(0,M.jsx)(`p`,{children:`Check the terminal running azdiffs for the Azure CLI error, then try again.`})});case`server-unreachable`:return(0,M.jsxs)(Q,{title:`azdiffs is not running`,onRetry:n,children:[(0,M.jsx)(`p`,{children:`azdiffs is no longer running. Start it again with npx azdiffs.`}),(0,M.jsx)(K,{command:`npx azdiffs`})]});case`invalid-organization`:return(0,M.jsx)(Q,{title:`Not an organization name`,onRetry:n,children:(0,M.jsx)(`p`,{children:`Azure DevOps organization names use letters, digits and hyphens.`})});case`pat-missing`:return(0,M.jsxs)(Q,{title:`No token stored`,onRetry:n,children:[(0,M.jsxs)(`p`,{children:[t??`This organization`,` is set up to sign in with a Personal Access Token, but none is stored. Run setup again, then try again.`]}),(0,M.jsx)(K,{command:Z(t)})]});case`account-unavailable`:return null}return t!==null&&y(e,`unauthorized`)?h(t)===`pat`?(0,M.jsx)(re,{organization:t,onRetry:n}):(0,M.jsx)(ie,{organization:t,onRetry:n}):(0,M.jsx)(Q,{title:`Could not reach Azure DevOps`,onRetry:n,children:(0,M.jsx)(`p`,{className:`font-mono text-xs text-danger`,children:e instanceof Error?e.message:`Unknown error`})})}function Z(e){return e===null?`npx azdiffs setup`:`npx azdiffs setup --org ${e}`}function re({organization:e,onRetry:t}){return(0,M.jsxs)(Q,{title:`${e} did not accept the token`,onRetry:t,children:[(0,M.jsx)(`p`,{children:`Your token expired or was revoked. Run: npx azdiffs setup`}),(0,M.jsx)(K,{command:Z(e)})]})}function ie({organization:e,onRetry:t}){let n=u().data?.displayName;return(0,M.jsxs)(Q,{title:`No access to ${e}`,onRetry:t,children:[(0,M.jsxs)(`p`,{children:[n===void 0?`Signed in`:`Signed in as ${n}`,`, but this account cannot access`,` `,e,`. If it belongs to another tenant, restart with npx azdiffs --tenant <tenant>.`]}),(0,M.jsx)(K,{command:`npx azdiffs --tenant <tenant>`})]})}function Q({title:e,onRetry:t,children:n}){let r=(0,E.useContext)(Y),i=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{role:`alert`,className:`space-y-3`,children:n}),(0,M.jsx)(q,{onRetry:t})]});return r===`page`?(0,M.jsx)(g,{title:e,children:i}):(0,M.jsxs)(`section`,{className:`space-y-3 rounded-[10px] border border-border bg-surface p-4 text-[13px] text-muted`,children:[(0,M.jsx)(`h2`,{className:`text-[14px] font-semibold text-fg-strong`,children:e}),i]})}function ae({href:e,className:t,children:n,...r}){let i=a();return(0,M.jsx)(`a`,{href:e,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),i({href:e}))},className:t,...r,children:n})}var $=`to-review`,oe=[{value:`created`,label:`Created`,testId:`inbox-tab-created`},{value:`to-review`,label:`To review`,testId:`inbox-tab-to-review`}],se={"to-review":`Nothing waiting for your review.`,created:`You have no open pull requests.`};function ce({organizations:e,linkOrganizations:t,current:n=null,quietProblems:r=!1}){return(0,M.jsx)(v,{children:e.length>0?(0,M.jsx)(le,{organizations:e,linkOrganizations:t,current:n,quietProblems:r}):(0,M.jsx)(`p`,{className:`px-4 py-2 text-[13px] leading-relaxed text-muted`,children:`Pull requests appear here when azdiffs is opened from your terminal.`})})}function le({organizations:e,linkOrganizations:t,current:r,quietProblems:i}){let[a,o]=(0,E.useState)(``),[s,c]=(0,E.useState)($),u=e=>{$=e,c(e)},d=(0,E.useId)();return(0,M.jsxs)(`section`,{"aria-label":`Inbox`,className:`flex min-h-0 flex-1 flex-col`,"data-testid":`inbox`,children:[(0,M.jsxs)(`div`,{className:`shrink-0 space-y-2 px-3 pb-2`,children:[(0,M.jsxs)(`div`,{className:`relative`,children:[(0,M.jsx)(`label`,{htmlFor:d,className:`sr-only`,children:`Search pull requests`}),(0,M.jsx)(n,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`}),(0,M.jsx)(`input`,{id:d,type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:`Search pull requests`,autoComplete:`off`,spellCheck:!1,className:`h-8 w-full rounded-[7px] border border-border bg-surface pr-2 pl-8 text-[13px] text-fg placeholder:text-muted hover:border-border-strong focus:border-[var(--azd-focus)] focus:outline-none`})]}),(0,M.jsx)(l,{label:`Pull requests`,value:s,onChange:u,choices:oe,size:`lg`,stretch:!0})]}),(0,M.jsx)(`div`,{className:`azd-scrollbar min-h-0 flex-1 space-y-3 overflow-y-auto px-2 pb-3`,children:e.map(e=>(0,M.jsx)(ue,{organization:e,query:a,tab:s,linkName:t,current:r,quietProblems:i},e.name))})]})}function ue({organization:e,query:t,tab:n,linkName:i,current:a,quietProblems:o}){let[c,l]=(0,E.useState)(e.project),u=m(e.name),f=u.data?.id,h=S({..._(e.name,c,f??``),enabled:f!==void 0}),g=S({...p(e.name,c,f??``),enabled:f!==void 0}),v=(0,E.useId)(),y=(0,E.useId)(),x=(0,E.useMemo)(()=>({"to-review":s(b(e.name,h.data?.items??[]),t),created:s(d(e.name,g.data?.items??[]),t)}),[e.name,h.data,g.data,t]),C=h.data?.capped===!0||g.data?.capped===!0,w=new Set([...h.data?.failedProjects??[],...g.data?.failedProjects??[]]),T={query:n===`to-review`?h:g,rows:x[n],pendingUser:u.isPending},D=T.query.data===void 0?null:T.rows.length;return(0,M.jsxs)(`section`,{"aria-labelledby":v,"data-testid":`inbox-organization`,"data-organization":e.name,children:[(0,M.jsxs)(`header`,{className:`flex min-w-0 items-center gap-1.5 px-2 pt-1 pb-1 text-xs`,children:[(0,M.jsx)(`h2`,{id:v,className:`min-w-0 truncate font-medium text-muted`,children:i?(0,M.jsx)(r,{to:`/$organization`,params:{organization:e.name},className:`hover:text-fg hover:underline`,children:e.name}):e.name}),D!==null&&(0,M.jsx)(`span`,{className:`tabular-nums text-muted`,"data-testid":`inbox-count`,children:D}),e.project===null?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`label`,{htmlFor:y,className:`sr-only`,children:[`Project in `,e.name]}),(0,M.jsxs)(`select`,{id:y,value:c??``,onChange:e=>l(e.target.value===``?null:e.target.value),className:`ml-auto h-6 max-w-[9rem] min-w-0 truncate rounded-md border border-transparent bg-transparent px-1 text-xs text-muted hover:border-border hover:text-fg focus:border-[var(--azd-focus)] focus:outline-none`,children:[(0,M.jsx)(`option`,{value:e.project,children:e.project}),(0,M.jsx)(`option`,{value:``,children:`All projects`})]})]})]}),(C||w.size>0)&&(0,M.jsxs)(`p`,{className:`px-2 pb-1 text-xs text-muted`,children:[C&&(0,M.jsx)(`span`,{"data-testid":`inbox-capped`,children:`Showing the first 25 projects`}),C&&w.size>0&&` · `,w.size>0&&(0,M.jsxs)(`span`,{title:[...w].join(`, `),children:[w.size,` project`,w.size===1?``:`s`,` could not be read`]})]}),u.isError&&o?(0,M.jsxs)(`p`,{className:`px-2 py-1 text-[13px] text-muted`,children:[`Not signed in to `,e.name,`.`]}):u.isError?(0,M.jsx)(`div`,{className:`px-2 py-1`,children:(0,M.jsx)(J,{variant:`inline`,error:u.error,organization:e.name,onRetry:()=>void u.refetch()})}):(0,M.jsx)(`div`,{"data-testid":`inbox-panel-${n}`,children:(0,M.jsx)(de,{state:T,kind:n,empty:t.trim().length>0?`No pull requests match the filter.`:se[n],current:a})})]})}function de({state:e,kind:t,empty:n,current:r}){if(e.query.data===void 0&&(e.pendingUser||e.query.isPending))return(0,M.jsx)(`div`,{className:`px-2 py-2`,children:(0,M.jsx)(P,{label:`Loading pull requests`,lines:3})});if(e.query.data===void 0){let t=e.query.error;return(0,M.jsx)(`div`,{className:`px-2 py-1`,children:f(t)||y(t,`unauthorized`)?(0,M.jsx)(J,{variant:`inline`,error:t,organization:null,onRetry:()=>void e.query.refetch()}):(0,M.jsx)(F,{what:`Pull requests could not be loaded.`,error:t,onRetry:()=>void e.query.refetch()})})}return e.rows.length===0?(0,M.jsx)(`p`,{className:`px-2 py-2 text-[13px] text-muted`,"data-testid":`inbox-empty`,children:n}):(0,M.jsx)(`ul`,{className:`space-y-px`,children:e.rows.map(e=>(0,M.jsx)(me,{row:e,kind:t,current:r!==null&&r.organization.toLowerCase()===e.organization.toLowerCase()&&r.pullRequestId===e.pullRequest.pullRequestId},`${e.pullRequest.repository.id}/${e.pullRequest.pullRequestId}`))})}var fe={muted:`text-muted`,bad:`text-danger`,good:`text-added`,warn:`text-warning`};function pe({pullRequest:e,className:t=`size-4`}){return e.isDraft?(0,M.jsx)(i,{className:`${t} text-muted`}):(0,M.jsx)(o,{className:`${t} text-added`})}function me({row:e,kind:t,current:n}){let r=e.pullRequest,i=C(e);return(0,M.jsx)(`li`,{"data-testid":`inbox-row`,"data-id":r.pullRequestId,children:(0,M.jsxs)(ae,{href:c(e),...n?{"aria-current":`page`}:{},className:`group flex min-w-0 items-start gap-2 rounded-[7px] px-2 py-1.5 hover:bg-hover aria-[current=page]:bg-[var(--azd-selected)] focus-visible:outline-offset-[-2px]`,children:[(0,M.jsxs)(`span`,{className:`mt-0.5`,children:[(0,M.jsx)(pe,{pullRequest:r,className:`size-[15px]`}),(0,M.jsx)(`span`,{className:`sr-only`,children:r.isDraft?`Draft`:`Active`})]}),(0,M.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-fg group-aria-[current=page]:text-fg-strong`,title:r.title,children:r.title}),(0,M.jsx)(`time`,{dateTime:r.creationDate,title:A(r.creationDate),className:`shrink-0 text-xs tabular-nums text-muted`,children:j(r.creationDate)})]}),(0,M.jsx)(`span`,{className:`flex min-w-0 items-baseline gap-1 text-xs text-muted`,children:(0,M.jsxs)(`span`,{className:`min-w-0 truncate`,children:[r.repository.name,` `,(0,M.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,r.pullRequestId]}),` · `,t===`to-review`?r.author.displayName:x(r)]})}),i.length>0&&(0,M.jsx)(`span`,{className:`mt-0.5 flex flex-wrap gap-x-2 text-xs`,children:i.map(e=>(0,M.jsx)(he,{badge:e},e.label))})]})]})})}function he({badge:e}){return(0,M.jsx)(`span`,{className:fe[e.tone],"data-testid":`inbox-badge`,children:e.label})}export{k as _,z as a,G as c,N as d,B as f,A as g,U as h,V as i,W as l,H as m,J as n,R as o,F as p,L as r,ne as s,ce as t,P as u,j as v};