tarsk 0.5.52 → 0.5.53
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/dist/index.js +1550 -1796
- package/dist/public/assets/{account-view-C5bYplbC.js → account-view-5qdPli2O.js} +1 -1
- package/dist/public/assets/{api-DDjBQKVp.js → api-DM6LtnPA.js} +1 -1
- package/dist/public/assets/browser-tab-B9KCHZ2L.js +8 -0
- package/dist/public/assets/commit-dialog-DeVXqj1Z.js +1 -0
- package/dist/public/assets/{context-menu-CyWNCdS8.js → context-menu-CHJI6MbC.js} +1 -1
- package/dist/public/assets/create-repo-dialog-ByIjJnh7.js +1 -0
- package/dist/public/assets/dialogs-config-DAMqiy-4.js +51 -0
- package/dist/public/assets/{diff-view-CUydKAcj.js → diff-view-DxSswxah.js} +2 -2
- package/dist/public/assets/{explorer-tab-view-DImsoaa7.js → explorer-tab-view-DMt-0Zcl.js} +2 -2
- package/dist/public/assets/{explorer-tree-C3N9yUX2.js → explorer-tree-D3nyQX1f.js} +1 -1
- package/dist/public/assets/explorer-view-BRBtKxsw.js +75 -0
- package/dist/public/assets/git-history-dialog-DJfkffd6.js +1 -0
- package/dist/public/assets/git-ops-button-0DrfLBkC.js +2 -0
- package/dist/public/assets/history-view-lvvTzW7O.js +9 -0
- package/dist/public/assets/index-C_iiobDl.js +81 -0
- package/dist/public/assets/index-DhnUeGIU.css +1 -0
- package/dist/public/assets/{mcp-server-card-euln08CV.js → mcp-server-card-DPMxJJU6.js} +1 -1
- package/dist/public/assets/merged-pr-dialog-BC9NMIet.js +1 -0
- package/dist/public/assets/model-star-rating-C4Ugsik_.js +1 -0
- package/dist/public/assets/onboarding-dys9Rwb5.js +1 -0
- package/dist/public/assets/project-settings-view-XGHhtLr_.js +1 -0
- package/dist/public/assets/providers-list-view-Cbndeobz.js +1 -0
- package/dist/public/assets/pull-request-dialog-kuaKjUle.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-CoxkFsGu.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-C4cbgPuA.js +1 -0
- package/dist/public/assets/{radio-group-DZUWbeu6.js → radio-group-C6EDTFov.js} +1 -1
- package/dist/public/assets/{react-vendor-G5EdW8A3.js → react-vendor-U9lUQswz.js} +5 -5
- package/dist/public/assets/settings-general-view-BHj9qn0K.js +1 -0
- package/dist/public/assets/{settings-instructions-view-DdZptx3T.js → settings-instructions-view-CRUCeWUk.js} +1 -1
- package/dist/public/assets/{settings-list-CKN-l-Ee.js → settings-list-BapKAJV3.js} +1 -1
- package/dist/public/assets/settings-mcp-servers-view-M2DQPcpo.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-bDHbKptW.js → settings-models-skeleton-B7TMwjxe.js} +1 -1
- package/dist/public/assets/{settings-models-view-Dm63snYH.js → settings-models-view-ObE_ktqH.js} +1 -1
- package/dist/public/assets/settings-rules-view-BhRBowk9.js +8 -0
- package/dist/public/assets/{settings-skills-view-DUq0nOrv.js → settings-skills-view-MZQjnD_g.js} +3 -3
- package/dist/public/assets/{settings-slash-commands-view-3UGw-rg7.js → settings-slash-commands-view-BYHthCEM.js} +1 -1
- package/dist/public/assets/settings-subagents-view-CmrFQcUF.js +2 -0
- package/dist/public/assets/{settings-system-prompt-view-C5zpTiRs.js → settings-system-prompt-view-CZe9uYNN.js} +1 -1
- package/dist/public/assets/{settings-view-BqDpwOQy.js → settings-view-BQL9vEvw.js} +2 -2
- package/dist/public/assets/{skeleton-jLDiBDMB.js → skeleton-rEPpLCqo.js} +1 -1
- package/dist/public/assets/{slug-utils-CKHx-ORv.js → slug-utils-DZ59sTAJ.js} +1 -1
- package/dist/public/assets/{tabs-BDis0z_E.js → tabs-D57g7ER1.js} +1 -1
- package/dist/public/assets/tasks-view-Bn9GiPNp.js +3 -0
- package/dist/public/assets/{terminal-panel-qSiost2C.js → terminal-panel-CrBP1KEj.js} +2 -2
- package/dist/public/assets/{ui-components-CxpS-7ye.js → ui-components-BPFbmhJA.js} +1 -1
- package/dist/public/assets/{use-deferred-search-BqzgL9XK.js → use-deferred-search-Bi99md6l.js} +1 -1
- package/dist/public/assets/{utils-DKzTCvnZ.js → utils-C-7eVelM.js} +1 -1
- package/dist/public/assets/{vosk-speech-Im3i-XDL.js → vosk-speech-DC3I453R.js} +1 -1
- package/dist/public/assets/{web-DE8zJOsF.js → web-CHeXRjkl.js} +1 -1
- package/dist/public/assets/{web-CY9AvMQI.js → web-DbVs7vzI.js} +1 -1
- package/dist/public/assets/{web-CtID-CpM.js → web-GowI_ZaX.js} +1 -1
- package/dist/public/assets/{web-D7a-Gt-K.js → web-t7m2rd8w.js} +1 -1
- package/dist/public/index.html +8 -8
- package/package.json +3 -3
- package/dist/public/assets/browser-tab-BLzy-OnY.js +0 -8
- package/dist/public/assets/commit-dialog-VaKgg0v7.js +0 -1
- package/dist/public/assets/create-repo-dialog-CxeBrzuI.js +0 -1
- package/dist/public/assets/dialogs-config-sFb6rmoV.js +0 -51
- package/dist/public/assets/explorer-view-t0Ubx-_E.js +0 -75
- package/dist/public/assets/git-history-dialog-BdFqU3-t.js +0 -1
- package/dist/public/assets/git-ops-button-DREYFquW.js +0 -2
- package/dist/public/assets/history-view-BaNsCvOG.js +0 -9
- package/dist/public/assets/index-BabXMhGR.js +0 -81
- package/dist/public/assets/index-CouJM3yT.css +0 -1
- package/dist/public/assets/merged-pr-dialog-CU3eepWu.js +0 -1
- package/dist/public/assets/model-star-rating-BeaqZyyn.js +0 -1
- package/dist/public/assets/onboarding-BtDZI4KL.js +0 -1
- package/dist/public/assets/project-settings-view-nULqYl1Q.js +0 -1
- package/dist/public/assets/providers-list-view-C_I7apJ0.js +0 -1
- package/dist/public/assets/pull-request-dialog-DPoyoAzR.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-BWeBUSvR.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-CelqoZ3J.js +0 -1
- package/dist/public/assets/settings-general-view-BIpRxHjN.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-DThIXFIU.js +0 -5
- package/dist/public/assets/settings-rules-view-C8EhiuF6.js +0 -8
- package/dist/public/assets/settings-subagents-view-DjY_-Vkl.js +0 -2
- package/dist/public/assets/tasks-view-Chkg_CWm.js +0 -3
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ba as t,Ii as n,Io as r,Ko as i,Ms as a,Pi as o,Ps as s,Sa as c,To as l,ao as u,at as d,ba as ee,fs as f,js as p,ka as te,mo as m,ns as ne,oo as h,rr as re,rs as g}from"./dialogs-config-sFb6rmoV.js";import{M as ie}from"./react-vendor-G5EdW8A3.js";import{I as _,a as v,l as y,n as b,o as x}from"./history-view-BaNsCvOG.js";import{n as ae}from"./utils-DKzTCvnZ.js";import{A as oe,B as S,D as C,E as w,P as T,R as se,T as ce,W as le,d as ue}from"./index-BabXMhGR.js";import{a as E,c as de,i as D,o as O,s as fe,t as pe,u as me}from"./api-DDjBQKVp.js";var k=a(),A=p(),j=e(s(),1),M=_(e=>(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[e.v0,(0,A.jsx)(`p`,{className:e.v1,children:`Select a thread to browse its files`})]}),{name:`ExplorerView_1`,portals:[`v0`]}),N=_(e=>(0,A.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[e.v0,(0,A.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,A.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:e.v1})}),e.v2]}),{name:`ExplorerView_2`,portals:[`v0`,`v1`,`v2`]}),P=function({selectedFile:e,showTreeBackButton:i=!1,onShowTree:a,onFileCreated:s}){let{resolvedTheme:u}=ae(),p=le(e=>e.selectedThreadId),{triggerExplorerRefresh:m}=T(),g=(0,j.useRef)(null),_=(0,j.useRef)(null),v=(0,j.useRef)(!1),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(!1),[P,F]=(0,j.useState)(!1),[U,W]=(0,j.useState)(`edit`),[ve,ye]=(0,j.useState)(0),[G,be]=(0,j.useState)(null),[K,q]=(0,j.useState)(!1),xe=e?.path??null;(0,j.useEffect)(()=>{p&&d(p).then(be).catch(()=>{})},[p]);let Se=async()=>{if(!(!G||K)){q(!0);try{await navigator.clipboard.writeText(G),S({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(e){V(`Failed to copy explorer folder path`,{threadId:p,folderPath:G},e),S({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}finally{q(!1)}}},Ce=async()=>{if(p)try{await fe(p,`.`)}catch(e){V(`Failed to open explorer repository folder`,{threadId:p,folderPath:G},e),S({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}},we=(0,j.useCallback)(async e=>{if(p)try{let t=await L(p,e);await pe(p,``,t);let n={name:t,path:t,type:`file`};_.current=t,v.current=!0,s?.(n),m(),S({title:`Created`,description:`${t} created successfully.`})}catch(t){V(`Failed to create explorer file`,{threadId:p,extension:e},t),S({title:`Error`,description:`Failed to create file.`,variant:`destructive`})}},[p,s,m]),J=e?ne(e.path,e.name):null,Y=e?.type===`file`&&p&&!J?e:null,X=Y?`${p}:${Y.path}:${ve}`:null,Z=E&&E.key===X?E:null,Q=Z?.content??``,Te=Z?.original??``;(0,j.useEffect)(()=>()=>{g.current&&=(g.current.getModel()?.dispose(),g.current.dispose(),null)},[]),(0,j.useEffect)(()=>{e?.type===`file`?_.current===e.path?(_.current=null,W(`edit`)):W(R(e.path)?`view`:`edit`):W(`edit`)},[xe,p]);async function $(){if(!(!p||!e||!X)){k(!0);try{await me(p,e.path,Q),D({key:X,content:Q,original:Q}),S({title:`Saved`,description:`${e.name} saved successfully.`})}catch(t){V(`Failed to save explorer file`,{threadId:p,path:e.path},t),S({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}finally{k(!1)}}}async function Ee(){if(!(!p||!e||P)){F(!0);try{if(!re()){if(typeof window>`u`)return;let t=document.querySelector(`[data-markdown-print-content]`);if(!(t instanceof HTMLElement)){S({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}let n=`<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>${e.name??`Markdown document`}</title>
|
|
7
|
-
<style>
|
|
8
|
-
:root {
|
|
9
|
-
color-scheme: light;
|
|
10
|
-
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
11
|
-
line-height: 1.5;
|
|
12
|
-
}
|
|
13
|
-
* {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
}
|
|
16
|
-
body {
|
|
17
|
-
margin: 0;
|
|
18
|
-
background: white;
|
|
19
|
-
color: black;
|
|
20
|
-
}
|
|
21
|
-
.markdown-print-shell {
|
|
22
|
-
max-width: 900px;
|
|
23
|
-
margin: 0 auto;
|
|
24
|
-
padding: 32px;
|
|
25
|
-
}
|
|
26
|
-
img, video, svg {
|
|
27
|
-
max-width: 100%;
|
|
28
|
-
height: auto;
|
|
29
|
-
}
|
|
30
|
-
pre {
|
|
31
|
-
white-space: pre-wrap;
|
|
32
|
-
overflow-wrap: anywhere;
|
|
33
|
-
border: 1px solid #d4d4d8;
|
|
34
|
-
border-radius: 8px;
|
|
35
|
-
padding: 12px;
|
|
36
|
-
background: #f4f4f5;
|
|
37
|
-
}
|
|
38
|
-
code {
|
|
39
|
-
white-space: pre-wrap;
|
|
40
|
-
overflow-wrap: anywhere;
|
|
41
|
-
}
|
|
42
|
-
table {
|
|
43
|
-
width: 100%;
|
|
44
|
-
border-collapse: collapse;
|
|
45
|
-
}
|
|
46
|
-
th, td {
|
|
47
|
-
border: 1px solid #d4d4d8;
|
|
48
|
-
padding: 8px;
|
|
49
|
-
text-align: left;
|
|
50
|
-
}
|
|
51
|
-
@page {
|
|
52
|
-
margin: 0.75in;
|
|
53
|
-
}
|
|
54
|
-
@media print {
|
|
55
|
-
body {
|
|
56
|
-
-webkit-print-color-adjust: exact;
|
|
57
|
-
print-color-adjust: exact;
|
|
58
|
-
}
|
|
59
|
-
.markdown-print-shell {
|
|
60
|
-
max-width: none;
|
|
61
|
-
padding: 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
|
-
</head>
|
|
66
|
-
<body>
|
|
67
|
-
<main class="markdown-print-shell">${t.innerHTML}</main>
|
|
68
|
-
<script>
|
|
69
|
-
window.addEventListener("load", () => {
|
|
70
|
-
window.focus();
|
|
71
|
-
window.print();
|
|
72
|
-
}, { once: true });
|
|
73
|
-
<\/script>
|
|
74
|
-
</body>
|
|
75
|
-
</html>`,r=window.open(``,`_blank`,`noopener,noreferrer`);if(!r){S({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`});return}r.document.open(),r.document.write(n),r.document.close();return}S({title:`PDF created`,description:`Opened ${(await de(p,e.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}catch(t){V(`Failed to print markdown file as PDF`,{threadId:p,path:e.path},t),S({title:`PDF export failed`,description:t instanceof Error?t.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}finally{F(!1)}}}function De(){!p||!Y||(x(B(p,Y.path)),ye(e=>e+1))}return p?(0,A.jsx)(N,{v0:(0,A.jsxs)(ue,{className:`justify-between print:hidden`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[i&&a?(0,A.jsxs)(o,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:a,children:[(0,A.jsx)(te,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,A.jsx)(`span`,{className:n(f.label,`truncate text-foreground`),children:e?e.name:`Select a file to edit`}),(0,A.jsx)(`span`,{className:n(f.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[Y&&Z?(0,A.jsxs)(A.Fragment,{children:[R(Y.path)?(0,A.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,A.jsx)(o,{size:`sm`,variant:U===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`view`),children:`View`}),(0,A.jsx)(o,{size:`sm`,variant:U===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`edit`),children:`Edit`})]}):null,R(Y.path)&&U===`view`?(0,A.jsxs)(o,{size:`sm`,variant:`outline`,onClick:()=>void Ee(),disabled:P,children:[P?(0,A.jsx)(t,{className:`h-4 w-4 animate-spin`}):(0,A.jsx)(ee,{className:`h-4 w-4`}),P?`Printing…`:`Print`]}):null,(0,A.jsxs)(o,{size:`sm`,onClick:()=>void $(),disabled:O||!Q||Q===Te,children:[O?(0,A.jsx)(t,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,e?null:(0,A.jsxs)(ce,{children:[(0,A.jsx)(oe,{asChild:!0,children:(0,A.jsxs)(o,{size:`sm`,className:`gap-1.5`,children:[(0,A.jsx)(c,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,A.jsx)(w,{align:`end`,children:I.map(({label:e,ext:t,icon:n})=>(0,A.jsxs)(C,{onSelect:()=>void we(t),children:[(0,A.jsx)(n,{className:`h-4 w-4`}),e]},t))})]})]})]}),v1:Y?(0,A.jsxs)(b,{fallbackTitle:`Failed to load file`,onRetry:De,children:[(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(he,{threadId:p,path:Y.path,contentKey:X??``,onContentReady:D},X??void 0)}),Z?R(Y.path)&&U===`view`?(0,A.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,A.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,A.jsx)(se,{content:Q,enableMermaid:!0})})}):(0,A.jsx)(ie,{height:`100%`,language:z(Y.path),value:Q,onChange:e=>D(t=>t&&{...t,content:e??``}),onMount:e=>{g.current=e,v.current&&(v.current=!1,e.focus())},theme:u===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:13,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,A.jsx)(y,{})]},X??void 0):e?.type===`file`&&J===`image`?(0,A.jsx)(b,{fallbackTitle:`Failed to load image`,onRetry:()=>{!p||!e||x(H(p,e.path))},children:(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(ge,{threadId:p,path:e.path,alt:e.name})})},e.path):e?.type===`file`&&J===`video`?(0,A.jsx)(b,{fallbackTitle:`Failed to load video`,onRetry:()=>{!p||!e||x(H(p,e.path))},children:(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(_e,{threadId:p,path:e.path})})},e.path):(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,A.jsx)(`h2`,{className:n(f.pageTitle,`text-foreground`),children:`File Explorer`}),(0,A.jsx)(`p`,{className:n(f.pageSubtitle),children:`Browse and edit files`})]}),v2:e?null:(0,A.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:G?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>void Ce(),className:n(f.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:G,children:G}),(0,A.jsxs)(o,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:()=>void Se(),disabled:K,children:[K?(0,A.jsx)(r,{className:`h-3.5 w-3.5`}):(0,A.jsx)(l,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,A.jsx)(`p`,{className:n(f.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})})}):(0,A.jsx)(M,{v0:(0,A.jsx)(h,{className:`h-8 w-8 text-muted-foreground`}),v1:f.bodyMuted})},F=i(`explorer.preview`),I=[{label:`Markdown`,ext:`md`,icon:h},{label:`TypeScript`,ext:`ts`,icon:m},{label:`Text`,ext:`txt`,icon:u}];async function L(e,t){try{let n=await O(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function R(e){return g(e)===`md`}function z(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[g(e)]??`plaintext`}function B(e,t){return`explorer-file:${e}:${t}`}function he(e){let t=(0,k.c)(11),{threadId:n,path:r,contentKey:i,onContentReady:a}=e,o;t[0]!==r||t[1]!==n?(o=B(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=async()=>{try{return await E(n,r)}catch(e){let t=e;throw V(`Failed to load explorer file preview`,{threadId:n,path:r},t),t}},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c=v(o,s),l,u;return t[6]!==i||t[7]!==a||t[8]!==c.content?(l=()=>{a({key:i,content:c.content,original:c.content})},u=[a,c.content,i],t[6]=i,t[7]=a,t[8]=c.content,t[9]=l,t[10]=u):(l=t[9],u=t[10]),(0,j.useLayoutEffect)(l,u),null}function V(e,t,n){F.error(e,{...t,error:n})}function H(e,t){return`explorer-media:${e}:${t}`}function U(e,t){let n=(0,k.c)(11),r;n[0]!==t||n[1]!==e?(r=H(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=async()=>{try{return await D(e,t)}catch(n){let r=n;throw V(`Failed to load explorer media preview`,{threadId:e,path:t},r),r}},n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=v(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,j.useEffect)(c,l),s}function ge(e){let t=(0,k.c)(3),{threadId:n,path:r,alt:i}=e,a=U(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,A.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function _e(e){let t=(0,k.c)(2),{threadId:n,path:r}=e,i=U(n,r),a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,A.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ba as e,Ii as t,Ms as n,Pi as r,Qr as i,ei as a,fs as o,ii as s,js as c,ni as l,ri as u,ti as d}from"./dialogs-config-sFb6rmoV.js";var f=n(),p=c();function m(n){let c=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=n,S;c[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(s,{children:`Commit History`}),c[0]=S):S=c[0];let C;c[1]===x?C=c[2]:(C=(0,p.jsxs)(u,{children:[S,(0,p.jsxs)(d,{children:[`Recent commits on branch `,x]})]}),c[1]=x,c[2]=C);let w;c[3]===v?w=c[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:t(o.bodyMuted,`text-center py-8`),children:`No commits found`}),c[3]=v,c[4]=w);let T;c[5]===y?T=c[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(e,{className:`h-4 w-4 animate-spin inline`})}),c[5]=y,c[6]=T);let E;c[7]!==_.length||c[8]!==v.length||c[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:t(o.caption,`p-3 text-center`),children:`Scroll to load more`}),c[7]=_.length,c[8]=v.length,c[9]=y,c[10]=E):E=c[10];let D;c[11]!==w||c[12]!==T||c[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),c[11]=w,c[12]=T,c[13]=E,c[14]=D):D=c[14];let O;c[15]!==b||c[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),c[15]=b,c[16]=D,c[17]=O):O=c[17];let k;c[18]===g?k=c[19]:(k=(0,p.jsx)(l,{children:(0,p.jsx)(r,{onClick:()=>g(!1),children:`Close`})}),c[18]=g,c[19]=k);let A;c[20]!==C||c[21]!==O||c[22]!==k?(A=(0,p.jsxs)(a,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),c[20]=C,c[21]=O,c[22]=k,c[23]=A):A=c[23];let j;return c[24]!==g||c[25]!==m||c[26]!==A?(j=(0,p.jsx)(i,{open:m,onOpenChange:g,children:A}),c[24]=g,c[25]=m,c[26]=A,c[27]=j):j=c[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:t(o.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:t(o.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:o.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-VaKgg0v7.js","assets/index-BabXMhGR.js","assets/rolldown-runtime-aKtaBQYM.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-BaNsCvOG.js","assets/dialogs-config-sFb6rmoV.js","assets/onboarding-BtDZI4KL.js","assets/vosk-speech-Im3i-XDL.js","assets/react-vendor-G5EdW8A3.js","assets/utils-DKzTCvnZ.js","assets/index-CouJM3yT.css","assets/pull-request-dialog-DPoyoAzR.js","assets/create-repo-dialog-CxeBrzuI.js","assets/git-history-dialog-BdFqU3-t.js","assets/push-before-pr-dialog-CelqoZ3J.js","assets/pull-with-changes-dialog-BWeBUSvR.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$t as t,Ba as n,Br as r,C as i,Cs as a,Dt as o,Fo as ee,Gi as te,Ii as ne,Ka as re,Kn as s,Ko as c,Kt as ie,Lr as ae,Ms as l,Pi as oe,Ps as u,Rr as d,Uo as f,Vo as se,Wt as ce,Xa as le,Xi as ue,Xt as p,Y as m,Yt as de,Za as fe,bo as pe,ct as me,dt as he,fs as h,js as g,mt as ge,on as _,q as _e,qt as ve,rn as ye,va as be,xo as xe,zr as Se}from"./dialogs-config-sFb6rmoV.js";import{r as v}from"./monaco-CZnIWXyV.js";import{A as Ce,B as y,D as b,E as we,K as Te,L as Ee,O as De,T as Oe,U as ke,W as Ae,k as je,v as Me,y as Ne}from"./index-BabXMhGR.js";var x=e(u(),1),S=g();function C(e){return!e.hasChanges&&e.defaultBranchBehind>0}function w(e){return e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits}function T(e){return e.hasUnpushedCommits&&e.prExists}function Pe(e,t){return t?`Creating PR...`:e.hasChanges?`Commit`:T(e)?`Update PR`:w(e)?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:C(e)?`Sync`:`Commit`}function Fe(e,t,n=!1){return t||n||e.hasChanges||T(e)||w(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||!e.hasChanges&&!e.hasUnpushedCommits&&!C(e)?null:C(e)?(0,S.jsx)(f,{className:`h-3.5 w-3.5`}):(0,S.jsx)(fe,{className:`h-3.5 w-3.5`})}function Ie(e){if(e.hasChanges)return e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`;if(T(e))return`Update pull request with unpushed commits`;if(w(e))return`View pull request in GitHub`;if(e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges)return`Create pull request for committed changes`;if(C(e)){let t=e.defaultBranch??`main`,n=`${e.defaultBranchBehind} commit${e.defaultBranchBehind===1?``:`s`} behind origin/${t}`,r=e.defaultBranchAhead>0?`, ${e.defaultBranchAhead} commit${e.defaultBranchAhead===1?``:`s`} ahead`:``;return e.currentBranch===e.defaultBranch?`Your branch is ${n}${r}. Click to pull the latest changes.`:`Your branch "${e.currentBranch}" is ${n}${r}. Click to rebase onto the latest ${t}.`}return`No actions available`}function Le(e,t,n=!1){return t||n?!0:w(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||C(e)?!1:!e.hasChanges&&!e.hasUnpushedCommits}function Re(e){return e.hasChanges||w(e)||T(e)||C(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}var ze=l();function Be(e){let t=(0,ze.c)(105),{branchStatus:i,remoteUrl:a,hasRemoteBranch:o,hasUnpushedCommits:s,canCreateRepo:c,repoUrl:ie,isRefreshing:l,isCreatingPR:u,isBrandState:ce,hasChanges:p,defaultBranch:m,defaultBranchAhead:de,defaultBranchBehind:me,gitUser:he,isDirectCommitMode:g,autoGenerateCommitMessage:ge,isLoading:_,isLoadingHistory:_e,isQuickCommitting:ve,onFetch:ye,onPull:v,onPush:y,onOpenHistory:Te,onCreatePR:Ee,onCreateRepo:ke,onViewInGitHub:Ae,onQuickCommit:Me,onSyncWithDefault:Ne,onOpenChange:x,open:C,layout:w}=e,T=u===void 0?!1:u,Pe=w===void 0?`bar`:w,Fe=!!m&&!!a&&me>0,Ie=!p&&!_,Le=Pe===`bar`&&`w-8 rounded-l-none`,Re=Pe===`menu`&&`w-full justify-start gap-2 rounded-md`,Be=ce&&Pe===`bar`&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`,E;t[0]!==Le||t[1]!==Re||t[2]!==Be?(E=ne(`h-8 px-1`,Le,Re,Be),t[0]=Le,t[1]=Re,t[2]=Be,t[3]=E):E=t[3];let Ve=_||T,D;t[4]===Pe?D=t[5]:(D=Pe===`menu`&&(0,S.jsx)(`span`,{children:`More git actions`}),t[4]=Pe,t[5]=D);let O;t[6]!==T||t[7]!==l?(O=T||l?(0,S.jsx)(n,{className:`h-3.5 w-3.5 animate-spin`}):(0,S.jsx)(ee,{className:`h-3.5 w-3.5`}),t[6]=T,t[7]=l,t[8]=O):O=t[8];let k;t[9]!==E||t[10]!==Ve||t[11]!==D||t[12]!==O?(k=(0,S.jsx)(Ce,{asChild:!0,children:(0,S.jsxs)(oe,{variant:`outline`,size:`sm`,className:E,disabled:Ve,children:[D,O]})}),t[9]=E,t[10]=Ve,t[11]=D,t[12]=O,t[13]=k):k=t[13];let A;t[14]!==i||t[15]!==a?(A=i===`Behind`&&(0,S.jsxs)(`div`,{className:ne(h.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,a?`origin`:`remote`]}),t[14]=i,t[15]=a,t[16]=A):A=t[16];let j;t[17]===he?j=t[18]:(j=he&&(0,S.jsxs)(`div`,{className:ne(h.compact,`px-2 py-1 text-muted-foreground`),children:[(0,S.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,he]}),t[17]=he,t[18]=j);let He;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,S.jsx)(De,{}),t[19]=He):He=t[19];let M;t[20]!==Ie||t[21]!==m||t[22]!==de||t[23]!==me||t[24]!==p||t[25]!==Ne||t[26]!==Fe?(M=Fe&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:()=>{Ie&&Ne()},className:Ie?``:`opacity-50 cursor-not-allowed`,children:[(0,S.jsx)(be,{className:`h-3.5 w-3.5 mr-2`}),`Sync with `,m,(0,S.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 pl-3 text-xs tabular-nums text-muted-foreground`,children:[de>0&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,S.jsx)(se,{className:`h-3 w-3`}),de]}),me>0&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,S.jsx)(f,{className:`h-3 w-3`}),me]})]})]})}),(0,S.jsx)(d,{side:`right`,children:p?`Commit or stash changes before syncing with the default branch`:`Pull latest changes from origin/${m} onto your current branch`})]})}),t[20]=Ie,t[21]=m,t[22]=de,t[23]=me,t[24]=p,t[25]=Ne,t[26]=Fe,t[27]=M):M=t[27];let N;t[28]!==ge||t[29]!==p||t[30]!==_||t[31]!==ve||t[32]!==Me?(N=p&&ge&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:Me,disabled:_||ve,children:[ve?(0,S.jsx)(n,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,S.jsx)(te,{className:`h-3.5 w-3.5 mr-2`}),`Quick Commit`,(0,S.jsx)(je,{children:`⌘⇧C`})]})}),(0,S.jsx)(d,{side:`right`,children:`Generate the commit message and commit`})]})}),t[28]=ge,t[29]=p,t[30]=_,t[31]=ve,t[32]=Me,t[33]=N):N=t[33];let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,S.jsx)(xe,{className:`h-3.5 w-3.5 mr-2`}),t[34]=P):P=t[34];let F;t[35]!==_||t[36]!==ye?(F=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:ye,disabled:_,children:[P,`Fetch`]})}),t[35]=_,t[36]=ye,t[37]=F):F=t[37];let Ue;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,S.jsx)(d,{side:`right`,children:`Download latest information from remote without merging changes`}),t[38]=Ue):Ue=t[38];let I;t[39]===F?I=t[40]:(I=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[F,Ue]})}),t[39]=F,t[40]=I);let L;t[41]!==o||t[42]!==_||t[43]!==v?(L=()=>{o&&!_&&v()},t[41]=o,t[42]=_,t[43]=v,t[44]=L):L=t[44];let We=!o||_?`opacity-50 cursor-not-allowed`:``,Ge;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,S.jsx)(f,{className:`h-3.5 w-3.5 mr-2`}),t[45]=Ge):Ge=t[45];let R;t[46]!==L||t[47]!==We?(R=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:L,className:We,children:[Ge,`Pull`]})}),t[46]=L,t[47]=We,t[48]=R):R=t[48];let Ke=o?`Pull latest changes from remote`:`No remote branch to pull from`,z;t[49]===Ke?z=t[50]:(z=(0,S.jsx)(d,{side:`right`,children:Ke}),t[49]=Ke,t[50]=z);let B;t[51]!==R||t[52]!==z?(B=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[R,z]})}),t[51]=R,t[52]=z,t[53]=B):B=t[53];let V;t[54]!==o||t[55]!==_||t[56]!==y?(V=!o&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:y,disabled:_,children:[(0,S.jsx)(ue,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,S.jsx)(d,{side:`right`,children:`Create remote branch and push local commits`})]})}),t[54]=o,t[55]=_,t[56]=y,t[57]=V):V=t[57];let H;t[58]!==s||t[59]!==_||t[60]!==y?(H=()=>{s&&!_&&y()},t[58]=s,t[59]=_,t[60]=y,t[61]=H):H=t[61];let qe=!s||_?`opacity-50 cursor-not-allowed`:``,Je;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,S.jsx)(ue,{className:`h-3.5 w-3.5 mr-2`}),t[62]=Je):Je=t[62];let U;t[63]!==H||t[64]!==qe?(U=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:H,className:qe,children:[Je,`Push Commits`]})}),t[63]=H,t[64]=qe,t[65]=U):U=t[65];let Ye=s?_?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,W;t[66]===Ye?W=t[67]:(W=(0,S.jsx)(d,{side:`right`,children:Ye}),t[66]=Ye,t[67]=W);let G;t[68]!==U||t[69]!==W?(G=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[U,W]})}),t[68]=U,t[69]=W,t[70]=G):G=t[70];let Xe=_||_e,Ze;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,S.jsx)(re,{className:`h-3.5 w-3.5 mr-2`}),t[71]=Ze):Ze=t[71];let K;t[72]!==Te||t[73]!==Xe?(K=(0,S.jsxs)(b,{onClick:Te,disabled:Xe,children:[Ze,`History`]}),t[72]=Te,t[73]=Xe,t[74]=K):K=t[74];let Qe;t[75]!==g||t[76]!==_||t[77]!==Ee?(Qe=!g&&(0,S.jsxs)(b,{onClick:Ee,disabled:_,children:[(0,S.jsx)(fe,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`,(0,S.jsx)(je,{children:`⌘⇧P`})]}),t[75]=g,t[76]=_,t[77]=Ee,t[78]=Qe):Qe=t[78];let q;t[79]!==c||t[80]!==_||t[81]!==ke?(q=c&&(0,S.jsxs)(b,{onClick:ke,disabled:_,children:[(0,S.jsx)(le,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),t[79]=c,t[80]=_,t[81]=ke,t[82]=q):q=t[82];let J;t[83]!==_||t[84]!==Ae||t[85]!==ie?(J=ie&&(0,S.jsxs)(b,{onClick:Ae,disabled:_,children:[(0,S.jsx)(pe,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`,(0,S.jsx)(je,{children:`⌘⇧G`})]}),t[83]=_,t[84]=Ae,t[85]=ie,t[86]=J):J=t[86];let Y;t[87]!==A||t[88]!==j||t[89]!==M||t[90]!==N||t[91]!==I||t[92]!==B||t[93]!==V||t[94]!==G||t[95]!==K||t[96]!==Qe||t[97]!==q||t[98]!==J?(Y=(0,S.jsxs)(we,{align:`end`,children:[A,j,He,M,N,I,B,V,G,K,Qe,q,J]}),t[87]=A,t[88]=j,t[89]=M,t[90]=N,t[91]=I,t[92]=B,t[93]=V,t[94]=G,t[95]=K,t[96]=Qe,t[97]=q,t[98]=J,t[99]=Y):Y=t[99];let X;return t[100]!==x||t[101]!==C||t[102]!==k||t[103]!==Y?(X=(0,S.jsxs)(Oe,{open:C,onOpenChange:x,children:[k,Y]}),t[100]=x,t[101]=C,t[102]=k,t[103]=Y,t[104]=X):X=t[104],X}function E(e){return e?!0:(y({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}function Ve(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}var D=c(`app.use-ai-generation.hook`);function O(e,t,n){let[r,i]=(0,x.useState)(!1),[a,o]=(0,x.useState)(!1),ee=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:Ve(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,x.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=ee();return await _e(e,n,t)}catch(e){return D.error(`Failed to generate commit message:`,e),y({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,x.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=ee();return await m(e,n,t)}catch(e){return D.error(`Failed to generate PR info:`,e),y({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}var k=(0,x.lazy)(()=>v(()=>import(`./commit-dialog-VaKgg0v7.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),A=(0,x.lazy)(()=>v(()=>import(`./pull-request-dialog-DPoyoAzR.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),j=(0,x.lazy)(()=>v(()=>import(`./create-repo-dialog-CxeBrzuI.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))),He=(0,x.lazy)(()=>v(()=>import(`./git-history-dialog-BdFqU3-t.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([14,6,2]))),M=(0,x.lazy)(()=>v(()=>import(`./push-before-pr-dialog-CelqoZ3J.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([15,6,2]))),N=(0,x.lazy)(()=>v(()=>import(`./pull-with-changes-dialog-BWeBUSvR.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([16,5,2,6]))),P=c(`app.git-ops-button.ui`);function F(){return null}async function Ue(e,t,n,r){r&&(await s(e,{title:r}),n({type:Te.UpdateThreadTitle,projectId:t,threadId:e,title:r}))}function I({projectId:e,threadId:n,layout:ee=`bar`}){let te=ke(),re=Ae(e=>e.projectModelSelections[n]),s=Ae(t=>t.projects.find(t=>t.projectId===e)),[c,l]=(0,x.useState)(!1),[u,f]=(0,x.useState)(!1),[se,le]=(0,x.useState)(!1),[ue,m]=(0,x.useState)(!1),[fe,pe]=(0,x.useState)(``),[h,g]=(0,x.useState)(``),[_e,be]=(0,x.useState)(``),[xe,v]=(0,x.useState)(!1),[Ce,b]=(0,x.useState)(null),we=(0,x.useRef)(!1),De=(0,x.useRef)(!1),Oe=(0,x.useRef)(h),je=(0,x.useRef)(_e);Oe.current=h,je.current=_e;let[C,w]=(0,x.useState)(!1),[T,ze]=(0,x.useState)([]),[Ve,D]=(0,x.useState)(!1),[I,L]=(0,x.useState)([]),[We,Ge]=(0,x.useState)(!1),[R,Ke]=(0,x.useState)(!1),[z,B]=(0,x.useState)(``),[V,H]=(0,x.useState)(``),[qe,Je]=(0,x.useState)(``),[U,Ye]=(0,x.useState)(!1),[W,G]=(0,x.useState)(!1),[Xe,Ze]=(0,x.useState)(!1),[K,Qe]=(0,x.useState)(!1),q=(0,x.useRef)(!1),J=Ee(),{fetchUnifiedStatus:Y}=J,X=O(n,e,re),Z=(0,x.useRef)(null),$e=(0,x.useRef)(()=>{}),et=(0,x.useRef)(()=>{}),tt=(0,x.useRef)(()=>{}),nt=(0,x.useRef)(()=>{});(0,x.useEffect)(()=>()=>{Z.current!==null&&(clearInterval(Z.current),Z.current=null)},[]);async function Q(){ye();let e=await o();te({type:Te.SetProjects,projects:e.projects})}let[$,rt]=(0,x.useState)(()=>Me()),it=s?.commitMethod===a.Direct;(0,x.useEffect)(()=>{R&&s?.name&&!z&&B(s.name)},[R,s?.name,z]),(0,x.useEffect)(()=>{Ne($)},[$]);function at(){U||(Ye(!0),he().then(e=>Je(e)).catch(()=>{}))}function ot(e){Qe(e),e&&(at(),Y(!0))}(0,x.useEffect)(()=>{if(!se){De.current=!1;return}if(se&&$.autoGenerateCommitMessage&&!fe.trim()&&n&&!De.current){De.current=!0;async function e(){let e=await X.generateCommitMessageWithAI();e&&pe(e)}e()}},[se,$.autoGenerateCommitMessage,n,X.generateCommitMessageWithAI,fe]),(0,x.useEffect)(()=>{if(!ue){we.current=!1;return}if(ue&&$.autoGeneratePRInfo&&!Oe.current.trim()&&!je.current.trim()&&n&&!we.current){we.current=!0;async function e(){let e=await X.generatePRInfoWithAI();e&&(g(e.title),be(e.description),y({title:`Success`,description:`PR title and description generated`}))}e()}},[ue,$.autoGeneratePRInfo,n,X.generatePRInfoWithAI]),$e.current=dt,et.current=()=>m(!0),tt.current=Dt,nt.current=()=>{c||u||ot(!0)},(0,x.useEffect)(()=>{function e(e){let t=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey){if(t===`c`){J.hasChanges&&$.autoGenerateCommitMessage&&!c&&(e.preventDefault(),$e.current());return}if(t===`p`){J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges&&!c&&!it&&(e.preventDefault(),et.current());return}if(t===`g`){J.repoUrl&&!c&&(e.preventDefault(),tt.current());return}t===`b`&&!c&&!u&&(e.preventDefault(),nt.current())}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[J.commitsAheadOfDefault,J.hasChanges,J.prExists,J.repoUrl,$.autoGenerateCommitMessage,c,u,it]),(0,x.useEffect)(()=>{u&&J.prExists&&J.prState===`OPEN`&&f(!1)},[J.prExists,J.prState,u]),(0,x.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>{f(!1)},15e3);return()=>clearTimeout(e)},[u]),(0,x.useEffect)(()=>{let e=J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits;e&&!q.current&&Q(),q.current=e},[J.hasChanges,J.hasUnpushedCommits,J.prExists,J.prState]);async function st(){if(fe.trim()&&E(n))try{l(!0),await ce(n,fe),pe(``),le(!1),await J.fetchUnifiedStatus(!0),Q(),y({title:`Changes committed successfully`,description:`Your changes have been committed to '${J.currentBranch}'.`}),Xe&&(Ze(!1),await ht())}catch(e){P.error(`Failed to commit:`,e),y({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{l(!1)}}async function ct(){if(!E(n))return;let e=J.prUrl;if(!e)try{e=(await ge(n)).url}catch(e){P.error(`Failed to fetch pull request URL:`,e),y({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to fetch pull request URL`,variant:`destructive`});return}if(!e){y({title:`Could not open pull request`,description:`Pull request URL is unavailable. Try refreshing git status.`,variant:`destructive`});return}try{await _(e)}catch(e){P.error(`Failed to open pull request:`,e),y({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to open URL in browser`,variant:`destructive`})}}async function lt(){if(J.hasChanges){le(!0);return}if(J.hasUnpushedCommits&&J.prExists){await pt();return}if(J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits){await ct();return}if(J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges){m(!0);return}if(J.defaultBranchBehind>0){await vt();return}}async function ut(){let e=await X.generateCommitMessageWithAI();e&&pe(e)}async function dt(){if(E(n))try{l(!0);let e=await X.generateCommitMessageWithAI();if(!e){y({title:`Quick Commit failed`,description:`Could not generate commit message`,variant:`destructive`});return}await ce(n,e),await J.fetchUnifiedStatus(!0),Q(),y({title:`Changes committed successfully`,description:`Committed: ${e}`})}catch(e){P.error(`Quick commit failed:`,e),y({title:`Quick Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{l(!1)}}async function ft(){if(E(n))try{l(!0),await ve(n),await J.fetchUnifiedStatus()}catch(e){P.error(`Failed to fetch:`,e)}finally{l(!1)}}async function pt(){if(E(n))try{l(!0),await p(n),await J.fetchUnifiedStatus(!0),Q(),J.hasRemoteBranch?y({title:`Branch pushed successfully`,description:`Your branch '${J.currentBranch}' has been pushed to the remote.`}):y({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){P.error(`Failed to push:`,e),y({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{l(!1)}}async function mt(){if(E(n)){if(J.hasChanges){G(!0);return}await ht()}}async function ht(){try{l(!0),await de(n),await J.fetchUnifiedStatus(!0),Q(),y({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){P.error(`Failed to pull:`,e),y({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{l(!1)}}function gt(){G(!1),Ze(!0),le(!0)}async function _t(){G(!1),await ht()}async function vt(){if(E(n))try{l(!0),await t(n),await J.fetchUnifiedStatus(!0),Q(),y({title:`Branch synced successfully`,description:`Your branch '${J.currentBranch}' has been synced with the latest changes`})}catch(e){P.error(`[sync] ✗ Failed to sync branch:`,e),y({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{l(!1)}}async function yt(){if(E(n))try{l(!0),f(!0);let t=await ie(n,h,_e);await Ue(n,e,te,t.title??h),t.prUrl&&await _(t.prUrl),g(``),be(``),m(!1),await J.fetchUnifiedStatus(!0),Q();let r=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(r++,r>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){P.error(`Failed to create PR:`,e);let t=e instanceof Error?e.message:`Failed to create PR`;t.includes(`push the current branch`)||t.includes(`--head flag`)?(m(!1),St({title:h,description:_e})):(f(!1),y({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{l(!1)}}async function bt(){if(E(n))try{l(!0);let e=await i(n,z,V,$.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{_(e.repoUrl)},3e3),B(``),H(``),Ke(!1),await J.fetchUnifiedStatus(),Q()}catch(e){P.error(`Failed to create repo:`,e)}finally{l(!1)}}async function xt(){let e=await X.generatePRInfoWithAI();e&&(g(e.title),be(e.description),y({title:`Success`,description:`PR title and description generated`}))}async function St(r){let i=r??Ce;if(!(!n||!i))try{l(!0),f(!0);try{await p(n)}catch(e){let r=e?.message??``;if(r.includes(`non-fast-forward`)||r.includes(`Updates were rejected because the tip of your current branch is behind`)){y({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await t(n),await p(n)}catch{throw e}}else throw e}let r=await ie(n,i.title,i.description);await Ue(n,e,te,r.title??i.title),r.prUrl&&await _(r.prUrl),g(``),be(``),b(null),v(!1),await J.fetchUnifiedStatus(!0),Q();let a=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(a++,a>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){P.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;f(!1),y({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{l(!1)}}async function Ct(){if(E(n))try{D(!0);let e=await me(n,100);ze(e),L(e.slice(0,10)),w(!0)}catch(e){P.error(`Failed to fetch git history:`,e)}finally{D(!1)}}function wt(){We||(Ge(!0),setTimeout(()=>{let e=I.length+10;L(T.slice(0,e)),Ge(!1)},300))}function Tt(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&I.length<T.length&&!We&&wt()}let Et=Re(J);function Dt(){J.repoUrl&&_(J.repoUrl)}function Ot(){v(!1),b(null)}return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:ne(`flex items-center gap-0`,ee===`menu`&&`w-full flex-col gap-1 [&_button]:w-full [&_button]:justify-start`),children:[(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(oe,{variant:`outline`,size:`sm`,className:ne(`h-8 gap-1.5`,ee===`bar`&&`rounded-r-none border-r-0`,ee===`menu`&&`rounded-md border`,Et&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`),disabled:Le(J,c,u),onClick:lt,children:[Fe(J,u,c),Pe(J,u)]})}),(0,S.jsx)(d,{children:Ie(J)})]})}),(0,S.jsx)(Be,{branchStatus:J.status,remoteUrl:J.remoteUrl,hasRemoteBranch:J.hasRemoteBranch,hasUnpushedCommits:J.hasUnpushedCommits,canCreateRepo:J.canCreateRepo,repoUrl:J.repoUrl,isRefreshing:J.isRefreshing,isCreatingPR:u,isBrandState:Et,hasChanges:J.hasChanges,defaultBranch:J.defaultBranch??null,defaultBranchAhead:J.defaultBranchAhead,defaultBranchBehind:J.defaultBranchBehind,gitUser:qe,isDirectCommitMode:it,autoGenerateCommitMessage:$.autoGenerateCommitMessage,isLoading:c,isLoadingHistory:Ve,isQuickCommitting:X.isGeneratingMessage&&c,onFetch:()=>void ft(),onPull:()=>void mt(),onPush:()=>void pt(),onOpenHistory:()=>void Ct(),onCreatePR:()=>m(!0),onCreateRepo:()=>Ke(!0),onViewInGitHub:Dt,onQuickCommit:()=>void dt(),onSyncWithDefault:()=>void vt(),open:K,onOpenChange:ot,layout:ee})]}),se&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(k,{open:se,onOpenChange:le,commitMessage:fe,onCommitMessageChange:pe,autoGenerateCommitMessage:$.autoGenerateCommitMessage,onAutoGenerateChange:e=>rt(t=>({...t,autoGenerateCommitMessage:e})),isGeneratingMessage:X.isGeneratingMessage,isLoading:c,onGenerateMessage:ut,onCommit:st,currentBranch:J.currentBranch})}),ue&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(A,{open:ue,onOpenChange:m,prTitle:h,onPrTitleChange:g,prDescription:_e,onPrDescriptionChange:be,isGeneratingPRInfo:X.isGeneratingPRInfo,isLoading:c,onGeneratePRInfo:xt,onCreatePR:yt,currentBranch:J.currentBranch,autoGeneratePRInfo:$.autoGeneratePRInfo,onAutoGeneratePRInfoChange:e=>rt(t=>({...t,autoGeneratePRInfo:e}))})}),xe&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(M,{open:xe,onOpenChange:v,isLoading:c,onPushAndCreatePR:St,onCancel:Ot})}),R&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(j,{open:R,onOpenChange:Ke,repoName:z,onRepoNameChange:B,repoDescription:V,onRepoDescriptionChange:H,isPrivateRepo:$.privateRepositoryDefault,onPrivateRepoChange:e=>rt(t=>({...t,privateRepositoryDefault:e})),isLoading:c,onCreateRepo:bt})}),C&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(He,{open:C,onOpenChange:w,commits:T,displayedCommits:I,isLoadingMore:We,onScroll:Tt,currentBranch:J.currentBranch})}),W&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(N,{open:W,onOpenChange:G,onCommitFirst:gt,onStashAndPull:_t,onCancel:()=>G(!1),isLoading:c})})]})}export{I as GitOpsButton};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{$i as n,Ai as r,Ba as i,Br as a,Di as o,Fi as s,Fo as c,Gr as l,Ii as u,Io as d,Ki as f,Ko as p,Kr as m,Lr as h,Mi as g,Mo as _,Ms as v,Ni as y,No as b,Ns as x,Oi as S,Pi as C,Po as w,Ps as T,Rr as E,Si as D,Ti as O,Ui as k,Ur as A,Vr as j,Wr as M,_ as ee,_i as te,ai as N,bi as ne,c as re,ci as P,di as F,ds as I,fi as ie,fs as L,gi as ae,hi as oe,ji as R,js as se,ki as ce,l as le,li as ue,mi as de,oi as fe,ot as pe,pi as me,qr as he,s as ge,si as _e,u as ve,ui as ye,wi as be,wo as xe,yi as Se,zr as Ce}from"./dialogs-config-sFb6rmoV.js";var z=v(),we=Object,Te=Map,Ee=Set,De=Ee.prototype.has,Oe=Ee.prototype.add,ke=Te.prototype.has,Ae=Te.prototype.get,je=Te.prototype.set,Me=1,Ne=2,Pe=4,Fe=8,Ie=16,Le=32,B=`__t`,Re=`__p`,ze=`__e`,Be=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ve=`http://www.w3.org/1999/xlink`,He=`http://www.w3.org/2000/xmlns/`,Ue=120,We=new Ee([`href`,`list`,`form`,`tabIndex`,`download`]),Ge=new Ee([`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`isindex`,`keygen`,`link`,`menuitem`,`meta`,`nextid`,`param`,`source`,`track`,`wbr`]);if(typeof window>`u`)throw Error(`See http://million.dev/docs/install to install the compiler.`);var V=document;V.createElement(`template`);var Ke=V.createElement(`template`),qe=Ke.content,Je=V.createElementNS(`http://www.w3.org/2000/svg`,`svg`),H=Node.prototype,Ye=Element.prototype,Xe=CharacterData.prototype,Ze=we.getOwnPropertyDescriptor,Qe=H.insertBefore,$e=H.cloneNode,et=H.replaceChild,tt=Ye.remove,nt=H.addEventListener,rt=Ye.removeAttribute,it=Ye.setAttribute,at=Ye.setAttributeNS,ot=Ze(H,`textContent`).set,st=Ze(H,`firstChild`).get,ct=Ze(H,`nextSibling`).get,lt=Ze(Xe,`data`).set,ut=(e,t)=>{let n=t?Je:Ke;return n.innerHTML=e,(t?Je:qe).firstChild};V[ze]=new Ee;var dt=(e,t,n)=>{let r=t.toLowerCase(),i=!1;r.endsWith(`capture`)&&(r=r.slice(0,-7),i=!0);let a=`$$${r}`;De.call(V[ze],r)||(nt.call(V,r,e=>{let t=e.target;for(;t;){let n=t[a];n&&(we.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t}}),n(e)),t=t.parentNode}},{capture:i}),Oe.call(V[ze],r));let o=t=>{t?`key`in t&&t.key===e[a]?.key||(e[a]=t):e[a]=null};return o(n),o},U=(e,t)=>{let n=st.call(e);if(t)for(let e=0;e<t&&n;++e)n=ct.call(n);return n},ft=new WeakSet,pt=e=>{if(ft.has(e))return;e.nodeType===8&&e.parentNode?.removeChild(e);let t=st.call(e);for(;t;)pt(t),t=t.nextSibling;ft.add(e)},mt=(e,t,n)=>{let r=V.createTextNode(t),i=U(e,n);return Qe.call(e,r,i),r},ht=(e,t)=>{lt.call(e,t)},gt=(e,t,n)=>{typeof n!=`number`||Be.test(t)?e.style[t]=n:typeof n==`string`?e.style.cssText=n:t.startsWith(`-`)?e.style.setProperty(t,String(n)):n==null?e.style[t]=``:e.style[t]=`${String(n)}px`},_t=(e,t,n)=>{t=t.replace(/xlink(?:H|:h)/,`h`).replace(/sName$/,`s`),t.startsWith(`xmlns`)?at.call(e,He,t,String(n)):t.startsWith(`xlink`)&&at.call(e,Ve,`href`,String(n))},vt=(e,t,n)=>{let r=n==null;if(n=r?``:n,t in e&&e[t]!==void 0&&e[t]!==null&&!(e instanceof SVGElement)&&De.call(We,t))try{e[t]=n}catch{}else !r&&n!==``&&(n!==!1||t.includes(`-`))?it.call(e,t,String(n)):rt.call(e,t);let i=e instanceof HTMLInputElement,a=e instanceof HTMLSelectElement,o=e instanceof HTMLTextAreaElement;t===`value`&&(i||a||o)&&(it.call(e,t,String(n)),e.value=n)},yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]);function bt(e){return yt.get(e)||e}var xt=Object.defineProperty,St=(e,t,n)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>(St(e,typeof t==`symbol`?t:t+``,n),n),Ct=class{constructor(){W(this,`r`),W(this,`e`),W(this,`l`),W(this,`g`),W(this,`_u`),W(this,`_t`),W(this,`d`),W(this,`k`),W(this,`c`)}},wt=(e,t=[],n=[])=>{if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`||e===!0)return String(e);if(e==null||e===!1)return``;if(typeof e==`object`&&`$`in e)return t.push({p:n,e:[{t:Me,n:null,v:null,h:e.$,i:0,l:null,p:null,b:null}],i:[]}),`<slot/>`;let r=``,i=``,a={p:n,e:[],i:[]};for(let t in e.props){let n=e.props[t];if(t===`key`||t===`ref`||t===`children`)continue;let i=bt(t);if(i&&(t=i),t===`className`&&(t=`class`),t.startsWith(`on`)){`$`in n?a.e.push({t:Pe,n:t.slice(2),v:null,h:n.$,i:null,l:null,p:null,b:null}):a.i.push({t:Pe,n:t.slice(2),v:null,h:null,i:null,l:n,p:null,b:null});continue}if(n){if(typeof n==`object`&&`$`in n){t===`style`?a.e.push({t:Fe,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):t.charCodeAt(0)===Ue?a.e.push({t:Ie,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):a.e.push({t:Ne,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null});continue}if(t===`style`&&typeof n==`object`){let e=``;for(let t in n){if(typeof n[t]==`object`){a.e.push({t:Fe,n:t,v:null,h:n[t].$,i:null,l:null,p:null,b:null});continue}let r=``;for(let e=0,n=t.length;e<n;++e){let n=t.charCodeAt(e);n<97?r+=`-${String.fromCharCode(n+32)}`:r+=t[e]}e+=`${r}:${String(n[t])};`}r+=` style="${e}"`;continue}r+=` ${t}="${String(n)}"`}}if(De.call(Ge,e.type))return a.e.length&&t.push(a),`<${e.type}${r} />`;let o=!1;for(let r=0,s=e.props.children?.length||0,c=0;r<s;++r){let s=e.props.children?.[r];if(s==null||s===!1)continue;if(typeof s==`object`&&`$`in s){a.e.push({t:Me,n:null,v:null,h:s.$,i:r,l:null,p:null,b:null});continue}if(s instanceof Ct){a.i.push({t:Le,n:null,v:null,h:null,i:r,l:null,p:null,b:s});continue}if(typeof s==`string`||typeof s==`number`||typeof s==`bigint`){let e=typeof s==`number`||typeof s==`bigint`?String(s):s;if(o){a.i.push({t:Me,n:null,v:e,h:null,i:r,l:null,p:null,b:null});continue}o=!0,i+=e,c++;continue}o=!1;let l=n.slice();l.push(c++),i+=wt(s,t,l)}return(a.i.length||a.e.length)&&t.push(a),`<${e.type}${r}>${i}</${e.type}>`},Tt=Object.defineProperty,Et=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t,n)=>(Et(e,typeof t==`symbol`?t:t+``,n),n),Ot=e=>new kt(e),kt=class extends Ct{constructor(e){super(),Dt(this,`b`),this.b=e}v(){}p(e){let t=this.b,n=e.b,r=t.length,i=n.length,a=this.t();if(this===e||i===0&&r===0)return a;if(this.b=n,i===0)return Nt.call(this),a;if(r===0)return jt.call(e,a),a;let o=0,s=0,c=r-1,l=i-1,u=t[0],d=n[0],f=t[c],p=n[l],m;for(;o<=c&&s<=l;){if(!u){u=t[++o];continue}if(!f){f=t[--c];continue}let e=u.k,r=d.k;if(e===r){Vt.call(u,d),n[s]=u,u=t[++o],d=n[++s];continue}let i=f.k,h=p.k;if(i===h){Vt.call(f,p),n[l]=f,f=t[--c],p=n[--l];continue}if(e===h){Vt.call(u,p),n[l]=u;let e=n[l+1];Ht.call(u,e,e?.l||null),u=t[++o],p=n[--l];continue}if(i===r){Vt.call(f,d),n[s]=f;let e=t[o];Ht.call(f,e,e?.l||null),f=t[--c],d=n[++s];continue}if(!m){m=new Te;for(let e=o;e<=c;e++)je.call(m,t[e].k,e)}let g=m.get(r);if(g===void 0)Bt.call(d,a,u.l||null);else{let e=t[g];Ht.call(e,u,null),Vt.call(e,d),n[s]=e,t[g]=null}d=n[++s]}if(o<=c||s<=l)if(o>c){let e=n[l+1];for(let t=s;t<=l;++t)Bt.call(n[t],a,e?e.l:null)}else for(let e=o;e<=c;++e)Ut.call(t[e]);return a}m(e,t=null){if(this._t)return this._t;for(let n=0,r=this.b.length;n<r;++n){let r=this.b[n];Bt.call(r,e,t)}return this._t=e,e}x(){let e=this.t();if(e)ot.call(e,``);else for(let e=0,t=this.b.length;e<t;++e)Ut.call(this.b[e]);this.b=[]}u(){return!0}s(){return this.b.map(e=>e.s()).join(``)}t(){return this._t||=this.b[0].t(),this._t}},At=kt.prototype,jt=At.m,Mt=At.p,Nt=At.x,Pt=new Proxy({},{get(e,t){return{$:t}}}),Ft=(e,t,n,r)=>{let i=e(Pt),a=[],o=ut(wt(t?t(i):i,a),r);return pt(o),(e,t,r)=>new Lt(o,a,e,t??e?.key??null,r??n??null,null)},It=(e,t)=>{if((`b`in e||`b`in t)&&Mt.call(e,t),e.l||Bt.call(e,void 0,null,null),e.k&&e.k===t.k||e.r===t.r)return Vt.call(e,t);let n=Bt.call(t,e.t(),e.l,null);return Ut.call(e),e.k=t.k,n},Lt=class extends Ct{constructor(e,t,n,r,i,a){super(),this.r=e,this.d=n,this.e=t,this.k=r,this.c=Array(t.length),i?this._u=i:this._u=null,a?this.g=a:this.g=null}m(e,t=null,n){if(this.l)return this.l;let r=n??$e.call(this.r,!0),i=this.g?.(r);i&&(this.c=i);for(let e=0,t=this.e.length;e<t;++e){let t=this.e[e],a=i?.[e]??Rt(t.p,r,this.c,e);for(let e=0,r=t.e.length;e<r;++e){let i=t.e[e],o=this.d[i.h];if(i.t&Me){if(o instanceof Ct){let e=U(a,i.i);n?o.m(a,e,e):o.m(a,e);continue}if(a[B]||(a[B]=Array(r)),o&&typeof o==`object`&&`foreign`in o){if(n){let e=U(a,i.i);o.reset(e)}let t=o.current;a[B][e]=t,n||Qe.call(a,t,U(a,i.i));continue}if(n){a[B][e]=U(a,i.i);continue}a[B][e]=mt(a,o==null||o===!1?``:String(o),i.i)}else if(i.t&Pe){let e=dt(a,i.n,o);a[Re+i.n]=e}else if(i.t&Ne)vt(a,i.n,o);else if(i.t&Fe)if(typeof o==`string`||typeof o==`number`)gt(a,i.n,o);else for(let e in o)gt(a,e,o[e]);else _t(a,i.n,o)}let o=t.i?.length;if(o)for(let e=0;e<o;++e){let r=t.i[e];if(r.t&Me)r.v&&!n&&mt(a,r.v,r.i);else if(r.t&Pe)dt(a,r.n,r.l);else{let e=U(a,r.i);n?r.b.m(a,e,e):r.b.m(a,e)}}}return e&&!n&&Qe.call(e,r,t),this.l=r,r}p(e){let t=this.l;if(!e.d)return t;let n=this.d;if(!Wt.call(this,n,e.d))return t;this.d=e.d;for(let r=0,i=this.e.length;r<i;++r){let i=this.e[r],a=this.c[r]??Rt(i.p,t,this.c,r);for(let t=0,o=i.e.length;t<o;++t){let o=i.e[t],s=n[o.h],c=e.d[o.h];if(c!==s){if(o.t&Pe){a[Re+o.n](c);continue}if(o.t&Me){if(s instanceof Ct){let n=e.e?.[r]?.e[t],i=e.d[n.h];s.p(i);continue}if(c&&typeof c==`object`&&`foreign`in c){let e=a[B][t];if(c.unstable&&s!==c){let n=c.current;a[B][t]=n,et.call(a,n,e)}else c.current=e;continue}ht(a[B][t],c==null||c===!1?``:String(c))}else if(o.t&Ne)vt(a,o.n,c);else if(o.t&Fe)if(typeof c==`string`||typeof c==`number`)gt(a,o.n,c);else for(let e in c)c[e]!==s[e]&>(a,e,c[e]);else _t(a,o.n,c)}}}return t}v(e=null,t=null){Qe.call(this.t(),this.l,e?e.l:t)}x(){tt.call(this.l),this.l=null}u(e,t){return this._u?this._u(e,t):!0}s(){return String(this.l?.outerHTML)}t(){return this._t||=this.l?.parentElement,this._t}},Rt=(e,t,n,r)=>{let i=e.length;if(!i)return t;let a=n&&r!==void 0;if(a&&n[r])return n[r];for(let n=0;n<i;++n){let r=e[n];t=U(t,r)}return a&&(n[r]=t),t},zt=Lt.prototype,Bt=zt.m,Vt=zt.p,Ht=zt.v,Ut=zt.x,Wt=zt.u,G=e(T(),1),Gt={noSlot:!1},Kt=e(x(),1),qt=`slot`,Jt=({effect:e,deps:t})=>((0,G.useEffect)(e,t||[]),null),K=new Map,Yt=(0,G.createContext)(!1),Xt=(e,t,n)=>{let r={ref:t},i=0;for(let t in e){let a=e[t];if((0,G.isValidElement)(a)||Array.isArray(a)&&a.length&&(0,G.isValidElement)(a[0])){r[t]=Qt(a,!1,n,i++);continue}r[t]=e[t]}return r},Zt=(e,t)=>(0,G.createElement)(qt,{suppressHydrationWarning:!0,id:t},e),Qt=(e,t,n,r,i)=>{let a=n?.[r]?.current,o=(0,G.isValidElement)(e)&&typeof e.type==`function`&&`_c`in e.type,s=o&&e.type._c;if(typeof window>`u`)return o?s?e:Zt(Zt(e),i):Zt(e,i);if(s){let t=e.type(e.props);if(K.has(t.type)){let e=K.get(t.type);if(typeof e==`function`)return e(t.props)}}let c=a??(i?document.getElementById(i):null)??document.createElement(`slot`),l={foreign:!0,current:c,portal:(0,Kt.createPortal)((0,G.createElement)(G.Fragment,{children:e}),c,i),reset:e=>{e.childNodes.forEach(t=>e.removeChild(t))},unstable:t};return n&&(n[r]=l),l},$t=e=>{if(typeof e!=`object`||!e||!(`type`in e))return typeof e==`number`?String(e):e;let t=e.type;if(typeof t==`function`)return $t(t(e.props??{}));if(typeof t==`object`&&`$`in t)return t;let n={...e.props};return`css`in n&&`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`in n&&(n.style=n.css.styles,t=n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.css),e.props?.children!=null&&(n.children=en(e.props.children).map(e=>$t(e))),{type:t,props:n}},en=e=>{if(e==null)return[];if(typeof e==`object`&&`type`in e&&e.type===G.Fragment)return en(e.props.children);if(!Array.isArray(e)||typeof e==`object`&&`$`in e)return[e];let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;++e)n.push(...en(t[e]));return n},tn=typeof window>`u`?G.useEffect:G.useLayoutEffect;function nn(e,t,n){if(!e||t(e))return e;let r=n?e.return:e.child;for(;r;){let e=nn(r,t,n);if(e)return e;r=n?null:r.sibling}}function rn(){let e=(0,G.useRef)();return(0,G.useState)(()=>{let t=Function.prototype.bind;Function.prototype.bind=function(n,r){return n===null&&typeof r?.type==`function`&&(e.current=r,Function.prototype.bind=t),t.apply(this,arguments)}}),e.current}function an(e){let t=rn(),n=(0,G.useRef)({el:null,depth:0});return tn(()=>{n.current.el=nn(t,t=>(n.current.depth++,typeof t.type==`string`&&(e===void 0||t.type===e)),!0)?.stateNode},[t]),n}function on(){let e=rn(),t=(0,G.useRef)({el:null,depth:0});return tn(()=>{t.current.el=nn(e,e=>(t.current.depth++,e.stateNode?.containerInfo!=null),!0)?.stateNode.containerInfo},[e]),t}var sn=(e,t={})=>{let n=t?.experimental_noSlot??Gt.noSlot,r=t?.block,i=t?.svg?`g`:qt;e&&(r=Ft(e,$t,t?.shouldUpdate,t?.svg));let a=(e,a)=>{let o=on(),s=an(),c=e._hmr,l=(0,G.useRef)(null),u=(0,G.useRef)(null),d=(0,G.useRef)([]);e=Xt(e,a,d.current),u.current?.(e);let f=(0,G.useCallback)(()=>{if(!l.current&&!n)return;let i=r(e,e.key);return c&&l.current?.textContent&&(l.current.textContent=``),n&&(l.current=s.current?.el??o.current?.el,(e.scoped||s.current&&o.current&&s.current.depth>o.current.depth)&&(l.current=o.current.el),l.current.childNodes.length&&console.error(Error(`\`experimental_options.noSlot\` does not support having siblings at the moment.
|
|
2
|
-
The block element should be the only child of the \`${$e.call(l.current).outerHTML}\` element.
|
|
3
|
-
To avoid this error, \`experimental_options.noSlot\` should be false`))),(u.current===null||c)&&(Bt.call(i,l.current,null),u.current=e=>{It(i,r(e,e.key,t?.shouldUpdate))}),()=>{Ut.call(i)}},[]),p=(0,G.useMemo)(()=>n?null:(0,G.createElement)(t?.as??i,{ref:l}),[]),m=d.current.length,h=Array(m);for(let e=0;e<m;++e)h[e]=d.current[e]?.portal;return(0,G.createElement)(G.Fragment,{},p,(0,G.createElement)(Jt,{effect:f,deps:c?[c]:[]}),h)};return ke.call(K,a)||je.call(K,a,sn),t?.name&&(e&&(e.displayName=`Million(Render(${t.name}))`),a.displayName=`Million(Block(${t.name}))`),a};(0,G.memo)(({each:e,children:t,memo:n,svg:r,as:i,...a})=>{let o=(0,G.useRef)(null),[s]=(0,G.useState)(()=>({current:Array(e.length)})),c=(0,G.useRef)(null),l=(0,G.useRef)({each:null,children:null,mounted:!1}),[,u]=(0,G.useState)(!1);if(c.current&&(e!==l.current.each||!n)){let r=cn(e,t,l,s,n);Mt.call(c.current,Ot(r))}let d=(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i??(r?`g`:`slot`),{...a,ref:o}),...s.current.map(e=>e.portal));return(0,G.useEffect)(()=>{!o.current||c.current||l.current.mounted||(c.current=Ot(cn(e,t,l,s,n)),ke.call(K,d)||je.call(K,d,c.current),jt.call(c.current,o.current),l.current.mounted=!0,u(!0))},[o.current]),d});var cn=(e,t,n,r,i)=>{let a=Array(e.length),o=n.current;for(let n=0,s=e.length;n<s;++n){if(i&&o.each&&o.each[n]===e[n]){a[n]=o.children?.[n];continue}let s=t(e[n],n);if(ke.call(K,s.type)){o.block||=Ae.call(K,s.type),a[n]=o.block(s.props,r,n);continue}if(typeof s.type==`function`&&`_c`in s.type){let e=s.type(s.props);if(ke.call(K,e.type)){let t=Ae.call(K,e.type);if(typeof t==`function`){a[n]=t(e.props);continue}}}let c=Ft(e=>e?.scope),l=(e,t,n)=>c({scope:Qt((0,G.createElement)(s.type,e),!1,t.current,n)},s.key?String(s.key):void 0);je.call(K,s.type,l),o.block=l,a[n]=l(s.props,r,n)}return o.each=e,o.children=a,a};function ln(e,t){return e===t||e!==e&&t!==t}function un(e,t){for(let n in e)if(!ln(e[n],t[n]))return!0;return!1}function dn(e,{portals:t,...n}){let r=`CompiledBlock(Inner(${n.name}))`,i=sn(t=>e(t),{...n,scoped:void 0,name:r,shouldUpdate:un}),a=t?.length||0,o=t&&a>0?e=>{let n=(0,G.useContext)(Yt),[r]=(0,G.useState)(()=>[]),o={...e,scoped:n};for(let e=0;e<a;e++){let n=t[e];o[n]=Qt(o[n],!1,r,e)}let s=[];for(let e=0,t=r.length;e<t;e++)s[e]=r[e].portal;return(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i,o),s)}:e=>(0,G.createElement)(i,e);return n.name&&(o.displayName=`Million(CompiledBlock(Outer(${n.name})))`),o}typeof window<`u`&&(window.__MILLION_DATA__={version:`3.1.11`});var q=se(),fn=`AlertDialog`,[pn,mn]=g(fn,[de]),J=de(),hn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(ye,{...r,...n,modal:!0})};hn.displayName=fn;var gn=`AlertDialogTrigger`,_n=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(ie,{...i,...r,ref:t})});_n.displayName=gn;var vn=`AlertDialogPortal`,yn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(ue,{...r,...n})};yn.displayName=vn;var bn=`AlertDialogOverlay`,xn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(P,{...i,...r,ref:t})});xn.displayName=bn;var Sn=`AlertDialogContent`,[Cn,wn]=pn(Sn),Tn=S(`AlertDialogContent`),En=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=J(n),o=G.useRef(null),s=k(t,o),c=G.useRef(null);return(0,q.jsx)(me,{contentName:Sn,titleName:Dn,docsSlug:`alert-dialog`,children:(0,q.jsx)(Cn,{scope:n,cancelRef:c,children:(0,q.jsxs)(fe,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:y(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,q.jsx)(Tn,{children:r}),(0,q.jsx)(Fn,{contentRef:o})]})})})});En.displayName=Sn;var Dn=`AlertDialogTitle`,On=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(F,{...i,...r,ref:t})});On.displayName=Dn;var kn=`AlertDialogDescription`,An=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(_e,{...i,...r,ref:t})});An.displayName=kn;var jn=`AlertDialogAction`,Mn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(N,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`AlertDialogCancel`,Pn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=wn(Nn,n),a=J(n),o=k(t,i);return(0,q.jsx)(N,{...a,...r,ref:o})});Pn.displayName=Nn;var Fn=({contentRef:e})=>{let t=`\`${Sn}\` requires a description for the component to be accessible for screen reader users.
|
|
4
|
-
|
|
5
|
-
You can add a description to the \`${Sn}\` by passing a \`${kn}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
6
|
-
|
|
7
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Sn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
8
|
-
|
|
9
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return G.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},In=hn,Ln=yn,Rn=xn,zn=En,Bn=Mn,Vn=Pn,Hn=On,Un=An,Wn=In,Gn=Ln,Kn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Rn,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Kn.displayName=Rn.displayName;var qn=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(Kn,{}),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=u(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,q.jsxs)(Gn,{children:[a,(0,q.jsx)(zn,{ref:t,className:o,...i})]}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});qn.displayName=zn.displayName;var Jn=e=>{let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Jn.displayName=`AlertDialogHeader`;var Yn=e=>{let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Yn.displayName=`AlertDialogFooter`;var Xn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.dialogTitle,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Hn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xn.displayName=Hn.displayName;var Zn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Un,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Zn.displayName=Un.displayName;var Qn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(s(),r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Bn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qn.displayName=Bn.displayName;var $n=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(s({variant:`outline`}),`mt-2 sm:mt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Vn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$n.displayName=Vn.displayName;var er=dn(e=>(0,q.jsxs)(`div`,{className:e.v0,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:e.v1,children:e.v2}),e.v3]}),e.v4]}),{name:`PageHeader_1`,portals:[`v2`,`v3`,`v4`]}),tr=function(e){let t=(0,z.c)(12),{title:n,description:r,action:i,className:a,titleClassName:o}=e,s;t[0]===a?s=t[1]:(s=u(`flex items-center justify-between mb-6`,a),t[0]=a,t[1]=s);let c;t[2]===o?c=t[3]:(c=u(L.pageTitle,o),t[2]=o,t[3]=c);let l;t[4]===r?l=t[5]:(l=r?(0,q.jsx)(`p`,{className:L.pageSubtitle,children:r}):null,t[4]=r,t[5]=l);let d;return t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==l||t[10]!==n?(d=(0,q.jsx)(er,{v0:s,v1:c,v2:n,v3:l,v4:i}),t[6]=i,t[7]=s,t[8]=c,t[9]=l,t[10]=n,t[11]=d):d=t[11],d};function nr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.settingsPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function rr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.accountPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ir(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.formPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ar(e){let t=(0,z.c)(5),{title:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(L.sectionTitle,`mb-3`,r),t[0]=r,t[1]=i);let a;return t[2]!==i||t[3]!==n?(a=(0,q.jsx)(`h2`,{className:i,children:n}),t[2]=i,t[3]=n,t[4]=a):a=t[4],a}function or(e){let t=(0,z.c)(6),{children:n,variant:r,className:i}=e,a=r===void 0?`info`:r,o;t[0]!==i||t[1]!==a?(o=u(a===`hint`?L.hintBanner:a===`success`?u(L.body,`text-green-700 bg-green-50 dark:text-green-400 dark:bg-green-950/30 rounded-md px-3 py-2 mb-4`):a===`error`?u(L.error,`bg-destructive/10 rounded-md px-3 py-2 mb-4`):L.infoBanner,i),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==o?(s=(0,q.jsx)(`div`,{className:o,children:n}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s}function sr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(`flex-1 overflow-auto`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function cr(e){let t=(0,z.c)(10),{children:n,title:r,action:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,q.jsx)(`h2`,{className:u(L.emptyStateTitle,`mb-2`),children:r}):null,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,q.jsx)(`p`,{className:L.bodyMuted,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,q.jsx)(`div`,{className:`mt-4`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,q.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,q.jsxs)(`div`,{className:`text-center`,children:[a,o,s]})}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function lr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(`h-full flex flex-col overflow-hidden`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ur(e){let t=(0,z.c)(14),{title:n,description:r,action:i,children:a,className:o}=e,s;t[0]===n?s=t[1]:(s=(0,q.jsx)(ar,{title:n,className:`mb-1`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=r?(0,q.jsx)(`p`,{className:L.bodyMuted,children:r}):null,t[2]=r,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==l?(u=(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[l,i]}),t[7]=i,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==o||t[12]!==u?(d=(0,q.jsxs)(`div`,{className:o,children:[u,a]}),t[10]=a,t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function dr(e){let t=G.useRef({value:e,previous:e});return G.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fr=[` `,`Enter`,`ArrowUp`,`ArrowDown`],pr=[` `,`Enter`],mr=`Select`,[hr,gr,_r]=ge(mr),[vr,yr]=g(mr,[_r,he]),br=he(),[xr,Y]=vr(mr),[Sr,Cr]=vr(mr),wr=e=>{let{__scopeSelect:t,children:n,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,_=br(t),[v,y]=G.useState(null),[b,x]=G.useState(null),[S,C]=G.useState(!1),w=ve(u),[T,E]=ce({prop:i,defaultProp:a??!1,onChange:o,caller:mr}),[D,O]=ce({prop:s,defaultProp:c,onChange:l,caller:mr}),k=G.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=G.useState(new Set),ee=Array.from(j).map(e=>e.props.value).join(`;`);return(0,q.jsx)(m,{..._,children:(0,q.jsxs)(xr,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:r(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:p,children:[(0,q.jsx)(hr.Provider,{scope:t,children:(0,q.jsx)(Sr,{scope:e.__scopeSelect,onNativeOptionAdd:G.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:G.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,q.jsxs)(_i,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>O(e.target.value),disabled:p,form:g,children:[D===void 0?(0,q.jsx)(`option`,{value:``}):null,Array.from(j)]},ee):null]})})};wr.displayName=mr;var Tr=`SelectTrigger`,Er=G.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=br(n),o=Y(Tr,n),s=o.disabled||r,c=k(t,o.onTriggerChange),l=gr(n),u=G.useRef(`touch`),[d,f,p]=yi(e=>{let t=l().filter(e=>!e.disabled),n=bi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,q.jsx)(A,{asChild:!0,...a,children:(0,q.jsx)(O.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":vi(o.value)?``:void 0,...i,ref:c,onClick:y(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:y(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:y(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&fr.includes(e.key)&&(m(),e.preventDefault())})})})});Er.displayName=Tr;var Dr=`SelectValue`,Or=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Y(Dr,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=k(t,c.onValueNodeChange);return R(()=>{l(u)},[l,u]),(0,q.jsx)(O.span,{...s,ref:d,style:{pointerEvents:`none`},children:vi(c.value)?(0,q.jsx)(q.Fragment,{children:o}):a})});Or.displayName=Dr;var kr=`SelectIcon`,Ar=G.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,q.jsx)(O.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Ar.displayName=kr;var jr=`SelectPortal`,Mr=e=>(0,q.jsx)(Se,{asChild:!0,...e});Mr.displayName=jr;var Nr=`SelectContent`,Pr=G.forwardRef((e,t)=>{let n=Y(Nr,e.__scopeSelect),[r,i]=G.useState();if(R(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Kt.createPortal((0,q.jsx)(Fr,{scope:e.__scopeSelect,children:(0,q.jsx)(hr.Slot,{scope:e.__scopeSelect,children:(0,q.jsx)(`div`,{children:e.children})})}),t):null}return(0,q.jsx)(Rr,{...e,ref:t})});Pr.displayName=Nr;var X=10,[Fr,Z]=vr(Nr),Ir=`SelectContentImpl`,Lr=o(`SelectContent.RemoveScroll`),Rr=G.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Y(Nr,n),[b,x]=G.useState(null),[S,C]=G.useState(null),w=k(t,e=>x(e)),[T,E]=G.useState(null),[O,A]=G.useState(null),j=gr(n),[M,ee]=G.useState(!1),N=G.useRef(!1);G.useEffect(()=>{if(b)return oe(b)},[b]),te();let re=G.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,S]),P=G.useCallback(()=>re([T,b]),[re,T,b]);G.useEffect(()=>{M&&P()},[M,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=v;G.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),G.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[ie,L]=yi(e=>{let t=j().filter(e=>!e.disabled),n=bi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),R=G.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(N.current=!0))},[v.value]),se=G.useCallback(()=>b?.focus(),[b]),ce=G.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&A(e)},[v.value]),le=r===`popper`?Hr:Br,ue=le===Hr?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,q.jsx)(Fr,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:R,selectedItem:T,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:P,selectedItemText:O,position:r,isPositioned:M,searchRef:ie,children:(0,q.jsx)(ae,{as:Lr,allowPinchZoom:!0,children:(0,q.jsx)(ne,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:y(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,q.jsx)(D,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,q.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ue,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:y(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>re(t)),e.preventDefault()}})})})})})})});Rr.displayName=Ir;var zr=`SelectItemAlignedPosition`,Br=G.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Y(Nr,n),o=Z(Nr,n),[s,c]=G.useState(null),[l,u]=G.useState(null),d=k(t,e=>u(e)),f=gr(n),p=G.useRef(!1),m=G.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=G.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=le(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=le(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-X*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);R(()=>y(),[y]);let[b,x]=G.useState();return R(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,q.jsx)(Ur,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:G.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,q.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,q.jsx)(O.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Br.displayName=zr;var Vr=`SelectPopperPosition`,Hr=G.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=br(n);return(0,q.jsx)(l,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Hr.displayName=Vr;var[Ur,Wr]=vr(Nr,{}),Gr=`SelectViewport`,Kr=G.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(Gr,n),o=Wr(Gr,n),s=k(t,a.onViewportChange),c=G.useRef(0);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,q.jsx)(hr.Slot,{scope:n,children:(0,q.jsx)(O.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:y(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Kr.displayName=Gr;var qr=`SelectGroup`,[Jr,Yr]=vr(qr),Xr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=r();return(0,q.jsx)(Jr,{scope:n,id:a,children:(0,q.jsx)(O.div,{role:`group`,"aria-labelledby":a,...i,ref:t})})});Xr.displayName=qr;var Zr=`SelectLabel`,Qr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Yr(Zr,n);return(0,q.jsx)(O.div,{id:i.id,...r,ref:t})});Qr.displayName=Zr;var $r=`SelectItem`,[ei,ti]=vr($r),ni=G.forwardRef((e,t)=>{let{__scopeSelect:n,value:i,disabled:a=!1,textValue:o,...s}=e,c=Y($r,n),l=Z($r,n),u=c.value===i,[d,f]=G.useState(o??``),[p,m]=G.useState(!1),h=k(t,e=>l.itemRefCallback?.(e,i,a)),g=r(),_=G.useRef(`touch`),v=()=>{a||(c.onValueChange(i),c.onOpenChange(!1))};if(i===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,q.jsx)(ei,{scope:n,value:i,disabled:a,textId:g,isSelected:u,onItemTextChange:G.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,q.jsx)(hr.ItemSlot,{scope:n,value:i,disabled:a,textValue:d,children:(0,q.jsx)(O.div,{role:`option`,"aria-labelledby":g,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:h,onFocus:y(s.onFocus,()=>m(!0)),onBlur:y(s.onBlur,()=>m(!1)),onClick:y(s.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:y(s.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:y(s.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:y(s.onPointerMove,e=>{_.current=e.pointerType,a?l.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:y(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:y(s.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(pr.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});ni.displayName=$r;var ri=`SelectItemText`,ii=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Y(ri,n),s=Z(ri,n),c=ti(ri,n),l=Cr(ri,n),[u,d]=G.useState(null),f=k(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=G.useMemo(()=>(0,q.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return R(()=>(h(m),()=>g(m)),[h,g,m]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Kt.createPortal(a.children,o.valueNode):null]})});ii.displayName=ri;var ai=`SelectItemIndicator`,oi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ti(ai,n).isSelected?(0,q.jsx)(O.span,{"aria-hidden":!0,...r,ref:t}):null});oi.displayName=ai;var si=`SelectScrollUpButton`,ci=G.forwardRef((e,t)=>{let n=Z(si,e.__scopeSelect),r=Wr(si,e.__scopeSelect),[i,a]=G.useState(!1),o=k(t,r.onScrollButtonChange);return R(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(di,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});ci.displayName=si;var li=`SelectScrollDownButton`,ui=G.forwardRef((e,t)=>{let n=Z(li,e.__scopeSelect),r=Wr(li,e.__scopeSelect),[i,a]=G.useState(!1),o=k(t,r.onScrollButtonChange);return R(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(di,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ui.displayName=li;var di=G.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=G.useRef(null),s=gr(n),c=G.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return G.useEffect(()=>()=>c(),[c]),R(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,q.jsx)(O.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:y(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:y(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:y(i.onPointerLeave,()=>{c()})})}),fi=`SelectSeparator`,pi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,q.jsx)(O.div,{"aria-hidden":!0,...r,ref:t})});pi.displayName=fi;var mi=`SelectArrow`,hi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=br(n),a=Y(mi,n),o=Z(mi,n);return a.open&&o.position===`popper`?(0,q.jsx)(M,{...i,...r,ref:t}):null});hi.displayName=mi;var gi=`SelectBubbleInput`,_i=G.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=G.useRef(null),a=k(r,i),o=dr(t);return G.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(O.select,{...n,style:{...j,...n.style},ref:a,defaultValue:t})});_i.displayName=gi;function vi(e){return e===``||e===void 0}function yi(e){let t=be(e),n=G.useRef(``),r=G.useRef(0),i=G.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=G.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return G.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function bi(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=xi(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function xi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Si=wr,Ci=Er,wi=Or,Ti=Ar,Ei=Mr,Di=Pr,Oi=Kr,ki=Qr,Ai=ni,ji=ii,Mi=oi,Ni=ci,Pi=ui,Fi=pi,Ii=Si,Li=wi,Ri=G.forwardRef((e,t)=>{let n=(0,z.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=u(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(Ti,{asChild:!0,children:(0,q.jsx)(c,{className:`h-4 w-4 opacity-50`})}),n[6]=s):s=n[6];let l;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(l=(0,q.jsxs)(Ci,{ref:t,className:o,...a,children:[r,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=l):l=n[11],l});Ri.displayName=Ci.displayName;var zi=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(_,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,q.jsx)(Ni,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});zi.displayName=Ni.displayName;var Bi=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(c,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,q.jsx)(Pi,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});Bi.displayName=Pi.displayName;var Vi=G.forwardRef((e,t)=>{let n=(0,z.c)(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,position:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;n[5]!==i||n[6]!==c?(l=u(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,c,i),n[5]=i,n[6]=c,n[7]=l):l=n[7];let d;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,q.jsx)(zi,{}),n[8]=d):d=n[8];let f=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`,p;n[9]===f?p=n[10]:(p=u(`p-1`,f),n[9]=f,n[10]=p);let m;n[11]!==r||n[12]!==p?(m=(0,q.jsx)(Oi,{className:p,children:r}),n[11]=r,n[12]=p,n[13]=m):m=n[13];let h;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,q.jsx)(Bi,{}),n[14]=h):h=n[14];let g;return n[15]!==s||n[16]!==a||n[17]!==t||n[18]!==l||n[19]!==m?(g=(0,q.jsx)(Ei,{children:(0,q.jsxs)(Di,{ref:t,className:l,position:s,...a,children:[d,m,h]})}),n[15]=s,n[16]=a,n[17]=t,n[18]=l,n[19]=m,n[20]=g):g=n[20],g});Vi.displayName=Di.displayName;var Hi=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`py-1.5 pl-8 pr-2 text-base font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(ki,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Hi.displayName=ki.displayName;var Ui=G.forwardRef((e,t)=>{let n=(0,z.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=u(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-base outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,q.jsx)(Mi,{children:(0,q.jsx)(d,{className:`h-4 w-4`})})}),n[6]=s):s=n[6];let c;n[7]===r?c=n[8]:(c=(0,q.jsx)(ji,{children:r}),n[7]=r,n[8]=c);let l;return n[9]!==a||n[10]!==t||n[11]!==o||n[12]!==c?(l=(0,q.jsxs)(Ai,{ref:t,className:o,...a,children:[s,c]}),n[9]=a,n[10]=t,n[11]=o,n[12]=c,n[13]=l):l=n[13],l});Ui.displayName=Ai.displayName;var Wi=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Fi,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Wi.displayName=Fi.displayName;function Gi(e){let t=(0,z.c)(14),{className:n,label:r,size:a}=e,o=a===void 0?`md`:a,s=o===`sm`?`h-4 w-4`:o===`lg`?`h-8 w-8`:`h-6 w-6`,c;t[0]===n?c=t[1]:(c=u(`flex h-full items-center justify-center`,n),t[0]=n,t[1]=c);let l;t[2]===s?l=t[3]:(l=u(s,`animate-spin mx-auto text-muted-foreground`),t[2]=s,t[3]=l);let d;t[4]===l?d=t[5]:(d=(0,q.jsx)(i,{className:l}),t[4]=l,t[5]=d);let f;t[6]===r?f=t[7]:(f=r?(0,q.jsx)(`p`,{className:u(L.bodyMuted,`mt-2`),children:r}):null,t[6]=r,t[7]=f);let p;t[8]!==d||t[9]!==f?(p=(0,q.jsxs)(`div`,{className:`text-center`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;return t[11]!==c||t[12]!==p?(m=(0,q.jsx)(`div`,{className:c,children:p}),t[11]=c,t[12]=p,t[13]=m):m=t[13],m}function Ki(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`space-y-1 px-2 py-2`,children:[1,2,3].map(qi)}),e[0]=t):t=e[0],t}function qi(e){return(0,q.jsx)(`div`,{className:`animate-pulse h-7 bg-muted rounded-full`},e)}function Ji(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded mx-4 my-1`}),e[0]=t):t=e[0],t}var Yi=new Map;function Xi(e,t){let n=Yi.get(e);return n||(n={promise:t().catch(t=>{throw Yi.delete(e),t})},Yi.set(e,n)),n.promise}function Zi(e){Yi.delete(e)}function Qi(e){for(let t of Yi.keys())t.startsWith(e)&&Yi.delete(t)}function $i(e,t){return(0,G.use)(Xi(e,t))}var ea=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`w-full caption-bottom`,L.body,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,q.jsx)(`table`,{ref:t,className:a,...i})}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ea.displayName=`Table`;var ta=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`[&_tr]:border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`thead`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ta.displayName=`TableHeader`;var na=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`[&_tr:last-child]:border-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tbody`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});na.displayName=`TableBody`;var ra=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tfoot`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ra.displayName=`TableFooter`;var ia=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tr`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ia.displayName=`TableRow`;var Q=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`th`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Q.displayName=`TableHead`;var $=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`td`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$.displayName=`TableCell`;var aa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.caption,`mt-4`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`caption`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});aa.displayName=`TableCaption`;var oa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`rounded-lg border bg-card text-card-foreground shadow-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});oa.displayName=`Card`;var sa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex flex-col space-y-1.5 p-6`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});sa.displayName=`CardHeader`;var ca=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.sectionTitle,`leading-none tracking-tight`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ca.displayName=`CardTitle`;var la=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.bodyMuted,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});la.displayName=`CardDescription`;var ua=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ua.displayName=`CardContent`;var da=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex items-center p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});da.displayName=`CardFooter`;var fa=p(`app.async-error-boundary.ui`),pa=class extends G.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){fa.error(`AsyncErrorBoundary caught an error`,{error:e,info:t})}handleRetry=()=>{this.setState({error:null}),this.props.onRetry?.()};render(){let{error:e}=this.state;return e?this.props.renderFallback?this.props.renderFallback(e,this.handleRetry):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(oa,{className:`max-w-md`,children:[(0,q.jsx)(sa,{children:(0,q.jsx)(ca,{className:`text-destructive`,children:this.props.fallbackTitle??`Something went wrong`})}),(0,q.jsxs)(ua,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{className:L.body,children:e.message}),(0,q.jsx)(C,{variant:`outline`,onClick:this.handleRetry,children:`Retry`})]})]})}):this.props.children}},ma=t({ConversationHistoryView:()=>Ta,default:()=>Ta}),ha=dn(e=>(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:e.v0,children:`No history`}),(0,q.jsx)(`p`,{className:e.v1,children:`No conversation history found for this thread.`})]})}),{name:`ConversationHistoryContent_1`}),ga=dn(e=>(0,q.jsxs)(`slot`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between border-b py-3 px-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.v0,e.v1]}),(0,q.jsxs)(`div`,{className:e.v2,children:[e.v3,` of `,e.v4,` messages`]})]}),e.v5]}),{name:`ConversationHistoryContent_2`,portals:[`v0`,`v1`,`v3`,`v4`,`v5`]}),_a=function(e){let t=(0,z.c)(39),{scope:n,projects:r,loadVersion:i,currentPromptIndex:o,onPromptIndexChange:s}=e,c;t[0]!==i||t[1]!==n?(c=Ca(n,i),t[0]=i,t[1]=n,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==n?(l=()=>wa(n,r),t[3]=r,t[4]=n,t[5]=l):l=t[5];let d=$i(c,l),f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=function(e){return new Date(e).toLocaleString()},t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=function(e,t){let n=new Date(e),r=new Date(t).getTime()-n.getTime();if(r<0)return{display:`0:00`,tooltip:`0 seconds`};let i=Math.floor(r/1e3),a=Math.floor(i/60),o=i%60,s=`${a}:${o.toString().padStart(2,`0`)}`,c;return c=a===0?`${o} second${o===1?``:`s`}`:o===0?`${a} minute${a===1?``:`s`}`:`${a} minute${a===1?``:`s`} ${o} second${o===1?``:`s`}`,{display:s,tooltip:c}},t[7]=m):m=t[7];let g=m,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){return{inputTokens:e.inputTokens??0,outputTokens:e.outputTokens??0}},t[8]=_):_=t[8];let v=_,y;t[9]!==o||t[10]!==d.messages||t[11]!==s?(y=function(){d.messages&&o<d.messages.length-1&&s(o+1)},t[9]=o,t[10]=d.messages,t[11]=s,t[12]=y):y=t[12];let x=y,S;t[13]!==o||t[14]!==s?(S=function(){o>0&&s(o-1)},t[13]=o,t[14]=s,t[15]=S):S=t[15];let T=S;if(!d.messages?.length){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ha,{v0:L.emptyStateTitle,v1:L.bodyMuted}),t[16]=e):e=t[16],e}let D=o===0,O;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,q.jsx)(w,{className:`h-4 w-4 mr-1`}),t[17]=O):O=t[17];let k;t[18]!==T||t[19]!==D?(k=(0,q.jsx)(C,{variant:`outline`,size:`sm`,onClick:T,disabled:D,children:O}),t[18]=T,t[19]=D,t[20]=k):k=t[20];let A=o>=d.messages.length-1,j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(b,{className:`h-4 w-4 ml-1`}),t[21]=j):j=t[21];let M;t[22]!==x||t[23]!==A?(M=(0,q.jsx)(C,{variant:`outline`,size:`sm`,onClick:x,disabled:A,children:j}),t[22]=x,t[23]=A,t[24]=M):M=t[24];let ee=o+1,te=d.messages.length,N;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,q.jsx)(ta,{children:(0,q.jsxs)(ia,{children:[(0,q.jsx)(Q,{children:`Prompt`}),(0,q.jsx)(Q,{children:`Answer`}),(0,q.jsx)(Q,{className:`w-24`,children:`Model`}),(0,q.jsx)(Q,{className:`w-24 text-right`,children:`Duration`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Input Tokens`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Output Tokens`}),(0,q.jsx)(Q,{className:`w-32 text-right`,children:`Timestamp`})]})}),t[25]=N):N=t[25];let ne;if(t[26]!==o||t[27]!==d.messages){let e;t[29]===o?e=t[30]:(e=(e,t)=>{let{inputTokens:n,outputTokens:r}=v(e);return(0,q.jsxs)(ia,{className:t===o?`bg-muted/50`:``,children:[(0,q.jsx)($,{className:`max-w-md`,children:(0,q.jsx)(`div`,{className:L.body,children:(0,q.jsx)(ba,{text:e.request.message})})}),(0,q.jsx)($,{className:`max-w-md`,children:e.response?(0,q.jsx)(`div`,{className:L.body,children:(0,q.jsx)(ba,{text:e.response.content})}):(0,q.jsx)(`span`,{className:u(L.bodyMuted,`italic`),children:`No response`})}),(0,q.jsx)($,{children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(xe,{className:`h-3 w-3 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.request.model})]})}),(0,q.jsx)($,{className:u(L.caption,`text-right`),children:e.response?(0,q.jsx)(Ce,{children:(0,q.jsxs)(h,{children:[(0,q.jsx)(a,{asChild:!0,children:(0,q.jsx)(`div`,{className:`cursor-help`,children:g(e.timestamp,e.response.completedAt).display})}),(0,q.jsx)(E,{children:(0,q.jsx)(`p`,{children:g(e.timestamp,e.response.completedAt).tooltip})})]})}):(0,q.jsx)(`span`,{className:`text-muted-foreground italic`,children:`-`})}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:n>0?n.toLocaleString():`-`}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:r>0?r.toLocaleString():`-`}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:p(e.timestamp)})]},e.id)},t[29]=o,t[30]=e),ne=d.messages.map(e),t[26]=o,t[27]=d.messages,t[28]=ne}else ne=t[28];let P;t[31]===ne?P=t[32]:(P=(0,q.jsx)(re,{className:`h-full`,children:(0,q.jsx)(`div`,{className:`py-4`,children:(0,q.jsxs)(ea,{children:[N,(0,q.jsx)(na,{children:ne})]})})}),t[31]=ne,t[32]=P);let F;return t[33]!==d.messages.length||t[34]!==k||t[35]!==M||t[36]!==ee||t[37]!==P?(F=(0,q.jsx)(ga,{v0:k,v1:M,v2:L.bodyMuted,v3:ee,v4:te,v5:P}),t[33]=d.messages.length,t[34]=k,t[35]=M,t[36]=ee,t[37]=P,t[38]=F):F=t[38],F},va=p(`app.conversation-history-view.ui`),ya=`__ALL_PROJECTS__`;function ba(e){let t=(0,z.c)(8),{text:n,maxLength:r}=e,i=r===void 0?100:r;if(n.length<=i){let e;return t[0]===n?e=t[1]:(e=(0,q.jsx)(q.Fragment,{children:n}),t[0]=n,t[1]=e),e}let a;t[2]!==i||t[3]!==n?(a=n.substring(0,i),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`span`,{className:`text-muted-foreground ml-2`,children:`...`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,q.jsxs)(q.Fragment,{children:[a,o]}),t[6]=a,t[7]=s),s}function xa(e,t){let n=`${t} - `,r=e.title??e.threadId;return r.startsWith(n)?r.slice(n.length):r}async function Sa(e){let t=[],n=new Set,r=``;for(let i of e)try{let e=await pe(i.threadId);e?.messages&&(t.push(...e.messages),e.conversationIds&&e.conversationIds.forEach(e=>n.add(e)),e.lastUpdated>r&&(r=e.lastUpdated))}catch(e){va.warn(`Failed to load history for thread ${i.threadId}:`,e)}return t.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()),{messages:t,conversationIds:Array.from(n),lastUpdated:r??new Date().toISOString()}}function Ca(e,t){return e.type===`thread`?`conversation-history:thread:${e.threadId}:${t}`:e.type===`project`?`conversation-history:project:${e.projectId}:${t}`:`conversation-history:all:${t}`}async function wa(e,t){if(e.type===`thread`)return await pe(e.threadId);if(e.type===`project`){let n=t.find(t=>t.projectId===e.projectId);if(!n||n.threads.length===0)return{threadId:e.projectId,messages:[],lastUpdated:new Date().toISOString(),conversationIds:[]};let r=await Sa(n.threads);return{threadId:e.projectId,...r}}return{threadId:ya,...await Sa(t.flatMap(e=>e.threads))}}var Ta=(0,G.memo)(function({isOpen:e,onClose:t,initialFilter:r,projects:i,inline:a}){let[o,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(0),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(null),w=(0,G.useMemo)(()=>u?{type:`thread`,threadId:u}:c===ya?{type:`all`}:c?{type:`project`,projectId:c}:null,[c,u]),T=w?Ca(w,_):null;(0,G.useEffect)(()=>{e&&r?r.type===`thread`?(d(r.id),l(``),s(0)):r.type===`project`&&(l(r.id),d(``),s(0)):e&&!r?(l(ya),d(``),s(0)):e||(d(``),l(``),s(0),S(null),b(null))},[e,r]);let E=e=>{d(e),l(``),s(0),b(null),S(null)},D=e=>{l(e),d(``),s(0),b(null),S(null)},O=(0,G.useCallback)(()=>{if(u){let e=i.flatMap(e=>e.threads).find(e=>e.threadId===u),t=i.find(e=>e.threads.some(e=>e.threadId===u)),n=e?xa(e,t?.name??t?.projectId??``):u;return{options:{threadId:u},title:`Clear Thread History`,description:`Permanently delete all conversation history for "${n}"? This cannot be undone.`}}if(c&&c!==ya){let e=i.find(e=>e.projectId===c)?.name??c;return{options:{projectId:c},title:`Clear Project History`,description:`Permanently delete all conversation history for "${e}"? This cannot be undone.`}}return{options:void 0,title:`Clear All History`,description:`Permanently delete all conversation history across every project and thread? This cannot be undone.`}},[i,c,u]),k=(0,G.useCallback)(async()=>{let e=O();g(!0),S(null);try{await ee(e.options),T&&Zi(T),b(T),s(0),m(!1)}catch(e){S(e instanceof Error?e.message:`Failed to clear conversation history`)}finally{g(!1)}},[O,T]);function A(){w&&Zi(Ca(w,_)),v(e=>e+1),b(null),S(null)}let j=O();if(!e)return null;let M=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Ii,{value:c,onValueChange:D,children:[(0,q.jsx)(Ri,{className:`w-48`,children:(0,q.jsx)(Li,{placeholder:`Select project`})}),(0,q.jsxs)(Vi,{children:[(0,q.jsx)(Ui,{value:ya,children:`All Projects`}),i.map(e=>(0,q.jsx)(Ui,{value:e.projectId,children:e.name??e.projectId},e.projectId))]})]}),(0,q.jsxs)(Ii,{value:u,onValueChange:E,children:[(0,q.jsx)(Ri,{className:`w-48`,children:(0,q.jsx)(Li,{placeholder:`Select thread`})}),(0,q.jsx)(Vi,{children:i.flatMap(e=>e.threads.map(t=>(0,q.jsx)(Ui,{value:t.threadId,children:xa(t,e.name??e.projectId)},t.threadId)))})]}),(0,q.jsxs)(C,{variant:`outline`,size:`sm`,onClick:()=>m(!0),disabled:h,children:[(0,q.jsx)(n,{className:`h-4 w-4 mr-2`}),`Clear`]})]}),te=(0,q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,q.jsx)(`div`,{className:a?void 0:`border-b px-6 py-4`,children:(0,q.jsx)(tr,{title:`History`,description:a?`View and browse conversation history across projects and threads.`:void 0,action:(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[M,a?null:(0,q.jsx)(C,{variant:`action`,size:`icon-sm`,onClick:t,children:(0,q.jsx)(f,{})})]})})}),(0,q.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:x?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,q.jsxs)(oa,{className:`max-w-md`,children:[(0,q.jsx)(sa,{children:(0,q.jsx)(ca,{className:`text-destructive`,children:`Error`})}),(0,q.jsxs)(ua,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{children:x}),(0,q.jsx)(C,{onClick:()=>S(null),children:`Dismiss`})]})]})}):y&&y===T?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:L.emptyStateTitle,children:`No history`}),(0,q.jsx)(`p`,{className:L.bodyMuted,children:`No conversation history found for this thread.`})]})}):w?(0,q.jsx)(pa,{fallbackTitle:`Failed to load conversation history`,onRetry:A,children:(0,q.jsx)(G.Suspense,{fallback:(0,q.jsx)(Gi,{label:`Loading conversation history...`,size:`lg`}),children:(0,q.jsx)(_a,{scope:w,projects:i,loadVersion:_,currentPromptIndex:o,onPromptIndexChange:s},T??void 0)})}):(0,q.jsx)(Gi,{label:`Loading conversation history...`,size:`lg`})})]});return(0,q.jsxs)(q.Fragment,{children:[a?(0,q.jsx)(sr,{children:(0,q.jsx)(nr,{className:`max-w-none w-full h-full flex flex-col min-h-0`,children:te})}):(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background`,children:te}),(0,q.jsx)(Wn,{open:p,onOpenChange:m,children:(0,q.jsxs)(qn,{children:[(0,q.jsxs)(Jn,{children:[(0,q.jsx)(Xn,{children:j.title}),(0,q.jsx)(Zn,{children:j.description})]}),(0,q.jsxs)(Yn,{children:[(0,q.jsx)($n,{disabled:h,children:`Cancel`}),(0,q.jsx)(Qn,{onClick:e=>{e.preventDefault(),k()},disabled:h,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:h?`Clearing...`:`Clear`})]})]})})]})});export{$n as A,ar as C,sr as D,nr as E,Xn as F,dn as I,Zn as M,Yn as N,Wn as O,Jn as P,tr as S,cr as T,dr as _,$i as a,ur as b,Ji as c,Ii as d,Vi as f,Li as g,Ri as h,ua as i,qn as j,Qn as k,Gi as l,Wi as m,pa as n,Zi as o,Ui as p,oa as r,Qi as s,ma as t,Ki as u,rr as v,lr as w,or as x,ir as y};
|