github-issue-tower-defence-management 1.112.0 → 1.112.2
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.
- package/CHANGELOG.md +14 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/{index-Bu5bQZyP.js → index-BMjm7L0w.js} +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BNPHMdzv.css +1 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/package.json +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.stories.tsx +72 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.test.tsx +140 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +8 -0
- package/src/adapter/entry-points/console/ui/src/index.css +90 -8
- package/src/adapter/entry-points/console/ui-dist/assets/{index-Bu5bQZyP.js → index-BMjm7L0w.js} +1 -1
- package/src/adapter/entry-points/console/ui-dist/assets/index-BNPHMdzv.css +1 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BPH6W1yn.css +0 -1
- package/src/adapter/entry-points/console/ui-dist/assets/index-BPH6W1yn.css +0 -1
|
@@ -568,6 +568,146 @@ describe('ConsolePage auto-advance', () => {
|
|
|
568
568
|
});
|
|
569
569
|
});
|
|
570
570
|
|
|
571
|
+
describe('ConsolePage scroll reset', () => {
|
|
572
|
+
beforeEach(() => {
|
|
573
|
+
localStorage.clear();
|
|
574
|
+
window.history.replaceState({}, '', '/projects/umino/prs?k=token');
|
|
575
|
+
const fetchMock = jest.fn(async (url: string) => {
|
|
576
|
+
const listMatch = url.match(/\/projects\/[^/]+\/([^/]+)\/list\.json/);
|
|
577
|
+
if (listMatch !== null) {
|
|
578
|
+
return {
|
|
579
|
+
ok: true,
|
|
580
|
+
status: 200,
|
|
581
|
+
json: async () =>
|
|
582
|
+
listMatch[1] === 'prs'
|
|
583
|
+
? twoItemPrPayload()
|
|
584
|
+
: { ...twoItemPrPayload(), items: [] },
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
return { ok: true, status: 200, json: async () => ({ body: '# body' }) };
|
|
588
|
+
});
|
|
589
|
+
global.fetch = fetchMock as unknown as typeof fetch;
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
it('resets the window scroll position to the top when an item is opened', async () => {
|
|
593
|
+
const scrollTo = jest.fn();
|
|
594
|
+
window.scrollTo = scrollTo as unknown as typeof window.scrollTo;
|
|
595
|
+
const { getByText, findByText } = render(<ConsolePage />);
|
|
596
|
+
await waitFor(() => {
|
|
597
|
+
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
601
|
+
expect(await findByText('Approve')).toBeInTheDocument();
|
|
602
|
+
|
|
603
|
+
expect(scrollTo).toHaveBeenCalledWith({ top: 0 });
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
it('resets the window scroll position to the top on each item switch', async () => {
|
|
607
|
+
const scrollTo = jest.fn();
|
|
608
|
+
window.scrollTo = scrollTo as unknown as typeof window.scrollTo;
|
|
609
|
+
const { container, getByText, findByText } = render(<ConsolePage />);
|
|
610
|
+
await waitFor(() => {
|
|
611
|
+
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
615
|
+
expect(await findByText('Approve')).toBeInTheDocument();
|
|
616
|
+
scrollTo.mockClear();
|
|
617
|
+
|
|
618
|
+
const detailScreen = container.querySelector('.console-detail-screen');
|
|
619
|
+
expect(detailScreen).not.toBeNull();
|
|
620
|
+
swipeDetailScreen(
|
|
621
|
+
detailScreen as HTMLElement,
|
|
622
|
+
{ clientX: 240, clientY: 100 },
|
|
623
|
+
{ clientX: 40, clientY: 110 },
|
|
624
|
+
);
|
|
625
|
+
|
|
626
|
+
await waitFor(() => {
|
|
627
|
+
expect(window.location.hash).toBe('#item/PVTI_2');
|
|
628
|
+
});
|
|
629
|
+
expect(scrollTo).toHaveBeenCalledWith({ top: 0 });
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
describe('ConsolePage comment composer isolation', () => {
|
|
634
|
+
beforeEach(() => {
|
|
635
|
+
localStorage.clear();
|
|
636
|
+
window.history.replaceState({}, '', '/projects/umino/prs?k=token');
|
|
637
|
+
const fetchMock = jest.fn(async (url: string, init?: RequestInit) => {
|
|
638
|
+
const listMatch = url.match(/\/projects\/[^/]+\/([^/]+)\/list\.json/);
|
|
639
|
+
if (listMatch !== null) {
|
|
640
|
+
return {
|
|
641
|
+
ok: true,
|
|
642
|
+
status: 200,
|
|
643
|
+
json: async () =>
|
|
644
|
+
listMatch[1] === 'prs'
|
|
645
|
+
? twoItemPrPayload()
|
|
646
|
+
: { ...twoItemPrPayload(), items: [] },
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
if (url.includes('/api/comment')) {
|
|
650
|
+
const requestBody =
|
|
651
|
+
typeof init?.body === 'string'
|
|
652
|
+
? (JSON.parse(init.body) as { body: string })
|
|
653
|
+
: { body: '' };
|
|
654
|
+
return {
|
|
655
|
+
ok: true,
|
|
656
|
+
status: 200,
|
|
657
|
+
json: async () => ({
|
|
658
|
+
comment: {
|
|
659
|
+
author: 'you',
|
|
660
|
+
body: requestBody.body,
|
|
661
|
+
createdAt: '2026-06-19T02:00:00.000Z',
|
|
662
|
+
},
|
|
663
|
+
}),
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
return { ok: true, status: 200, json: async () => ({ body: '# body' }) };
|
|
667
|
+
});
|
|
668
|
+
global.fetch = fetchMock as unknown as typeof fetch;
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
it('does not show a comment posted on one item under the next item', async () => {
|
|
672
|
+
const {
|
|
673
|
+
container,
|
|
674
|
+
getByText,
|
|
675
|
+
findByText,
|
|
676
|
+
getByPlaceholderText,
|
|
677
|
+
queryByText,
|
|
678
|
+
} = render(<ConsolePage />);
|
|
679
|
+
await waitFor(() => {
|
|
680
|
+
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
684
|
+
expect(await findByText('Approve')).toBeInTheDocument();
|
|
685
|
+
|
|
686
|
+
fireEvent.click(getByText('💬 Add a comment'));
|
|
687
|
+
fireEvent.change(getByPlaceholderText('Leave a comment…'), {
|
|
688
|
+
target: { value: 'first item only comment' },
|
|
689
|
+
});
|
|
690
|
+
fireEvent.click(getByText('Comment'));
|
|
691
|
+
|
|
692
|
+
await waitFor(() => {
|
|
693
|
+
expect(getByText('first item only comment')).toBeInTheDocument();
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
const detailScreen = container.querySelector('.console-detail-screen');
|
|
697
|
+
expect(detailScreen).not.toBeNull();
|
|
698
|
+
swipeDetailScreen(
|
|
699
|
+
detailScreen as HTMLElement,
|
|
700
|
+
{ clientX: 240, clientY: 100 },
|
|
701
|
+
{ clientX: 40, clientY: 110 },
|
|
702
|
+
);
|
|
703
|
+
|
|
704
|
+
await waitFor(() => {
|
|
705
|
+
expect(window.location.hash).toBe('#item/PVTI_2');
|
|
706
|
+
});
|
|
707
|
+
expect(queryByText('first item only comment')).toBeNull();
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
|
|
571
711
|
describe('ConsolePage auto-advance tab', () => {
|
|
572
712
|
beforeEach(() => {
|
|
573
713
|
localStorage.clear();
|
|
@@ -120,6 +120,13 @@ export const ConsolePage = () => {
|
|
|
120
120
|
);
|
|
121
121
|
}, [selectedItemKey, activeSnapshot]);
|
|
122
122
|
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (selectedItemKey === null) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
window.scrollTo({ top: 0 });
|
|
128
|
+
}, [selectedItemKey]);
|
|
129
|
+
|
|
123
130
|
const activeCount = counts[activeTab];
|
|
124
131
|
const previousActiveTabCountRef = useRef<{
|
|
125
132
|
tab: ConsoleTabName;
|
|
@@ -238,6 +245,7 @@ export const ConsolePage = () => {
|
|
|
238
245
|
) : (
|
|
239
246
|
<div className="console-detail-screen" ref={detailScreenRef}>
|
|
240
247
|
<ConsoleItemDetailContainer
|
|
248
|
+
key={selectedItem.projectItemId}
|
|
241
249
|
tab={activeTab}
|
|
242
250
|
item={selectedItem}
|
|
243
251
|
caches={caches}
|
|
@@ -31,8 +31,7 @@ body {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.console-app {
|
|
34
|
-
|
|
35
|
-
margin: 0 auto;
|
|
34
|
+
width: 100%;
|
|
36
35
|
display: flex;
|
|
37
36
|
flex-direction: column;
|
|
38
37
|
}
|
|
@@ -404,6 +403,91 @@ body {
|
|
|
404
403
|
background: #161b22;
|
|
405
404
|
}
|
|
406
405
|
|
|
406
|
+
.console-markdown h1,
|
|
407
|
+
.console-markdown h2,
|
|
408
|
+
.console-markdown h3,
|
|
409
|
+
.console-markdown h4,
|
|
410
|
+
.console-markdown h5,
|
|
411
|
+
.console-markdown h6 {
|
|
412
|
+
font-weight: 700;
|
|
413
|
+
line-height: 1.25;
|
|
414
|
+
margin: 1em 0 0.5em;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.console-markdown h1 {
|
|
418
|
+
font-size: 1.6em;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.console-markdown h2 {
|
|
422
|
+
font-size: 1.4em;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.console-markdown h3 {
|
|
426
|
+
font-size: 1.2em;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.console-markdown h4 {
|
|
430
|
+
font-size: 1.05em;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.console-markdown h5 {
|
|
434
|
+
font-size: 0.95em;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.console-markdown h6 {
|
|
438
|
+
font-size: 0.9em;
|
|
439
|
+
color: #8b949e;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.console-markdown pre {
|
|
443
|
+
background: #161b22;
|
|
444
|
+
border: 1px solid #30363d;
|
|
445
|
+
border-radius: 6px;
|
|
446
|
+
padding: 12px;
|
|
447
|
+
margin: 0.5em 0;
|
|
448
|
+
overflow-x: auto;
|
|
449
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
450
|
+
font-size: 13px;
|
|
451
|
+
line-height: 1.45;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.console-markdown code {
|
|
455
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
456
|
+
font-size: 0.9em;
|
|
457
|
+
background: rgba(110, 118, 129, 0.4);
|
|
458
|
+
border-radius: 4px;
|
|
459
|
+
padding: 0.15em 0.4em;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.console-markdown pre code {
|
|
463
|
+
background: transparent;
|
|
464
|
+
border-radius: 0;
|
|
465
|
+
padding: 0;
|
|
466
|
+
font-size: inherit;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.console-markdown blockquote {
|
|
470
|
+
border-left: 3px solid #30363d;
|
|
471
|
+
padding: 0 1em;
|
|
472
|
+
margin: 0.5em 0;
|
|
473
|
+
color: #8b949e;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.console-markdown a {
|
|
477
|
+
color: #4493f8;
|
|
478
|
+
text-decoration: none;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.console-markdown a:hover {
|
|
482
|
+
text-decoration: underline;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.console-markdown hr {
|
|
486
|
+
border: none;
|
|
487
|
+
border-top: 1px solid #30363d;
|
|
488
|
+
margin: 1em 0;
|
|
489
|
+
}
|
|
490
|
+
|
|
407
491
|
.console-mermaid-error {
|
|
408
492
|
color: #f85149;
|
|
409
493
|
font-size: 13px;
|
|
@@ -477,22 +561,20 @@ body {
|
|
|
477
561
|
}
|
|
478
562
|
|
|
479
563
|
.console-actionbar {
|
|
480
|
-
position:
|
|
564
|
+
position: sticky;
|
|
481
565
|
bottom: 0;
|
|
482
|
-
left: 0;
|
|
483
|
-
right: 0;
|
|
484
566
|
z-index: 100;
|
|
485
567
|
background: #161b22;
|
|
486
568
|
border-top: 2px solid #30363d;
|
|
487
569
|
padding: 10px 16px;
|
|
570
|
+
padding-bottom: calc(10px + env(safe-area-inset-bottom));
|
|
488
571
|
}
|
|
489
572
|
|
|
490
573
|
.console-operation-bar {
|
|
491
574
|
display: flex;
|
|
492
575
|
flex-direction: column;
|
|
493
576
|
gap: 8px;
|
|
494
|
-
|
|
495
|
-
margin: 0 auto;
|
|
577
|
+
width: 100%;
|
|
496
578
|
}
|
|
497
579
|
|
|
498
580
|
.console-op-group {
|
|
@@ -575,7 +657,7 @@ body {
|
|
|
575
657
|
}
|
|
576
658
|
|
|
577
659
|
.console-detail-screen {
|
|
578
|
-
padding-bottom:
|
|
660
|
+
padding-bottom: 8px;
|
|
579
661
|
}
|
|
580
662
|
|
|
581
663
|
.console-panel-open-link {
|
package/src/adapter/entry-points/console/ui-dist/assets/{index-Bu5bQZyP.js → index-BMjm7L0w.js}
RENAMED
|
@@ -98,4 +98,4 @@ Please report this to https://github.com/markedjs/marked.`,o){const c="<p>An err
|
|
|
98
98
|
`)}),d+=1,r=[])};for(const b of o){if(c===null&&/^```mermaid\s*$/.test(b.trim())){m(),c=[];continue}if(c!==null){if(b.trim()==="```"){u.push({kind:"mermaid",key:`mermaid:${d}`,code:c.join(`
|
|
99
99
|
`)}),d+=1,c=null;continue}c.push(b);continue}r.push(b)}return c!==null&&r.push("```mermaid",...c),m(),u},yv="https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js";let yi=null,fp=0;const dp=i=>(i.initialize({startOnLoad:!1,securityLevel:"strict",theme:"dark",themeVariables:{background:"#0d1117",primaryColor:"#161b22",primaryTextColor:"#e6edf3",primaryBorderColor:"#30363d",lineColor:"#8b949e",fontSize:"14px"}}),i),vv=()=>yi!==null?yi:window.mermaid!==void 0?(yi=Promise.resolve(dp(window.mermaid)),yi):(yi=new Promise((i,o)=>{const u=document.createElement("script");u.src=yv,u.async=!0,u.onload=()=>{if(window.mermaid===void 0){o(new Error("mermaid failed to load"));return}i(dp(window.mermaid))},u.onerror=()=>o(new Error("mermaid script failed to load")),document.head.appendChild(u)}),yi),Sv=async i=>{const o=await vv();fp+=1;const u=`console-mermaid-${fp}`,{svg:r}=await o.render(u,i);return Hp.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["foreignObject"]})},Tv=({code:i})=>{const[o,u]=q.useState({status:"loading"}),r=q.useRef(null);return q.useEffect(()=>{let c=!1;return u({status:"loading"}),Sv(i).then(d=>{c||u({status:"ready",svg:d})}).catch(d=>{c||u({status:"error",message:d instanceof Error?d.message:String(d)})}),()=>{c=!0}},[i]),q.useEffect(()=>{const c=r.current;c!==null&&(c.innerHTML=o.status==="ready"?o.svg:"")},[o]),o.status==="loading"?v.jsx("div",{className:"console-mermaid-loading",children:"Rendering diagram..."}):o.status==="error"?v.jsxs("div",{className:"console-mermaid",children:[v.jsxs("div",{className:"console-mermaid-error",children:["Mermaid render error: ",o.message]}),v.jsx("pre",{className:"console-mermaid-source",children:v.jsx("code",{children:i})})]}):v.jsx("div",{ref:r,className:"console-mermaid-rendered"})},wv=({source:i,buildImageProxyUrl:o})=>{const u=q.useMemo(()=>{const c=_v(i);return o===void 0?c:Py(c,o)},[i,o]),r=q.useRef(null);return q.useEffect(()=>{const c=r.current;c!==null&&(c.innerHTML=u)},[u]),v.jsx("div",{ref:r,className:"console-markdown"})},dr=({body:i,buildImageProxyUrl:o})=>{const u=q.useMemo(()=>bv(i),[i]);return i.trim()===""?v.jsx("p",{className:"console-markdown-empty",children:"No description provided."}):v.jsx("div",{className:"console-markdown-view",children:u.map(r=>r.kind==="mermaid"?v.jsx(Tv,{code:r.code},r.key):v.jsx(wv,{source:r.source,buildImageProxyUrl:o},r.key))})},xv=({isPr:i,now:o,onSubmit:u})=>{const[r,c]=q.useState(!i),[d,m]=q.useState(""),[b,g]=q.useState({kind:"idle"}),[p,E]=q.useState([]),x=async()=>{const O=d.trim();if(!(O.length===0||b.kind==="posting")){g({kind:"posting"});try{const B=await u(O);E(H=>[...H,B]),m(""),g({kind:"idle"})}catch(B){g({kind:"error",message:B instanceof Error?B.message:"failed to post"})}}};return v.jsxs("div",{className:"console-composer",children:[v.jsx("button",{type:"button",className:"console-composer-toggle","aria-expanded":r,onClick:()=>c(O=>!O),children:r?"✕ Cancel":"💬 Add a comment"}),p.length>0&&v.jsx("div",{className:"console-composer-posted",children:p.map(O=>v.jsxs("article",{className:"console-comment",children:[v.jsxs("header",{className:"console-comment-header",title:Lc(O.createdAt),children:[v.jsx("span",{className:"console-comment-author",children:O.author===""?"you":O.author}),v.jsx("span",{className:"console-comment-time",children:Oo(O.createdAt,o)})]}),v.jsx(dr,{body:O.body})]},`${O.author}:${O.createdAt}:${O.body}`))}),r&&v.jsxs("div",{className:"console-composer-form",children:[v.jsx("textarea",{className:"console-composer-input",rows:3,placeholder:"Leave a comment…",value:d,onChange:O=>m(O.target.value)}),v.jsxs("div",{className:"console-composer-row",children:[v.jsx("button",{type:"button",className:"console-composer-submit",disabled:b.kind==="posting",onClick:()=>{x()},children:"Comment"}),b.kind==="posting"&&v.jsx("span",{className:"console-composer-status",children:"Posting…"}),b.kind==="error"&&v.jsxs("span",{role:"alert",className:"console-composer-status console-composer-error",children:["Failed: ",b.message]})]})]})]})},va=({title:i,count:o=null,defaultCollapsed:u=!1,headerAction:r,children:c})=>{const[d,m]=q.useState(u),b=o===null?i:`${i} (${o})`;return v.jsxs("section",{className:"console-panel",children:[v.jsxs("header",{className:"console-panel-header",children:[v.jsxs("button",{type:"button",className:"console-panel-toggle","aria-expanded":!d,onClick:()=>m(g=>!g),children:[v.jsx("span",{className:"console-panel-caret",children:d?"▸":"▾"}),v.jsx("span",{className:"console-panel-title",children:b})]}),r!==void 0&&v.jsx("div",{className:"console-panel-action",children:r})]}),!d&&v.jsx("div",{className:"console-panel-body",children:c})]})},Ev=i=>{switch(i){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"}}},Av=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,kv=i=>{const o=[];let u=0,r=0;for(const c of i.split(`
|
|
100
100
|
`)){if(c.startsWith("@@")){const d=c.match(Av);d!==null&&(u=Number(d[1]),r=Number(d[2])),o.push({kind:"hunk",oldLineNumber:null,newLineNumber:null,content:c});continue}if(c.startsWith("+")){o.push({kind:"add",oldLineNumber:null,newLineNumber:r,content:c}),r+=1;continue}if(c.startsWith("-")){o.push({kind:"del",oldLineNumber:u,newLineNumber:null,content:c}),u+=1;continue}o.push({kind:"ctx",oldLineNumber:u,newLineNumber:r,content:c}),u+=1,r+=1}return o},zv=i=>i.kind==="add"||i.kind==="ctx"?i.newLineNumber===null?null:{line:i.newLineNumber,side:"RIGHT"}:i.kind==="del"?i.oldLineNumber===null?null:{line:i.oldLineNumber,side:"LEFT"}:null,Nv=i=>`${i.kind}:${i.oldLineNumber??"x"}:${i.newLineNumber??"x"}:${i.content}`,Ov=({target:i,onSubmit:o,onClose:u})=>{const[r,c]=q.useState(""),[d,m]=q.useState({kind:"idle"}),b=async()=>{const g=r.trim();if(!(g.length===0||d.kind==="posting")){m({kind:"posting"});try{await o(i.path,i.line,i.side,g),c(""),m({kind:"posted"})}catch(p){m({kind:"error",message:p instanceof Error?p.message:"failed to post"})}}};return v.jsxs("div",{className:"console-diff-composer",children:[v.jsxs("div",{className:"console-diff-composer-anchor",children:["commenting on line ",i.line," (",i.side,")"]}),d.kind==="posted"?v.jsx("p",{className:"console-diff-composer-posted",children:"Comment posted."}):v.jsxs(v.Fragment,{children:[v.jsx("textarea",{className:"console-diff-composer-input",rows:3,placeholder:"Leave a review comment on this line…",value:r,onChange:g=>c(g.target.value)}),v.jsxs("div",{className:"console-diff-composer-controls",children:[v.jsx("button",{type:"button",className:"console-diff-composer-submit",disabled:d.kind==="posting",onClick:()=>{b()},children:"Comment"}),v.jsx("button",{type:"button",className:"console-diff-composer-cancel",onClick:u,children:"Cancel"}),d.kind==="posting"&&v.jsx("span",{className:"console-diff-composer-status",children:"Posting…"}),d.kind==="error"&&v.jsxs("span",{role:"alert",className:"console-diff-composer-status console-diff-composer-error",children:["Failed: ",d.message]})]})]})]})},Cv=({patch:i,path:o,onAddInlineComment:u})=>{const[r,c]=q.useState(null);if(i===null||i==="")return v.jsx("p",{className:"console-file-diff-empty",children:"(no diff / binary or too large)"});const d=kv(i),m=u!==void 0&&o!==void 0&&o.length>0,b=m?4:3;return v.jsx("table",{className:"console-file-diff",children:v.jsx("tbody",{children:d.map(g=>{const p=Nv(g),E=m?zv(g):null,x=r!==null&&E!==null&&r.line===E.line&&r.side===E.side;return v.jsxs(q.Fragment,{children:[v.jsxs("tr",{className:`console-diff-row console-diff-${g.kind}`,children:[m&&v.jsx("td",{className:"console-diff-comment-cell",children:E!==null&&o!==void 0&&v.jsx("button",{type:"button",className:"console-diff-comment-button","aria-label":`Comment on line ${E.line} (${E.side})`,"aria-expanded":x,onClick:()=>c(x?null:{path:o,line:E.line,side:E.side}),children:"+"})}),v.jsx("td",{className:"console-diff-ln",children:g.oldLineNumber??""}),v.jsx("td",{className:"console-diff-ln",children:g.newLineNumber??""}),v.jsx("td",{className:"console-diff-code",children:g.content})]}),x&&u!==void 0&&r!==null&&v.jsx("tr",{className:"console-diff-composer-row",children:v.jsx("td",{colSpan:b,children:v.jsx(Ov,{target:r,onSubmit:u,onClose:()=>c(null)})})})]},p)})})})},Rv=({file:i,onAddInlineComment:o})=>{const[u,r]=q.useState(!1),c=Ev(i.status);return v.jsxs("li",{className:"console-file",children:[v.jsxs("button",{type:"button",className:"console-file-row","aria-expanded":u,onClick:()=>r(d=>!d),children:[v.jsx("span",{className:"console-file-caret",children:u?"▾":"▸"}),v.jsx("span",{className:"console-file-badge",style:{color:c.color,borderColor:c.color},children:c.label}),v.jsx("span",{className:"console-file-path",children:i.path}),v.jsxs("span",{className:"console-file-stat console-file-add",children:["+",i.additions]}),v.jsxs("span",{className:"console-file-stat console-file-del",children:["-",i.deletions]})]}),u&&v.jsx(Cv,{patch:i.patch,path:i.path,onAddInlineComment:o})]})},Ip=({files:i,isLoading:o,error:u,onAddInlineComment:r})=>u!==null?v.jsxs("p",{role:"alert",className:"console-files-error",children:["Failed to load changed files: ",u]}):o?v.jsx("p",{className:"console-files-loading",children:"Loading changed files..."}):i.length===0?v.jsx("p",{className:"console-files-empty",children:"No changed files."}):v.jsx("ul",{className:"console-files",children:i.map(c=>v.jsx(Rv,{file:c,onAddInlineComment:r},c.path))}),Mv=({comments:i,isLoading:o,error:u,now:r,buildImageProxyUrl:c})=>{const[d,m]=q.useState(!1);if(u!==null)return v.jsxs("p",{role:"alert",className:"console-comment-error",children:["Failed to load comments: ",u]});if(o)return v.jsx("p",{className:"console-comment-loading",children:"Loading comments..."});if(i.length===0)return v.jsx("p",{className:"console-comment-empty",children:"No comments."});const b=d?i:i.slice(-1);return v.jsxs("div",{className:"console-comment-list",children:[!d&&i.length>1&&v.jsxs("button",{type:"button",className:"console-comment-show-all",onClick:()=>m(!0),children:["Show all ",i.length]}),b.map(g=>v.jsxs("article",{className:"console-comment",children:[v.jsxs("header",{className:"console-comment-header",children:[v.jsx("span",{className:"console-comment-author",children:g.author}),v.jsx("span",{className:"console-comment-time",children:Oo(g.createdAt,r)})]}),v.jsx(dr,{body:g.body,buildImageProxyUrl:c})]},`${g.author}:${g.createdAt}:${g.body}`))]})},Dv=i=>i.slice(0,7),jv=i=>i.split(`
|
|
101
|
-
`)[0],Fp=({commits:i,isLoading:o,error:u,now:r})=>u!==null?v.jsxs("p",{role:"alert",className:"console-commits-error",children:["Failed to load commits: ",u]}):o?v.jsx("p",{className:"console-commits-loading",children:"Loading commits..."}):i.length===0?v.jsx("p",{className:"console-commits-empty",children:"No commits."}):v.jsx("ul",{className:"console-commits",children:i.map(c=>v.jsxs("li",{className:"console-commit",children:[v.jsx("span",{className:"console-commit-message",children:jv(c.message)}),v.jsx("span",{className:"console-commit-sha",children:Dv(c.sha)}),v.jsx("span",{className:"console-commit-author",children:c.author}),v.jsx("span",{className:"console-commit-time",children:Oo(c.authoredAt,r)})]},c.sha))});function mp(i,o){if(typeof i=="function")return i(o);i!=null&&(i.current=o)}function Uv(...i){return o=>{let u=!1;const r=i.map(c=>{const d=mp(c,o);return!u&&typeof d=="function"&&(u=!0),d});if(u)return()=>{for(let c=0;c<r.length;c++){const d=r[c];typeof d=="function"?d():mp(i[c],null)}}}}function Lv(...i){return q.useCallback(Uv(...i),i)}function Hv(i){const o=q.forwardRef((u,r)=>{let{children:c,...d}=u,m=null,b=!1;const g=[];hp(c)&&typeof lr=="function"&&(c=lr(c._payload)),q.Children.forEach(c,O=>{var B;if(Xv(O)){b=!0;const H=O;let G="child"in H.props?H.props.child:H.props.children;hp(G)&&typeof lr=="function"&&(G=lr(G._payload)),m=Gv(H,G),g.push((B=m==null?void 0:m.props)==null?void 0:B.children)}else g.push(O)}),m?m=q.cloneElement(m,void 0,g):!b&&q.Children.count(c)===1&&q.isValidElement(c)&&(m=c);const p=m?Zv(m):void 0,E=Lv(r,p);if(!m){if(c||c===0)throw new Error(b?Jv(i):Kv(i));return c}const x=Yv(d,m.props??{});return m.type!==q.Fragment&&(x.ref=r?E:p),q.cloneElement(m,x)});return o.displayName=`${i}.Slot`,o}var qv=Hv("Slot"),Bv=Symbol.for("radix.slottable"),Gv=(i,o)=>{if("child"in i.props){const u=i.props.child;return q.isValidElement(u)?q.cloneElement(u,void 0,i.props.children(u.props.children)):null}return q.isValidElement(o)?o:null};function Yv(i,o){const u={...o};for(const r in o){const c=i[r],d=o[r];/^on[A-Z]/.test(r)?c&&d?u[r]=(...b)=>{const g=d(...b);return c(...b),g}:c&&(u[r]=c):r==="style"?u[r]={...c,...d}:r==="className"&&(u[r]=[c,d].filter(Boolean).join(" "))}return{...i,...u}}function Zv(i){var r,c;let o=(r=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:r.get,u=o&&"isReactWarning"in o&&o.isReactWarning;return u?i.ref:(o=(c=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:c.get,u=o&&"isReactWarning"in o&&o.isReactWarning,u?i.props.ref:i.props.ref||i.ref)}function Xv(i){return q.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===Bv}var Qv=Symbol.for("react.lazy");function hp(i){return i!=null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===Qv&&"_payload"in i&&Vv(i._payload)}function Vv(i){return typeof i=="object"&&i!==null&&"then"in i}var Kv=i=>`${i} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Jv=i=>`${i} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,lr=zb[" use ".trim().toString()];function Wp(i){var o,u,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var c=i.length;for(o=0;o<c;o++)i[o]&&(u=Wp(i[o]))&&(r&&(r+=" "),r+=u)}else for(u in i)i[u]&&(r&&(r+=" "),r+=u);return r}function Pp(){for(var i,o,u=0,r="",c=arguments.length;u<c;u++)(i=arguments[u])&&(o=Wp(i))&&(r&&(r+=" "),r+=o);return r}const pp=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,gp=Pp,$v=(i,o)=>u=>{var r;if((o==null?void 0:o.variants)==null)return gp(i,u==null?void 0:u.class,u==null?void 0:u.className);const{variants:c,defaultVariants:d}=o,m=Object.keys(c).map(p=>{const E=u==null?void 0:u[p],x=d==null?void 0:d[p];if(E===null)return null;const O=pp(E)||pp(x);return c[p][O]}),b=u&&Object.entries(u).reduce((p,E)=>{let[x,O]=E;return O===void 0||(p[x]=O),p},{}),g=o==null||(r=o.compoundVariants)===null||r===void 0?void 0:r.reduce((p,E)=>{let{class:x,className:O,...B}=E;return Object.entries(B).every(H=>{let[G,Y]=H;return Array.isArray(Y)?Y.includes({...d,...b}[G]):{...d,...b}[G]===Y})?[...p,x,O]:p},[]);return gp(i,m,g,u==null?void 0:u.class,u==null?void 0:u.className)},Iv=(i,o)=>{const u=new Array(i.length+o.length);for(let r=0;r<i.length;r++)u[r]=i[r];for(let r=0;r<o.length;r++)u[i.length+r]=o[r];return u},Fv=(i,o)=>({classGroupId:i,validator:o}),eg=(i=new Map,o=null,u)=>({nextPart:i,validators:o,classGroupId:u}),ur="-",_p=[],Wv="arbitrary..",Pv=i=>{const o=t1(i),{conflictingClassGroups:u,conflictingClassGroupModifiers:r}=i;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return e1(m);const b=m.split(ur),g=b[0]===""&&b.length>1?1:0;return tg(b,g,o)},getConflictingClassGroupIds:(m,b)=>{if(b){const g=r[m],p=u[m];return g?p?Iv(p,g):g:p||_p}return u[m]||_p}}},tg=(i,o,u)=>{if(i.length-o===0)return u.classGroupId;const c=i[o],d=u.nextPart.get(c);if(d){const p=tg(i,o+1,d);if(p)return p}const m=u.validators;if(m===null)return;const b=o===0?i.join(ur):i.slice(o).join(ur),g=m.length;for(let p=0;p<g;p++){const E=m[p];if(E.validator(b))return E.classGroupId}},e1=i=>i.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=i.slice(1,-1),u=o.indexOf(":"),r=o.slice(0,u);return r?Wv+r:void 0})(),t1=i=>{const{theme:o,classGroups:u}=i;return n1(u,o)},n1=(i,o)=>{const u=eg();for(const r in i){const c=i[r];Vc(c,u,r,o)}return u},Vc=(i,o,u,r)=>{const c=i.length;for(let d=0;d<c;d++){const m=i[d];l1(m,o,u,r)}},l1=(i,o,u,r)=>{if(typeof i=="string"){a1(i,o,u);return}if(typeof i=="function"){i1(i,o,u,r);return}o1(i,o,u,r)},a1=(i,o,u)=>{const r=i===""?o:ng(o,i);r.classGroupId=u},i1=(i,o,u,r)=>{if(s1(i)){Vc(i(r),o,u,r);return}o.validators===null&&(o.validators=[]),o.validators.push(Fv(u,i))},o1=(i,o,u,r)=>{const c=Object.entries(i),d=c.length;for(let m=0;m<d;m++){const[b,g]=c[m];Vc(g,ng(o,b),u,r)}},ng=(i,o)=>{let u=i;const r=o.split(ur),c=r.length;for(let d=0;d<c;d++){const m=r[d];let b=u.nextPart.get(m);b||(b=eg(),u.nextPart.set(m,b)),u=b}return u},s1=i=>"isThemeGetter"in i&&i.isThemeGetter===!0,r1=i=>{if(i<1)return{get:()=>{},set:()=>{}};let o=0,u=Object.create(null),r=Object.create(null);const c=(d,m)=>{u[d]=m,o++,o>i&&(o=0,r=u,u=Object.create(null))};return{get(d){let m=u[d];if(m!==void 0)return m;if((m=r[d])!==void 0)return c(d,m),m},set(d,m){d in u?u[d]=m:c(d,m)}}},jc="!",bp=":",u1=[],yp=(i,o,u,r,c)=>({modifiers:i,hasImportantModifier:o,baseClassName:u,maybePostfixModifierPosition:r,isExternal:c}),c1=i=>{const{prefix:o,experimentalParseClassName:u}=i;let r=c=>{const d=[];let m=0,b=0,g=0,p;const E=c.length;for(let G=0;G<E;G++){const Y=c[G];if(m===0&&b===0){if(Y===bp){d.push(c.slice(g,G)),g=G+1;continue}if(Y==="/"){p=G;continue}}Y==="["?m++:Y==="]"?m--:Y==="("?b++:Y===")"&&b--}const x=d.length===0?c:c.slice(g);let O=x,B=!1;x.endsWith(jc)?(O=x.slice(0,-1),B=!0):x.startsWith(jc)&&(O=x.slice(1),B=!0);const H=p&&p>g?p-g:void 0;return yp(d,B,O,H)};if(o){const c=o+bp,d=r;r=m=>m.startsWith(c)?d(m.slice(c.length)):yp(u1,!1,m,void 0,!0)}if(u){const c=r;r=d=>u({className:d,parseClassName:c})}return r},f1=i=>{const o=new Map;return i.orderSensitiveModifiers.forEach((u,r)=>{o.set(u,1e6+r)}),u=>{const r=[];let c=[];for(let d=0;d<u.length;d++){const m=u[d],b=m[0]==="[",g=o.has(m);b||g?(c.length>0&&(c.sort(),r.push(...c),c=[]),r.push(m)):c.push(m)}return c.length>0&&(c.sort(),r.push(...c)),r}},d1=i=>({cache:r1(i.cacheSize),parseClassName:c1(i),sortModifiers:f1(i),postfixLookupClassGroupIds:m1(i),...Pv(i)}),m1=i=>{const o=Object.create(null),u=i.postfixLookupClassGroups;if(u)for(let r=0;r<u.length;r++)o[u[r]]=!0;return o},h1=/\s+/,p1=(i,o)=>{const{parseClassName:u,getClassGroupId:r,getConflictingClassGroupIds:c,sortModifiers:d,postfixLookupClassGroupIds:m}=o,b=[],g=i.trim().split(h1);let p="";for(let E=g.length-1;E>=0;E-=1){const x=g[E],{isExternal:O,modifiers:B,hasImportantModifier:H,baseClassName:G,maybePostfixModifierPosition:Y}=u(x);if(O){p=x+(p.length>0?" "+p:p);continue}let re=!!Y,ae;if(re){const le=G.substring(0,Y);ae=r(le);const Q=ae&&m[ae]?r(G):void 0;Q&&Q!==ae&&(ae=Q,re=!1)}else ae=r(G);if(!ae){if(!re){p=x+(p.length>0?" "+p:p);continue}if(ae=r(G),!ae){p=x+(p.length>0?" "+p:p);continue}re=!1}const ee=B.length===0?"":B.length===1?B[0]:d(B).join(":"),ue=H?ee+jc:ee,pe=ue+ae;if(b.indexOf(pe)>-1)continue;b.push(pe);const fe=c(ae,re);for(let le=0;le<fe.length;++le){const Q=fe[le];b.push(ue+Q)}p=x+(p.length>0?" "+p:p)}return p},g1=(...i)=>{let o=0,u,r,c="";for(;o<i.length;)(u=i[o++])&&(r=lg(u))&&(c&&(c+=" "),c+=r);return c},lg=i=>{if(typeof i=="string")return i;let o,u="";for(let r=0;r<i.length;r++)i[r]&&(o=lg(i[r]))&&(u&&(u+=" "),u+=o);return u},_1=(i,...o)=>{let u,r,c,d;const m=g=>{const p=o.reduce((E,x)=>x(E),i());return u=d1(p),r=u.cache.get,c=u.cache.set,d=b,b(g)},b=g=>{const p=r(g);if(p)return p;const E=p1(g,u);return c(g,E),E};return d=m,(...g)=>d(g1(...g))},b1=[],gt=i=>{const o=u=>u[i]||b1;return o.isThemeGetter=!0,o},ag=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ig=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,v1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gl=i=>y1.test(i),_e=i=>!!i&&!Number.isNaN(Number(i)),Dn=i=>!!i&&Number.isInteger(Number(i)),zc=i=>i.endsWith("%")&&_e(i.slice(0,-1)),ol=i=>v1.test(i),og=()=>!0,E1=i=>S1.test(i)&&!T1.test(i),Kc=()=>!1,A1=i=>w1.test(i),k1=i=>x1.test(i),z1=i=>!I(i)&&!F(i),N1=i=>i.startsWith("@container")&&(i[10]==="/"&&i[11]!==void 0||i[11]==="s"&&i[16]!==void 0&&i.startsWith("-size/",10)||i[11]==="n"&&i[18]!==void 0&&i.startsWith("-normal/",10)),O1=i=>Ql(i,ug,Kc),I=i=>ag.test(i),ya=i=>Ql(i,cg,E1),vp=i=>Ql(i,H1,_e),C1=i=>Ql(i,dg,og),R1=i=>Ql(i,fg,Kc),Sp=i=>Ql(i,sg,Kc),M1=i=>Ql(i,rg,k1),ar=i=>Ql(i,mg,A1),F=i=>ig.test(i),xo=i=>xa(i,cg),D1=i=>xa(i,fg),Tp=i=>xa(i,sg),j1=i=>xa(i,ug),U1=i=>xa(i,rg),ir=i=>xa(i,mg,!0),L1=i=>xa(i,dg,!0),Ql=(i,o,u)=>{const r=ag.exec(i);return r?r[1]?o(r[1]):u(r[2]):!1},xa=(i,o,u=!1)=>{const r=ig.exec(i);return r?r[1]?o(r[1]):u:!1},sg=i=>i==="position"||i==="percentage",rg=i=>i==="image"||i==="url",ug=i=>i==="length"||i==="size"||i==="bg-size",cg=i=>i==="length",H1=i=>i==="number",fg=i=>i==="family-name",dg=i=>i==="number"||i==="weight",mg=i=>i==="shadow",q1=()=>{const i=gt("color"),o=gt("font"),u=gt("text"),r=gt("font-weight"),c=gt("tracking"),d=gt("leading"),m=gt("breakpoint"),b=gt("container"),g=gt("spacing"),p=gt("radius"),E=gt("shadow"),x=gt("inset-shadow"),O=gt("text-shadow"),B=gt("drop-shadow"),H=gt("blur"),G=gt("perspective"),Y=gt("aspect"),re=gt("ease"),ae=gt("animate"),ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],pe=()=>[...ue(),F,I],fe=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto","contain","none"],Q=()=>[F,I,g],ke=()=>[Gl,"full","auto",...Q()],at=()=>[Dn,"none","subgrid",F,I],$e=()=>["auto",{span:["full",Dn,F,I]},Dn,F,I],je=()=>[Dn,"auto",F,I],vt=()=>["auto","min","max","fr",F,I],ct=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],be=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...Q()],L=()=>[Gl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],J=()=>[Gl,"screen","full","dvw","lvw","svw","min","max","fit",...Q()],ye=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Q()],V=()=>[i,F,I],S=()=>[...ue(),Tp,Sp,{position:[F,I]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",j1,O1,{size:[F,I]}],$=()=>[zc,xo,ya],ne=()=>["","none","full",p,F,I],ie=()=>["",_e,xo,ya],ve=()=>["solid","dashed","dotted","double"],et=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[_e,zc,Tp,Sp],mn=()=>["","none",H,F,I],Oe=()=>["none",_e,F,I],hn=()=>["none",_e,F,I],Le=()=>[_e,F,I],Rt=()=>[Gl,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ol],breakpoint:[ol],color:[og],container:[ol],"drop-shadow":[ol],ease:["in","out","in-out"],font:[z1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ol],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ol],shadow:[ol],spacing:["px",_e],text:[ol],"text-shadow":[ol],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,I,F,Y]}],container:["container"],"container-type":[{"@container":["","normal","size",F,I]}],"container-named":[N1],columns:[{columns:[_e,I,F,b]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:pe()}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:le()}],"overscroll-x":[{"overscroll-x":le()}],"overscroll-y":[{"overscroll-y":le()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ke()}],"inset-x":[{"inset-x":ke()}],"inset-y":[{"inset-y":ke()}],start:[{"inset-s":ke(),start:ke()}],end:[{"inset-e":ke(),end:ke()}],"inset-bs":[{"inset-bs":ke()}],"inset-be":[{"inset-be":ke()}],top:[{top:ke()}],right:[{right:ke()}],bottom:[{bottom:ke()}],left:[{left:ke()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",F,I]}],basis:[{basis:[Gl,"full","auto",b,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Gl,"auto","initial","none",I]}],grow:[{grow:["",_e,F,I]}],shrink:[{shrink:["",_e,F,I]}],order:[{order:[Dn,"first","last","none",F,I]}],"grid-cols":[{"grid-cols":at()}],"col-start-end":[{col:$e()}],"col-start":[{"col-start":je()}],"col-end":[{"col-end":je()}],"grid-rows":[{"grid-rows":at()}],"row-start-end":[{row:$e()}],"row-start":[{"row-start":je()}],"row-end":[{"row-end":je()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":vt()}],"auto-rows":[{"auto-rows":vt()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...ct(),"normal"]}],"justify-items":[{"justify-items":[...be(),"normal"]}],"justify-self":[{"justify-self":["auto",...be()]}],"align-content":[{content:["normal",...ct()]}],"align-items":[{items:[...be(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...be(),{baseline:["","last"]}]}],"place-content":[{"place-content":ct()}],"place-items":[{"place-items":[...be(),"baseline"]}],"place-self":[{"place-self":["auto",...be()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pbs:[{pbs:Q()}],pbe:[{pbe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[b,"screen",...L()]}],"min-w":[{"min-w":[b,"screen","none",...L()]}],"max-w":[{"max-w":[b,"screen","none","prose",{screen:[m]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",u,xo,ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,L1,C1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zc,I]}],"font-family":[{font:[D1,R1,o]}],"font-features":[{"font-features":[I]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,F,I]}],"line-clamp":[{"line-clamp":[_e,"none",F,vp]}],leading:[{leading:[d,...Q()]}],"list-image":[{"list-image":["none",F,I]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",F,I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",F,ya]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[_e,"auto",F,I]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"tab-size":[{tab:[Dn,F,I]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F,I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F,I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:S()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,F,I],radial:["",F,I],conic:[Dn,F,I]},U1,M1]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,F,I]}],"outline-w":[{outline:["",_e,xo,ya]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",E,ir,ar]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",x,ir,ar]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[_e,ya]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",O,ir,ar]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[_e,F,I]}],"mix-blend":[{"mix-blend":[...et(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":et()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[F,I]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ue()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:S()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",F,I]}],filter:[{filter:["","none",F,I]}],blur:[{blur:mn()}],brightness:[{brightness:[_e,F,I]}],contrast:[{contrast:[_e,F,I]}],"drop-shadow":[{"drop-shadow":["","none",B,ir,ar]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",_e,F,I]}],"hue-rotate":[{"hue-rotate":[_e,F,I]}],invert:[{invert:["",_e,F,I]}],saturate:[{saturate:[_e,F,I]}],sepia:[{sepia:["",_e,F,I]}],"backdrop-filter":[{"backdrop-filter":["","none",F,I]}],"backdrop-blur":[{"backdrop-blur":mn()}],"backdrop-brightness":[{"backdrop-brightness":[_e,F,I]}],"backdrop-contrast":[{"backdrop-contrast":[_e,F,I]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,F,I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,F,I]}],"backdrop-invert":[{"backdrop-invert":["",_e,F,I]}],"backdrop-opacity":[{"backdrop-opacity":[_e,F,I]}],"backdrop-saturate":[{"backdrop-saturate":[_e,F,I]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,F,I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",F,I]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",F,I]}],ease:[{ease:["linear","initial",re,F,I]}],delay:[{delay:[_e,F,I]}],animate:[{animate:["none",ae,F,I]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[G,F,I]}],"perspective-origin":[{"perspective-origin":pe()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:hn()}],"scale-x":[{"scale-x":hn()}],"scale-y":[{"scale-y":hn()}],"scale-z":[{"scale-z":hn()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[F,I,"","none","gpu","cpu"]}],"transform-origin":[{origin:pe()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Rt()}],"translate-x":[{"translate-x":Rt()}],"translate-y":[{"translate-y":Rt()}],"translate-z":[{"translate-z":Rt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,F,I]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F,I]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mbs":[{"scroll-mbs":Q()}],"scroll-mbe":[{"scroll-mbe":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pbs":[{"scroll-pbs":Q()}],"scroll-pbe":[{"scroll-pbe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F,I]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[_e,xo,ya,vp]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},B1=_1(q1),G1=(...i)=>B1(Pp(i)),Y1=$v("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8"}},defaultVariants:{variant:"default",size:"default"}}),hg=q.forwardRef(({className:i,variant:o,size:u,asChild:r=!1,...c},d)=>{const m=r?qv:"button";return v.jsx(m,{className:G1(Y1({variant:o,size:u,className:i})),ref:d,...c})});hg.displayName="Button";const Z1=1500,pg=({url:i,label:o="Copy URL"})=>{const[u,r]=q.useState(!1),c=q.useRef(null);q.useEffect(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);const d=async()=>{await navigator.clipboard.writeText(i),r(!0),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>{r(!1),c.current=null},Z1)};return v.jsx(hg,{type:"button",variant:"ghost",size:"sm",className:"console-copy-url-button","aria-label":u?"URL copied to clipboard":o,onClick:d,children:u?"Copied":"Copy URL"})},X1=({pullRequest:i,body:o,bodyIsLoading:u,files:r,filesAreLoading:c,filesError:d,commits:m,commitsAreLoading:b,commitsError:g,now:p,buildImageProxyUrl:E})=>{const x=i.summary,O=c||d!==null?null:r.length,B=b||g!==null?null:m.length;return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"console-pr-header",children:[v.jsx("a",{href:i.url,className:"console-pr-section-title",target:"_blank",rel:"noopener noreferrer",children:(x==null?void 0:x.title)??i.url}),i.isDraft&&v.jsx("span",{className:"console-pr-section-state",children:"draft"}),v.jsx(pg,{url:i.url,label:"Copy PR URL"}),v.jsxs("div",{className:"console-pr-statbar",children:[i.branchName!==null&&v.jsx("span",{className:"console-pr-branch",children:i.branchName}),x!==null&&v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"console-pr-add",children:["+",x.additions]}),v.jsxs("span",{className:"console-pr-del",children:["-",x.deletions]}),v.jsxs("span",{className:"console-pr-files-count",children:[x.changedFiles," files"]})]})]})]}),v.jsx(va,{title:"Description",defaultCollapsed:!0,children:u?v.jsx("p",{className:"console-pr-body-loading",children:"Loading description..."}):v.jsx(dr,{body:(x==null?void 0:x.body)??o,buildImageProxyUrl:E})}),v.jsx(va,{title:"Changed files",count:O,children:v.jsx(Ip,{files:r,isLoading:c,error:d})}),v.jsx(va,{title:"Commits",count:B,defaultCollapsed:!0,children:v.jsx(Fp,{commits:m,isLoading:b,error:g,now:p})})]})},Q1=({item:i,storyName:o,storyColorEnum:u,overlayStatus:r,state:c,body:d,bodyIsLoading:m,bodyError:b,comments:g,commentsAreLoading:p,commentsError:E,files:x,filesAreLoading:O,filesError:B,commits:H,commitsAreLoading:G,commitsError:Y,relatedPullRequests:re,now:ae,commentComposer:ee,operationBar:ue,buildImageProxyUrl:pe,onAddInlineComment:fe})=>{const le=(c==null?void 0:c.state)??"open",Q=(c==null?void 0:c.merged)??!1,ke=!i.isPr&&le==="closed"?"Closed":null,at=No(u),$e=r?No(r.color):null,je=O||B!==null?null:x.length,vt=p||E!==null?null:g.length,ct=G||Y!==null?null:H.length;return v.jsxs("article",{className:"console-detail",children:[o!==null&&v.jsx("div",{className:"console-detail-story",children:v.jsxs("span",{className:"console-storytag",children:[v.jsx("span",{className:"console-story-dot",style:{backgroundColor:at.dot}}),o]})}),r!==null&&$e!==null&&v.jsx("span",{className:"console-detail-status-chip",style:{color:$e.fg,borderColor:$e.border,backgroundColor:$e.bg},children:r.name}),v.jsxs("h2",{className:"console-detail-title",children:[v.jsx(zp,{isPr:i.isPr,state:le,merged:Q,isDraft:!1,stateReason:""}),v.jsx("span",{className:"console-detail-title-text",children:i.title}),v.jsx("span",{className:"console-detail-number",children:i.isPr?`PR #${i.number}`:`#${i.number}`}),ke!==null&&v.jsx("span",{className:"console-detail-closed-label",children:ke})]}),v.jsxs("div",{className:"console-detail-subbar",children:[v.jsx("a",{href:i.url,className:"console-detail-link",target:"_blank",rel:"noopener noreferrer",children:i.isPr?`PR #${i.number}`:`Issue #${i.number}`}),v.jsx("span",{className:"console-detail-repo",children:i.repo}),v.jsx("span",{className:"console-detail-pill",children:i.isPr?"PR":"Issue"}),v.jsx(pg,{url:i.url})]}),i.labels.length>0&&v.jsx("div",{className:"console-detail-labels",children:i.labels.map(be=>v.jsx("span",{className:"console-label-chip",children:be},be))}),v.jsxs("div",{className:"console-detail-createdat",title:Lc(i.createdAt),children:["opened ",Oo(i.createdAt,ae)]}),v.jsx(va,{title:"Description",headerAction:v.jsx("a",{href:i.url,className:"console-panel-open-link",target:"_blank",rel:"noopener noreferrer",children:"open"}),children:b!==null?v.jsxs("p",{role:"alert",className:"console-detail-body-error",children:["Failed to load description: ",b]}):m?v.jsx("p",{className:"console-detail-body-loading",children:"Loading description..."}):v.jsx(dr,{body:d,buildImageProxyUrl:pe})}),i.isPr&&v.jsx(va,{title:"Changed files",count:je,children:v.jsx(Ip,{files:x,isLoading:O,error:B,onAddInlineComment:fe})}),v.jsx(va,{title:"Comments",count:vt,defaultCollapsed:i.isPr,children:v.jsx(Mv,{comments:g,isLoading:p,error:E,now:ae,buildImageProxyUrl:pe})}),i.isPr&&v.jsx(va,{title:"Commits",count:ct,defaultCollapsed:!0,children:v.jsx(Fp,{commits:H,isLoading:G,error:Y,now:ae})}),!i.isPr&&re.map(be=>{var C;return v.jsx(X1,{pullRequest:be.pullRequest,body:((C=be.pullRequest.summary)==null?void 0:C.body)??"",bodyIsLoading:!1,files:be.files,filesAreLoading:be.filesAreLoading,filesError:be.filesError,commits:be.commits,commitsAreLoading:be.commitsAreLoading,commitsError:be.commitsError,now:ae,buildImageProxyUrl:pe},be.pullRequest.url)}),ee,v.jsx("div",{className:"console-actionbar",children:ue})]})},V1=({onClose:i})=>v.jsxs("div",{className:"console-op-group",children:[v.jsx("button",{type:"button",className:"console-op-button",onClick:()=>i("close_not_planned"),children:"Close as not planned"}),v.jsx("button",{type:"button",className:"console-op-button",onClick:()=>i("close"),children:"Close"})]}),K1=({isTodoByHuman:i,onSetNextActionDate:o})=>v.jsxs("div",{className:"console-op-group",children:[v.jsx("button",{type:"button",className:"console-op-button console-op-button-snooze",onClick:()=>o("snooze_1day"),children:"+1 day"}),v.jsx("button",{type:"button",className:"console-op-button console-op-button-snooze",onClick:()=>o("snooze_1week"),children:i?"+1 week and skip":"+1 week"})]}),J1=[{action:"unnecessary",label:"Unnecessary",variant:"unneeded"},{action:"totally_wrong",label:"Totally wrong",variant:"wrong"},{action:"request_changes",label:"Reject",variant:"reject"},{action:"approve",label:"Approve",variant:"approve"}],$1=({onReview:i})=>v.jsx("div",{className:"console-op-group console-op-group-review",children:J1.map(o=>v.jsx("button",{type:"button",className:`console-op-button console-op-button-${o.variant}`,onClick:()=>i(o.action),children:o.label},o.action))}),I1=(i,o)=>{const u=o.toLowerCase();return i.find(r=>r.name.toLowerCase()===u)??null},F1=({statusOptions:i,onSetStatus:o,onSetInTmuxByHuman:u})=>{const r=vy.map(c=>({name:c,option:I1(i,c)})).filter(c=>c.option!==null);return r.length===0?null:v.jsx("div",{className:"console-op-group",children:r.map(({name:c,option:d})=>{const m=No(d.color),b=c===Sy;return v.jsx("button",{type:"button",className:"console-op-button",style:{color:m.fg,borderColor:m.border,backgroundColor:m.bg},onClick:()=>b?u(d):o(d),children:d.name},d.id)})})},W1=i=>i.name.toLowerCase().includes("no story"),P1=({storyOptions:i,onSetStory:o})=>{const u=i.filter(r=>!W1(r));return u.length===0?null:v.jsx("div",{className:"console-op-group console-op-group-stories",children:u.map(r=>{const c=No(r.color);return v.jsx("button",{type:"button",className:"console-op-button",style:{color:c.fg,borderColor:c.border,backgroundColor:c.bg},onClick:()=>o(r),children:r.name},r.id)})})},eS=({tab:i,item:o,hasPullRequest:u,statusOptions:r,storyOptions:c,handlers:d})=>{const m=i==="triage",b=i==="workflow-blocker"||!o.isPr;return v.jsxs("div",{className:"console-operation-bar",children:[u&&v.jsx($1,{onReview:d.onReview}),v.jsx(K1,{isTodoByHuman:Ty(i),onSetNextActionDate:d.onSetNextActionDate}),m&&v.jsx(P1,{storyOptions:c,onSetStory:d.onSetStory}),v.jsx(F1,{statusOptions:r,onSetStatus:d.onSetStatus,onSetInTmuxByHuman:d.onSetInTmuxByHuman}),b&&v.jsx(V1,{onClose:d.onClose})]})},vi=(i,o,u,r)=>{const c=o!==null?i.peek(o):void 0,[d,m]=q.useState(c??r),[b,g]=q.useState(o!==null&&c===void 0),[p,E]=q.useState(null);return q.useEffect(()=>{if(o===null||u===null)return;const x=i.peek(o);if(x!==void 0){m(x),g(!1),E(null);return}let O=!1;return g(!0),E(null),i.load(o,u).then(B=>{O||(m(B),g(!1))}).catch(B=>{O||(E(B instanceof Error?B.message:String(B)),g(!1))}),()=>{O=!0}},[i,o,u]),{data:d,isLoading:b,error:p}},tS=[],wp=[],xp=[],nS=[],lS={state:"open",merged:!1,isPullRequest:!1},aS=(i,o)=>{const u=o!==null?`${o.repo}#${o.number}`:null,r=o!==null?o.url:null,c=(o==null?void 0:o.isPr)??!1,d=vi(i.body,u,r,""),m=vi(i.state,u,r,lS),b=vi(i.comments,u,r,tS),g=vi(i.files,c?u:null,c?r:null,wp),p=vi(i.commits,c?u:null,c?r:null,xp),E=vi(i.relatedPrs,c?null:u,c?null:r,nS),[x,O]=q.useState([]);return q.useEffect(()=>{if(c||E.data.length===0){O([]);return}let B=!1;const H=E.data.map(Y=>({pullRequest:Y,files:wp,filesAreLoading:!0,filesError:null,commits:xp,commitsAreLoading:!0,commitsError:null}));O(H);const G=(Y,re)=>{B||O(ae=>ae.map(ee=>ee.pullRequest.url===Y?{...ee,...re}:ee))};for(const Y of E.data){const re=Y.url;i.files.load(re,Y.url).then(ae=>G(Y.url,{files:ae,filesAreLoading:!1})).catch(ae=>G(Y.url,{filesAreLoading:!1,filesError:ae instanceof Error?ae.message:String(ae)})),i.commits.load(re,Y.url).then(ae=>G(Y.url,{commits:ae,commitsAreLoading:!1})).catch(ae=>G(Y.url,{commitsAreLoading:!1,commitsError:ae instanceof Error?ae.message:String(ae)}))}return()=>{B=!0}},[i,c,E.data]),{state:m.data,body:d.data,bodyIsLoading:d.isLoading,bodyError:d.error,comments:b.data,commentsAreLoading:b.isLoading,commentsError:b.error,files:g.data,filesAreLoading:g.isLoading,filesError:g.error,commits:p.data,commitsAreLoading:p.isLoading,commitsError:p.error,relatedPullRequests:x}},iS=({tab:i,item:o,caches:u,operations:r,statusOptions:c,storyOptions:d,storyColors:m,storyName:b,overlayStatus:g,now:p,onQueueAction:E})=>{const x=aS(u,o),{token:O}=cr(),B=q.useCallback(ee=>Wy(ee,O),[O]),H=o.isPr||x.relatedPullRequests.length>0,G=q.useCallback((ee,ue,pe,fe)=>r.addInlineReviewComment(o.url,ee,ue,pe,fe),[r,o.url]),Y={onReview:ee=>{var pe;const ue=o.isPr?o.url:((pe=x.relatedPullRequests[0])==null?void 0:pe.pullRequest.url)??o.url;E({kind:{type:"review",action:ee},item:o,commit:()=>r.reviewPullRequest(o,ue,ee)})},onSetNextActionDate:ee=>{E({kind:{type:"next_action_date",action:ee},item:o,commit:()=>r.setNextActionDate(o,ee)})},onSetStory:ee=>{E({kind:{type:"set_story",optionName:ee.name},item:o,commit:()=>r.setStory(o,ee)})},onSetStatus:ee=>{E({kind:{type:"set_status",optionName:ee.name},item:o,commit:()=>r.setStatus(o,ee)})},onSetInTmuxByHuman:ee=>{E({kind:{type:"set_in_tmux_by_human",optionName:ee.name},item:o,commit:()=>r.setInTmuxByHuman(o,ee)})},onClose:ee=>{E({kind:{type:"close",action:ee},item:o,commit:()=>r.closeIssue(o,ee)})}},re=b??(o.story.trim()!==""?o.story:null),ae=re!==null?Ep(m,re):null;return v.jsx(Q1,{item:o,storyName:re,storyColorEnum:ae,overlayStatus:g,state:x.state,body:x.body,bodyIsLoading:x.bodyIsLoading,bodyError:x.bodyError,comments:x.comments,commentsAreLoading:x.commentsAreLoading,commentsError:x.commentsError,files:x.files,filesAreLoading:x.filesAreLoading,filesError:x.filesError,commits:x.commits,commitsAreLoading:x.commitsAreLoading,commitsError:x.commitsError,relatedPullRequests:x.relatedPullRequests,now:p,buildImageProxyUrl:B,onAddInlineComment:o.isPr?G:void 0,commentComposer:v.jsx(xv,{isPr:o.isPr,now:p,onSubmit:ee=>r.addComment(o,ee)}),operationBar:v.jsx(eS,{tab:i,item:o,hasPullRequest:H,statusOptions:c,storyOptions:d,handlers:Y})})},oS=()=>{const i={};for(const o of Tn)i[o.name]=0;return i},sS="console",rS=()=>{const i=Ly(),{snapshots:o,isLoading:u,error:r}=Vy(i),c=jy(i??sS),d=q.useMemo(()=>{const L=oS();for(const J of Tn){const ye=o[J.name];ye!==null&&(L[J.name]=Ey(ye.items,c.overlay,J.name))}return L},[o,c.overlay]),m=_y(i,d),{activeTab:b,selectedItemKey:g,openItem:p,closeItem:E,selectTab:x}=m,O=my(),B=Cy(i,b,c),H=Pb(),G=Date.now(),Y=o[b],re=q.useMemo(()=>Y===null?[]:Ay(Y.items,c.overlay,b),[Y,c.overlay,b]),ae=q.useMemo(()=>re.map(L=>sl(L)),[re]),ee=q.useMemo(()=>Hb(re,c.overlay),[re,c.overlay]),ue=(Y==null?void 0:Y.storyColors)??{},pe=(Y==null?void 0:Y.statusOptions)??[],fe=(Y==null?void 0:Y.storyOptions)??[],le=(Y==null?void 0:Y.generatedAt)??null,Q=q.useMemo(()=>g===null||Y===null?null:Y.items.find(L=>L.projectItemId===g)??null,[g,Y]),ke=d[b],at=q.useRef({tab:b,count:ke});q.useEffect(()=>{const L=at.current;if(at.current={tab:b,count:ke},L.tab===b&&L.count>0&&ke===0){const J=hy(b,d);J!==null&&(x(J),E())}},[b,ke,d,x,E]);const $e=(()=>{if(Q===null)return null;const L=c.overlay[sl(Q)];return(L==null?void 0:L.status)??null})(),je=Q!==null?Nc(Q,c.overlay):null,vt=q.useCallback(L=>{const J=Ky(ae,L);J!==null?p(J):E()},[ae,p,E]),ct=q.useCallback(L=>{const J=sl(L.item);H.enqueue({message:Ib(L.kind,L.item,b),color:Jb(L.kind),commit:L.commit,advance:()=>{$b(L.kind,b)&&vt(J)}})},[H,b,vt]),be=q.useCallback(L=>{if(g===null||L===null)return;const J=L==="next"?Jy(ae,g):$y(ae,g);J!==null&&p(J)},[g,ae,p]),C=Yy(be);return v.jsxs("main",{className:"console-app",children:[H.pending!==null&&v.jsx(Xb,{message:H.pending.message,color:H.pending.color,remainingSeconds:H.pending.remainingSeconds,progress:H.pending.progress,onUndo:H.undo}),H.error!==null&&v.jsx(Qb,{message:`Operation failed: ${H.error.reason}`,onDismiss:H.dismissError}),v.jsx(Ub,{activeTab:b,counts:d,pjcode:i,generatedAt:le,tabHref:m.tabHref,onSelectTab:m.selectTab}),Q===null?v.jsx(Zb,{rows:ee,storyColors:ue,activeItemId:null,now:G,isLoading:u,error:r,onSelectItem:L=>m.openItem(L.projectItemId)}):v.jsx("div",{className:"console-detail-screen",ref:C,children:v.jsx(iS,{tab:b,item:Q,caches:O,operations:B,statusOptions:pe,storyOptions:fe,storyColors:ue,storyName:je,overlayStatus:$e,now:G,onQueueAction:ct})})]})},gg=document.getElementById("root");if(gg===null)throw new Error("Root container #root not found");jb.createRoot(gg).render(v.jsx(q.StrictMode,{children:v.jsx(rS,{})}));
|
|
101
|
+
`)[0],Fp=({commits:i,isLoading:o,error:u,now:r})=>u!==null?v.jsxs("p",{role:"alert",className:"console-commits-error",children:["Failed to load commits: ",u]}):o?v.jsx("p",{className:"console-commits-loading",children:"Loading commits..."}):i.length===0?v.jsx("p",{className:"console-commits-empty",children:"No commits."}):v.jsx("ul",{className:"console-commits",children:i.map(c=>v.jsxs("li",{className:"console-commit",children:[v.jsx("span",{className:"console-commit-message",children:jv(c.message)}),v.jsx("span",{className:"console-commit-sha",children:Dv(c.sha)}),v.jsx("span",{className:"console-commit-author",children:c.author}),v.jsx("span",{className:"console-commit-time",children:Oo(c.authoredAt,r)})]},c.sha))});function mp(i,o){if(typeof i=="function")return i(o);i!=null&&(i.current=o)}function Uv(...i){return o=>{let u=!1;const r=i.map(c=>{const d=mp(c,o);return!u&&typeof d=="function"&&(u=!0),d});if(u)return()=>{for(let c=0;c<r.length;c++){const d=r[c];typeof d=="function"?d():mp(i[c],null)}}}}function Lv(...i){return q.useCallback(Uv(...i),i)}function Hv(i){const o=q.forwardRef((u,r)=>{let{children:c,...d}=u,m=null,b=!1;const g=[];hp(c)&&typeof lr=="function"&&(c=lr(c._payload)),q.Children.forEach(c,O=>{var B;if(Xv(O)){b=!0;const H=O;let G="child"in H.props?H.props.child:H.props.children;hp(G)&&typeof lr=="function"&&(G=lr(G._payload)),m=Gv(H,G),g.push((B=m==null?void 0:m.props)==null?void 0:B.children)}else g.push(O)}),m?m=q.cloneElement(m,void 0,g):!b&&q.Children.count(c)===1&&q.isValidElement(c)&&(m=c);const p=m?Zv(m):void 0,E=Lv(r,p);if(!m){if(c||c===0)throw new Error(b?Jv(i):Kv(i));return c}const x=Yv(d,m.props??{});return m.type!==q.Fragment&&(x.ref=r?E:p),q.cloneElement(m,x)});return o.displayName=`${i}.Slot`,o}var qv=Hv("Slot"),Bv=Symbol.for("radix.slottable"),Gv=(i,o)=>{if("child"in i.props){const u=i.props.child;return q.isValidElement(u)?q.cloneElement(u,void 0,i.props.children(u.props.children)):null}return q.isValidElement(o)?o:null};function Yv(i,o){const u={...o};for(const r in o){const c=i[r],d=o[r];/^on[A-Z]/.test(r)?c&&d?u[r]=(...b)=>{const g=d(...b);return c(...b),g}:c&&(u[r]=c):r==="style"?u[r]={...c,...d}:r==="className"&&(u[r]=[c,d].filter(Boolean).join(" "))}return{...i,...u}}function Zv(i){var r,c;let o=(r=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:r.get,u=o&&"isReactWarning"in o&&o.isReactWarning;return u?i.ref:(o=(c=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:c.get,u=o&&"isReactWarning"in o&&o.isReactWarning,u?i.props.ref:i.props.ref||i.ref)}function Xv(i){return q.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===Bv}var Qv=Symbol.for("react.lazy");function hp(i){return i!=null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===Qv&&"_payload"in i&&Vv(i._payload)}function Vv(i){return typeof i=="object"&&i!==null&&"then"in i}var Kv=i=>`${i} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Jv=i=>`${i} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,lr=zb[" use ".trim().toString()];function Wp(i){var o,u,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var c=i.length;for(o=0;o<c;o++)i[o]&&(u=Wp(i[o]))&&(r&&(r+=" "),r+=u)}else for(u in i)i[u]&&(r&&(r+=" "),r+=u);return r}function Pp(){for(var i,o,u=0,r="",c=arguments.length;u<c;u++)(i=arguments[u])&&(o=Wp(i))&&(r&&(r+=" "),r+=o);return r}const pp=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,gp=Pp,$v=(i,o)=>u=>{var r;if((o==null?void 0:o.variants)==null)return gp(i,u==null?void 0:u.class,u==null?void 0:u.className);const{variants:c,defaultVariants:d}=o,m=Object.keys(c).map(p=>{const E=u==null?void 0:u[p],x=d==null?void 0:d[p];if(E===null)return null;const O=pp(E)||pp(x);return c[p][O]}),b=u&&Object.entries(u).reduce((p,E)=>{let[x,O]=E;return O===void 0||(p[x]=O),p},{}),g=o==null||(r=o.compoundVariants)===null||r===void 0?void 0:r.reduce((p,E)=>{let{class:x,className:O,...B}=E;return Object.entries(B).every(H=>{let[G,Y]=H;return Array.isArray(Y)?Y.includes({...d,...b}[G]):{...d,...b}[G]===Y})?[...p,x,O]:p},[]);return gp(i,m,g,u==null?void 0:u.class,u==null?void 0:u.className)},Iv=(i,o)=>{const u=new Array(i.length+o.length);for(let r=0;r<i.length;r++)u[r]=i[r];for(let r=0;r<o.length;r++)u[i.length+r]=o[r];return u},Fv=(i,o)=>({classGroupId:i,validator:o}),eg=(i=new Map,o=null,u)=>({nextPart:i,validators:o,classGroupId:u}),ur="-",_p=[],Wv="arbitrary..",Pv=i=>{const o=t1(i),{conflictingClassGroups:u,conflictingClassGroupModifiers:r}=i;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return e1(m);const b=m.split(ur),g=b[0]===""&&b.length>1?1:0;return tg(b,g,o)},getConflictingClassGroupIds:(m,b)=>{if(b){const g=r[m],p=u[m];return g?p?Iv(p,g):g:p||_p}return u[m]||_p}}},tg=(i,o,u)=>{if(i.length-o===0)return u.classGroupId;const c=i[o],d=u.nextPart.get(c);if(d){const p=tg(i,o+1,d);if(p)return p}const m=u.validators;if(m===null)return;const b=o===0?i.join(ur):i.slice(o).join(ur),g=m.length;for(let p=0;p<g;p++){const E=m[p];if(E.validator(b))return E.classGroupId}},e1=i=>i.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=i.slice(1,-1),u=o.indexOf(":"),r=o.slice(0,u);return r?Wv+r:void 0})(),t1=i=>{const{theme:o,classGroups:u}=i;return n1(u,o)},n1=(i,o)=>{const u=eg();for(const r in i){const c=i[r];Vc(c,u,r,o)}return u},Vc=(i,o,u,r)=>{const c=i.length;for(let d=0;d<c;d++){const m=i[d];l1(m,o,u,r)}},l1=(i,o,u,r)=>{if(typeof i=="string"){a1(i,o,u);return}if(typeof i=="function"){i1(i,o,u,r);return}o1(i,o,u,r)},a1=(i,o,u)=>{const r=i===""?o:ng(o,i);r.classGroupId=u},i1=(i,o,u,r)=>{if(s1(i)){Vc(i(r),o,u,r);return}o.validators===null&&(o.validators=[]),o.validators.push(Fv(u,i))},o1=(i,o,u,r)=>{const c=Object.entries(i),d=c.length;for(let m=0;m<d;m++){const[b,g]=c[m];Vc(g,ng(o,b),u,r)}},ng=(i,o)=>{let u=i;const r=o.split(ur),c=r.length;for(let d=0;d<c;d++){const m=r[d];let b=u.nextPart.get(m);b||(b=eg(),u.nextPart.set(m,b)),u=b}return u},s1=i=>"isThemeGetter"in i&&i.isThemeGetter===!0,r1=i=>{if(i<1)return{get:()=>{},set:()=>{}};let o=0,u=Object.create(null),r=Object.create(null);const c=(d,m)=>{u[d]=m,o++,o>i&&(o=0,r=u,u=Object.create(null))};return{get(d){let m=u[d];if(m!==void 0)return m;if((m=r[d])!==void 0)return c(d,m),m},set(d,m){d in u?u[d]=m:c(d,m)}}},jc="!",bp=":",u1=[],yp=(i,o,u,r,c)=>({modifiers:i,hasImportantModifier:o,baseClassName:u,maybePostfixModifierPosition:r,isExternal:c}),c1=i=>{const{prefix:o,experimentalParseClassName:u}=i;let r=c=>{const d=[];let m=0,b=0,g=0,p;const E=c.length;for(let G=0;G<E;G++){const Y=c[G];if(m===0&&b===0){if(Y===bp){d.push(c.slice(g,G)),g=G+1;continue}if(Y==="/"){p=G;continue}}Y==="["?m++:Y==="]"?m--:Y==="("?b++:Y===")"&&b--}const x=d.length===0?c:c.slice(g);let O=x,B=!1;x.endsWith(jc)?(O=x.slice(0,-1),B=!0):x.startsWith(jc)&&(O=x.slice(1),B=!0);const H=p&&p>g?p-g:void 0;return yp(d,B,O,H)};if(o){const c=o+bp,d=r;r=m=>m.startsWith(c)?d(m.slice(c.length)):yp(u1,!1,m,void 0,!0)}if(u){const c=r;r=d=>u({className:d,parseClassName:c})}return r},f1=i=>{const o=new Map;return i.orderSensitiveModifiers.forEach((u,r)=>{o.set(u,1e6+r)}),u=>{const r=[];let c=[];for(let d=0;d<u.length;d++){const m=u[d],b=m[0]==="[",g=o.has(m);b||g?(c.length>0&&(c.sort(),r.push(...c),c=[]),r.push(m)):c.push(m)}return c.length>0&&(c.sort(),r.push(...c)),r}},d1=i=>({cache:r1(i.cacheSize),parseClassName:c1(i),sortModifiers:f1(i),postfixLookupClassGroupIds:m1(i),...Pv(i)}),m1=i=>{const o=Object.create(null),u=i.postfixLookupClassGroups;if(u)for(let r=0;r<u.length;r++)o[u[r]]=!0;return o},h1=/\s+/,p1=(i,o)=>{const{parseClassName:u,getClassGroupId:r,getConflictingClassGroupIds:c,sortModifiers:d,postfixLookupClassGroupIds:m}=o,b=[],g=i.trim().split(h1);let p="";for(let E=g.length-1;E>=0;E-=1){const x=g[E],{isExternal:O,modifiers:B,hasImportantModifier:H,baseClassName:G,maybePostfixModifierPosition:Y}=u(x);if(O){p=x+(p.length>0?" "+p:p);continue}let re=!!Y,ae;if(re){const le=G.substring(0,Y);ae=r(le);const Q=ae&&m[ae]?r(G):void 0;Q&&Q!==ae&&(ae=Q,re=!1)}else ae=r(G);if(!ae){if(!re){p=x+(p.length>0?" "+p:p);continue}if(ae=r(G),!ae){p=x+(p.length>0?" "+p:p);continue}re=!1}const ee=B.length===0?"":B.length===1?B[0]:d(B).join(":"),ue=H?ee+jc:ee,pe=ue+ae;if(b.indexOf(pe)>-1)continue;b.push(pe);const fe=c(ae,re);for(let le=0;le<fe.length;++le){const Q=fe[le];b.push(ue+Q)}p=x+(p.length>0?" "+p:p)}return p},g1=(...i)=>{let o=0,u,r,c="";for(;o<i.length;)(u=i[o++])&&(r=lg(u))&&(c&&(c+=" "),c+=r);return c},lg=i=>{if(typeof i=="string")return i;let o,u="";for(let r=0;r<i.length;r++)i[r]&&(o=lg(i[r]))&&(u&&(u+=" "),u+=o);return u},_1=(i,...o)=>{let u,r,c,d;const m=g=>{const p=o.reduce((E,x)=>x(E),i());return u=d1(p),r=u.cache.get,c=u.cache.set,d=b,b(g)},b=g=>{const p=r(g);if(p)return p;const E=p1(g,u);return c(g,E),E};return d=m,(...g)=>d(g1(...g))},b1=[],gt=i=>{const o=u=>u[i]||b1;return o.isThemeGetter=!0,o},ag=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ig=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,v1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gl=i=>y1.test(i),_e=i=>!!i&&!Number.isNaN(Number(i)),Dn=i=>!!i&&Number.isInteger(Number(i)),zc=i=>i.endsWith("%")&&_e(i.slice(0,-1)),ol=i=>v1.test(i),og=()=>!0,E1=i=>S1.test(i)&&!T1.test(i),Kc=()=>!1,A1=i=>w1.test(i),k1=i=>x1.test(i),z1=i=>!I(i)&&!F(i),N1=i=>i.startsWith("@container")&&(i[10]==="/"&&i[11]!==void 0||i[11]==="s"&&i[16]!==void 0&&i.startsWith("-size/",10)||i[11]==="n"&&i[18]!==void 0&&i.startsWith("-normal/",10)),O1=i=>Ql(i,ug,Kc),I=i=>ag.test(i),ya=i=>Ql(i,cg,E1),vp=i=>Ql(i,H1,_e),C1=i=>Ql(i,dg,og),R1=i=>Ql(i,fg,Kc),Sp=i=>Ql(i,sg,Kc),M1=i=>Ql(i,rg,k1),ar=i=>Ql(i,mg,A1),F=i=>ig.test(i),xo=i=>xa(i,cg),D1=i=>xa(i,fg),Tp=i=>xa(i,sg),j1=i=>xa(i,ug),U1=i=>xa(i,rg),ir=i=>xa(i,mg,!0),L1=i=>xa(i,dg,!0),Ql=(i,o,u)=>{const r=ag.exec(i);return r?r[1]?o(r[1]):u(r[2]):!1},xa=(i,o,u=!1)=>{const r=ig.exec(i);return r?r[1]?o(r[1]):u:!1},sg=i=>i==="position"||i==="percentage",rg=i=>i==="image"||i==="url",ug=i=>i==="length"||i==="size"||i==="bg-size",cg=i=>i==="length",H1=i=>i==="number",fg=i=>i==="family-name",dg=i=>i==="number"||i==="weight",mg=i=>i==="shadow",q1=()=>{const i=gt("color"),o=gt("font"),u=gt("text"),r=gt("font-weight"),c=gt("tracking"),d=gt("leading"),m=gt("breakpoint"),b=gt("container"),g=gt("spacing"),p=gt("radius"),E=gt("shadow"),x=gt("inset-shadow"),O=gt("text-shadow"),B=gt("drop-shadow"),H=gt("blur"),G=gt("perspective"),Y=gt("aspect"),re=gt("ease"),ae=gt("animate"),ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],pe=()=>[...ue(),F,I],fe=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto","contain","none"],Q=()=>[F,I,g],ke=()=>[Gl,"full","auto",...Q()],at=()=>[Dn,"none","subgrid",F,I],$e=()=>["auto",{span:["full",Dn,F,I]},Dn,F,I],je=()=>[Dn,"auto",F,I],vt=()=>["auto","min","max","fr",F,I],ct=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],be=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...Q()],L=()=>[Gl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],J=()=>[Gl,"screen","full","dvw","lvw","svw","min","max","fit",...Q()],ye=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Q()],V=()=>[i,F,I],S=()=>[...ue(),Tp,Sp,{position:[F,I]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",j1,O1,{size:[F,I]}],$=()=>[zc,xo,ya],ne=()=>["","none","full",p,F,I],ie=()=>["",_e,xo,ya],ve=()=>["solid","dashed","dotted","double"],et=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[_e,zc,Tp,Sp],mn=()=>["","none",H,F,I],Oe=()=>["none",_e,F,I],hn=()=>["none",_e,F,I],Le=()=>[_e,F,I],Rt=()=>[Gl,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ol],breakpoint:[ol],color:[og],container:[ol],"drop-shadow":[ol],ease:["in","out","in-out"],font:[z1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ol],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ol],shadow:[ol],spacing:["px",_e],text:[ol],"text-shadow":[ol],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,I,F,Y]}],container:["container"],"container-type":[{"@container":["","normal","size",F,I]}],"container-named":[N1],columns:[{columns:[_e,I,F,b]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:pe()}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:le()}],"overscroll-x":[{"overscroll-x":le()}],"overscroll-y":[{"overscroll-y":le()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ke()}],"inset-x":[{"inset-x":ke()}],"inset-y":[{"inset-y":ke()}],start:[{"inset-s":ke(),start:ke()}],end:[{"inset-e":ke(),end:ke()}],"inset-bs":[{"inset-bs":ke()}],"inset-be":[{"inset-be":ke()}],top:[{top:ke()}],right:[{right:ke()}],bottom:[{bottom:ke()}],left:[{left:ke()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",F,I]}],basis:[{basis:[Gl,"full","auto",b,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Gl,"auto","initial","none",I]}],grow:[{grow:["",_e,F,I]}],shrink:[{shrink:["",_e,F,I]}],order:[{order:[Dn,"first","last","none",F,I]}],"grid-cols":[{"grid-cols":at()}],"col-start-end":[{col:$e()}],"col-start":[{"col-start":je()}],"col-end":[{"col-end":je()}],"grid-rows":[{"grid-rows":at()}],"row-start-end":[{row:$e()}],"row-start":[{"row-start":je()}],"row-end":[{"row-end":je()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":vt()}],"auto-rows":[{"auto-rows":vt()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...ct(),"normal"]}],"justify-items":[{"justify-items":[...be(),"normal"]}],"justify-self":[{"justify-self":["auto",...be()]}],"align-content":[{content:["normal",...ct()]}],"align-items":[{items:[...be(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...be(),{baseline:["","last"]}]}],"place-content":[{"place-content":ct()}],"place-items":[{"place-items":[...be(),"baseline"]}],"place-self":[{"place-self":["auto",...be()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pbs:[{pbs:Q()}],pbe:[{pbe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[b,"screen",...L()]}],"min-w":[{"min-w":[b,"screen","none",...L()]}],"max-w":[{"max-w":[b,"screen","none","prose",{screen:[m]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",u,xo,ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,L1,C1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zc,I]}],"font-family":[{font:[D1,R1,o]}],"font-features":[{"font-features":[I]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,F,I]}],"line-clamp":[{"line-clamp":[_e,"none",F,vp]}],leading:[{leading:[d,...Q()]}],"list-image":[{"list-image":["none",F,I]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",F,I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",F,ya]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[_e,"auto",F,I]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"tab-size":[{tab:[Dn,F,I]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F,I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F,I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:S()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,F,I],radial:["",F,I],conic:[Dn,F,I]},U1,M1]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,F,I]}],"outline-w":[{outline:["",_e,xo,ya]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",E,ir,ar]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",x,ir,ar]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[_e,ya]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",O,ir,ar]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[_e,F,I]}],"mix-blend":[{"mix-blend":[...et(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":et()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[F,I]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ue()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:S()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",F,I]}],filter:[{filter:["","none",F,I]}],blur:[{blur:mn()}],brightness:[{brightness:[_e,F,I]}],contrast:[{contrast:[_e,F,I]}],"drop-shadow":[{"drop-shadow":["","none",B,ir,ar]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",_e,F,I]}],"hue-rotate":[{"hue-rotate":[_e,F,I]}],invert:[{invert:["",_e,F,I]}],saturate:[{saturate:[_e,F,I]}],sepia:[{sepia:["",_e,F,I]}],"backdrop-filter":[{"backdrop-filter":["","none",F,I]}],"backdrop-blur":[{"backdrop-blur":mn()}],"backdrop-brightness":[{"backdrop-brightness":[_e,F,I]}],"backdrop-contrast":[{"backdrop-contrast":[_e,F,I]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,F,I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,F,I]}],"backdrop-invert":[{"backdrop-invert":["",_e,F,I]}],"backdrop-opacity":[{"backdrop-opacity":[_e,F,I]}],"backdrop-saturate":[{"backdrop-saturate":[_e,F,I]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,F,I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",F,I]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",F,I]}],ease:[{ease:["linear","initial",re,F,I]}],delay:[{delay:[_e,F,I]}],animate:[{animate:["none",ae,F,I]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[G,F,I]}],"perspective-origin":[{"perspective-origin":pe()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:hn()}],"scale-x":[{"scale-x":hn()}],"scale-y":[{"scale-y":hn()}],"scale-z":[{"scale-z":hn()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[F,I,"","none","gpu","cpu"]}],"transform-origin":[{origin:pe()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Rt()}],"translate-x":[{"translate-x":Rt()}],"translate-y":[{"translate-y":Rt()}],"translate-z":[{"translate-z":Rt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,F,I]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F,I]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mbs":[{"scroll-mbs":Q()}],"scroll-mbe":[{"scroll-mbe":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pbs":[{"scroll-pbs":Q()}],"scroll-pbe":[{"scroll-pbe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F,I]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[_e,xo,ya,vp]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},B1=_1(q1),G1=(...i)=>B1(Pp(i)),Y1=$v("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8"}},defaultVariants:{variant:"default",size:"default"}}),hg=q.forwardRef(({className:i,variant:o,size:u,asChild:r=!1,...c},d)=>{const m=r?qv:"button";return v.jsx(m,{className:G1(Y1({variant:o,size:u,className:i})),ref:d,...c})});hg.displayName="Button";const Z1=1500,pg=({url:i,label:o="Copy URL"})=>{const[u,r]=q.useState(!1),c=q.useRef(null);q.useEffect(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);const d=async()=>{await navigator.clipboard.writeText(i),r(!0),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>{r(!1),c.current=null},Z1)};return v.jsx(hg,{type:"button",variant:"ghost",size:"sm",className:"console-copy-url-button","aria-label":u?"URL copied to clipboard":o,onClick:d,children:u?"Copied":"Copy URL"})},X1=({pullRequest:i,body:o,bodyIsLoading:u,files:r,filesAreLoading:c,filesError:d,commits:m,commitsAreLoading:b,commitsError:g,now:p,buildImageProxyUrl:E})=>{const x=i.summary,O=c||d!==null?null:r.length,B=b||g!==null?null:m.length;return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"console-pr-header",children:[v.jsx("a",{href:i.url,className:"console-pr-section-title",target:"_blank",rel:"noopener noreferrer",children:(x==null?void 0:x.title)??i.url}),i.isDraft&&v.jsx("span",{className:"console-pr-section-state",children:"draft"}),v.jsx(pg,{url:i.url,label:"Copy PR URL"}),v.jsxs("div",{className:"console-pr-statbar",children:[i.branchName!==null&&v.jsx("span",{className:"console-pr-branch",children:i.branchName}),x!==null&&v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"console-pr-add",children:["+",x.additions]}),v.jsxs("span",{className:"console-pr-del",children:["-",x.deletions]}),v.jsxs("span",{className:"console-pr-files-count",children:[x.changedFiles," files"]})]})]})]}),v.jsx(va,{title:"Description",defaultCollapsed:!0,children:u?v.jsx("p",{className:"console-pr-body-loading",children:"Loading description..."}):v.jsx(dr,{body:(x==null?void 0:x.body)??o,buildImageProxyUrl:E})}),v.jsx(va,{title:"Changed files",count:O,children:v.jsx(Ip,{files:r,isLoading:c,error:d})}),v.jsx(va,{title:"Commits",count:B,defaultCollapsed:!0,children:v.jsx(Fp,{commits:m,isLoading:b,error:g,now:p})})]})},Q1=({item:i,storyName:o,storyColorEnum:u,overlayStatus:r,state:c,body:d,bodyIsLoading:m,bodyError:b,comments:g,commentsAreLoading:p,commentsError:E,files:x,filesAreLoading:O,filesError:B,commits:H,commitsAreLoading:G,commitsError:Y,relatedPullRequests:re,now:ae,commentComposer:ee,operationBar:ue,buildImageProxyUrl:pe,onAddInlineComment:fe})=>{const le=(c==null?void 0:c.state)??"open",Q=(c==null?void 0:c.merged)??!1,ke=!i.isPr&&le==="closed"?"Closed":null,at=No(u),$e=r?No(r.color):null,je=O||B!==null?null:x.length,vt=p||E!==null?null:g.length,ct=G||Y!==null?null:H.length;return v.jsxs("article",{className:"console-detail",children:[o!==null&&v.jsx("div",{className:"console-detail-story",children:v.jsxs("span",{className:"console-storytag",children:[v.jsx("span",{className:"console-story-dot",style:{backgroundColor:at.dot}}),o]})}),r!==null&&$e!==null&&v.jsx("span",{className:"console-detail-status-chip",style:{color:$e.fg,borderColor:$e.border,backgroundColor:$e.bg},children:r.name}),v.jsxs("h2",{className:"console-detail-title",children:[v.jsx(zp,{isPr:i.isPr,state:le,merged:Q,isDraft:!1,stateReason:""}),v.jsx("span",{className:"console-detail-title-text",children:i.title}),v.jsx("span",{className:"console-detail-number",children:i.isPr?`PR #${i.number}`:`#${i.number}`}),ke!==null&&v.jsx("span",{className:"console-detail-closed-label",children:ke})]}),v.jsxs("div",{className:"console-detail-subbar",children:[v.jsx("a",{href:i.url,className:"console-detail-link",target:"_blank",rel:"noopener noreferrer",children:i.isPr?`PR #${i.number}`:`Issue #${i.number}`}),v.jsx("span",{className:"console-detail-repo",children:i.repo}),v.jsx("span",{className:"console-detail-pill",children:i.isPr?"PR":"Issue"}),v.jsx(pg,{url:i.url})]}),i.labels.length>0&&v.jsx("div",{className:"console-detail-labels",children:i.labels.map(be=>v.jsx("span",{className:"console-label-chip",children:be},be))}),v.jsxs("div",{className:"console-detail-createdat",title:Lc(i.createdAt),children:["opened ",Oo(i.createdAt,ae)]}),v.jsx(va,{title:"Description",headerAction:v.jsx("a",{href:i.url,className:"console-panel-open-link",target:"_blank",rel:"noopener noreferrer",children:"open"}),children:b!==null?v.jsxs("p",{role:"alert",className:"console-detail-body-error",children:["Failed to load description: ",b]}):m?v.jsx("p",{className:"console-detail-body-loading",children:"Loading description..."}):v.jsx(dr,{body:d,buildImageProxyUrl:pe})}),i.isPr&&v.jsx(va,{title:"Changed files",count:je,children:v.jsx(Ip,{files:x,isLoading:O,error:B,onAddInlineComment:fe})}),v.jsx(va,{title:"Comments",count:vt,defaultCollapsed:i.isPr,children:v.jsx(Mv,{comments:g,isLoading:p,error:E,now:ae,buildImageProxyUrl:pe})}),i.isPr&&v.jsx(va,{title:"Commits",count:ct,defaultCollapsed:!0,children:v.jsx(Fp,{commits:H,isLoading:G,error:Y,now:ae})}),!i.isPr&&re.map(be=>{var C;return v.jsx(X1,{pullRequest:be.pullRequest,body:((C=be.pullRequest.summary)==null?void 0:C.body)??"",bodyIsLoading:!1,files:be.files,filesAreLoading:be.filesAreLoading,filesError:be.filesError,commits:be.commits,commitsAreLoading:be.commitsAreLoading,commitsError:be.commitsError,now:ae,buildImageProxyUrl:pe},be.pullRequest.url)}),ee,v.jsx("div",{className:"console-actionbar",children:ue})]})},V1=({onClose:i})=>v.jsxs("div",{className:"console-op-group",children:[v.jsx("button",{type:"button",className:"console-op-button",onClick:()=>i("close_not_planned"),children:"Close as not planned"}),v.jsx("button",{type:"button",className:"console-op-button",onClick:()=>i("close"),children:"Close"})]}),K1=({isTodoByHuman:i,onSetNextActionDate:o})=>v.jsxs("div",{className:"console-op-group",children:[v.jsx("button",{type:"button",className:"console-op-button console-op-button-snooze",onClick:()=>o("snooze_1day"),children:"+1 day"}),v.jsx("button",{type:"button",className:"console-op-button console-op-button-snooze",onClick:()=>o("snooze_1week"),children:i?"+1 week and skip":"+1 week"})]}),J1=[{action:"unnecessary",label:"Unnecessary",variant:"unneeded"},{action:"totally_wrong",label:"Totally wrong",variant:"wrong"},{action:"request_changes",label:"Reject",variant:"reject"},{action:"approve",label:"Approve",variant:"approve"}],$1=({onReview:i})=>v.jsx("div",{className:"console-op-group console-op-group-review",children:J1.map(o=>v.jsx("button",{type:"button",className:`console-op-button console-op-button-${o.variant}`,onClick:()=>i(o.action),children:o.label},o.action))}),I1=(i,o)=>{const u=o.toLowerCase();return i.find(r=>r.name.toLowerCase()===u)??null},F1=({statusOptions:i,onSetStatus:o,onSetInTmuxByHuman:u})=>{const r=vy.map(c=>({name:c,option:I1(i,c)})).filter(c=>c.option!==null);return r.length===0?null:v.jsx("div",{className:"console-op-group",children:r.map(({name:c,option:d})=>{const m=No(d.color),b=c===Sy;return v.jsx("button",{type:"button",className:"console-op-button",style:{color:m.fg,borderColor:m.border,backgroundColor:m.bg},onClick:()=>b?u(d):o(d),children:d.name},d.id)})})},W1=i=>i.name.toLowerCase().includes("no story"),P1=({storyOptions:i,onSetStory:o})=>{const u=i.filter(r=>!W1(r));return u.length===0?null:v.jsx("div",{className:"console-op-group console-op-group-stories",children:u.map(r=>{const c=No(r.color);return v.jsx("button",{type:"button",className:"console-op-button",style:{color:c.fg,borderColor:c.border,backgroundColor:c.bg},onClick:()=>o(r),children:r.name},r.id)})})},eS=({tab:i,item:o,hasPullRequest:u,statusOptions:r,storyOptions:c,handlers:d})=>{const m=i==="triage",b=i==="workflow-blocker"||!o.isPr;return v.jsxs("div",{className:"console-operation-bar",children:[u&&v.jsx($1,{onReview:d.onReview}),v.jsx(K1,{isTodoByHuman:Ty(i),onSetNextActionDate:d.onSetNextActionDate}),m&&v.jsx(P1,{storyOptions:c,onSetStory:d.onSetStory}),v.jsx(F1,{statusOptions:r,onSetStatus:d.onSetStatus,onSetInTmuxByHuman:d.onSetInTmuxByHuman}),b&&v.jsx(V1,{onClose:d.onClose})]})},vi=(i,o,u,r)=>{const c=o!==null?i.peek(o):void 0,[d,m]=q.useState(c??r),[b,g]=q.useState(o!==null&&c===void 0),[p,E]=q.useState(null);return q.useEffect(()=>{if(o===null||u===null)return;const x=i.peek(o);if(x!==void 0){m(x),g(!1),E(null);return}let O=!1;return g(!0),E(null),i.load(o,u).then(B=>{O||(m(B),g(!1))}).catch(B=>{O||(E(B instanceof Error?B.message:String(B)),g(!1))}),()=>{O=!0}},[i,o,u]),{data:d,isLoading:b,error:p}},tS=[],wp=[],xp=[],nS=[],lS={state:"open",merged:!1,isPullRequest:!1},aS=(i,o)=>{const u=o!==null?`${o.repo}#${o.number}`:null,r=o!==null?o.url:null,c=(o==null?void 0:o.isPr)??!1,d=vi(i.body,u,r,""),m=vi(i.state,u,r,lS),b=vi(i.comments,u,r,tS),g=vi(i.files,c?u:null,c?r:null,wp),p=vi(i.commits,c?u:null,c?r:null,xp),E=vi(i.relatedPrs,c?null:u,c?null:r,nS),[x,O]=q.useState([]);return q.useEffect(()=>{if(c||E.data.length===0){O([]);return}let B=!1;const H=E.data.map(Y=>({pullRequest:Y,files:wp,filesAreLoading:!0,filesError:null,commits:xp,commitsAreLoading:!0,commitsError:null}));O(H);const G=(Y,re)=>{B||O(ae=>ae.map(ee=>ee.pullRequest.url===Y?{...ee,...re}:ee))};for(const Y of E.data){const re=Y.url;i.files.load(re,Y.url).then(ae=>G(Y.url,{files:ae,filesAreLoading:!1})).catch(ae=>G(Y.url,{filesAreLoading:!1,filesError:ae instanceof Error?ae.message:String(ae)})),i.commits.load(re,Y.url).then(ae=>G(Y.url,{commits:ae,commitsAreLoading:!1})).catch(ae=>G(Y.url,{commitsAreLoading:!1,commitsError:ae instanceof Error?ae.message:String(ae)}))}return()=>{B=!0}},[i,c,E.data]),{state:m.data,body:d.data,bodyIsLoading:d.isLoading,bodyError:d.error,comments:b.data,commentsAreLoading:b.isLoading,commentsError:b.error,files:g.data,filesAreLoading:g.isLoading,filesError:g.error,commits:p.data,commitsAreLoading:p.isLoading,commitsError:p.error,relatedPullRequests:x}},iS=({tab:i,item:o,caches:u,operations:r,statusOptions:c,storyOptions:d,storyColors:m,storyName:b,overlayStatus:g,now:p,onQueueAction:E})=>{const x=aS(u,o),{token:O}=cr(),B=q.useCallback(ee=>Wy(ee,O),[O]),H=o.isPr||x.relatedPullRequests.length>0,G=q.useCallback((ee,ue,pe,fe)=>r.addInlineReviewComment(o.url,ee,ue,pe,fe),[r,o.url]),Y={onReview:ee=>{var pe;const ue=o.isPr?o.url:((pe=x.relatedPullRequests[0])==null?void 0:pe.pullRequest.url)??o.url;E({kind:{type:"review",action:ee},item:o,commit:()=>r.reviewPullRequest(o,ue,ee)})},onSetNextActionDate:ee=>{E({kind:{type:"next_action_date",action:ee},item:o,commit:()=>r.setNextActionDate(o,ee)})},onSetStory:ee=>{E({kind:{type:"set_story",optionName:ee.name},item:o,commit:()=>r.setStory(o,ee)})},onSetStatus:ee=>{E({kind:{type:"set_status",optionName:ee.name},item:o,commit:()=>r.setStatus(o,ee)})},onSetInTmuxByHuman:ee=>{E({kind:{type:"set_in_tmux_by_human",optionName:ee.name},item:o,commit:()=>r.setInTmuxByHuman(o,ee)})},onClose:ee=>{E({kind:{type:"close",action:ee},item:o,commit:()=>r.closeIssue(o,ee)})}},re=b??(o.story.trim()!==""?o.story:null),ae=re!==null?Ep(m,re):null;return v.jsx(Q1,{item:o,storyName:re,storyColorEnum:ae,overlayStatus:g,state:x.state,body:x.body,bodyIsLoading:x.bodyIsLoading,bodyError:x.bodyError,comments:x.comments,commentsAreLoading:x.commentsAreLoading,commentsError:x.commentsError,files:x.files,filesAreLoading:x.filesAreLoading,filesError:x.filesError,commits:x.commits,commitsAreLoading:x.commitsAreLoading,commitsError:x.commitsError,relatedPullRequests:x.relatedPullRequests,now:p,buildImageProxyUrl:B,onAddInlineComment:o.isPr?G:void 0,commentComposer:v.jsx(xv,{isPr:o.isPr,now:p,onSubmit:ee=>r.addComment(o,ee)}),operationBar:v.jsx(eS,{tab:i,item:o,hasPullRequest:H,statusOptions:c,storyOptions:d,handlers:Y})})},oS=()=>{const i={};for(const o of Tn)i[o.name]=0;return i},sS="console",rS=()=>{const i=Ly(),{snapshots:o,isLoading:u,error:r}=Vy(i),c=jy(i??sS),d=q.useMemo(()=>{const L=oS();for(const J of Tn){const ye=o[J.name];ye!==null&&(L[J.name]=Ey(ye.items,c.overlay,J.name))}return L},[o,c.overlay]),m=_y(i,d),{activeTab:b,selectedItemKey:g,openItem:p,closeItem:E,selectTab:x}=m,O=my(),B=Cy(i,b,c),H=Pb(),G=Date.now(),Y=o[b],re=q.useMemo(()=>Y===null?[]:Ay(Y.items,c.overlay,b),[Y,c.overlay,b]),ae=q.useMemo(()=>re.map(L=>sl(L)),[re]),ee=q.useMemo(()=>Hb(re,c.overlay),[re,c.overlay]),ue=(Y==null?void 0:Y.storyColors)??{},pe=(Y==null?void 0:Y.statusOptions)??[],fe=(Y==null?void 0:Y.storyOptions)??[],le=(Y==null?void 0:Y.generatedAt)??null,Q=q.useMemo(()=>g===null||Y===null?null:Y.items.find(L=>L.projectItemId===g)??null,[g,Y]);q.useEffect(()=>{g!==null&&window.scrollTo({top:0})},[g]);const ke=d[b],at=q.useRef({tab:b,count:ke});q.useEffect(()=>{const L=at.current;if(at.current={tab:b,count:ke},L.tab===b&&L.count>0&&ke===0){const J=hy(b,d);J!==null&&(x(J),E())}},[b,ke,d,x,E]);const $e=(()=>{if(Q===null)return null;const L=c.overlay[sl(Q)];return(L==null?void 0:L.status)??null})(),je=Q!==null?Nc(Q,c.overlay):null,vt=q.useCallback(L=>{const J=Ky(ae,L);J!==null?p(J):E()},[ae,p,E]),ct=q.useCallback(L=>{const J=sl(L.item);H.enqueue({message:Ib(L.kind,L.item,b),color:Jb(L.kind),commit:L.commit,advance:()=>{$b(L.kind,b)&&vt(J)}})},[H,b,vt]),be=q.useCallback(L=>{if(g===null||L===null)return;const J=L==="next"?Jy(ae,g):$y(ae,g);J!==null&&p(J)},[g,ae,p]),C=Yy(be);return v.jsxs("main",{className:"console-app",children:[H.pending!==null&&v.jsx(Xb,{message:H.pending.message,color:H.pending.color,remainingSeconds:H.pending.remainingSeconds,progress:H.pending.progress,onUndo:H.undo}),H.error!==null&&v.jsx(Qb,{message:`Operation failed: ${H.error.reason}`,onDismiss:H.dismissError}),v.jsx(Ub,{activeTab:b,counts:d,pjcode:i,generatedAt:le,tabHref:m.tabHref,onSelectTab:m.selectTab}),Q===null?v.jsx(Zb,{rows:ee,storyColors:ue,activeItemId:null,now:G,isLoading:u,error:r,onSelectItem:L=>m.openItem(L.projectItemId)}):v.jsx("div",{className:"console-detail-screen",ref:C,children:v.jsx(iS,{tab:b,item:Q,caches:O,operations:B,statusOptions:pe,storyOptions:fe,storyColors:ue,storyName:je,overlayStatus:$e,now:G,onQueueAction:ct},Q.projectItemId)})]})},gg=document.getElementById("root");if(gg===null)throw new Error("Root container #root not found");jb.createRoot(gg).render(v.jsx(q.StrictMode,{children:v.jsx(rS,{})}));
|