junhost 0.2.2 → 0.2.5
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/browser-mcp-server.js +1 -1
- package/dist/index.js +58 -59
- package/dist/mcp-server.js +11 -11
- package/package.json +1 -1
- package/ui-dist/assets/BrowserPage-BGBh4z-R.js +1 -0
- package/ui-dist/assets/DashboardPage-p5NKjE2b.js +1 -0
- package/ui-dist/assets/FilesPage-DhvtFQSF.js +64 -0
- package/ui-dist/assets/FormContext-CdQ9sDWR.js +1 -0
- package/ui-dist/assets/LogsPage-7aaauFsL.js +1 -0
- package/ui-dist/assets/McpPage-DtbL2uXL.js +1 -0
- package/ui-dist/assets/MemoriesPage-w0MWI88A.js +1 -0
- package/ui-dist/assets/{RunsPage-D0xR47tG.js → RunsPage-BNrvTKxB.js} +50 -50
- package/ui-dist/assets/SchedulesPage-BYsWhL4b.js +1 -0
- package/ui-dist/assets/SettingsPage-BVUtUDq9.js +1 -0
- package/ui-dist/assets/SkillsPage-C3SE9cvn.js +1 -0
- package/ui-dist/assets/api-DTaM-PBA.js +1 -0
- package/ui-dist/assets/architecture-7EHR7CIX-oae14Sjp.js +1 -0
- package/ui-dist/assets/{architectureDiagram-3BPJPVTR-k2gsD5OO.js → architectureDiagram-3BPJPVTR-CLvALvWH.js} +1 -1
- package/ui-dist/assets/badge-Czi0QcSt.js +1 -0
- package/ui-dist/assets/{blockDiagram-GPEHLZMM-DW56ELL9.js → blockDiagram-GPEHLZMM-agZaaW3b.js} +1 -1
- package/ui-dist/assets/button-C5SbvNQM.js +1 -0
- package/ui-dist/assets/{c4Diagram-AAUBKEIU-a19n5MC0.js → c4Diagram-AAUBKEIU-BtGNvFTN.js} +1 -1
- package/ui-dist/assets/channel-BJilWGHp.js +1 -0
- package/ui-dist/assets/checkbox-OXJcAFyD.js +1 -0
- package/ui-dist/assets/{chunk-2J33WTMH-Dq1oKvzF.js → chunk-2J33WTMH-Bz0Lx4CH.js} +1 -1
- package/ui-dist/assets/{chunk-3OPIFGDE-DOjepp5u.js → chunk-3OPIFGDE-DlqezFBL.js} +1 -1
- package/ui-dist/assets/{chunk-5ZQYHXKU-DQd7S-DN.js → chunk-5ZQYHXKU-06bRImiz.js} +1 -1
- package/ui-dist/assets/{chunk-727SXJPM-ZC51AjIP.js → chunk-727SXJPM-BACu39ui.js} +1 -1
- package/ui-dist/assets/{chunk-AQP2D5EJ-CWf39VtR.js → chunk-AQP2D5EJ-Chjw9I_j.js} +1 -1
- package/ui-dist/assets/{chunk-BO2N2NFS-HkysRQLG.js → chunk-BO2N2NFS-BH2X3sir.js} +4 -4
- package/ui-dist/assets/{chunk-CSCIHK7Q-Bbq9a-f4.js → chunk-CSCIHK7Q-cNr3wQ4T.js} +3 -3
- package/ui-dist/assets/{chunk-KSCS5N6A-BKp-kveo.js → chunk-KSCS5N6A-C0xPXGha.js} +1 -1
- package/ui-dist/assets/{chunk-L5ZTLDWV-C8BqtMre.js → chunk-L5ZTLDWV-CoUNWrar.js} +1 -1
- package/ui-dist/assets/{chunk-LZXEDZCA-Diyjko3L.js → chunk-LZXEDZCA-DPQ-Ldy1.js} +2 -2
- package/ui-dist/assets/{chunk-ND2GUHAM-BV6JTPNQ.js → chunk-ND2GUHAM-u6TfxADn.js} +1 -1
- package/ui-dist/assets/{chunk-NZK2D7GU-CB-RR-1q.js → chunk-NZK2D7GU-C1GtSkoM.js} +1 -1
- package/ui-dist/assets/{chunk-O5CBEL6O-Zyg3pbBu.js → chunk-O5CBEL6O-Di3YbCi3.js} +1 -1
- package/ui-dist/assets/{chunk-WU5MYG2G-CPYS59Yv.js → chunk-WU5MYG2G-C6fBWWCO.js} +1 -1
- package/ui-dist/assets/{circle-x-BSTd_gmE.js → circle-x-CAsSuVme.js} +1 -1
- package/ui-dist/assets/classDiagram-4FO5ZUOK-D9QMu2xp.js +1 -0
- package/ui-dist/assets/classDiagram-v2-Q7XG4LA2-D9QMu2xp.js +1 -0
- package/ui-dist/assets/collapsible-Dgd4Palj.js +1 -0
- package/ui-dist/assets/{dagre-BM42HDAG-B0nNmf3c.js → dagre-BM42HDAG-A8Y6yGN2.js} +1 -1
- package/ui-dist/assets/{diagram-2AECGRRQ-CmnP-Pwj.js → diagram-2AECGRRQ-CSy7jejs.js} +1 -1
- package/ui-dist/assets/{diagram-5GNKFQAL-DoplqwrH.js → diagram-5GNKFQAL-D00SleZk.js} +1 -1
- package/ui-dist/assets/{diagram-KO2AKTUF-C82yVEmF.js → diagram-KO2AKTUF-Bzkz5rYI.js} +1 -1
- package/ui-dist/assets/{diagram-LMA3HP47-CVf08v2e.js → diagram-LMA3HP47-C2enmWGa.js} +1 -1
- package/ui-dist/assets/{diagram-OG6HWLK6-GN7yiGuE.js → diagram-OG6HWLK6-SEm482Ky.js} +1 -1
- package/ui-dist/assets/dialog-BypJveGC.js +1 -0
- package/ui-dist/assets/{erDiagram-TEJ5UH35-1_XoHZAp.js → erDiagram-TEJ5UH35-D5-7flX_.js} +1 -1
- package/ui-dist/assets/eventmodeling-FCH6USID-Bxy3erui.js +1 -0
- package/ui-dist/assets/{external-link-DiZ5uX5z.js → external-link-DCXGJhiP.js} +1 -1
- package/ui-dist/assets/{flowDiagram-I6XJVG4X-c8jaDuzg.js → flowDiagram-I6XJVG4X-D6Kk1UFg.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-6RSMTGT7-Ck7UsWeu.js → ganttDiagram-6RSMTGT7-SvRvoSwm.js} +1 -1
- package/ui-dist/assets/{gitGraph-WXDBUCRP-sFX7u0r_.js → gitGraph-WXDBUCRP-M4xvAR7q.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-PVQCEYII-DSvNtio2.js → gitGraphDiagram-PVQCEYII-CsnXODOl.js} +1 -1
- package/ui-dist/assets/{highlighted-body-OFNGDK62-DesBT53i.js → highlighted-body-OFNGDK62-DHE0Z04J.js} +1 -1
- package/ui-dist/assets/index-BCipkFMc.js +12 -0
- package/ui-dist/assets/{index-CZzHSXB1.css → index-DEggNXsI.css} +1 -1
- package/ui-dist/assets/{info-J43DQDTF-Lf1TcbL5.js → info-J43DQDTF-DJfbaKer.js} +1 -1
- package/ui-dist/assets/{infoDiagram-5YYISTIA-CMVUnYwe.js → infoDiagram-5YYISTIA-ykgWzX2_.js} +1 -1
- package/ui-dist/assets/input-pcSINvE3.js +1 -0
- package/ui-dist/assets/{ishikawaDiagram-YF4QCWOH-8CQOcn5a.js → ishikawaDiagram-YF4QCWOH-CWlbevKa.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-JHISSGLW-CrgcWtuA.js → journeyDiagram-JHISSGLW-Co9hkrSV.js} +1 -1
- package/ui-dist/assets/{kanban-definition-UN3LZRKU-DM4XwTkG.js → kanban-definition-UN3LZRKU-BqYnrzvT.js} +1 -1
- package/ui-dist/assets/katex-DzkW7LcA.js +1 -0
- package/ui-dist/assets/{key-round-D965pLEl.js → key-round-i_iJarVP.js} +1 -1
- package/ui-dist/assets/label-Bu19spuB.js +1 -0
- package/ui-dist/assets/{line-8DyrseaS.js → line-De084cjd.js} +1 -1
- package/ui-dist/assets/mermaid-GHXKKRXX-CD13uw1J.js +1 -0
- package/ui-dist/assets/{mermaid-parser.core-BflpgWAW.js → mermaid-parser.core-BgxY7hnP.js} +2 -2
- package/ui-dist/assets/{mindmap-definition-RKZ34NQL-Bjgr9zoF.js → mindmap-definition-RKZ34NQL-LkEZGFmn.js} +1 -1
- package/ui-dist/assets/{packet-YPE3B663-BhtAK3Ll.js → packet-YPE3B663-BkDiC9SL.js} +1 -1
- package/ui-dist/assets/{pause-h76ixDr5.js → pause-DhMeMeEd.js} +1 -1
- package/ui-dist/assets/{pie-LRSECV5Y-BsSRI3VF.js → pie-LRSECV5Y-C89oa4ep.js} +1 -1
- package/ui-dist/assets/{pieDiagram-4H26LBE5-Bp52danX.js → pieDiagram-4H26LBE5-dPB1x16f.js} +1 -1
- package/ui-dist/assets/play-D3mjFMmX.js +1 -0
- package/ui-dist/assets/{quadrantDiagram-W4KKPZXB-2-HXTKYE.js → quadrantDiagram-W4KKPZXB-C_mqMlKY.js} +1 -1
- package/ui-dist/assets/{radar-GUYGQ44K-jd5iouXS.js → radar-GUYGQ44K-DTBZ6zeL.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-4Y6WPE33-BilSVdwW.js → requirementDiagram-4Y6WPE33-C02Lll9V.js} +1 -1
- package/ui-dist/assets/{rotate-cw-B1ZRM7VI.js → rotate-cw-BUTALXBe.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-5OEKKPKP-CoFgnJWS.js → sankeyDiagram-5OEKKPKP-BpCTN0fI.js} +1 -1
- package/ui-dist/assets/search-CKqhWG6h.js +1 -0
- package/ui-dist/assets/select-BPFroWD-.js +1 -0
- package/ui-dist/assets/{sequenceDiagram-3UESZ5HK-joTVEA7C.js → sequenceDiagram-3UESZ5HK-BSZzFC0b.js} +1 -1
- package/ui-dist/assets/square-COjZqkOL.js +1 -0
- package/ui-dist/assets/{stateDiagram-AJRCARHV-D79-k_XU.js → stateDiagram-AJRCARHV-sbrBtcyv.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-BHNVJYJU-Dvy9QnJ1.js +1 -0
- package/ui-dist/assets/tabs-RuXfAo0Q.js +1 -0
- package/ui-dist/assets/textarea-CwL3B5t5.js +1 -0
- package/ui-dist/assets/{timeline-definition-PNZ67QCA-D8MLBaMD.js → timeline-definition-PNZ67QCA-DerlFFtJ.js} +1 -1
- package/ui-dist/assets/{trash-2-D4CnL8wv.js → trash-2-D5W0vize.js} +1 -1
- package/ui-dist/assets/{treeView-BLDUP644-POJvg-dl.js → treeView-BLDUP644-CHplYEW1.js} +1 -1
- package/ui-dist/assets/{treemap-LRROVOQU-DS7TnyOD.js → treemap-LRROVOQU-DQciiAhX.js} +1 -1
- package/ui-dist/assets/useBaseUiId-DL38u1cQ.js +1 -0
- package/ui-dist/assets/useButton-kcIJA9wR.js +1 -0
- package/ui-dist/assets/useCompositeListItem-aicL7pEO.js +1 -0
- package/ui-dist/assets/useRegisterFieldControl-DOObtV36.js +1 -0
- package/ui-dist/assets/{vennDiagram-CIIHVFJN-D0EqM2aD.js → vennDiagram-CIIHVFJN-DItyMCJy.js} +1 -1
- package/ui-dist/assets/{wardley-L42UT6IY-ZBPaCQPM.js → wardley-L42UT6IY-rnuyIYo6.js} +1 -1
- package/ui-dist/assets/{wardleyDiagram-YWT4CUSO-CN9nmvW3.js → wardleyDiagram-YWT4CUSO-BfG0cbM-.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-2RQKCTM6-CTV-CuX-.js → xychartDiagram-2RQKCTM6-DmzunUZx.js} +1 -1
- package/ui-dist/index.html +4 -4
- package/ui-dist/assets/BrowserPage-BwT5k8-s.js +0 -1
- package/ui-dist/assets/DashboardPage-BvxkAL6I.js +0 -1
- package/ui-dist/assets/FilesPage-Br3C0Pem.js +0 -64
- package/ui-dist/assets/FormContext-6Ydu-jal.js +0 -1
- package/ui-dist/assets/LogsPage-D7DXOEb9.js +0 -1
- package/ui-dist/assets/McpPage-CecHRhqq.js +0 -1
- package/ui-dist/assets/MemoriesPage-DBq4WGnc.js +0 -1
- package/ui-dist/assets/SchedulesPage-P4MkReA9.js +0 -1
- package/ui-dist/assets/SettingsPage-DCe6V1dk.js +0 -1
- package/ui-dist/assets/SkillsPage-CbJM3z7o.js +0 -1
- package/ui-dist/assets/architecture-7EHR7CIX-D_7WJiS2.js +0 -1
- package/ui-dist/assets/badge-DjyNiZCE.js +0 -1
- package/ui-dist/assets/button-Cg-0y2B2.js +0 -1
- package/ui-dist/assets/channel-D9Lx8ecr.js +0 -1
- package/ui-dist/assets/checkbox-Bwtgo2Iq.js +0 -1
- package/ui-dist/assets/classDiagram-4FO5ZUOK-DdMTKe_j.js +0 -1
- package/ui-dist/assets/classDiagram-v2-Q7XG4LA2-DdMTKe_j.js +0 -1
- package/ui-dist/assets/collapsible-BbFbh2zH.js +0 -1
- package/ui-dist/assets/dialog-BlNguSbT.js +0 -1
- package/ui-dist/assets/eventmodeling-FCH6USID-CYsRhu9T.js +0 -1
- package/ui-dist/assets/index-73cjKBdb.js +0 -12
- package/ui-dist/assets/input-DHLFV6Sc.js +0 -1
- package/ui-dist/assets/katex-9FE8ZsoR.js +0 -1
- package/ui-dist/assets/label-CxX4-RmK.js +0 -1
- package/ui-dist/assets/mermaid-GHXKKRXX-DBJCUbG7.js +0 -1
- package/ui-dist/assets/play-B4R5rXMZ.js +0 -1
- package/ui-dist/assets/search-09Pme-NO.js +0 -1
- package/ui-dist/assets/select-D9XYqRQR.js +0 -1
- package/ui-dist/assets/square-_9cV5Fet.js +0 -1
- package/ui-dist/assets/stateDiagram-v2-BHNVJYJU-BtJOy0q4.js +0 -1
- package/ui-dist/assets/tabs-DnAM3F1s.js +0 -1
- package/ui-dist/assets/textarea-5JHEEgU-.js +0 -1
- package/ui-dist/assets/useBaseUiId-dSIElxm7.js +0 -1
- package/ui-dist/assets/useButton-DKtiRcm8.js +0 -1
- package/ui-dist/assets/useCompositeListItem-C7NilwuX.js +0 -1
- package/ui-dist/assets/useRegisterFieldControl-CbOBCC3j.js +0 -1
- package/ui-dist/assets/utils-BX1Diber.js +0 -1
package/ui-dist/index.html
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>Jun</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BCipkFMc.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-Cyuzqnbw.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-DssaXR6m.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/useBaseUiId-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/api-DTaM-PBA.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useBaseUiId-DL38u1cQ.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/react-dom-Bm-PY09n.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DEggNXsI.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{I as r,L as i,V as a,t as o}from"./utils-BX1Diber.js";import{x as s}from"./useBaseUiId-dSIElxm7.js";import{t as c}from"./pause-h76ixDr5.js";import{t as l}from"./play-B4R5rXMZ.js";import{t as u}from"./rotate-cw-B1ZRM7VI.js";import{t as d}from"./square-_9cV5Fet.js";import{Yt as f,t as p}from"./index-73cjKBdb.js";import{t as m}from"./button-Cg-0y2B2.js";import{t as h}from"./input-DHLFV6Sc.js";var ee=s(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),g=s(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),_=s(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),v=s(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),y=s(`mouse-pointer`,[[`path`,{d:`M12.586 12.586 19 19`,key:`ea5xo7`}],[`path`,{d:`M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z`,key:`277e5u`}]]),b=e(t(),1),x=n(),S={width:1280,height:720},C=[{value:`agent`,label:`Agent`,icon:_},{value:`user`,label:`You`,icon:y},{value:`paused`,label:`Paused`,icon:c}];function w(e){return!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0)}var T=[`left`,`middle`,`right`];function E(){let[e,t]=(0,b.useState)(null),[n,s]=(0,b.useState)([]),[c,_]=(0,b.useState)(``),[E,D]=(0,b.useState)(null),[O,te]=(0,b.useState)(null),[k,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(null),N=(0,b.useRef)(null),P=(0,b.useRef)(null),F=(0,b.useRef)(null),I=(0,b.useRef)(null),L=(0,b.useCallback)(()=>{let e=I.current;if(!e)return;let t=S.width/S.height,n=e.clientWidth,r=e.clientHeight;if(n===0||r===0)return;let i=n,a=n/t;a>r&&(a=r,i=r*t);let o={w:Math.floor(i),h:Math.floor(a)};te(e=>e?.w===o.w&&e?.h===o.h?e:o)},[]);(0,b.useEffect)(()=>{L();let e=new ResizeObserver(L);return I.current&&e.observe(I.current),()=>e.disconnect()},[L]);let R=(0,b.useRef)(!1),z=(0,b.useRef)(0),B=e?.streaming??!1,V=e?.running??!1,H=e?.controller??`agent`,U=H===`user`,W=(0,b.useCallback)(async()=>{try{let[{status:e},{actions:n}]=await Promise.all([r(`/api/browser/status`),r(`/api/browser/actions`)]);t(e),s(n),!R.current&&e.url&&e.url!==`about:blank`&&_(e.url),M(null)}catch(e){M(e instanceof Error?e.message:String(e))}},[]);p(W,5e3),(0,b.useEffect)(()=>{U&&F.current?.focus()},[U]),(0,b.useEffect)(()=>{if(!B){D(null);return}let e=!1,t=null,n=0,r=()=>{let i=a(`/api/browser/stream`);N.current=i,i.onmessage=e=>{try{let t=JSON.parse(String(e.data));t.type===`frame`&&t.data&&(n=0,D(`data:image/jpeg;base64,${t.data}`))}catch{}},i.onclose=()=>{if(N.current===i&&(N.current=null),e)return;let a=Math.min(1e3*2**n,1e4);n+=1,t=setTimeout(r,a)}};return r(),()=>{e=!0,t&&clearTimeout(t),N.current?.close(),N.current=null}},[B]);let G=(0,b.useCallback)(async e=>{A(!0),M(null);try{await e(),await W()}catch(e){M(e instanceof Error?e.message:String(e))}finally{A(!1)}},[W]),K=()=>G(()=>i(`/api/browser/start`,{url:c.trim()||void 0})),q=()=>G(()=>i(`/api/browser/stop`)),J=()=>{let e=c.trim();if(!e)return;let t=/^[a-z]+:\/\//i.test(e)?e:`https://${e}`;return G(()=>i(`/api/browser/navigate`,{url:t}))},Y=e=>G(()=>i(`/api/browser/${e}`)),ne=()=>G(()=>i(`/api/browser/screenshot`)),X=e=>G(()=>i(`/api/browser/control`,{controller:e})),Z=e=>{let t=N.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},re=e=>{let t=P.current;if(!t)return null;let n=t.getBoundingClientRect();return n.width===0||n.height===0?null:{x:Math.round((e.clientX-n.left)/n.width*S.width),y:Math.round((e.clientY-n.top)/n.height*S.height)}},Q=(e,t,n={})=>{if(!U)return;let r=re(e);r&&(e.preventDefault(),Z({type:`input_mouse`,eventType:t,...r,button:T[e.button]??`left`,clickCount:e.detail||1,modifiers:w(e),...n}))},ie=e=>{let t=performance.now();t-z.current<33||(z.current=t,Q(e,`mouseMoved`))},ae=e=>{let t=e.ctrlKey||e.metaKey||e.altKey;if(e.key.length===1&&!t)return null;let n=[];return e.ctrlKey&&n.push(`Control`),e.shiftKey&&n.push(`Shift`),e.altKey&&n.push(`Alt`),e.metaKey&&n.push(`Meta`),n.push(e.key===` `?`Space`:e.key),n.join(`+`)},$=(e,t)=>{if(!U)return;e.preventDefault();let n=ae(e);if(n){t===`keyDown`&&i(`/api/browser/key`,{key:n}).catch(()=>{});return}Z({type:`input_keyboard`,eventType:t,key:e.key,code:e.code,text:t===`keyDown`?e.key:void 0,modifiers:w(e)})};return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 p-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(m,{size:`icon-sm`,variant:`outline`,disabled:!V||k,onClick:()=>Y(`back`),children:(0,x.jsx)(ee,{})}),(0,x.jsx)(m,{size:`icon-sm`,variant:`outline`,disabled:!V||k,onClick:()=>Y(`forward`),children:(0,x.jsx)(g,{})}),(0,x.jsx)(m,{size:`icon-sm`,variant:`outline`,disabled:!V||k,onClick:()=>Y(`reload`),children:(0,x.jsx)(u,{})})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,x.jsx)(h,{placeholder:`https://example.com`,value:c,onChange:e=>_(e.target.value),onFocus:()=>R.current=!0,onBlur:()=>R.current=!1,onKeyDown:e=>{e.key===`Enter`&&(V?J:K)()}}),(0,x.jsx)(m,{size:`sm`,variant:`outline`,disabled:k||c.trim().length===0,onClick:()=>V?J():K(),children:`Go`})]}),(0,x.jsx)(m,{size:`icon-sm`,variant:`outline`,disabled:!V||k,onClick:ne,title:`Screenshot → workspace/screenshots`,children:(0,x.jsx)(v,{})}),(0,x.jsx)(`div`,{className:`flex items-center rounded-md border p-0.5`,children:C.map(({value:e,label:t,icon:n})=>(0,x.jsxs)(m,{size:`sm`,variant:H===e?`secondary`:`ghost`,className:`h-7 gap-1.5 px-2`,disabled:k,onClick:()=>X(e),children:[(0,x.jsx)(n,{className:`size-3.5`}),t]},e))}),V?(0,x.jsxs)(m,{size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,disabled:k,onClick:q,children:[(0,x.jsx)(d,{className:`size-3.5`}),` Stop`]}):(0,x.jsxs)(m,{size:`sm`,disabled:k,onClick:K,children:[(0,x.jsx)(l,{className:`size-3.5`}),` Start`]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:o(`inline-block size-2 rounded-full`,V?`bg-emerald-500`:`bg-neutral-300`)}),V?e?.title||e?.url||`Browser running`:`Browser stopped`,U&&V&&(0,x.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 font-medium text-primary`,children:`You have control — click the page and type`})]}),j&&(0,x.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:j}),(0,x.jsx)(`div`,{ref:I,className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,x.jsxs)(`div`,{ref:F,style:O?{width:O.w,height:O.h}:void 0,className:o(`group relative flex items-center justify-center overflow-hidden rounded-lg border bg-neutral-950/95 outline-none`,U&&`ring-2 ring-primary/60`),tabIndex:0,onMouseDown:()=>{U&&F.current?.focus()},onKeyDown:e=>$(e,`keyDown`),onKeyUp:e=>$(e,`keyUp`),children:[E?(0,x.jsx)(`img`,{ref:P,src:E,alt:`Browser viewport`,draggable:!1,className:o(`h-full w-full select-none object-contain`,U?`cursor-crosshair`:`cursor-default`),onMouseDown:e=>Q(e,`mousePressed`),onMouseUp:e=>Q(e,`mouseReleased`),onMouseMove:ie,onContextMenu:e=>U&&e.preventDefault(),onWheel:e=>Q(e,`mouseWheel`,{deltaX:e.deltaX,deltaY:e.deltaY})}):(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-sm text-neutral-400`,children:[(0,x.jsx)(f,{className:`size-8`}),V?`Waiting for viewport frames…`:`Start the browser to see the live viewport.`]}),!U&&E&&(0,x.jsx)(`div`,{className:`absolute inset-0 flex items-end justify-center pb-4 opacity-0 transition-opacity group-hover:opacity-100`,children:(0,x.jsxs)(m,{size:`sm`,className:`shadow-lg`,onClick:()=>X(`user`),children:[(0,x.jsx)(y,{className:`size-3.5`}),` Take control`]})})]})})]}),(0,x.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-l`,children:[(0,x.jsx)(`div`,{className:`border-b px-3 py-2 text-sm font-semibold`,children:`Action log`}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-1 overflow-auto p-2`,children:[n.map(e=>(0,x.jsxs)(`div`,{className:`rounded-md px-2 py-1.5 text-xs hover:bg-muted/60`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:e.kind}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()})]}),e.detail&&(0,x.jsx)(`div`,{className:`truncate text-muted-foreground`,title:e.detail,children:e.detail})]},e.id)),n.length===0&&(0,x.jsx)(`p`,{className:`px-2 py-4 text-xs text-muted-foreground`,children:`No actions yet. Start the browser or navigate somewhere.`})]})]})]})}export{E as BrowserPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{I as r,t as i}from"./utils-BX1Diber.js";import{tn as a}from"./index-73cjKBdb.js";import{t as o}from"./button-Cg-0y2B2.js";import{t as s}from"./badge-DjyNiZCE.js";var c=e(t(),1),l=n();function u({className:e,size:t=`default`,...n}){return(0,l.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:i(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function d({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`card-header`,className:i(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function f({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`card-title`,className:i(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function p({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`card-description`,className:i(`text-sm text-muted-foreground`,e),...t})}function m({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`card-content`,className:i(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function h(){let[e,t]=(0,c.useState)(null),[n,i]=(0,c.useState)(null);return(0,c.useEffect)(()=>{r(`/api/status`).then(t).catch(()=>{}),r(`/api/runs`).then(({runs:e})=>i(e.filter(e=>[`queued`,`starting`,`running`,`waiting_approval`].includes(e.status)).length)).catch(()=>{})},[]),(0,l.jsxs)(`div`,{className:`page`,children:[(0,l.jsx)(`h1`,{children:`Dashboard`}),(0,l.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[(0,l.jsxs)(u,{children:[(0,l.jsxs)(d,{children:[(0,l.jsxs)(f,{className:`flex items-center justify-between`,children:[`Daemon`,(0,l.jsx)(s,{variant:e?`default`:`destructive`,children:e?`online`:`offline`})]}),(0,l.jsx)(p,{children:`Local Jun control plane`})]}),(0,l.jsx)(m,{className:`text-sm text-muted-foreground`,children:e?(0,l.jsxs)(`p`,{className:`truncate`,title:e.workspaceRoot,children:[`project `,(0,l.jsx)(`span`,{className:`text-foreground`,children:e.projectId}),` · up `,e.uptimeSeconds,`s`]}):(0,l.jsx)(`p`,{children:`Waiting for daemon…`})})]}),(0,l.jsxs)(u,{children:[(0,l.jsxs)(d,{children:[(0,l.jsxs)(f,{className:`flex items-center justify-between`,children:[`Codex runs`,n!==null&&(0,l.jsxs)(s,{variant:n>0?`default`:`secondary`,children:[n,` active`]})]}),(0,l.jsx)(p,{children:`Agent activity in this workspace`})]}),(0,l.jsx)(m,{children:(0,l.jsx)(o,{size:`sm`,render:(0,l.jsx)(a,{to:`/runs`}),children:`Open Runs`})})]}),(0,l.jsxs)(u,{children:[(0,l.jsxs)(d,{children:[(0,l.jsx)(f,{children:`Dynamic widgets`}),(0,l.jsx)(p,{children:`JSON Render widgets arrive in Phase 7 — this grid is their home.`})]}),(0,l.jsx)(m,{children:(0,l.jsx)(o,{variant:`secondary`,size:`sm`,render:(0,l.jsx)(a,{to:`/files`}),children:`Browse workspace`})})]})]})]})}export{h as DashboardPage};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{B as r,H as i,I as a,L as o,V as s,t as c,z as l}from"./utils-BX1Diber.js";import{x as u}from"./useBaseUiId-dSIElxm7.js";import{i as d,n as f,r as p,t as m}from"./collapsible-BbFbh2zH.js";import{Xt as h,en as ee}from"./index-73cjKBdb.js";var g=u(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),_=u(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),v=e(t(),1),y=n(),b=(0,v.createContext)({expandedPaths:new Set,togglePath:()=>{}}),x=({expanded:e,defaultExpanded:t=new Set,selectedPath:n,onSelect:r,onExpandedChange:i,className:a,children:o,...s})=>{let[l,u]=(0,v.useState)(t),d=e??l,f=(0,v.useCallback)(e=>{let t=new Set(d);t.has(e)?t.delete(e):t.add(e),u(t),i?.(t)},[d,i]),p=(0,v.useMemo)(()=>({expandedPaths:d,onSelect:r,selectedPath:n,togglePath:f}),[d,r,n,f]);return(0,y.jsx)(b.Provider,{value:p,children:(0,y.jsx)(`div`,{className:c(`rounded-lg border bg-background font-mono text-sm`,a),role:`tree`,...s,children:(0,y.jsx)(`div`,{className:`p-2`,children:o})})})},S=({className:e,children:t,...n})=>(0,y.jsx)(`span`,{className:c(`shrink-0`,e),...n,children:t}),C=({className:e,children:t,...n})=>(0,y.jsx)(`span`,{className:c(`truncate`,e),...n,children:t}),w=(0,v.createContext)({isExpanded:!1,name:``,path:``}),T=({path:e,name:t,className:n,children:r,...i})=>{let{expandedPaths:a,togglePath:o,selectedPath:s,onSelect:l}=(0,v.useContext)(b),u=a.has(e),ee=s===e,g=(0,v.useCallback)(()=>{o(e)},[o,e]),x=(0,v.useCallback)(()=>{l?.(e)},[l,e]),T=(0,v.useMemo)(()=>({isExpanded:u,name:t,path:e}),[u,t,e]);return(0,y.jsx)(w.Provider,{value:T,children:(0,y.jsx)(m,{onOpenChange:g,open:u,children:(0,y.jsxs)(`div`,{className:c(``,n),role:`treeitem`,tabIndex:0,...i,children:[(0,y.jsxs)(`div`,{className:c(`flex w-full items-center gap-1 rounded px-2 py-1 text-left transition-colors hover:bg-muted/50`,ee&&`bg-muted`),children:[(0,y.jsx)(p,{className:`flex shrink-0 cursor-pointer items-center border-none bg-transparent p-0`,children:(0,y.jsx)(d,{className:c(`size-4 shrink-0 text-muted-foreground transition-transform`,u&&`rotate-90`)})}),(0,y.jsxs)(`button`,{className:`flex min-w-0 flex-1 cursor-pointer items-center gap-1 border-none bg-transparent p-0 text-left`,onClick:x,type:`button`,children:[(0,y.jsx)(S,{children:u?(0,y.jsx)(h,{className:`size-4`}):(0,y.jsx)(_,{className:`size-4`})}),(0,y.jsx)(C,{children:t})]})]}),(0,y.jsx)(f,{children:(0,y.jsx)(`div`,{className:`ml-4 border-l pl-2`,children:r})})]})})})},E=(0,v.createContext)({name:``,path:``}),D=({path:e,name:t,icon:n,className:r,children:i,...a})=>{let{selectedPath:o,onSelect:s}=(0,v.useContext)(b),l=o===e,u=(0,v.useCallback)(()=>{s?.(e)},[s,e]),d=(0,v.useCallback)(t=>{(t.key===`Enter`||t.key===` `)&&s?.(e)},[s,e]),f=(0,v.useMemo)(()=>({name:t,path:e}),[t,e]);return(0,y.jsx)(E.Provider,{value:f,children:(0,y.jsx)(`div`,{className:c(`flex cursor-pointer items-center gap-1 rounded px-2 py-1 transition-colors hover:bg-muted/50`,l&&`bg-muted`,r),onClick:u,onKeyDown:d,role:`treeitem`,tabIndex:0,...a,children:i??(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`size-4 shrink-0`}),(0,y.jsx)(S,{children:n??(0,y.jsx)(g,{className:`size-4 text-muted-foreground`})}),(0,y.jsx)(C,{children:t})]})})})};function te({root:e,selectedPath:t,expanded:n,onSelect:r,onToggle:i}){let a=new Map;return ne(e,a),(0,y.jsx)(x,{className:`ai-file-tree`,expanded:n,selectedPath:t??void 0,onExpandedChange:e=>{let t=re(n,e);t&&i(t)},onSelect:e=>{let t=a.get(e);t&&r(t)},children:(e.children??[]).map(e=>(0,y.jsx)(O,{node:e},e.path))})}function O({node:e}){return e.type===`dir`?(0,y.jsx)(T,{name:e.name,path:e.path,children:(e.children??[]).map(e=>(0,y.jsx)(O,{node:e},e.path))}):(0,y.jsx)(D,{name:e.name,path:e.path})}function ne(e,t){t.set(e.path,e);for(let n of e.children??[])ne(n,t)}function re(e,t){for(let n of t)if(!e.has(n))return n;for(let n of e)if(!t.has(n))return n;return null}function k(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=k();function ie(e){A=e}var j={exec:()=>null};function M(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function N(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(P.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ae=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:M(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:M(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:M(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:M(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:M(e=>RegExp(`^ {0,${e}}>`))},oe=/^(?:[ \t]*(?:\n|$))+/,se=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ce=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,F=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,le=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ue=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,de=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fe=N(de).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),pe=N(de).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),me=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,he=/^[^\n]+/,I=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ge=N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,I).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_e=N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ue).getRegex(),L=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,R=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ve=N(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,R).replace(`tag`,L).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye=N(me).replace(`hr`,F).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,L).getRegex(),z={blockquote:N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ye).getRegex(),code:se,def:ge,fences:ce,heading:le,hr:F,html:ve,lheading:fe,list:_e,newline:oe,paragraph:ye,table:j,text:he},be=N(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,F).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,L).getRegex(),xe={...z,lheading:pe,table:be,paragraph:N(me).replace(`hr`,F).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,be).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,L).getRegex()},Se={...z,html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,R).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(me).replace(`hr`,F).replace(`heading`,` *#{1,6} *[^
|
|
2
|
-
]`).replace(`lheading`,fe).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ce=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,we=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Te=/^( {2,}|\\)\n(?!\s*$)/,Ee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,V=/[\s\p{P}\p{S}]/u,De=/[^\s\p{P}\p{S}]/u,Oe=N(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V).getRegex(),ke=/(?!~)[\p{P}\p{S}]/u,Ae=/(?!~)[\s\p{P}\p{S}]/u,je=/(?:[^\s\p{P}\p{S}]|~)/u,Me=N(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ae?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ne=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Pe=N(Ne,`u`).replace(/punct/g,B).getRegex(),Fe=N(Ne,`u`).replace(/punct/g,ke).getRegex(),Ie=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Le=N(Ie,`gu`).replace(/notPunctSpace/g,De).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Re=N(Ie,`gu`).replace(/notPunctSpace/g,je).replace(/punctSpace/g,Ae).replace(/punct/g,ke).getRegex(),ze=N(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,De).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Be=N(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B).getRegex(),Ve=N(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,De).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),He=N(/\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),Ue=N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),We=N(R).replace(`(?:-->|$)`,`-->`).getRegex(),Ge=N(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,We).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),H=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ke=N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,H).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qe=N(/^!?\[(label)\]\[(ref)\]/).replace(`label`,H).replace(`ref`,I).getRegex(),Je=N(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,I).getRegex(),Ye=N(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,qe).replace(`nolink`,Je).getRegex(),Xe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ze={_backpedal:j,anyPunctuation:He,autolink:Ue,blockSkip:Me,br:Te,code:we,del:j,delLDelim:j,delRDelim:j,emStrongLDelim:Pe,emStrongRDelimAst:Le,emStrongRDelimUnd:ze,escape:Ce,link:Ke,nolink:Je,punctuation:Oe,reflink:qe,reflinkSearch:Ye,tag:Ge,text:Ee,url:j},Qe={...Ze,link:N(/^!?\[(label)\]\((.*?)\)/).replace(`label`,H).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,H).getRegex()},$e={...Ze,emStrongRDelimAst:Re,emStrongLDelim:Fe,delLDelim:Be,delRDelim:Ve,url:N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Xe).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:N(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Xe).getRegex()},et={...$e,br:N(Te).replace(`{2,}`,`*`).getRegex(),text:N($e.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},U={normal:z,gfm:xe,pedantic:Se},W={normal:Ze,gfm:$e,breaks:et,pedantic:Qe},tt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},nt=e=>tt[e];function G(e,t){if(t){if(P.escapeTest.test(e))return e.replace(P.escapeReplace,nt)}else if(P.escapeTestNoEncode.test(e))return e.replace(P.escapeReplaceNoEncode,nt);return e}function rt(e){try{e=encodeURI(e).replace(P.percentDecode,`%`)}catch{return null}return e}function it(e,t){let n=e.replace(P.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(P.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(P.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function at(e){let t=e.split(`
|
|
3
|
-
`),n=t.length-1;for(;n>=0&&P.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
4
|
-
`)}function ot(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function st(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ct(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function lt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
5
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
6
|
-
`)}var q=class{options;rules;lexer;constructor(e){this.options=e||A}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:at(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=lt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:K(t[0],`
|
|
7
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
|
|
8
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
|
|
9
|
-
`).split(`
|
|
10
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
11
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
13
|
-
${s}`:s,r=r?`${r}
|
|
14
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
15
|
-
`+e.join(`
|
|
16
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
17
|
-
`+e.join(`
|
|
18
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
19
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=st(t[2].split(`
|
|
20
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
21
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
22
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
23
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
24
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
25
|
-
`+l}u=!l.trim(),r+=p+`
|
|
26
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=at(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:K(t[0],`
|
|
27
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=it(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
28
|
-
`):[],a={type:`table`,raw:K(t[0],`
|
|
29
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(it(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:K(t[0],`
|
|
30
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
31
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=K(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ot(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ct(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ct(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},J=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:P,block:U.normal,inline:W.normal};this.options.pedantic?(t.block=U.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=U.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}static get rules(){return{block:U,inline:W}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(P.carriageReturn,`
|
|
32
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(P.tabCharGlobal,` `).replace(P.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
33
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
34
|
-
`)?``:`
|
|
35
|
-
`)+i.raw,n.text+=`
|
|
36
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
37
|
-
`)?``:`
|
|
38
|
-
`)+i.raw,n.text+=`
|
|
39
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
40
|
-
`)?``:`
|
|
41
|
-
`)+i.raw,r.text+=`
|
|
42
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
43
|
-
`)?``:`
|
|
44
|
-
`)+i.raw,n.text+=`
|
|
45
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Y=class{options;parser;constructor(e){this.options=e||A}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(P.notSpaceStart)?.[0],i=e.replace(P.endingNewline,``)+`
|
|
46
|
-
`;return r?`<pre><code class="language-`+G(r)+`">`+(n?i:G(i,!0))+`</code></pre>
|
|
47
|
-
`:`<pre><code>`+(n?i:G(i,!0))+`</code></pre>
|
|
48
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
49
|
-
${this.parser.parse(e)}</blockquote>
|
|
50
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
51
|
-
`}hr(e){return`<hr>
|
|
52
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
53
|
-
`+r+`</`+i+`>
|
|
54
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
55
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
56
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
57
|
-
<thead>
|
|
58
|
-
`+t+`</thead>
|
|
59
|
-
`+r+`</table>
|
|
60
|
-
`}tablerow({text:e}){return`<tr>
|
|
61
|
-
${e}</tr>
|
|
62
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
63
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=rt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+G(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=rt(e);if(i===null)return G(n);e=i;let a=`<img src="${e}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},ut=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new Y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ut}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Z=class{options;block;constructor(e){this.options=e||A}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?J.lex:J.lexInline}provideParser(e=this.block){return e?X.parse:X.parseInline}},Q=new class{defaults=k();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=Y;TextRenderer=ut;Lexer=J;Tokenizer=q;Hooks=Z;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Y(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new q(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Z;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Z.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return J.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?J.lex:J.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?X.parse:X.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?J.lex:J.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?X.parse:X.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
64
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,ie($.defaults),$},$.getDefaults=k,$.defaults=A,$.use=function(...e){return Q.use(...e),$.defaults=Q.defaults,ie($.defaults),$},$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=X,$.parser=X.parse,$.Renderer=Y,$.TextRenderer=ut,$.Lexer=J,$.lexer=J.lex,$.Tokenizer=q,$.Hooks=Z,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,X.parse,J.lex;function dt({file:e}){return e.kind===`image`?(0,y.jsx)(`div`,{className:`preview-pane`,children:(0,y.jsx)(`img`,{className:`preview-image`,src:r(e.path),alt:e.path})}):e.kind===`binary`?(0,y.jsx)(`div`,{className:`preview-pane`,children:(0,y.jsxs)(`p`,{className:`page-hint`,children:[`Binary file (`,e.size,` bytes).`,` `,(0,y.jsx)(`a`,{href:r(e.path),children:`Download`})]})}):e.kind===`markdown`?(0,y.jsx)(ft,{content:e.content??``}):e.kind===`json`?(0,y.jsx)(pt,{content:e.content??``}):(0,y.jsx)(`div`,{className:`preview-pane`,children:(0,y.jsx)(`pre`,{className:`code-block`,children:e.content??``})})}function ft({content:e}){return(0,y.jsx)(`div`,{className:`preview-pane markdown-body`,dangerouslySetInnerHTML:{__html:(0,v.useMemo)(()=>$.parse(e,{async:!1}),[e])}})}function pt({content:e}){return(0,y.jsx)(`div`,{className:`preview-pane`,children:(0,y.jsx)(`pre`,{className:`code-block`,children:(0,v.useMemo)(()=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},[e])})})}function mt(){let{activeProjectId:e}=ee(),[t,n]=(0,v.useState)(null),[c,u]=(0,v.useState)(new Set),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(``),[_,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(`edit`),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(null),D=(0,v.useRef)(null),O=(0,v.useCallback)(async()=>{try{n(await a(i(`/api/files/tree`,e))),w(null)}catch(e){w(e instanceof Error?e.message:String(e))}},[e]);(0,v.useEffect)(()=>{O()},[O]),(0,v.useEffect)(()=>{f(null),m(null),u(new Set)},[e]),(0,v.useEffect)(()=>{let e=s(`/api/files/watch`),t=null;return e.onmessage=()=>{t&&clearTimeout(t),t=setTimeout(O,400)},()=>{t&&clearTimeout(t),e.close()}},[O]);let ne=(0,v.useCallback)(async t=>{if(f(t),E(null),t.type!==`file`){m(null);return}try{let n=await a(i(`/api/files/read?path=${encodeURIComponent(t.path)}`,e));m(n),g(n.content??``),b(!1),S(n.kind===`markdown`||n.kind===`json`?`preview`:`edit`),w(null)}catch(e){m(null),w(e instanceof Error?e.message:String(e))}},[e]),re=(0,v.useCallback)(e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),k=()=>{if(!d)return`.`;if(d.type===`dir`)return d.path;let e=d.path.lastIndexOf(`/`);return e===-1?`.`:d.path.slice(0,e)},A=async(e,t)=>{try{await e(),w(null),t&&E(t),await O()}catch(e){w(e instanceof Error?e.message:String(e))}},ie=()=>{let t=window.prompt(`New file name (relative to selected folder):`);if(!t)return;let n=ht(k(),t);A(()=>o(i(`/api/files/write`,e),{path:n,content:``}),`Created ${n}`)},j=()=>{let t=window.prompt(`New folder name:`);if(!t)return;let n=ht(k(),t);A(()=>o(i(`/api/files/mkdir`,e),{path:n}),`Created ${n}/`)},M=()=>{if(!d)return;let t=window.prompt(`New path:`,d.path);if(!t||t===d.path)return;let n=d.path;A(async()=>{await o(i(`/api/files/rename`,e),{from:n,to:t}),f(null),m(null)},`Renamed to ${t}`)},N=()=>{if(!d||!window.confirm(`Delete ${d.path}? This cannot be undone.`))return;let t=d.path;A(async()=>{await o(i(`/api/files/delete`,e),{path:t}),f(null),m(null)},`Deleted ${t}`)},ae=t=>{if(!t||t.length===0)return;let n=new FormData;n.set(`path`,k());for(let e of Array.from(t))n.append(`file`,e);A(()=>l(i(`/api/files/upload`,e),n),`Uploaded ${t.length} file(s)`)},P=()=>{p&&A(async()=>{await o(i(`/api/files/write`,e),{path:p.path,content:h}),m({...p,content:h}),b(!1)},`Saved ${p.path}`)},oe=p&&p.kind!==`image`&&p.kind!==`binary`;return(0,y.jsxs)(`div`,{className:`files-page`,children:[(0,y.jsxs)(`aside`,{className:`files-sidebar`,children:[(0,y.jsxs)(`div`,{className:`files-toolbar`,children:[(0,y.jsx)(`button`,{onClick:ie,children:`+ File`}),(0,y.jsx)(`button`,{onClick:j,children:`+ Folder`}),(0,y.jsx)(`button`,{onClick:()=>D.current?.click(),children:`Upload`}),(0,y.jsx)(`button`,{onClick:O,children:`Refresh`}),(0,y.jsx)(`input`,{ref:D,type:`file`,multiple:!0,hidden:!0,onChange:e=>{ae(e.target.files),e.target.value=``}})]}),t?(0,y.jsx)(te,{root:t,selectedPath:d?.path??null,expanded:c,onSelect:ne,onToggle:re}):(0,y.jsx)(`p`,{className:`page-hint`,children:`Loading workspace…`})]}),(0,y.jsxs)(`section`,{className:`files-content`,children:[C&&(0,y.jsx)(`div`,{className:`banner error`,children:C}),T&&!C&&(0,y.jsx)(`div`,{className:`banner notice`,children:T}),d?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`files-header`,children:[(0,y.jsxs)(`span`,{className:`files-path`,title:d.path,children:[d.path,_?` •`:``]}),(0,y.jsxs)(`div`,{className:`files-actions`,children:[oe&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{className:x===`edit`?`active`:``,onClick:()=>S(`edit`),children:`Edit`}),(0,y.jsx)(`button`,{className:x===`preview`?`active`:``,onClick:()=>S(`preview`),children:`Preview`}),(0,y.jsx)(`button`,{disabled:!_,onClick:P,children:`Save`})]}),d.type===`file`&&(0,y.jsx)(`a`,{className:`button-link`,href:r(d.path,e),children:`Download`}),(0,y.jsx)(`button`,{onClick:M,children:`Rename`}),(0,y.jsx)(`button`,{className:`danger`,onClick:N,children:`Delete`})]})]}),d.type===`dir`?(0,y.jsx)(`p`,{className:`page-hint`,children:`Folder selected. New files, folders, and uploads land here.`}):p?x===`edit`&&oe?(0,y.jsx)(`textarea`,{className:`file-editor`,value:h,spellCheck:!1,onChange:e=>{g(e.target.value),b(!0)}}):(0,y.jsx)(dt,{file:_?{...p,content:h}:p}):(0,y.jsx)(`p`,{className:`page-hint`,children:`Loading file…`})]}):(0,y.jsx)(`p`,{className:`page-hint`,children:`Select a file from the workspace tree to view or edit it.`})]})]})}function ht(e,t){let n=t.replace(/^[/\\]+/,``);return e===`.`?n:`${e}/${n}`}export{mt as FilesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t}from"./bundle-mjs-DssaXR6m.js";import{f as n}from"./utils-BX1Diber.js";import{x as r}from"./useBaseUiId-dSIElxm7.js";var i=r(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),a=e(t()),o=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:n,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function s(){return a.useContext(o)}export{i as n,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{I as r,V as i}from"./utils-BX1Diber.js";import{x as a}from"./useBaseUiId-dSIElxm7.js";import{t as o}from"./pause-h76ixDr5.js";import{t as s}from"./play-B4R5rXMZ.js";import{t as c}from"./trash-2-D4CnL8wv.js";import{t as l}from"./button-Cg-0y2B2.js";import{t as u}from"./input-DHLFV6Sc.js";var d=a(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),f=e(t(),1),p=n(),m=2e3,h=[{key:`all`,label:`All`},{key:`warn`,label:`Warnings`},{key:`error`,label:`Errors`}],g={info:0,warn:1,error:2},_={info:`var(--muted-foreground)`,warn:`oklch(0.62 0.17 75)`,error:`oklch(0.58 0.22 27)`};function v(){let[e,t]=(0,f.useState)([]),[n,a]=(0,f.useState)(`all`),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(!0),[S,C]=(0,f.useState)(!1),w=(0,f.useRef)(null),T=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=!0,n=null,a=null;r(`/api/logs?limit=1000`).then(n=>e&&t(n.logs)).catch(()=>{});let o=()=>{n=i(`/api/logs/stream`),n.onopen=()=>e&&C(!0),n.onclose=()=>{e&&(C(!1),a=setTimeout(o,1500))},n.onmessage=e=>{try{let n=JSON.parse(e.data);t(e=>{if(e.length&&e[e.length-1].seq>=n.seq)return e;let t=[...e,n];return t.length>m?t.slice(-2e3):t})}catch{}}};return o(),()=>{e=!1,a&&clearTimeout(a),n?.close()}},[]);let E=(0,f.useMemo)(()=>{let t=n===`all`?0:g[n],r=v.trim().toLowerCase();return e.filter(e=>g[e.level]>=t&&(!r||e.text.toLowerCase().includes(r)))},[e,n,v]);return(0,f.useEffect)(()=>{b&&w.current?.scrollIntoView({block:`end`})},[E,b]),(0,p.jsxs)(`div`,{className:`flex h-full flex-col gap-3 p-6`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h1`,{className:`mr-2 text-lg font-semibold`,children:`Logs`}),(0,p.jsx)(`div`,{className:`flex items-center gap-1 rounded-md border p-0.5`,style:{borderColor:`var(--border)`},children:h.map(e=>(0,p.jsx)(`button`,{onClick:()=>a(e.key),className:`rounded px-2 py-1 text-xs`,style:{background:n===e.key?`var(--primary)`:`transparent`,color:n===e.key?`var(--primary-foreground)`:`var(--muted-foreground)`},children:e.label},e.key))}),(0,p.jsx)(u,{value:v,onChange:e=>y(e.target.value),placeholder:`Filter…`,className:`h-8 w-48`}),(0,p.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-xs`,style:{color:`var(--muted-foreground)`},children:[(0,p.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:S?`oklch(0.7 0.17 145)`:`var(--muted-foreground)`}}),S?`live`:`reconnecting…`,` · `,E.length,` lines`]}),(0,p.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>x(e=>!e),children:[b?(0,p.jsx)(o,{className:`size-4`}):(0,p.jsx)(s,{className:`size-4`}),b?`Pause scroll`:`Resume`]}),(0,p.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>{w.current?.scrollIntoView({block:`end`}),x(!0)},children:[(0,p.jsx)(d,{className:`size-4`}),` Bottom`]}),(0,p.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>t([]),children:[(0,p.jsx)(c,{className:`size-4`}),` Clear`]})]}),(0,p.jsx)(`div`,{ref:T,onScroll:()=>{let e=T.current;e&&x(e.scrollHeight-e.scrollTop-e.clientHeight<40)},className:`min-h-0 flex-1 overflow-auto rounded-md border font-mono text-xs leading-relaxed`,style:{borderColor:`var(--border)`,background:`var(--card)`},children:E.length===0?(0,p.jsxs)(`div`,{className:`p-4`,style:{color:`var(--muted-foreground)`},children:[`No log lines`,v||n!==`all`?` match the filter`:` yet`,`.`]}):(0,p.jsxs)(`div`,{className:`p-2`,children:[E.map(e=>(0,p.jsxs)(`div`,{className:`flex gap-2 whitespace-pre-wrap break-words px-1 py-0.5`,children:[(0,p.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:e.ts.slice(11,23)}),(0,p.jsx)(`span`,{style:{color:_[e.level],minWidth:`2.6rem`},children:e.level}),(0,p.jsx)(`span`,{style:{color:e.level===`error`?_.error:`var(--foreground)`},children:e.text})]},e.seq)),(0,p.jsx)(`div`,{ref:w})]})})]})}export{v as LogsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{F as r,I as i,L as a,R as o,t as s}from"./utils-BX1Diber.js";import{x as c}from"./useBaseUiId-dSIElxm7.js";import{i as l,n as u,r as d,t as f}from"./collapsible-BbFbh2zH.js";import{t as p}from"./circle-x-BSTd_gmE.js";import{t as m}from"./key-round-D965pLEl.js";import{a as h,i as g,n as _,r as v,t as y}from"./tabs-DnAM3F1s.js";import{E as b}from"./useCompositeListItem-C7NilwuX.js";import{t as x}from"./rotate-cw-B1ZRM7VI.js";import{t as S}from"./trash-2-D4CnL8wv.js";import{a as C,i as w,o as T,r as E,s as D,t as O}from"./dialog-BlNguSbT.js";import{qt as k}from"./index-73cjKBdb.js";import{t as A}from"./button-Cg-0y2B2.js";import{t as j}from"./input-DHLFV6Sc.js";import{t as M}from"./badge-DjyNiZCE.js";import{t as N}from"./label-CxX4-RmK.js";import{t as P}from"./textarea-5JHEEgU-.js";var F=c(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),I=c(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),L=e(t(),1),R=n();function z({server:e}){if(!e.enabled)return(0,R.jsx)(M,{variant:`outline`,children:`disabled`});switch(e.startupState){case`ready`:return(0,R.jsxs)(M,{variant:`secondary`,className:`gap-1`,children:[(0,R.jsx)(F,{className:`size-3 text-emerald-600`}),` ready`]});case`starting`:return(0,R.jsxs)(M,{variant:`secondary`,className:`gap-1`,children:[(0,R.jsx)(h,{className:`size-3 animate-spin`}),` starting`]});case`failed`:case`cancelled`:return(0,R.jsxs)(M,{variant:`outline`,className:`gap-1 text-destructive`,children:[(0,R.jsx)(p,{className:`size-3`}),` `,e.startupState]});default:return(0,R.jsxs)(M,{variant:`outline`,className:`gap-1`,children:[(0,R.jsx)(I,{className:`size-3`}),` not connected`]})}}function B(){let[e,t]=(0,L.useState)([]),[n,c]=(0,L.useState)(``),[p,h]=(0,L.useState)(!1),[C,w]=(0,L.useState)(null),[T,E]=(0,L.useState)(!1),[D,O]=(0,L.useState)(null),[j,N]=(0,L.useState)(!1),F=(0,L.useCallback)(async()=>{try{let[{servers:e},{toml:n}]=await Promise.all([i(`/api/mcp`),i(`/api/mcp/config`)]);t(e),p||c(n),w(null)}catch(e){w(e instanceof Error?e.message:String(e))}},[p]);(0,L.useEffect)(()=>{F()},[F]);let I=(0,L.useCallback)(async e=>{E(!0),w(null);try{await e(),await F()}catch(e){w(e instanceof Error?e.message:String(e))}finally{E(!1)}},[F]),B=()=>I(()=>a(`/api/mcp/reload`)),H=()=>I(async()=>{await o(`/api/mcp/config`,{toml:n}),h(!1),await a(`/api/mcp/reload`)}),U=e=>I(async()=>{await a(`/api/mcp/servers/${e.name}/enable`,{enabled:!e.enabled}),await a(`/api/mcp/reload`)}),W=e=>I(async()=>{window.confirm(`Remove MCP server "${e}"?`)&&(await r(`/api/mcp/servers/${e}`),await a(`/api/mcp/reload`))});return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`h1`,{className:`text-base font-semibold`,children:`MCP servers`}),(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,R.jsxs)(A,{size:`sm`,variant:`outline`,onClick:B,disabled:T,children:[(0,R.jsx)(x,{className:`size-3.5`}),` Reload`]}),(0,R.jsxs)(A,{size:`sm`,onClick:()=>N(!0),disabled:T,children:[(0,R.jsx)(b,{className:`size-3.5`}),` Add server`]})]})]}),C&&(0,R.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:C}),(0,R.jsxs)(y,{defaultValue:`servers`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(v,{children:[(0,R.jsx)(g,{value:`servers`,children:`Servers`}),(0,R.jsx)(g,{value:`toml`,children:`config.toml`})]}),(0,R.jsx)(_,{value:`servers`,className:`min-h-0 flex-1 overflow-auto pt-2`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.map(e=>(0,R.jsx)(`div`,{className:`rounded-lg border bg-card`,children:(0,R.jsxs)(f,{open:D===e.name,onOpenChange:t=>O(t?e.name:null),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 p-3`,children:[(0,R.jsx)(k,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,R.jsx)(z,{server:e}),e.tools.length>0&&(0,R.jsxs)(M,{variant:`outline`,children:[e.tools.length,` tools`]}),e.authStatus===`notLoggedIn`&&(0,R.jsxs)(M,{variant:`outline`,className:`gap-1`,children:[(0,R.jsx)(m,{className:`size-3`}),` login required`]})]}),(0,R.jsx)(`code`,{className:`block truncate text-xs text-muted-foreground`,children:e.url??[e.command,...e.args??[]].join(` `)}),e.envKeys&&e.envKeys.length>0&&(0,R.jsxs)(`div`,{className:`text-xs text-muted-foreground/70`,children:[`env: `,e.envKeys.map(e=>`${e}=••••`).join(` `)]})]}),(0,R.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>U(e),disabled:T,children:e.enabled?`Disable`:`Enable`}),(0,R.jsx)(A,{size:`icon-sm`,variant:`ghost`,className:`text-destructive hover:text-destructive`,onClick:()=>W(e.name),disabled:T,children:(0,R.jsx)(S,{})}),e.tools.length>0&&(0,R.jsx)(d,{className:`flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted`,children:(0,R.jsx)(l,{className:s(`size-4 transition-transform`,D===e.name&&`rotate-90`)})})]}),(0,R.jsx)(u,{children:(0,R.jsx)(`div`,{className:`grid gap-1 border-t p-3 sm:grid-cols-2`,children:e.tools.map(e=>(0,R.jsxs)(`div`,{className:`rounded-md bg-muted/40 px-2 py-1.5`,children:[(0,R.jsx)(`code`,{className:`text-xs font-medium`,children:e.name}),e.description&&(0,R.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:e.description,children:e.description})]},e.name))})})]})},e.name)),e.length===0&&(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-12 text-center text-sm text-muted-foreground`,children:[(0,R.jsx)(k,{className:`size-8`}),`No MCP servers configured. Add one to give Codex extra tools.`]})]})}),(0,R.jsxs)(_,{value:`toml`,className:`flex min-h-0 flex-1 flex-col gap-2 pt-2`,children:[(0,R.jsx)(P,{value:n,spellCheck:!1,className:`min-h-0 flex-1 resize-none font-mono text-sm`,onChange:e=>{c(e.target.value),h(!0)}}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(A,{size:`sm`,onClick:H,disabled:!p||T,children:T?`Saving…`:`Save & reload`}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing here preserves your comments; structured edits reformat the file.`})]})]})]}),(0,R.jsx)(V,{open:j,onOpenChange:N,onAdded:()=>I(()=>a(`/api/mcp/reload`))})]})}function V({open:e,onOpenChange:t,onAdded:n}){let[r,i]=(0,L.useState)(``),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(``),[f,p]=(0,L.useState)(null),[m,h]=(0,L.useState)(!1);return(0,R.jsx)(O,{open:e,onOpenChange:t,children:(0,R.jsxs)(E,{children:[(0,R.jsxs)(T,{children:[(0,R.jsx)(D,{children:`Add MCP server`}),(0,R.jsxs)(w,{children:[`A stdio command server (e.g. `,(0,R.jsx)(`code`,{children:`npx -y @scope/pkg`}),`). For URL or advanced transports, use the config.toml tab.`]})]}),f&&(0,R.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:f}),(0,R.jsxs)(`div`,{className:`grid gap-3`,children:[(0,R.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,R.jsx)(N,{htmlFor:`mcp-name`,children:`Name`}),(0,R.jsx)(j,{id:`mcp-name`,value:r,placeholder:`context7`,onChange:e=>i(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,R.jsx)(N,{htmlFor:`mcp-command`,children:`Command`}),(0,R.jsx)(j,{id:`mcp-command`,value:o,placeholder:`npx`,onChange:e=>s(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,R.jsx)(N,{htmlFor:`mcp-args`,children:`Args (space-separated)`}),(0,R.jsx)(j,{id:`mcp-args`,value:c,placeholder:`-y @upstash/context7-mcp`,onChange:e=>l(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,R.jsx)(N,{htmlFor:`mcp-env`,children:`Env (KEY=value per line)`}),(0,R.jsx)(P,{id:`mcp-env`,value:u,rows:3,placeholder:`API_KEY=sk-…`,onChange:e=>d(e.target.value)})]})]}),(0,R.jsxs)(C,{children:[(0,R.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,R.jsx)(A,{onClick:async()=>{h(!0),p(null);try{let e={};for(let t of u.split(/\r?\n/)){let n=t.indexOf(`=`);n>0&&(e[t.slice(0,n).trim()]=t.slice(n+1).trim())}await a(`/api/mcp/servers`,{name:r.trim(),command:o.trim()||void 0,args:c.trim()?c.trim().split(/\s+/):void 0,env:Object.keys(e).length>0?e:void 0}),t(!1),i(``),s(``),l(``),d(``),n()}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}},disabled:m||r.trim().length===0||o.trim().length===0,children:m?`Adding…`:`Add & reload`})]})]})})}export{B as McpPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{F as r,I as i,R as a,t as o}from"./utils-BX1Diber.js";import{t as s}from"./checkbox-Bwtgo2Iq.js";import{t as c}from"./rotate-cw-B1ZRM7VI.js";import{t as l}from"./trash-2-D4CnL8wv.js";import{Qt as u}from"./index-73cjKBdb.js";import{t as d}from"./button-Cg-0y2B2.js";import{t as f}from"./input-DHLFV6Sc.js";import{t as p}from"./badge-DjyNiZCE.js";import{t as m}from"./label-CxX4-RmK.js";import{t as h}from"./textarea-5JHEEgU-.js";var g=e(t(),1),_=n();function v(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function y(){let[e,t]=(0,g.useState)(null),[n,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(null),[w,T]=(0,g.useState)(``),[E,D]=(0,g.useState)(!1),[O,k]=(0,g.useState)(``),A=(0,g.useCallback)(async()=>{try{let e=await i(`/api/memories`);t(e),k(e.settings.minRateLimitRemainingPercent===void 0?``:String(e.settings.minRateLimitRemainingPercent)),y(null)}catch(e){y(e instanceof Error?e.message:String(e))}},[]);(0,g.useEffect)(()=>{A()},[A]);let j=(0,g.useCallback)(async e=>{x(!0),y(null);try{await e(),await A()}catch(e){y(e instanceof Error?e.message:String(e))}finally{x(!1)}},[A]),M=()=>j(()=>a(`/api/memories/config`,{enabled:!e?.enabled})),N=e=>j(()=>a(`/api/memories/config`,{settings:e})),P=()=>{let e=Number(O);if(!Number.isFinite(e)||e<0||e>100){y(`Rate-limit threshold must be a number between 0 and 100`);return}N({minRateLimitRemainingPercent:e})},F=e=>j(async()=>{let t=await i(`/api/memories/file?path=${encodeURIComponent(e.path)}`);C(t.path),T(t.content),D(!1)}),I=()=>j(async()=>{S&&(await a(`/api/memories/file`,{path:S,content:w}),D(!1))}),L=e=>j(async()=>{window.confirm(`Delete memory file "${e}"?`)&&(await r(`/api/memories/file?path=${encodeURIComponent(e)}`),S===e&&(C(null),T(``),D(!1)))}),R=e?.enabled??!1,z=e?.settings??{},B=e?.files??[];return(0,_.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 p-4`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`h1`,{className:`text-base font-semibold`,children:`Memories`}),(0,_.jsx)(p,{variant:`outline`,children:`beta`}),e&&e.liveEnabled!==null&&e.liveEnabled!==R&&(0,_.jsx)(p,{variant:`outline`,className:`text-amber-600`,children:`engine state differs — restart pending`}),(0,_.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,_.jsxs)(d,{size:`sm`,variant:`outline`,onClick:()=>A(),disabled:b,children:[(0,_.jsx)(c,{className:`size-3.5`}),` Refresh`]}),(0,_.jsx)(d,{size:`sm`,onClick:M,disabled:b||!e,children:R?`Disable`:`Enable`})]})]}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Codex turns useful context from past sessions into local memory files and brings them into new conversations. Memories are global across workspaces (they live in the shared Codex home) and are generated in the background — new files can take a while to appear.`}),n&&(0,_.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:n}),(0,_.jsxs)(`div`,{className:o(`flex flex-col gap-3`,!R&&`opacity-60`),children:[(0,_.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,_.jsx)(`div`,{className:`mb-2 text-sm font-medium`,children:`Behavior`}),(0,_.jsxs)(`div`,{className:`grid gap-2`,children:[(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(s,{checked:z.generateMemories!==!1,disabled:b||!R,onCheckedChange:e=>N({generateMemories:e===!0})}),`Generate memories from new sessions`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(s,{checked:z.useMemories!==!1,disabled:b||!R,onCheckedChange:e=>N({useMemories:e===!0})}),`Use existing memories in new sessions`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(s,{checked:z.disableOnExternalContext===!0,disabled:b||!R,onCheckedChange:e=>N({disableOnExternalContext:e===!0})}),`Skip sessions that used external context (MCP tools, web search)`]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(m,{htmlFor:`mem-rate`,className:`font-normal`,children:`Pause generation below`}),(0,_.jsx)(f,{id:`mem-rate`,type:`number`,min:0,max:100,placeholder:`25`,className:`h-7 w-20`,value:O,disabled:b||!R,onChange:e=>k(e.target.value),onBlur:()=>{O!==``&&P()},onKeyDown:e=>{e.key===`Enter`&&O!==``&&P()}}),(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:`% rate limit remaining`})]})]}),(0,_.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:`Behavior settings are read by the engine at startup; the on/off toggle applies immediately.`})]}),(0,_.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-3`,children:[(0,_.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-1 overflow-auto`,children:[(0,_.jsxs)(`div`,{className:`text-sm font-medium`,children:[`Memory files`,B.length>0&&` (${B.length})`]}),B.map(e=>(0,_.jsxs)(`div`,{className:o(`group flex cursor-pointer items-center gap-2 rounded-md border px-2 py-1.5`,S===e.path?`border-foreground/30 bg-muted/60`:`bg-card hover:bg-muted/40`),onClick:()=>F(e),children:[(0,_.jsx)(u,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`truncate text-sm`,title:e.path,children:e.path}),(0,_.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[v(e.size),` · `,new Date(e.modifiedAt).toLocaleString()]})]}),(0,_.jsx)(d,{size:`icon-sm`,variant:`ghost`,className:`invisible text-destructive hover:text-destructive group-hover:visible`,disabled:b,onClick:t=>{t.stopPropagation(),L(e.path)},children:(0,_.jsx)(l,{})})]},e.path)),B.length===0&&(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-muted-foreground`,children:[(0,_.jsx)(u,{className:`size-8`}),R?`No memories yet. Codex builds them in the background from finished sessions.`:`Enable memories to let Codex remember context across sessions.`]})]}),(0,_.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2`,children:S?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`code`,{className:`truncate text-xs text-muted-foreground`,children:S}),(0,_.jsx)(d,{size:`sm`,className:`ml-auto`,onClick:I,disabled:!E||b,children:b?`Saving…`:`Save`})]}),(0,_.jsx)(h,{value:w,spellCheck:!1,className:`min-h-0 flex-1 resize-none font-mono text-sm`,onChange:e=>{T(e.target.value),D(!0)}})]}):(0,_.jsx)(`div`,{className:`flex flex-1 items-center justify-center rounded-lg border border-dashed text-sm text-muted-foreground`,children:`Select a memory file to inspect or edit it`})})]})]})]})}export{y as MemoriesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{F as r,H as i,I as a,L as o,R as s,t as c}from"./utils-BX1Diber.js";import{a as l,i as u,n as d,r as f,t as p}from"./select-D9XYqRQR.js";import{t as m}from"./checkbox-Bwtgo2Iq.js";import{t as h}from"./play-B4R5rXMZ.js";import{E as g}from"./useCompositeListItem-C7NilwuX.js";import{t as _}from"./rotate-cw-B1ZRM7VI.js";import{t as v}from"./trash-2-D4CnL8wv.js";import{Zt as y,en as b}from"./index-73cjKBdb.js";import{t as x}from"./button-Cg-0y2B2.js";import{t as S}from"./input-DHLFV6Sc.js";import{t as C}from"./badge-DjyNiZCE.js";import{t as w}from"./label-CxX4-RmK.js";import{t as T}from"./textarea-5JHEEgU-.js";var E=e(t(),1),D=n(),O={unattended:{label:`Unattended`,hint:`A Codex subagent approves for you · workspace-write (recommended for 24/7)`,mode:{sandbox:`workspaceWrite`,approvalPolicy:`onRequest`,approvalsReviewer:`auto_review`}},all:{label:`Allow everything`,hint:`⚠ No approvals + full disk/network access. Use with care.`,mode:{sandbox:`dangerFullAccess`,approvalPolicy:`never`,approvalsReviewer:`user`}}};function k(e){for(let t of Object.keys(O)){let n=O[t].mode;if(e.sandbox===n.sandbox&&e.approvalPolicy===n.approvalPolicy&&e.approvalsReviewer===n.approvalsReviewer)return t}return`unattended`}var A=[{label:`Every hour`,cron:`0 * * * *`},{label:`Daily 9am`,cron:`0 9 * * *`},{label:`Weekdays 9am`,cron:`0 9 * * 1-5`},{label:`Mondays 8am`,cron:`0 8 * * 1`},{label:`1st of month`,cron:`0 9 1 * *`}];function j(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function M(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}var N=Intl.DateTimeFormat().resolvedOptions().timeZone;function P(){return{name:``,prompt:``,kind:`cron`,cron:`0 9 * * *`,runAtLocal:``,tz:N,modeKey:`unattended`,model:``,effort:``,resume:!1,enabled:!0}}function F(e){return{name:e.name,prompt:e.prompt,kind:e.kind,cron:e.cron??`0 9 * * *`,runAtLocal:j(e.runAt),tz:e.tz??``,modeKey:k(e.mode),model:e.mode.model??``,effort:e.mode.effort??``,resume:e.resume??!1,enabled:e.enabled}}function I(){let{activeProjectId:e,activeProject:t}=b(),[n,k]=(0,E.useState)([]),[j,I]=(0,E.useState)([]),[L,R]=(0,E.useState)(null),[z,B]=(0,E.useState)(!1),[V,H]=(0,E.useState)(P),[U,W]=(0,E.useState)(null),[G,K]=(0,E.useState)(!1),q=(0,E.useCallback)(async()=>{try{let{schedules:t}=await a(i(`/api/schedules`,e));k(t),W(null)}catch(e){W(e instanceof Error?e.message:String(e))}},[e]);(0,E.useEffect)(()=>{q()},[q]),(0,E.useEffect)(()=>{a(`/api/models`).then(({models:e})=>I(e)).catch(()=>{})},[]),(0,E.useEffect)(()=>{R(null),B(!1)},[e]);let J=()=>{R(null),B(!0),H(P()),W(null)},ee=e=>{R(e.id),B(!1),H(F(e)),W(null)},Y=(0,E.useCallback)(async e=>{K(!0),W(null);try{await e(),await q()}catch(e){W(e instanceof Error?e.message:String(e))}finally{K(!1)}},[q]),te=()=>{let t=O[V.modeKey].mode;return{name:V.name,prompt:V.prompt,projectId:e,kind:V.kind,cron:V.kind===`cron`?V.cron:void 0,runAt:V.kind===`once`&&V.runAtLocal?new Date(V.runAtLocal).toISOString():void 0,tz:V.tz||void 0,mode:{...t,model:V.model||void 0,effort:V.effort||void 0},resume:V.resume,enabled:V.enabled}},ne=()=>{if(!V.name.trim()){W(`Name is required`);return}if(!V.prompt.trim()){W(`Prompt is required`);return}Y(async()=>{let t=te();if(z){let{schedule:n}=await o(i(`/api/schedules`,e),t);R(n.id),B(!1),H(F(n))}else if(L){let{schedule:e}=await s(`/api/schedules/${L}`,t);H(F(e))}})},re=e=>Y(()=>s(`/api/schedules/${e.id}`,{enabled:!e.enabled})),X=e=>Y(()=>o(`/api/schedules/${e.id}/run`)),ie=e=>Y(async()=>{window.confirm(`Delete schedule "${e.name}"?`)&&(await r(`/api/schedules/${e.id}`),L===e.id&&(R(null),B(!1)))}),Z=(0,E.useMemo)(()=>n.find(e=>e.id===L)??null,[n,L]),ae=z||Z!==null,Q=j.find(e=>e.model===V.model),oe=Q?.supportedReasoningEfforts??[],$=(e,t)=>H(n=>({...n,[e]:t}));return(0,D.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 p-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`h1`,{className:`text-base font-semibold`,children:`Schedules`}),(0,D.jsx)(C,{variant:`outline`,children:t?.name??e}),(0,D.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,D.jsxs)(x,{size:`sm`,variant:`outline`,onClick:()=>q(),disabled:G,children:[(0,D.jsx)(_,{className:`size-3.5`}),` Refresh`]}),(0,D.jsxs)(x,{size:`sm`,onClick:J,disabled:G,children:[(0,D.jsx)(g,{className:`size-3.5`}),` New schedule`]})]})]}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run a prompt automatically on a cron schedule or once at a set time. Scheduled runs fire in the background and appear in the Runs page — they default to Unattended mode so approvals don't block while no one is watching.`}),U&&(0,D.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:U}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex w-80 shrink-0 flex-col gap-1 overflow-auto`,children:[n.map(e=>(0,D.jsxs)(`div`,{className:c(`group flex cursor-pointer items-start gap-2 rounded-md border px-2 py-2`,L===e.id?`border-foreground/30 bg-muted/60`:`bg-card hover:bg-muted/40`),onClick:()=>ee(e),children:[(0,D.jsx)(y,{className:c(`mt-0.5 size-4 shrink-0`,e.enabled?`text-foreground`:`text-muted-foreground`)}),(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),!e.enabled&&(0,D.jsx)(C,{variant:`outline`,className:`text-muted-foreground`,children:`paused`})]}),(0,D.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.kind===`cron`?(0,D.jsx)(`code`,{children:e.cron}):`once · ${M(e.runAt)}`}),(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.enabled?`next: ${M(e.nextRunAt)}`:`paused`}),e.lastError&&(0,D.jsxs)(`div`,{className:`truncate text-xs text-destructive`,title:e.lastError,children:[`last error: `,e.lastError]})]}),(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-1`,children:[(0,D.jsx)(x,{size:`icon-sm`,variant:`ghost`,title:`Run now`,disabled:G,onClick:t=>{t.stopPropagation(),X(e)},children:(0,D.jsx)(h,{})}),(0,D.jsx)(x,{size:`icon-sm`,variant:`ghost`,className:`text-destructive hover:text-destructive`,title:`Delete`,disabled:G,onClick:t=>{t.stopPropagation(),ie(e)},children:(0,D.jsx)(v,{})})]})]},e.id)),n.length===0&&(0,D.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-muted-foreground`,children:[(0,D.jsx)(y,{className:`size-8`}),`No schedules in this workspace yet. Create one to run a prompt on a timer.`]})]}),(0,D.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-auto`,children:ae?(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border bg-card p-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-sm font-medium`,children:z?`New schedule`:`Edit schedule`}),Z&&(0,D.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,D.jsxs)(x,{size:`sm`,variant:`outline`,onClick:()=>X(Z),disabled:G,children:[(0,D.jsx)(h,{className:`size-3.5`}),` Run now`]}),(0,D.jsx)(x,{size:`sm`,variant:`outline`,onClick:()=>re(Z),disabled:G,children:Z.enabled?`Pause`:`Resume`})]})]}),(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,D.jsx)(w,{htmlFor:`sch-name`,children:`Name`}),(0,D.jsx)(S,{id:`sch-name`,value:V.name,placeholder:`Morning report`,onChange:e=>$(`name`,e.target.value)})]}),(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,D.jsx)(w,{htmlFor:`sch-prompt`,children:`Prompt`}),(0,D.jsx)(T,{id:`sch-prompt`,value:V.prompt,placeholder:`What should the agent do each time?`,className:`min-h-24 resize-y font-mono text-sm`,onChange:e=>$(`prompt`,e.target.value)})]}),(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,D.jsx)(w,{children:`When`}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsxs)(p,{value:V.kind,onValueChange:e=>$(`kind`,e??`cron`),children:[(0,D.jsx)(u,{size:`sm`,className:`w-32`,children:(0,D.jsx)(l,{children:V.kind===`cron`?`Repeating`:`One-off`})}),(0,D.jsxs)(d,{children:[(0,D.jsx)(f,{value:`cron`,children:`Repeating (cron)`}),(0,D.jsx)(f,{value:`once`,children:`One-off`})]})]}),V.kind===`cron`?(0,D.jsx)(S,{value:V.cron,placeholder:`0 9 * * *`,className:`w-44 font-mono`,onChange:e=>$(`cron`,e.target.value)}):(0,D.jsx)(S,{type:`datetime-local`,value:V.runAtLocal,className:`w-56`,onChange:e=>$(`runAtLocal`,e.target.value)})]}),V.kind===`cron`&&(0,D.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:A.map(e=>(0,D.jsx)(x,{size:`sm`,variant:`outline`,className:`h-6 text-xs`,onClick:()=>$(`cron`,e.cron),children:e.label},e.cron))}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(w,{htmlFor:`sch-tz`,className:`font-normal text-muted-foreground`,children:`Timezone`}),(0,D.jsx)(S,{id:`sch-tz`,value:V.tz,placeholder:N,className:`h-7 w-56`,onChange:e=>$(`tz`,e.target.value)})]}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Cron fields: minute hour day-of-month month day-of-week. Times are evaluated in the timezone above (defaults to the daemon's local time if blank).`})]}),(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,D.jsx)(w,{children:`Run mode`}),(0,D.jsxs)(p,{value:V.modeKey,onValueChange:e=>$(`modeKey`,e??`unattended`),children:[(0,D.jsx)(u,{size:`sm`,className:`w-full`,children:(0,D.jsx)(l,{children:O[V.modeKey].label})}),(0,D.jsx)(d,{children:Object.keys(O).map(e=>(0,D.jsx)(f,{value:e,children:(0,D.jsxs)(`span`,{className:`channel-mode-item`,children:[(0,D.jsx)(`span`,{className:`channel-mode-label`,children:O[e].label}),(0,D.jsx)(`span`,{className:`channel-mode-hint`,children:O[e].hint})]})},e))})]})]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,D.jsxs)(`div`,{className:`grid flex-1 gap-1.5`,children:[(0,D.jsx)(w,{children:`Model`}),(0,D.jsxs)(p,{value:V.model||`__default`,onValueChange:e=>$(`model`,e===`__default`?``:e??``),children:[(0,D.jsx)(u,{size:`sm`,className:`w-full`,children:(0,D.jsx)(l,{children:Q?.displayName??`Engine default`})}),(0,D.jsxs)(d,{children:[(0,D.jsx)(f,{value:`__default`,children:`Engine default`}),j.map(e=>(0,D.jsxs)(f,{value:e.model,children:[e.displayName,e.isDefault?` · default`:``]},e.id))]})]})]}),(0,D.jsxs)(`div`,{className:`grid flex-1 gap-1.5`,children:[(0,D.jsx)(w,{children:`Reasoning effort`}),(0,D.jsxs)(p,{value:V.effort||`__default`,onValueChange:e=>$(`effort`,e===`__default`?``:e??``),children:[(0,D.jsx)(u,{size:`sm`,className:`w-full`,children:(0,D.jsx)(l,{children:V.effort||`Default (medium)`})}),(0,D.jsxs)(d,{children:[(0,D.jsx)(f,{value:`__default`,children:`Default (medium)`}),oe.map(e=>(0,D.jsx)(f,{value:e.reasoningEffort,children:e.reasoningEffort},e.reasoningEffort))]})]})]})]}),(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(m,{checked:V.resume,onCheckedChange:e=>$(`resume`,e===!0)}),`Resume one persistent conversation each fire (context accumulates across runs)`]}),(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(m,{checked:V.enabled,onCheckedChange:e=>$(`enabled`,e===!0)}),`Enabled`]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(x,{onClick:ne,disabled:G,children:G?`Saving…`:z?`Create schedule`:`Save changes`}),(0,D.jsx)(x,{variant:`ghost`,onClick:()=>{B(!1),R(null)},disabled:G,children:`Cancel`})]}),Z&&(0,D.jsxs)(`div`,{className:`mt-1 grid gap-0.5 border-t pt-2 text-xs text-muted-foreground`,children:[(0,D.jsxs)(`div`,{children:[`Next run: `,M(Z.nextRunAt)]}),(0,D.jsxs)(`div`,{children:[`Last run: `,M(Z.lastRunAt)]}),Z.lastRunId&&(0,D.jsxs)(`div`,{children:[`Last run id: `,Z.lastRunId]}),Z.lastError&&(0,D.jsxs)(`div`,{className:`text-destructive`,children:[`Last error: `,Z.lastError]})]})]}):(0,D.jsx)(`div`,{className:`flex flex-1 items-center justify-center rounded-lg border border-dashed text-sm text-muted-foreground`,children:`Select a schedule to edit, or create a new one.`})})]})]})}export{I as SchedulesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{I as r,L as i,R as a}from"./utils-BX1Diber.js";import{x as o}from"./useBaseUiId-dSIElxm7.js";import{t as s}from"./external-link-DiZ5uX5z.js";import{t as c}from"./key-round-D965pLEl.js";import{t as l}from"./rotate-cw-B1ZRM7VI.js";import{Yt as u}from"./index-73cjKBdb.js";import{t as d}from"./button-Cg-0y2B2.js";import{t as f}from"./input-DHLFV6Sc.js";import{t as p}from"./badge-DjyNiZCE.js";var m=o(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),h=o(`monitor-smartphone`,[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]),g=o(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),_=e(t(),1),v=n(),y=2e3;function b(){let[e,t]=(0,_.useState)(null),[n,o]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(!1),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(!1),O=(0,_.useRef)(null),[k,A]=(0,_.useState)(null),[j,M]=(0,_.useState)(``),[N,P]=(0,_.useState)(``),[F,I]=(0,_.useState)(!1),[L,R]=(0,_.useState)(!1),z=(0,_.useCallback)(async()=>{try{let e=await r(`/api/account`);return o(e),x(null),e}catch(e){return x(e instanceof Error?e.message:String(e)),null}},[]);(0,_.useEffect)(()=>{r(`/api/status`).then(t).catch(()=>{}),r(`/api/settings`).then(e=>{A(e),P(e.browserProxy.noProxy??``)}).catch(()=>{}),z()},[z]);let B=(0,_.useCallback)(async e=>{I(!0),x(null);try{let t=await a(`/api/settings/browser-proxy`,e);A(t),M(``),P(t.browserProxy.noProxy??``),R(!0)}catch(e){x(e instanceof Error?e.message:String(e))}finally{I(!1)}},[]),V=()=>{let e={noProxy:N.trim()||null};return j.trim()&&(e.proxyUrl=j.trim()),B(e)},H=()=>B({proxyUrl:null,noProxy:null}),U=async()=>{I(!0),x(null);try{await i(`/api/browser/stop`),await i(`/api/browser/start`),R(!1)}catch(e){x(e instanceof Error?e.message:String(e))}finally{I(!1)}};(0,_.useEffect)(()=>{if(!n?.pendingLogin){O.current!==null&&(window.clearInterval(O.current),O.current=null);return}if(O.current===null)return O.current=window.setInterval(z,y),()=>{O.current!==null&&(window.clearInterval(O.current),O.current=null)}},[n?.pendingLogin,z]);let W=(0,_.useCallback)(async e=>{C(!0),x(null);try{o(await e())}catch(e){x(e instanceof Error?e.message:String(e))}finally{C(!1)}},[]),G=()=>W(async()=>{let e=await i(`/api/account/login`,{type:`chatgpt`});return e.pendingLogin?.authUrl&&window.open(e.pendingLogin.authUrl,`_blank`,`noopener`),e}),K=()=>W(()=>i(`/api/account/login`,{type:`chatgptDeviceCode`})),q=()=>W(async()=>{let e=await i(`/api/account/login`,{type:`apiKey`,apiKey:w.trim()});return T(``),D(!1),e}),J=()=>W(()=>i(`/api/account/login/cancel`)),Y=()=>W(()=>i(`/api/account/logout`)),X=n?.pendingLogin??null,Z=n?.lastLoginResult??null;return(0,v.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 overflow-auto p-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`h1`,{className:`text-base font-semibold`,children:`Settings`}),(0,v.jsx)(`div`,{className:`ml-auto`,children:(0,v.jsxs)(d,{size:`sm`,variant:`outline`,onClick:()=>z(),disabled:S,children:[(0,v.jsx)(l,{className:`size-3.5`}),` Refresh`]})})]}),b&&(0,v.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:b}),(0,v.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,v.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Codex account`}),(0,v.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[`The engine's sign-in — shared by every workspace. Auth is stored in the Jun Codex home, separate from your personal `,(0,v.jsx)(`code`,{children:`~/.codex`}),`.`]}),n?n.account?(0,v.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,v.jsx)(g,{className:`size-4 text-muted-foreground`}),n.account.type===`chatgpt`?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`text-sm`,children:n.account.email}),(0,v.jsxs)(p,{variant:`outline`,children:[`ChatGPT · `,n.account.planType]})]}):n.account.type===`apiKey`?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`text-sm`,children:`Signed in with an OpenAI API key`}),(0,v.jsx)(p,{variant:`outline`,children:`API key`})]}):(0,v.jsx)(p,{variant:`outline`,children:`Amazon Bedrock`}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,className:`ml-auto`,onClick:Y,disabled:S,children:[(0,v.jsx)(m,{className:`size-3.5`}),` Sign out`]})]}):X?(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[X.type===`chatgpt`?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`p`,{className:`text-sm`,children:`Finish signing in to ChatGPT in the browser tab that just opened.`}),X.authUrl&&(0,v.jsxs)(`a`,{href:X.authUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground underline underline-offset-2`,children:[`Open the sign-in page again `,(0,v.jsx)(s,{className:`size-3.5`})]}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The sign-in callback lands on this machine — if Jun runs on a remote server, cancel and use the device code instead.`})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`p`,{className:`text-sm`,children:[`Sign in at`,` `,X.verificationUrl?(0,v.jsx)(`a`,{href:X.verificationUrl,target:`_blank`,rel:`noopener noreferrer`,className:`underline underline-offset-2`,children:X.verificationUrl}):`the verification page`,` `,`and enter this code:`]}),(0,v.jsx)(`div`,{className:`w-fit rounded-md border bg-muted/40 px-4 py-2 font-mono text-xl tracking-widest`,children:X.userCode})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Waiting for sign-in…`}),(0,v.jsx)(d,{size:`sm`,variant:`outline`,onClick:J,disabled:S,children:`Cancel`})]})]}):(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Z&&!Z.success&&(0,v.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[`Sign-in failed`,Z.error?`: ${Z.error}`:`.`]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsxs)(d,{size:`sm`,onClick:K,disabled:S,children:[(0,v.jsx)(h,{className:`size-3.5`}),` Sign in with ChatGPT`]}),(0,v.jsx)(d,{size:`sm`,variant:`outline`,onClick:G,disabled:S,children:`Browser sign-in (local only)`}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,onClick:()=>D(e=>!e),disabled:S,children:[(0,v.jsx)(c,{className:`size-3.5`}),` Use an API key`]})]}),E&&(0,v.jsxs)(`div`,{className:`flex max-w-md items-center gap-2`,children:[(0,v.jsx)(f,{type:`password`,placeholder:`sk-…`,value:w,autoComplete:`off`,onChange:e=>T(e.target.value),onKeyDown:e=>{e.key===`Enter`&&w.trim()&&q()}}),(0,v.jsx)(d,{size:`sm`,onClick:q,disabled:S||!w.trim(),children:`Sign in`})]}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sign-in uses a device code: open the link on any device, enter the code — works headless (VPS). Browser sign-in needs its callback to reach this machine, so use it only when Jun runs locally.`})]}):(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,v.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-sm font-medium`,children:[(0,v.jsx)(u,{className:`size-4 text-muted-foreground`}),` Browser proxy`]}),(0,v.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Routes the agent browser through a proxy (e.g. a residential exit when the host IP is datacenter space sites block). Browser traffic only — Codex API traffic is never proxied. Applies when the browser session (re)starts.`}),k?(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(`div`,{className:`flex items-center gap-2 text-sm`,children:k.browserProxy.proxyUrl?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`code`,{className:`rounded bg-muted/40 px-2 py-1 text-xs`,children:k.browserProxy.proxyUrl}),(0,v.jsx)(p,{variant:`outline`,children:k.browserProxy.source===`settings`?`from settings`:`from environment`}),k.browserProxy.source===`settings`&&(0,v.jsx)(d,{size:`sm`,variant:`outline`,onClick:H,disabled:F,children:`Clear`})]}):(0,v.jsx)(`span`,{className:`text-muted-foreground`,children:`No proxy configured — the browser uses the host connection directly.`})}),(0,v.jsxs)(`div`,{className:`flex max-w-xl flex-col gap-2`,children:[(0,v.jsx)(f,{type:`password`,placeholder:k.browserProxy.proxyUrl?`Replace proxy URL: http://user:pass@host:port`:`http://user:pass@host:port`,value:j,autoComplete:`off`,onChange:e=>M(e.target.value)}),(0,v.jsx)(f,{placeholder:`Bypass list (optional), e.g. localhost,*.internal`,value:N,onChange:e=>P(e.target.value)}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(d,{size:`sm`,onClick:V,disabled:F||!j.trim()&&(N.trim()||``)===(k.browserProxy.noProxy??``),children:`Save`}),L&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Saved — restart the browser session to apply.`}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,onClick:U,disabled:F,children:[(0,v.jsx)(l,{className:`size-3.5`}),` Restart browser`]})]})]})]})]}):(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,v.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`Daemon status`}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,disabled:S,onClick:()=>{r(`/api/status?refresh=1`).then(t).catch(()=>{})},children:[(0,v.jsx)(l,{className:`size-3.5`}),` Check for updates`]})]}),e?(0,v.jsx)(`pre`,{className:`overflow-auto rounded-md bg-muted/40 p-2 text-xs`,children:JSON.stringify(e,null,2)}):(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`})]})]})}export{b as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{F as ee,H as r,I as i,L as a,R as te,t as ne}from"./utils-BX1Diber.js";import{x as o}from"./useBaseUiId-dSIElxm7.js";import{t as re}from"./external-link-DiZ5uX5z.js";import{a as s,i as c,n as l,r as ie,t as ae}from"./tabs-DnAM3F1s.js";import{E as oe}from"./useCompositeListItem-C7NilwuX.js";import{t as se}from"./search-09Pme-NO.js";import{t as ce}from"./trash-2-D4CnL8wv.js";import{a as le,i as u,o as d,r as ue,s as f,t as p}from"./dialog-BlNguSbT.js";import{$t as m,en as de,tn as fe}from"./index-73cjKBdb.js";import{t as h}from"./button-Cg-0y2B2.js";import{t as g}from"./input-DHLFV6Sc.js";import{t as _}from"./badge-DjyNiZCE.js";import{t as v}from"./label-CxX4-RmK.js";import{t as y}from"./textarea-5JHEEgU-.js";var pe=o(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),me=o(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),he=o(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),ge=o(`store`,[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]),b=e(t(),1),x=n();function S({className:e,...t}){return(0,x.jsx)(s,{role:`status`,"aria-label":`Loading`,className:ne(`size-4 animate-spin`,e),...t})}function _e(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(e.replace(/^/,``));if(!t)return{name:``,description:``,body:e,ok:!1};let n={};for(let e of t[1].split(/\r?\n/)){let t=/^([A-Za-z_][\w-]*):\s*(.*)$/.exec(e);t&&(n[t[1].toLowerCase()]=t[2].trim().replace(/^["']|["']$/g,``))}return{name:n.name??``,description:n.description??``,body:t[2].replace(/^\r?\n/,``),ok:!0}}function C(e,t,n){return`---\nname: ${e}\ndescription: ${t}\n---\n\n${n.trim()}\n`}function w(){let{activeProjectId:e,activeProject:t}=de(),[n,o]=(0,b.useState)([]),[s,w]=(0,b.useState)(null),[T,E]=(0,b.useState)(null),[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(!1),[N,P]=(0,b.useState)(!1),[F,I]=(0,b.useState)(null),[ve,L]=(0,b.useState)(!1),[R,z]=(0,b.useState)(``),[B,V]=(0,b.useState)(``),[H,ye]=(0,b.useState)(``),[be,U]=(0,b.useState)(null),[W,G]=(0,b.useState)(!1),[xe,Se]=(0,b.useState)(!1),[K,Ce]=(0,b.useState)(``),[we,Te]=(0,b.useState)([]),[q,Ee]=(0,b.useState)(!1),[De,Oe]=(0,b.useState)(!1),[ke,J]=(0,b.useState)(null),[Y,Ae]=(0,b.useState)(null),[je,Me]=(0,b.useState)(new Set),X=(0,b.useCallback)(async()=>{try{let{skills:t}=await i(r(`/api/skills`,e));o(t),I(null)}catch(e){I(e instanceof Error?e.message:String(e))}},[e]);(0,b.useEffect)(()=>{X()},[X]),(0,b.useEffect)(()=>{w(null),E(null)},[e]);let Z=(0,b.useCallback)(async t=>{w(t),E(null),U(null),M(!0);try{let{skill:n}=await i(r(`/api/skills/${t}`,e));E(n),O(n.content),A(!1)}catch(e){I(e instanceof Error?e.message:String(e))}finally{M(!1)}},[e]),Q=(0,b.useMemo)(()=>_e(D),[D]),Ne=async()=>{if(!(!s||N)){P(!0),I(null);try{let{skill:t}=await te(r(`/api/skills/${s}`,e),{content:D});E(t),O(t.content),A(!1),await X()}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}},Pe=async()=>{let t=R.trim(),n=B.trim();if(!(!t||!n)){I(null);try{let{skill:ee}=await a(r(`/api/skills`,e),{name:t,description:n});L(!1),z(``),V(``),await X(),await Z(ee.info.id)}catch(e){I(e instanceof Error?e.message:String(e))}}},Fe=async()=>{if(s&&window.confirm(`Delete skill "${s}"? This removes its folder.`))try{await ee(r(`/api/skills/${s}`,e)),w(null),E(null),await X()}catch(e){I(e instanceof Error?e.message:String(e))}},Ie=async()=>{if(!(!s||!T))try{await a(r(`/api/skills/${s}/enable`,e),{enabled:!T.info.enabled}),await X(),await Z(s)}catch(e){I(e instanceof Error?e.message:String(e))}},Le=async()=>{if(!(!s||W)){G(!0),U(null),I(null);try{let{run:t}=await a(r(`/api/skills/${s}/test`,e),{prompt:H.trim()||void 0});U(t)}catch(e){I(e instanceof Error?e.message:String(e))}finally{G(!1)}}},Re=async()=>{let e=K.trim();if(!(!e||q)){Ee(!0),J(null);try{let{results:t}=await i(`/api/skills/registry/search?q=${encodeURIComponent(e)}`);Te(t),Oe(!0)}catch(e){J(e instanceof Error?e.message:String(e))}finally{Ee(!1)}}},ze=async t=>{if(!Y){Ae(t),J(null);try{let n=await a(r(`/api/skills/registry/install`,e),{source:t});Me(e=>new Set(e).add(t)),o(n.skills)}catch(e){J(e instanceof Error?e.message:String(e))}finally{Ae(null)}}},$=(e,t)=>{O(e===`description`?C(Q.name||s||``,t,Q.body):C(Q.name||s||``,Q.description,t)),A(!0)};return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,x.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-r`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2`,children:[(0,x.jsx)(`span`,{className:`text-sm font-semibold`,children:`Skills`}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsxs)(h,{size:`sm`,variant:`outline`,onClick:()=>Se(!0),children:[(0,x.jsx)(ge,{className:`size-3.5`}),` Browse`]}),(0,x.jsx)(h,{size:`icon-sm`,variant:`outline`,onClick:()=>L(!0),children:(0,x.jsx)(oe,{})})]})]}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[n.map(e=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>Z(e.id),className:ne(`w-full rounded-md px-2.5 py-2 text-left transition-colors hover:bg-muted/60`,e.id===s&&`bg-muted`),children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),e.errors.length>0&&(0,x.jsx)(pe,{className:`size-3.5 shrink-0 text-destructive`}),!e.enabled&&(0,x.jsx)(_,{variant:`outline`,className:`shrink-0`,children:`disabled`})]}),(0,x.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.description||`No description`})]},e.id)),n.length===0&&(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-muted-foreground`,children:[(0,x.jsx)(m,{className:`size-8`}),`No skills in the `,t?.name??e,` workspace yet. Create one — it becomes a folder with a SKILL.md, available to runs in this workspace.`]})]})]}),(0,x.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col gap-3 p-4`,children:[F&&(0,x.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:F}),!s&&(0,x.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,x.jsx)(m,{className:`size-8`}),`Select a skill or create a new one.`]}),s&&j&&(0,x.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,x.jsx)(S,{})}),s&&T&&!j&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(`h2`,{className:`text-base font-semibold`,children:T.info.name}),(0,x.jsx)(_,{variant:T.info.enabled?`secondary`:`outline`,children:T.info.enabled?`enabled`:`disabled`}),(0,x.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,x.jsx)(h,{size:`sm`,variant:`outline`,onClick:Ie,children:T.info.enabled?`Disable`:`Enable`}),(0,x.jsxs)(h,{size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:Fe,children:[(0,x.jsx)(ce,{className:`size-3.5`}),` Delete`]}),(0,x.jsx)(h,{size:`sm`,onClick:Ne,disabled:!k||N,children:N?`Saving…`:k?`Save`:`Saved`})]})]}),T.info.errors.length>0&&(0,x.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:T.info.errors.map(e=>(0,x.jsx)(`div`,{children:e},e))}),(0,x.jsxs)(ae,{defaultValue:Q.ok?`simple`:`advanced`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,x.jsxs)(ie,{children:[(0,x.jsx)(c,{value:`simple`,disabled:!Q.ok,children:`Simple`}),(0,x.jsx)(c,{value:`advanced`,children:`Advanced`}),(0,x.jsxs)(c,{value:`test`,children:[(0,x.jsx)(he,{className:`size-3.5`}),` Test`]})]}),(0,x.jsxs)(l,{value:`simple`,className:`flex min-h-0 flex-1 flex-col gap-3 pt-2`,children:[(0,x.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,x.jsx)(v,{htmlFor:`skill-description`,children:`Description`}),(0,x.jsx)(g,{id:`skill-description`,value:Q.description,placeholder:`When should Codex reach for this skill?`,onChange:e=>$(`description`,e.target.value)}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Codex reads this to decide when the skill applies.`})]}),(0,x.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-1.5`,children:[(0,x.jsx)(v,{htmlFor:`skill-instructions`,children:`Instructions`}),(0,x.jsx)(y,{id:`skill-instructions`,value:Q.body,placeholder:`Step-by-step instructions for Codex…`,className:`min-h-0 flex-1 resize-none font-mono text-sm`,onChange:e=>$(`body`,e.target.value)})]})]}),(0,x.jsxs)(l,{value:`advanced`,className:`flex min-h-0 flex-1 flex-col gap-2 pt-2`,children:[(0,x.jsx)(y,{value:D,className:`min-h-0 flex-1 resize-none font-mono text-sm`,onChange:e=>{O(e.target.value),A(!0)}}),T.files.length>0&&(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Extra files: `,T.files.join(`, `),` (edit via the Files page)`]})]}),(0,x.jsxs)(l,{value:`test`,className:`flex flex-col gap-3 pt-2`,children:[(0,x.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,x.jsx)(v,{htmlFor:`test-prompt`,children:`Test prompt`}),(0,x.jsx)(y,{id:`test-prompt`,value:H,rows:3,placeholder:`Leave empty for a default prompt that exercises "${T.info.name}".`,onChange:e=>ye(e.target.value)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,x.jsx)(h,{size:`sm`,onClick:Le,disabled:W,children:W?`Starting…`:`Run test with Codex`}),be&&(0,x.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Test run started —`,` `,(0,x.jsx)(fe,{to:`/runs`,className:`text-primary underline-offset-2 hover:underline`,children:`watch it in Runs`})]})]}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The run loads this skill explicitly, so Codex follows its instructions even for a generic prompt.`})]})]})]})]}),(0,x.jsx)(p,{open:ve,onOpenChange:L,children:(0,x.jsxs)(ue,{children:[(0,x.jsxs)(d,{children:[(0,x.jsx)(f,{children:`New skill`}),(0,x.jsxs)(u,{children:[`Creates `,(0,x.jsx)(`code`,{children:`.agents/skills/<name>/SKILL.md`}),` in the`,` `,t?.name??e,` workspace.`]})]}),(0,x.jsxs)(`div`,{className:`grid gap-3`,children:[(0,x.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,x.jsx)(v,{htmlFor:`new-skill-name`,children:`Name`}),(0,x.jsx)(g,{id:`new-skill-name`,value:R,placeholder:`my-skill (lowercase, dashes)`,onChange:e=>z(e.target.value)})]}),(0,x.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,x.jsx)(v,{htmlFor:`new-skill-description`,children:`Description`}),(0,x.jsx)(g,{id:`new-skill-description`,value:B,placeholder:`What this skill does and when to use it`,onChange:e=>V(e.target.value)})]})]}),(0,x.jsxs)(le,{children:[(0,x.jsx)(h,{variant:`outline`,onClick:()=>L(!1),children:`Cancel`}),(0,x.jsx)(h,{onClick:Pe,disabled:R.trim().length===0||B.trim().length===0,children:`Create`})]})]})}),(0,x.jsx)(p,{open:xe,onOpenChange:Se,children:(0,x.jsxs)(ue,{className:`flex max-h-[80vh] flex-col sm:max-w-2xl`,children:[(0,x.jsxs)(d,{children:[(0,x.jsx)(f,{children:`Browse skills.sh`}),(0,x.jsxs)(u,{children:[`Search the`,` `,(0,x.jsx)(`a`,{href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,className:`text-primary underline-offset-2 hover:underline`,children:`skills.sh`}),` `,`registry and install into the`,` `,t?.name??e,` workspace. Skills run with full agent permissions — review before use.`]})]}),(0,x.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),Re()},children:[(0,x.jsx)(g,{autoFocus:!0,value:K,placeholder:`Search skills (e.g. react, deploy, postgres)…`,onChange:e=>Ce(e.target.value)}),(0,x.jsxs)(h,{type:`submit`,disabled:q||K.trim().length===0,children:[q?(0,x.jsx)(S,{className:`size-4`}):(0,x.jsx)(se,{className:`size-4`}),`Search`]})]}),ke&&(0,x.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm whitespace-pre-wrap text-destructive`,children:ke}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[De&&we.length===0&&!q&&(0,x.jsxs)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:[`No skills found for “`,K.trim(),`”.`]}),(0,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:we.map(e=>{let t=je.has(e.source);return(0,x.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border px-3 py-2`,children:[(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),e.installs&&(0,x.jsx)(_,{variant:`outline`,className:`shrink-0`,children:e.installs})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 truncate text-xs text-muted-foreground`,children:[e.repo,e.url&&(0,x.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center hover:text-foreground`,children:(0,x.jsx)(re,{className:`size-3`})})]})]}),(0,x.jsx)(h,{size:`sm`,variant:t?`secondary`:`outline`,disabled:t||Y!==null,onClick:()=>ze(e.source),children:Y===e.source?(0,x.jsx)(S,{className:`size-4`}):t?`Installed`:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(me,{className:`size-3.5`}),` Install`]})})]},e.source)})})]})]})})]})}export{w as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-NNHCCRGN-DlpIbxXb.js";import{x as e}from"./mermaid-parser.core-BflpgWAW.js";export{e as createArchitectureServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./utils-BX1Diber.js";import{n as r}from"./button-Cg-0y2B2.js";function i(e){return t(e.defaultTagName??`div`,e,e)}var a=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function o({className:t,variant:r=`default`,render:o,...s}){return i({defaultTagName:`span`,props:e({className:n(a({variant:r}),t)},s),render:o,state:{slot:`badge`,variant:r}})}export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,n,r}from"./bundle-mjs-DssaXR6m.js";import{n as i,t as a}from"./utils-BX1Diber.js";import{t as o}from"./useButton-DKtiRcm8.js";var s=e(t()).forwardRef(function(e,t){let{render:n,className:r,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:c=!0,style:l,...u}=e,{getButtonProps:d,buttonRef:f}=o({disabled:a,focusableWhenDisabled:s,native:c});return i(`button`,e,{state:{disabled:a},ref:[t,f],props:[u,d]})}),c=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,l=n,u=(e,t)=>n=>{if(t?.variants==null)return l(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=c(t)||c(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return l(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},d=r(),f=u(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function p({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,d.jsx)(s,{"data-slot":`button`,className:a(f({variant:t,size:n,className:e})),...r})}export{u as n,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,ot as t}from"./chunk-CSCIHK7Q-Bbq9a-f4.js";var n=(n,r)=>t.lang.round(e.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{M as r,N as i,P as a,d as o,f as s,i as c,l,n as ee,t as u,x as d}from"./utils-BX1Diber.js";import{h as f,i as p,t as m,x as h}from"./useBaseUiId-dSIElxm7.js";import{n as g,t as te}from"./FormContext-6Ydu-jal.js";import{M as _,N as v,k as y,vt as ne,yt as re}from"./index-73cjKBdb.js";import{t as ie}from"./useButton-DKtiRcm8.js";import{a as b,i as ae,r as oe,t as se}from"./useRegisterFieldControl-CbOBCC3j.js";import{t as ce}from"./useControlled-t2_qXo7Q.js";import{n as le}from"./label-CxX4-RmK.js";var ue=h(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),x=e(t());function de(e,t,n,r=!0,a){let[o,s]=x.useState(),c=m(a?`${a}-label`:void 0),l=e??t??o;return i(()=>{let i=e||t||!r?void 0:S(n.current,c);o!==i&&s(i)}),l}function S(e,t){let n=C(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function C(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var w=x.createContext({disabled:!1});function fe(){return x.useContext(w)}var pe=x.createContext(void 0);function me(e=!0){let t=x.useContext(pe);if(t===void 0&&!e)throw Error(r(3));return t}function he(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var T=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function E(e){return x.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[T.checked]:``}:{[T.unchecked]:``}},...b}),[e.indeterminate])}var D=x.createContext(void 0);function O(){let e=x.useContext(D);if(e===void 0)throw Error(r(14));return e}var k=n(),ge=`data-parent`,A=x.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:u=!1,"aria-labelledby":h,disabled:g=!1,form:_,id:v,indeterminate:y=!1,inputRef:b,name:ue,onCheckedChange:S,parent:C=!1,readOnly:w=!1,render:pe,required:T=!1,uncheckedValue:O,value:A,nativeButton:j=!1,style:_e,...ve}=e,{clearErrors:ye}=te(),{disabled:be,name:xe,setDirty:Se,setFilled:M,setFocused:N,setTouched:Ce,state:P,validationMode:we,validityData:Te,shouldValidateOnChange:Ee,validation:De}=ae(),Oe=fe(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:I}=oe(),L=me(),R=L?.parent,z=R&&L.allValues,B=be||Oe.disabled||L?.disabled||g,V=xe??ue,H=A??V,je=m(),Me=m(),U=Ae;z?U=C?Me:`${R.id}-${H}`:v&&(U=v);let W={};z&&(C?W=L.parent.getParentProps():H&&(W=L.parent.getChildProps(H)));let{checked:Ne=n,indeterminate:G=y,onCheckedChange:Pe,...Fe}=W,K=L?.value,Ie=L?.setValue,Le=L?.defaultValue,q=x.useRef(null),J=a(()=>Symbol(`checkbox-control`)),Y=x.useRef(!1),{getButtonProps:Re,buttonRef:ze}=ie({disabled:B,native:j}),X=L?.validation??De,[Z,Be]=ce({controlled:H&&K&&!C?K.includes(H):Ne,default:H&&Le&&!C?Le.includes(H):u,name:`Checkbox`,state:`checked`});i(()=>{F!==s&&(Y.current=!0,F(J.current,U))},[U,F,J]),x.useEffect(()=>{let e=J.current;return()=>{!Y.current||F===s||(Y.current=!1,F(e,void 0))}},[F,J]),se(q,je,Z,void 0,!L);let Q=x.useRef(null),Ve=l(b,Q,X.inputRef),He=de(h,ke,Q,!j,U??void 0);i(()=>{Q.current&&(Q.current.indeterminate=G,Z&&M(!0))},[Z,G,M]),le(Z,()=>{L&&!C||(ye(V),M(Z),Se(Z!==Te.initialValue),Ee()?X.commit(Z):X.commit(Z,!0))});let Ue=c({checked:Z,disabled:B,form:_,name:C?void 0:V,id:j?void 0:U??void 0,required:T,ref:Ve,style:V?re:ne,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(w){e.preventDefault();return}let t=e.currentTarget.checked,n=p(f,e.nativeEvent);Pe?.(t,n),S?.(t,n),!n.isCanceled&&(Be(t),H&&K&&Ie&&!C&&!z&&Ie(t?[...K,H]:K.filter(e=>e!==H),n))},onFocus(){q.current?.focus()}},A===void 0?o:{value:(L?Z&&A:A)||``},I,L?X.getValidationProps:X.getInputValidationProps),We=z?!!Ne:Z,Ge=z&&G||y;x.useEffect(()=>{if(!R||!H)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let $=x.useMemo(()=>({...P,checked:We,disabled:B,readOnly:w,required:T,indeterminate:Ge}),[P,We,B,w,T,Ge]),Ke=E($),qe=ee(`span`,e,{state:$,ref:[ze,q,t,L?.registerControlRef],props:[{id:j?U??void 0:je,role:`checkbox`,"aria-checked":G?`mixed`:Z,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":He,[ge]:C?``:void 0,onFocus(){N(!0)},onBlur(){let e=Q.current;e&&(Ce(!0),N(!1),we===`onBlur`&&X.commit(L?K:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),d(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||he(t)?.click()})},onClick(e){if(w||B)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(d(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},I,X.getValidationProps,ve,Fe,Re],stateAttributesMapping:Ke});return(0,k.jsxs)(D.Provider,{value:$,children:[qe,!Z&&!L&&V&&!C&&O!==void 0&&(0,k.jsx)(`input`,{type:`hidden`,form:_,name:V,value:O}),(0,k.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),j=x.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=O(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=v(c),f=x.useRef(null),p={...s,transitionStatus:u};y({open:c,ref:f,onComplete(){c||d(!1)}});let m={...E(s),..._,...b},h=a||l,g=ee(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function _e({className:e,...t}){return(0,k.jsx)(A,{"data-slot":`checkbox`,className:u(`peer inline-flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-neutral-300 bg-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:border-neutral-900 data-[checked]:bg-neutral-900 data-[checked]:text-white data-[indeterminate]:border-neutral-900 data-[indeterminate]:bg-neutral-900 data-[indeterminate]:text-white`,e),...t,children:(0,k.jsx)(j,{className:`flex items-center justify-center`,children:t.indeterminate?(0,k.jsx)(ue,{className:`size-3`}):(0,k.jsx)(g,{className:`size-3`})})})}export{_e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-D-NMWEou.js";import"./chunk-CSCIHK7Q-Bbq9a-f4.js";import"./chunk-5ZQYHXKU-DQd7S-DN.js";import"./chunk-BSJP7CBP-DIpfLhEz.js";import"./chunk-L5ZTLDWV-C8BqtMre.js";import"./chunk-NZK2D7GU-CB-RR-1q.js";import"./chunk-O5CBEL6O-Zyg3pbBu.js";import"./chunk-3OPIFGDE-DOjepp5u.js";import"./chunk-KSCS5N6A-BKp-kveo.js";import"./chunk-LZXEDZCA-Diyjko3L.js";import"./chunk-FMBD7UC4-C9D6P7Uq.js";import"./chunk-ND2GUHAM-BV6JTPNQ.js";import"./chunk-55IACEB6-QyFAFTWp.js";import"./chunk-2J33WTMH-Dq1oKvzF.js";import{i as t,n,r,t as i}from"./chunk-727SXJPM-ZC51AjIP.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-D-NMWEou.js";import"./chunk-CSCIHK7Q-Bbq9a-f4.js";import"./chunk-5ZQYHXKU-DQd7S-DN.js";import"./chunk-BSJP7CBP-DIpfLhEz.js";import"./chunk-L5ZTLDWV-C8BqtMre.js";import"./chunk-NZK2D7GU-CB-RR-1q.js";import"./chunk-O5CBEL6O-Zyg3pbBu.js";import"./chunk-3OPIFGDE-DOjepp5u.js";import"./chunk-KSCS5N6A-BKp-kveo.js";import"./chunk-LZXEDZCA-Diyjko3L.js";import"./chunk-FMBD7UC4-C9D6P7Uq.js";import"./chunk-ND2GUHAM-BV6JTPNQ.js";import"./chunk-55IACEB6-QyFAFTWp.js";import"./chunk-2J33WTMH-Dq1oKvzF.js";import{i as t,n,r,t as i}from"./chunk-727SXJPM-ZC51AjIP.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{M as r,N as i,a,l as o,n as s,s as c,x as l}from"./utils-BX1Diber.js";import{h as u,i as d,t as f,x as p,y as m}from"./useBaseUiId-dSIElxm7.js";import{A as h,M as g,N as _,St as v,bt as y,j as b,k as x,wt as S}from"./index-73cjKBdb.js";import{t as C}from"./useButton-DKtiRcm8.js";import{t as w}from"./useControlled-t2_qXo7Q.js";var T=p(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),E=e(t());function D(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=w({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:l,transitionStatus:u}=_(a,!0,!0),p=f(),[h,g]=E.useState(),v=h??p,y=c(e=>{let t=!a,n=d(m,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return E.useMemo(()=>({disabled:i,handleTrigger:y,mounted:s,open:a,panelId:v,setMounted:l,setOpen:o,setPanelIdState:g,transitionStatus:u}),[i,y,s,a,v,l,o,g,u])}var O=E.createContext(void 0);function k(){let e=E.useContext(O);if(e===void 0)throw Error(r(15));return e}var A=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e}({}),j=function(e){return e.panelOpen=`data-panel-open`,e}({}),M={[A.open]:``},N={[A.closed]:``},P={open(e){return e?{[j.panelOpen]:``}:null}},F={open(e){return e?M:N},...g},I=n(),L=E.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:l,style:u,...d}=e,f=c(o),p=D({open:l,defaultOpen:i,onOpenChange:f,disabled:a}),m=E.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),h=E.useMemo(()=>({...p,onOpenChange:f,state:m}),[p,f,m]),g=s(`div`,e,{state:m,ref:t,props:d,stateAttributesMapping:F});return(0,I.jsx)(O.Provider,{value:h,children:g})}),R={...P,...g},z=E.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=k(),{className:c,disabled:l=o,id:u,render:d,nativeButton:f=!0,style:p,...m}=e,{getButtonProps:h,buttonRef:g}=C({disabled:l,focusableWhenDisabled:!0,native:f});return s(`button`,e,{state:a,ref:[t,g],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},m,h],stateAttributesMapping:R})}),B={height:void 0,width:void 0};function V(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:a,mounted:s,onOpenChange:l,open:f,setMounted:p,setOpen:m,transitionStatus:g}=e,_=E.useRef(null),b=E.useRef(null),[C,w]=E.useState(B),T=E.useRef(B),D=E.useRef(!1),O=E.useRef(f),k=E.useRef(!1),[j,M]=E.useState(!1),N=E.useRef(null),P=o(t,_),F=v({mounted:s,open:f}),I=h(_,!1,!1),L=!f&&!s,R=j?`idle`:g,z=f&&(O.current||k.current),V=!f&&s&&b.current===`css-animation`&&C.height===void 0&&C.width===void 0?T.current:C,W=n&&L&&b.current!==`css-animation`,q=c((e,t=!0)=>{t&&(T.current=e),w(e)}),J=c(()=>{N.current?.(),N.current=null}),Y=c(e=>{J(),N.current=()=>{N.current=null,e()}}),X=c(()=>{f&&s&&b.current===`css-animation`&&(k.current=!0)});i(()=>{!j||g===`starting`||M(!1)},[j,g]),E.useEffect(()=>()=>{X(),J()},[X,J]),i(()=>{let e=_.current;if(!e)return;!f&&N.current&&J();let t=U(e,z);if(b.current=t,f&&g===`idle`&&O.current&&t===`css-animation`){T.current=H(e);return}if(f&&g===`starting`){let n=D.current;if(D.current=!1,t===`none`){q(H(e)),M(!0);return}if(t===`css-transition`){let t=K(e);return q(H(e)),n?(Y(G(e,`transition-duration`,`0s`)),M(!0),t):t}if(t===`css-animation`){if(q(H(e)),!n){G(e,`animation-name`,`none`)();return}let t=G(e,`animation-name`,`none`),r=G(e,`animation-duration`,`0s`);t(),Y(r),M(!0);return}}if(!f&&s&&(g===`idle`||g===`starting`)){if(t===`none`){q(B,!1),p(!1);return}t===`css-animation`&&(O.current=!1,k.current=!1),q(H(e));return}if(g!==`ending`)return;if(t===`none`){p(!1);return}let n=H(e);if(!((n.height??0)>0||(n.width??0)>0)){p(!1);return}q(n),t===`css-animation`&&G(e,`animation-name`,`none`)()},[s,f,J,q,p,Y,z,g]),x({enabled:f&&s&&R===`idle`,open:!0,ref:_,onComplete(){f&&q(B,!1)}}),E.useEffect(()=>{if(f||!s||R!==`ending`||!_.current)return;let e=new AbortController,t=-1;function n(){F.current.open||(p(!1),q(B,!1))}return t=y.request(()=>{e.signal.aborted||I(n,e.signal)}),()=>{y.cancel(t),e.abort()}},[F,s,f,R,I,q,p]),i(()=>{let e=_.current;!e||!n||!L||e.setAttribute(`hidden`,`until-found`)},[L,n]),E.useEffect(function(){let e=_.current;if(!e)return;function t(e){D.current=!0,m(!0),l(!0,d(u,e))}return S(e,`beforematch`,t)},[l,m]);let Z=a||n||s||f;return{height:V.height,props:{...W?{[A.startingStyle]:``}:void 0,hidden:L,id:r},ref:P,shouldPreventOpenAnimation:z,shouldRender:Z,transitionStatus:R,width:V.width}}function H(e){return{height:e.scrollHeight,width:e.scrollWidth}}function U(e,t=!1){let n=l(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&W(n.animationDuration),i=W(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function W(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function G(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function K(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=y.request(n);return()=>{y.cancel(r),n()}}var q=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),J=E.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:o,render:c,id:l,style:u,...d}=e,{mounted:f,onOpenChange:p,open:m,panelId:h,setMounted:g,setPanelIdState:_,setOpen:v,state:y,transitionStatus:b}=k(),x=r??!1,S=o??!1;i(()=>{if(l)return _(l),()=>{_(void 0)}},[l,_]);let{height:C,props:w,ref:T,shouldPreventOpenAnimation:E,shouldRender:D,transitionStatus:O,width:A}=V({externalRef:t,hiddenUntilFound:x,id:h,keepMounted:S,mounted:f,onOpenChange:p,open:m,setMounted:g,setOpen:v,transitionStatus:b}),j={...y,transitionStatus:O},M=a(u,j),N=s(`div`,{...e,style:void 0},{state:j,ref:T,props:[w,{style:{[q.collapsiblePanelHeight]:C===void 0?`auto`:`${C}px`,[q.collapsiblePanelWidth]:A===void 0?`auto`:`${A}px`}},d,M?{style:M}:void 0,E?{style:{animationName:`none`}}:void 0],stateAttributesMapping:F});return D?N:null});function Y({...e}){return(0,I.jsx)(L,{"data-slot":`collapsible`,...e})}function X({...e}){return(0,I.jsx)(z,{"data-slot":`collapsible-trigger`,...e})}function Z({...e}){return(0,I.jsx)(J,{"data-slot":`collapsible-content`,...e})}export{T as i,Z as n,X as r,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-Cyuzqnbw.js";import{i as t,r as n}from"./bundle-mjs-DssaXR6m.js";import{M as r,d as i,i as a,n as o,t as s}from"./utils-BX1Diber.js";import{i as c,o as l,t as u,u as d,x as f}from"./useBaseUiId-dSIElxm7.js";import{C as p,S as m,a as h,o as g,p as _,s as v,w as y}from"./useCompositeListItem-C7NilwuX.js";import{At as b,C as x,D as S,E as C,J as w,K as T,L as E,M as D,O,P as k,S as A,T as j,Ut as M,_ as N,b as P,c as F,d as ee,k as te,kt as ne,l as I,v as L,w as R,x as z,y as B,z as re}from"./index-73cjKBdb.js";import{t as V}from"./useButton-DKtiRcm8.js";import{t as H}from"./button-Cg-0y2B2.js";var U=f(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),W=e(t()),G=W.createContext(!1),K=W.createContext(void 0);function q(e){let t=W.useContext(K);if(e===!1&&t===void 0)throw Error(r(27));return t}var J={...I,...D},Y=W.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...s}=e,{store:c}=q(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`mounted`);return o(`div`,e,{state:{open:l,transitionStatus:c.useState(`transitionStatus`)},ref:[c.context.backdropRef,t],stateAttributesMapping:J,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},s],enabled:a||!u})}),X=W.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,...u}=e,{store:d}=q(),f=d.useState(`open`),{getButtonProps:p,buttonRef:m}=V({disabled:a,native:s}),h={disabled:a};function g(e){f&&d.setOpen(!1,c(l,e.nativeEvent))}return o(`button`,e,{state:h,ref:[t,m],props:[{onClick:g},u,p]})}),ie=W.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{store:c}=q(),l=u(a);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),o(`p`,e,{ref:t,props:[{id:l},s]})}),ae=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),oe=function(e){return e[e.open=F.open]=`open`,e[e.closed=F.closed]=`closed`,e[e.startingStyle=F.startingStyle]=`startingStyle`,e[e.endingStyle=F.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Z=W.createContext(void 0);function se(){let e=W.useContext(Z);if(e===void 0)throw Error(r(26));return e}var Q=n(),ce={...I,...D,nestedDialogOpen(e){return e?{[oe.nestedDialogOpen]:``}:null}},le=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:s,...c}=e,{store:l}=q(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),v=l.useState(`nestedOpenDialogCount`),b=l.useState(`open`),x=l.useState(`openMethod`),S=l.useState(`titleElementId`),C=l.useState(`transitionStatus`),w=l.useState(`role`),T=f.useState(`floatingId`),E=c.id??T;se(),te({open:b,ref:l.context.popupRef,onComplete(){b&&l.context.onOpenChangeComplete?.(!0)}});function D(e){return e===`touch`?l.context.popupRef.current:!0}let O=s===void 0?D:s,k=v>0,A=l.useStateSetter(`popupElement`),j=o(`div`,e,{state:{open:b,nested:g,transitionStatus:C,nestedDialogOpen:k},props:[p,{id:E,"aria-labelledby":S??void 0,"aria-describedby":u??void 0,role:w,...z,hidden:!h,onKeyDown(e){_.has(e.key)&&e.stopPropagation()},style:{[ae.nestedDialogs]:v}},c],ref:[t,l.context.popupRef,A],stateAttributesMapping:ce});return(0,Q.jsx)(y,{context:f,openInteractionType:x,disabled:!h,closeOnFocusOut:!d,initialFocus:O,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:j})}),ue=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=q(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(Z.Provider,{value:n,children:(0,Q.jsxs)(T,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(v,{ref:i.context.internalBackdropRef,inert:m(!s)}),e.children]})}):null});function de(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`);C(t,a),x(t);let{forceUnmount:o}=R(a,t),s=W.useCallback(()=>{t.setOpen(!1,c(d))},[t]);return W.useImperativeHandle(r,()=>({unmount:o,close:s}),[o,s]),{parentContext:n,isDrawer:i}}function fe({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,o=e.useState(`open`),s=e.useState(`disablePointerDismissal`),c=e.useState(`modal`),l=e.useState(`popupElement`),u=e.useState(`floatingRootContext`),[d,f]=W.useState(0),[p,m]=W.useState(0),h=d===0,_=re(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:c===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=b(t);if(h&&!s){let t=n;return c&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||ne(t,l)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:h});return g(o&&c===!0,l),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{f(e),m(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{f(0),m(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(d+1,p+ +!!r),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[r,o,d,p,n]),j(e,{activeTriggerProps:_.reference??i,inactiveTriggerProps:_.trigger??i,popupProps:W.useMemo(()=>a(z,_.floating),[_.floating]),nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}var pe={...B,modal:E(e=>e.modal),nested:E(e=>e.nested),nestedOpenDialogCount:E(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:E(e=>e.nestedOpenDrawerCount),disablePointerDismissal:E(e=>e.disablePointerDismissal),openMethod:E(e=>e.openMethod),descriptionElementId:E(e=>e.descriptionElementId),titleElementId:E(e=>e.titleElementId),viewportElement:E(e=>e.viewportElement),role:E(e=>e.role)},me=class e extends k{constructor(e,t,n=!1){let r=new P,i=he(e);i.floatingRootContext=L(r,t,n),super(i,{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},pe)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};A(n,e,t.trigger),this.update(n)};static useStore(t,n){return S(t,(t,r)=>new e(n,t,r),!0).store}};function he(e={}){return{...N(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function ge(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=q(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=me.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});M(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`),w=de({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),T=x||S,E=W.useMemo(()=>({store:b}),[b]);return(0,Q.jsx)(G.Provider,{value:!1,children:(0,Q.jsxs)(K.Provider,{value:E,children:[T&&(0,Q.jsx)(fe,{store:b,dialogRoot:w}),typeof n==`function`?n({payload:C}):n]})})}function _e(e){return ge(e,W.useContext(G)?`drawer`:`dialog`)}var ve=W.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{store:c}=q(),l=u(a);return c.useSyncedValueWithCleanup(`titleElementId`,l),o(`h2`,e,{ref:t,props:[{id:l},s]})}),ye=W.forwardRef(function(e,t){let{render:n,className:i,style:a,disabled:s=!1,nativeButton:c=!0,id:l,payload:d,handle:f,...m}=e,g=q(!0),_=f?.store??g?.store;if(!_)throw Error(r(79));let v=u(l),y=_.useState(`floatingRootContext`),b=_.useState(`isOpenedByTrigger`,v),x=_.useState(`triggerPopupId`,v),S=W.useRef(null),{registerTrigger:C,isMountedByThisTrigger:T}=O(v,S,_,{payload:d}),{getButtonProps:E,buttonRef:D}=V({disabled:s,native:c}),k=p(y,{enabled:y!=null}),A=h(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),j={disabled:s,open:b},M=_.useState(`triggerProps`,T);return o(`button`,e,{state:j,ref:[D,t,C,S],props:[k.reference,M,A,{[w]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},m,E],stateAttributesMapping:ee})});function be({...e}){return(0,Q.jsx)(_e,{"data-slot":`dialog`,...e})}function $({...e}){return(0,Q.jsx)(ye,{"data-slot":`dialog-trigger`,...e})}function xe({...e}){return(0,Q.jsx)(ue,{"data-slot":`dialog-portal`,...e})}function Se({...e}){return(0,Q.jsx)(X,{"data-slot":`dialog-close`,...e})}function Ce({className:e,...t}){return(0,Q.jsx)(Y,{"data-slot":`dialog-overlay`,className:s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function we({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Q.jsxs)(xe,{children:[(0,Q.jsx)(Ce,{}),(0,Q.jsxs)(le,{"data-slot":`dialog-content`,className:s(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Q.jsxs)(X,{"data-slot":`dialog-close`,render:(0,Q.jsx)(H,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(U,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Te({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:s(`flex flex-col gap-2`,e),...t})}function Ee({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(X,{render:(0,Q.jsx)(H,{variant:`outline`}),children:`Close`})]})}function De({className:e,...t}){return(0,Q.jsx)(ve,{"data-slot":`dialog-title`,className:s(`text-base leading-none font-medium`,e),...t})}function Oe({className:e,...t}){return(0,Q.jsx)(ie,{"data-slot":`dialog-description`,className:s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{Ee as a,$ as c,Oe as i,U as l,Se as n,Te as o,we as r,De as s,be as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-NNHCCRGN-DlpIbxXb.js";import{y as e}from"./mermaid-parser.core-BflpgWAW.js";export{e as createEventModelingServices};
|