buddy-workbench 0.1.11 β 0.1.12
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/package.json +3 -2
- package/pages/.gitkeep +1 -0
- package/pages/welcome/index.html +72 -0
- package/server/config.js +2 -0
- package/server/services/process-manager.js +29 -11
- package/server.js +3 -0
- package/ui/dist/assets/{index-CdpFZDzz.js β index-BfTsErqX.js} +2 -2
- package/ui/dist/index.html +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buddy-workbench",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"server.js",
|
|
11
11
|
"server/",
|
|
12
12
|
"ui/dist/",
|
|
13
|
-
"plugins/"
|
|
13
|
+
"plugins/",
|
|
14
|
+
"pages/"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"start": "exec node server.js",
|
package/pages/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Keep pages directory
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Welcome - DevBuddy Static Pages</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0f172a;
|
|
10
|
+
--card-bg: #1e293b;
|
|
11
|
+
--text: #f8fafc;
|
|
12
|
+
--text-muted: #94a3b8;
|
|
13
|
+
--accent: #38bdf8;
|
|
14
|
+
--border: #334155;
|
|
15
|
+
}
|
|
16
|
+
body {
|
|
17
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
18
|
+
background: var(--bg);
|
|
19
|
+
color: var(--text);
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
min-height: 100vh;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 24px;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
.card {
|
|
29
|
+
background: var(--card-bg);
|
|
30
|
+
padding: 32px;
|
|
31
|
+
border-radius: 16px;
|
|
32
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
|
|
33
|
+
border: 1px solid var(--border);
|
|
34
|
+
text-align: center;
|
|
35
|
+
max-width: 520px;
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
.icon {
|
|
39
|
+
font-size: 48px;
|
|
40
|
+
margin-bottom: 16px;
|
|
41
|
+
}
|
|
42
|
+
h1 {
|
|
43
|
+
color: var(--accent);
|
|
44
|
+
margin-top: 0;
|
|
45
|
+
margin-bottom: 12px;
|
|
46
|
+
font-size: 24px;
|
|
47
|
+
}
|
|
48
|
+
p {
|
|
49
|
+
color: var(--text-muted);
|
|
50
|
+
line-height: 1.6;
|
|
51
|
+
margin-bottom: 20px;
|
|
52
|
+
}
|
|
53
|
+
code {
|
|
54
|
+
background: rgba(15, 23, 42, 0.8);
|
|
55
|
+
padding: 4px 8px;
|
|
56
|
+
border-radius: 6px;
|
|
57
|
+
color: #f43f5e;
|
|
58
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
59
|
+
font-size: 0.9em;
|
|
60
|
+
border: 1px solid var(--border);
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
63
|
+
</head>
|
|
64
|
+
<body>
|
|
65
|
+
<div class="card">
|
|
66
|
+
<div class="icon">π</div>
|
|
67
|
+
<h1>Static Server Active</h1>
|
|
68
|
+
<p>Place your HTML, CSS, and JS files inside the <code>pages/</code> directory in your workspace.</p>
|
|
69
|
+
<p>Configure this page in Settings > Static Pages with URL <code>/pages/welcome/index.html</code></p>
|
|
70
|
+
</div>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
package/server/config.js
CHANGED
|
@@ -14,5 +14,7 @@ export const paths = {
|
|
|
14
14
|
shutdownLog: join(root, 'data', 'shutdown.log'),
|
|
15
15
|
clipboardDir: join(root, 'data', 'clipboard'),
|
|
16
16
|
plugins: join(root, 'plugins'),
|
|
17
|
+
pages: join(root, 'pages'),
|
|
18
|
+
dataPages: join(root, 'data', 'pages'),
|
|
17
19
|
ui: join(root, 'ui', 'dist')
|
|
18
20
|
};
|
|
@@ -15,7 +15,7 @@ const savedPortHistory = new Map(listPortHistory().map((record) => [record.port,
|
|
|
15
15
|
const supervisorPath = fileURLToPath(new URL('./script-supervisor.js', import.meta.url));
|
|
16
16
|
const execFileAsync = promisify(execFile);
|
|
17
17
|
const keyFor = (launcherId, scriptId) => `${launcherId}:${scriptId}`;
|
|
18
|
-
function countErrorBlocks(text, isStderr = false) {
|
|
18
|
+
export function countErrorBlocks(text, isStderr = false) {
|
|
19
19
|
if (!text) return 0;
|
|
20
20
|
const lines = text.split(/\r?\n/);
|
|
21
21
|
let count = 0;
|
|
@@ -28,14 +28,32 @@ function countErrorBlocks(text, isStderr = false) {
|
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
const cleanLine = trimmed
|
|
32
|
+
.replace(/[\u001b\x1b]\[[0-9;]*[a-zA-ZKk]/g, '')
|
|
33
|
+
.replace(/[\u001b\x1b](?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, '');
|
|
34
|
+
|
|
35
|
+
const isNonErrorLine =
|
|
36
|
+
/<i>|<s>/i.test(cleanLine) ||
|
|
37
|
+
/^\s*<(?:i|s|w|info|success|warn|warning)>/i.test(cleanLine) ||
|
|
38
|
+
/^\s*\[(?:info|success|warn|warning|note|notice)\]/i.test(cleanLine) ||
|
|
39
|
+
/^(?:npm WARN|yarn warning|pnpm warning)/i.test(cleanLine) ||
|
|
40
|
+
/^\s*\((?:node:\d+|node:|Use\b)/i.test(cleanLine) ||
|
|
41
|
+
/^[βΉβ]/u.test(cleanLine) ||
|
|
42
|
+
/\b(?:compiled successfully|build completed|done in)\b/i.test(cleanLine);
|
|
43
|
+
|
|
44
|
+
if (isNonErrorLine) {
|
|
45
|
+
inErrorBlock = false;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
const isNewHeader =
|
|
32
|
-
/^(?:\[?(?:error|fatal|fail|failed)\]?|error:|uncaught|fatal:)/i.test(
|
|
33
|
-
/^(?:TypeError|ReferenceError|SyntaxError|RangeError|EvalError|URIError|Error|UnhandledPromiseRejectionWarning|UnhandledPromiseRejection):/i.test(
|
|
34
|
-
/^npm ERR! (?:code|syscall|path|errno)/i.test(
|
|
35
|
-
/^\[vite\] Internal server error/i.test(
|
|
36
|
-
/\bTS\d{4,5}\b/i.test(
|
|
37
|
-
/\berror TS\d+/i.test(
|
|
38
|
-
/^(?:\[TypeScript\]|TS ERROR)/i.test(
|
|
50
|
+
/^(?:\[?(?:error|fatal|fail|failed)\]?|error:|uncaught|fatal:)/i.test(cleanLine) ||
|
|
51
|
+
/^(?:TypeError|ReferenceError|SyntaxError|RangeError|EvalError|URIError|Error|UnhandledPromiseRejectionWarning|UnhandledPromiseRejection):/i.test(cleanLine) ||
|
|
52
|
+
/^npm ERR! (?:code|syscall|path|errno)/i.test(cleanLine) ||
|
|
53
|
+
/^\[vite\] Internal server error/i.test(cleanLine) ||
|
|
54
|
+
/\bTS\d{4,5}\b/i.test(cleanLine) ||
|
|
55
|
+
/\berror TS\d+/i.test(cleanLine) ||
|
|
56
|
+
/^(?:\[TypeScript\]|TS ERROR)/i.test(cleanLine);
|
|
39
57
|
|
|
40
58
|
if (isNewHeader) {
|
|
41
59
|
inErrorBlock = false;
|
|
@@ -44,9 +62,9 @@ function countErrorBlocks(text, isStderr = false) {
|
|
|
44
62
|
const isErrorLine =
|
|
45
63
|
isStderr ||
|
|
46
64
|
isNewHeader ||
|
|
47
|
-
/\b(error|failed|fatal|exception)\b/i.test(
|
|
48
|
-
/^npm ERR!/i.test(
|
|
49
|
-
/\bTS\d{4,5}\b/i.test(
|
|
65
|
+
/\b(error|failed|fatal|exception)\b/i.test(cleanLine) ||
|
|
66
|
+
/^npm ERR!/i.test(cleanLine) ||
|
|
67
|
+
/\bTS\d{4,5}\b/i.test(cleanLine) ||
|
|
50
68
|
/^\s*at\s+[\w\d_$.<>]+\s+\(/i.test(line);
|
|
51
69
|
|
|
52
70
|
if (isErrorLine) {
|
package/server.js
CHANGED
|
@@ -55,6 +55,9 @@ app.use((req, res, next) => {
|
|
|
55
55
|
|
|
56
56
|
app.use(express.static(paths.ui));
|
|
57
57
|
app.use('/plugins', express.static(paths.plugins));
|
|
58
|
+
app.use('/pages', express.static(paths.pages));
|
|
59
|
+
app.use('/pages', express.static(paths.dataPages));
|
|
60
|
+
app.use('/data/pages', express.static(paths.dataPages));
|
|
58
61
|
app.use('/api/launchers', launcherRoutes);
|
|
59
62
|
app.use('/api/plugins', pluginRoutes);
|
|
60
63
|
app.use('/api/clipboard', clipboardRoutes);
|
|
@@ -494,7 +494,7 @@ html body {
|
|
|
494
494
|
${n}-download,
|
|
495
495
|
${n}-delete
|
|
496
496
|
`]:{zIndex:10,width:r,margin:`0 ${re(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:a,"&:hover":{color:a},svg:{verticalAlign:"baseline"}}},[`${u}-thumbnail, ${u}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${u}-name`]:{display:"none",textAlign:"center"},[`${u}-file + ${u}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${re(i(e.paddingXS).mul(2).equal())})`},[`${u}-uploading`]:{[`&${u}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${u}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${re(i(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},Bne=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},Lne=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},fn(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},Hne=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),kne=ln("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:a,calc:i}=e,c=tn(e,{uploadThumbnailSize:i(t).mul(2).equal(),uploadProgressOffset:i(i(n).div(2)).add(r).equal(),uploadPicCardSize:a});return[Lne(c),Pne(c),zne(c),Ane(c),Dne(c),_ne(c),Bne(c),jd(c)]},Hne);var Fne={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},Vne=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Fne}))},Wne=l.forwardRef(Vne),Kne={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Une=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Kne}))},qne=l.forwardRef(Une),Gne={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},Xne=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Gne}))},Yne=l.forwardRef(Xne);function wm(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function Em(e,t){const n=Te(t),r=n.findIndex(({uid:a})=>a===e.uid);return r===-1?n.push(e):n[r]=e,n}function U0(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function Qne(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(a=>a[n]!==e[n]);return r.length===t.length?null:r}const Zne=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},qT=e=>e.indexOf("image/")===0,Jne=e=>{if(e.type&&!e.thumbUrl)return qT(e.type);const t=e.thumbUrl||e.url||"",n=Zne(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},qi=200;function ere(e){return new Promise(t=>{if(!e.type||!qT(e.type)){t("");return}const n=document.createElement("canvas");n.width=qi,n.height=qi,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${qi}px; height: ${qi}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:i,height:c}=a;let u=qi,d=qi,f=0,v=0;i>c?(d=c*(qi/i),v=-(d-u)/2):(u=i*(qi/c),f=-(u-d)/2),r.drawImage(a,f,v,u,d);const g=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(a.src),t(g)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const i=new FileReader;i.onload=()=>{i.result&&typeof i.result=="string"&&(a.src=i.result)},i.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const i=new FileReader;i.onload=()=>{i.result&&t(i.result)},i.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}var tre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},nre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:tre}))},GT=l.forwardRef(nre);const rre=l.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:a,file:i,items:c,progress:u,iconRender:d,actionIconRender:f,itemRender:v,isImgUrl:g,showPreviewIcon:p,showRemoveIcon:y,showDownloadIcon:C,previewIcon:S,removeIcon:b,downloadIcon:x,extra:$,onPreview:w,onDownload:E,onClose:O},I)=>{var R,T;const{status:N}=i,[j,_]=l.useState(N);l.useEffect(()=>{N!=="removed"&&_(N)},[N]);const[B,k]=l.useState(!1);l.useEffect(()=>{const Y=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(Y)}},[]);const A=d(i);let F=l.createElement("div",{className:`${e}-icon`},A);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(j==="uploading"||!i.thumbUrl&&!i.url){const Y=se(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:j!=="uploading"});F=l.createElement("div",{className:Y},A)}else{const Y=g!=null&&g(i)?l.createElement("img",{src:i.thumbUrl||i.url,alt:i.name,className:`${e}-list-item-image`,crossOrigin:i.crossOrigin}):A,le=se(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:g&&!g(i)});F=l.createElement("a",{className:le,onClick:ue=>w(i,ue),href:i.url||i.thumbUrl,target:"_blank",rel:"noopener noreferrer"},Y)}const z=se(`${e}-list-item`,`${e}-list-item-${j}`),L=typeof i.linkProps=="string"?JSON.parse(i.linkProps):i.linkProps,W=(typeof y=="function"?y(i):y)?f((typeof b=="function"?b(i):b)||l.createElement(fa,null),()=>O(i),e,r.removeFile,!0):null,G=(typeof C=="function"?C(i):C)&&j==="done"?f((typeof x=="function"?x(i):x)||l.createElement(GT,null),()=>E(i),e,r.downloadFile):null,V=a!=="picture-card"&&a!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:se(`${e}-list-item-actions`,{picture:a==="picture"})},G,W),H=typeof $=="function"?$(i):$,U=H&&l.createElement("span",{className:`${e}-list-item-extra`},H),K=se(`${e}-list-item-name`),q=i.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:K,title:i.name},L,{href:i.url,onClick:Y=>w(i,Y)}),i.name,U):l.createElement("span",{key:"view",className:K,onClick:Y=>w(i,Y),title:i.name},i.name,U),Z=(typeof p=="function"?p(i):p)&&(i.url||i.thumbUrl)?l.createElement("a",{href:i.url||i.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:Y=>w(i,Y),title:r.previewFile},typeof S=="function"?S(i):S||l.createElement(eT,null)):null,X=(a==="picture-card"||a==="picture-circle")&&j!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},Z,j==="done"&&G,W),{getPrefixCls:ee}=l.useContext(It),te=ee(),ie=l.createElement("div",{className:z},F,q,V,X,B&&l.createElement(Ur,{motionName:`${te}-fade`,visible:j==="uploading",motionDeadline:2e3},({className:Y})=>{const le="percent"in i?l.createElement(fT,Object.assign({type:"line",percent:i.percent,"aria-label":i["aria-label"],"aria-labelledby":i["aria-labelledby"]},u)):null;return l.createElement("div",{className:se(`${e}-list-item-progress`,Y)},le)})),oe=i.response&&typeof i.response=="string"?i.response:((R=i.error)===null||R===void 0?void 0:R.statusText)||((T=i.error)===null||T===void 0?void 0:T.message)||r.uploadError,ne=j==="error"?l.createElement(fr,{title:oe,getPopupContainer:Y=>Y.parentNode},ie):ie;return l.createElement("div",{className:se(`${e}-list-item-container`,t),style:n,ref:I},v?v(ne,i,c,{download:E.bind(null,i),preview:w.bind(null,i),remove:O.bind(null,i)}):ne)}),are=(e,t)=>{const{listType:n="text",previewFile:r=ere,onPreview:a,onDownload:i,onRemove:c,locale:u,iconRender:d,isImageUrl:f=Jne,prefixCls:v,items:g=[],showPreviewIcon:p=!0,showRemoveIcon:y=!0,showDownloadIcon:C=!1,removeIcon:S,previewIcon:b,downloadIcon:x,extra:$,progress:w={size:[-1,2],showInfo:!1},appendAction:E,appendActionVisible:O=!0,itemRender:I,disabled:R}=e,[,T]=Wy(),[N,j]=l.useState(!1),_=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(g||[]).forEach(K=>{!(K.originFileObj instanceof File||K.originFileObj instanceof Blob)||K.thumbUrl!==void 0||(K.thumbUrl="",r==null||r(K.originFileObj).then(q=>{K.thumbUrl=q||"",T()}))})},[n,g,r]),l.useEffect(()=>{j(!0)},[]);const B=(K,q)=>{if(a)return q==null||q.preventDefault(),a(K)},k=K=>{typeof i=="function"?i(K):K.url&&window.open(K.url)},A=K=>{c==null||c(K)},F=K=>{if(d)return d(K,n);const q=K.status==="uploading";if(n.startsWith("picture")){const Z=n==="picture"?l.createElement(Ro,null):u.uploading,X=f!=null&&f(K)?l.createElement(Yne,null):l.createElement(Wne,null);return q?Z:X}return q?l.createElement(Ro,null):l.createElement(qne,null)},z=(K,q,Z,X,ee)=>{const te={type:"text",size:"small",title:X,onClick:ie=>{var oe,ne;q(),l.isValidElement(K)&&((ne=(oe=K.props).onClick)===null||ne===void 0||ne.call(oe,ie))},className:`${Z}-list-item-action`,disabled:ee?R:!1};return l.isValidElement(K)?l.createElement($t,Object.assign({},te,{icon:$r(K,Object.assign(Object.assign({},K.props),{onClick:()=>{}}))})):l.createElement($t,Object.assign({},te),l.createElement("span",null,K))};l.useImperativeHandle(t,()=>({handlePreview:B,handleDownload:k}));const{getPrefixCls:L}=l.useContext(It),W=L("upload",v),G=L(),V=se(`${W}-list`,`${W}-list-${n}`),H=l.useMemo(()=>xn(bc(G),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[G]),U=Object.assign(Object.assign({},_?{}:H),{motionDeadline:2e3,motionName:`${W}-${_?"animate-inline":"animate"}`,keys:Te(g.map(K=>({key:K.uid,file:K}))),motionAppear:N});return l.createElement("div",{className:V},l.createElement(Fy,Object.assign({},U,{component:!1}),({key:K,file:q,className:Z,style:X})=>l.createElement(rre,{key:K,locale:u,prefixCls:W,className:Z,style:X,file:q,items:g,progress:w,listType:n,isImgUrl:f,showPreviewIcon:p,showRemoveIcon:y,showDownloadIcon:C,removeIcon:S,previewIcon:b,downloadIcon:x,extra:$,iconRender:F,actionIconRender:z,itemRender:I,onPreview:B,onDownload:k,onClose:A})),E&&l.createElement(Ur,Object.assign({},U,{visible:O,forceRender:!0}),({className:K,style:q})=>$r(E,Z=>({className:se(Z.className,K),style:Object.assign(Object.assign(Object.assign({},q),{pointerEvents:K?"none":void 0}),Z.style)}))))},ore=l.forwardRef(are);var ire=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(c){c(i)})}return new(n||(n=Promise))(function(i,c){function u(v){try{f(r.next(v))}catch(g){c(g)}}function d(v){try{f(r.throw(v))}catch(g){c(g)}}function f(v){v.done?i(v.value):a(v.value).then(u,d)}f((r=r.apply(e,[])).next())})};const ed=`__LIST_IGNORE_${Date.now()}__`,lre=(e,t)=>{const n=cr("upload"),{fileList:r,defaultFileList:a,onRemove:i,showUploadList:c=!0,listType:u="text",onPreview:d,onDownload:f,onChange:v,onDrop:g,previewFile:p,disabled:y,locale:C,iconRender:S,isImageUrl:b,progress:x,prefixCls:$,className:w,type:E="select",children:O,style:I,itemRender:R,maxCount:T,data:N={},multiple:j=!1,hasControlInside:_=!0,action:B="",accept:k="",supportServerRender:A=!0,rootClassName:F}=e,z=l.useContext(Br),L=y??z,W=e.customRequest||n.customRequest,[G,V]=hn(a||[],{value:r,postState:be=>be??[]}),[H,U]=l.useState("drop"),K=l.useRef(null),q=l.useRef(null);l.useMemo(()=>{const be=Date.now();(r||[]).forEach((Se,Me)=>{!Se.uid&&!Object.isFrozen(Se)&&(Se.uid=`__AUTO__${be}_${Me}__`)})},[r]);const Z=(be,Se,Me)=>{let He=Te(Se),et=!1;T===1?He=He.slice(-1):T&&(et=He.length>T,He=He.slice(0,T)),oo.flushSync(()=>{V(He)});const ht={file:be,fileList:He};Me&&(ht.event=Me),(!et||be.status==="removed"||He.some(We=>We.uid===be.uid))&&oo.flushSync(()=>{v==null||v(ht)})},X=(be,Se)=>ire(void 0,void 0,void 0,function*(){const{beforeUpload:Me,transformFile:He}=e;let et=be;if(Me){const ht=yield Me(be,Se);if(ht===!1)return!1;if(delete be[ed],ht===ed)return Object.defineProperty(be,ed,{value:!0,configurable:!0}),!1;typeof ht=="object"&&ht&&(et=ht)}return He&&(et=yield He(et)),et}),ee=be=>{const Se=be.filter(et=>!et.file[ed]);if(!Se.length)return;const Me=Se.map(et=>wm(et.file));let He=Te(G);Me.forEach(et=>{He=Em(et,He)}),Me.forEach((et,ht)=>{let We=et;if(Se[ht].parsedFile)et.status="uploading";else{const{originFileObj:tt}=et;let ut;try{ut=new File([tt],tt.name,{type:tt.type})}catch{ut=new Blob([tt],{type:tt.type}),ut.name=tt.name,ut.lastModifiedDate=new Date,ut.lastModified=new Date().getTime()}ut.uid=et.uid,We=ut}Z(We,He)})},te=(be,Se,Me)=>{try{typeof be=="string"&&(be=JSON.parse(be))}catch{}if(!U0(Se,G))return;const He=wm(Se);He.status="done",He.percent=100,He.response=be,He.xhr=Me;const et=Em(He,G);Z(He,et)},ie=(be,Se)=>{if(!U0(Se,G))return;const Me=wm(Se);Me.status="uploading",Me.percent=be.percent;const He=Em(Me,G);Z(Me,He,be)},oe=(be,Se,Me)=>{if(!U0(Me,G))return;const He=wm(Me);He.error=be,He.response=Se,He.status="error";const et=Em(He,G);Z(He,et)},ne=be=>{let Se;Promise.resolve(typeof i=="function"?i(be):i).then(Me=>{var He;if(Me===!1)return;const et=Qne(be,G);et&&(Se=Object.assign(Object.assign({},be),{status:"removed"}),G==null||G.forEach(ht=>{const We=Se.uid!==void 0?"uid":"name";ht[We]===Se[We]&&!Object.isFrozen(ht)&&(ht.status="removed")}),(He=K.current)===null||He===void 0||He.abort(Se),Z(Se,et))})},Y=be=>{U(be.type),be.type==="drop"&&(g==null||g(be))};l.useImperativeHandle(t,()=>({onBatchStart:ee,onSuccess:te,onProgress:ie,onError:oe,fileList:G,upload:K.current,nativeElement:q.current}));const{getPrefixCls:le,direction:ue,upload:de}=l.useContext(It),ce=le("upload",$),ge=Object.assign(Object.assign({onBatchStart:ee,onError:oe,onProgress:ie,onSuccess:te},e),{customRequest:W,data:N,multiple:j,action:B,accept:k,supportServerRender:A,prefixCls:ce,disabled:L,beforeUpload:X,onChange:void 0,hasControlInside:_});delete ge.className,delete ge.style,(!O||L)&&delete ge.id;const he=`${ce}-wrapper`,[Oe,Re,pe]=kne(ce,he),[Ie]=Ia("Upload",lo.Upload),{showRemoveIcon:we,showPreviewIcon:ye,showDownloadIcon:ze,removeIcon:Ae,previewIcon:Ye,downloadIcon:Ke,extra:Fe}=typeof c=="boolean"?{}:c,Ge=typeof we>"u"?!L:we,je=(be,Se)=>c?l.createElement(ore,{prefixCls:ce,listType:u,items:G,previewFile:p,onPreview:d,onDownload:f,onRemove:ne,showRemoveIcon:Ge,showPreviewIcon:ye,showDownloadIcon:ze,removeIcon:Ae,previewIcon:Ye,downloadIcon:Ke,iconRender:S,extra:Fe,locale:Object.assign(Object.assign({},Ie),C),isImageUrl:b,progress:x,appendAction:be,appendActionVisible:Se,itemRender:R,disabled:L}):be,$e=se(he,w,F,Re,pe,de==null?void 0:de.className,{[`${ce}-rtl`]:ue==="rtl",[`${ce}-picture-card-wrapper`]:u==="picture-card",[`${ce}-picture-circle-wrapper`]:u==="picture-circle"}),_e=Object.assign(Object.assign({},de==null?void 0:de.style),I);if(E==="drag"){const be=se(Re,ce,`${ce}-drag`,{[`${ce}-drag-uploading`]:G.some(Se=>Se.status==="uploading"),[`${ce}-drag-hover`]:H==="dragover",[`${ce}-disabled`]:L,[`${ce}-rtl`]:ue==="rtl"});return Oe(l.createElement("span",{className:$e,ref:q},l.createElement("div",{className:be,style:_e,onDrop:Y,onDragOver:Y,onDragLeave:Y},l.createElement(wy,Object.assign({},ge,{ref:K,className:`${ce}-btn`}),l.createElement("div",{className:`${ce}-drag-container`},O))),je()))}const Ee=se(ce,`${ce}-select`,{[`${ce}-disabled`]:L,[`${ce}-hidden`]:!O}),Pe=l.createElement("div",{className:Ee,style:_e},l.createElement(wy,Object.assign({},ge,{ref:K})));return Oe(u==="picture-card"||u==="picture-circle"?l.createElement("span",{className:$e,ref:q},je(Pe,!!O)):l.createElement("span",{className:$e,ref:q},Pe,je()))},XT=l.forwardRef(lre);var sre=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const cre=l.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:a=!1,children:i}=e,c=sre(e,["style","height","hasControlInside","children"]),u=Object.assign(Object.assign({},n),{height:r});return l.createElement(XT,Object.assign({ref:t,hasControlInside:a},c,{style:u,type:"drag"}),i)}),sS=XT;sS.Dragger=cre;sS.LIST_IGNORE=ed;var ure={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 00-11.3 0l-39.6 39.6a8.03 8.03 0 000 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 00-11.3 0l-67.9 67.9a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"}}]},name:"alert",theme:"outlined"},dre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:ure}))},YT=l.forwardRef(dre),fre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},mre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:fre}))},dR=l.forwardRef(mre),vre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},gre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:vre}))},pre=l.forwardRef(gre),hre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},bre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:hre}))},Ov=l.forwardRef(bre),yre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M433.1 657.7a31.8 31.8 0 0051.7 0l210.6-292c3.8-5.3 0-12.7-6.5-12.7H642c-10.2 0-19.9 4.9-25.9 13.3L459 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H315c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"check-square",theme:"outlined"},Cre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:yre}))},QT=l.forwardRef(Cre),Sre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},xre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Sre}))},$re=l.forwardRef(xre),wre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M573 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40zm-280 0c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}},{tag:"path",attrs:{d:"M894 345a343.92 343.92 0 00-189-130v.1c-17.1-19-36.4-36.5-58-52.1-163.7-119-393.5-82.7-513 81-96.3 133-92.2 311.9 6 439l.8 132.6c0 3.2.5 6.4 1.5 9.4a31.95 31.95 0 0040.1 20.9L309 806c33.5 11.9 68.1 18.7 102.5 20.6l-.5.4c89.1 64.9 205.9 84.4 313 49l127.1 41.4c3.2 1 6.5 1.6 9.9 1.6 17.7 0 32-14.3 32-32V753c88.1-119.6 90.4-284.9 1-408zM323 735l-12-5-99 31-1-104-8-9c-84.6-103.2-90.2-251.9-11-361 96.4-132.2 281.2-161.4 413-66 132.2 96.1 161.5 280.6 66 412-80.1 109.9-223.5 150.5-348 102zm505-17l-8 10 1 104-98-33-12 5c-56 20.8-115.7 22.5-171 7l-.2-.1A367.31 367.31 0 00729 676c76.4-105.3 88.8-237.6 44.4-350.4l.6.4c23 16.5 44.1 37.1 62 62 72.6 99.6 68.5 235.2-8 330z"}},{tag:"path",attrs:{d:"M433 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}}]},name:"comment",theme:"outlined"},Ere=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:wre}))},fR=l.forwardRef(Ere),Ore={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M326 664H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V696c0-17.7-14.3-32-32-32zm16-576h-48c-8.8 0-16 7.2-16 16v176H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V104c0-8.8-7.2-16-16-16zm578 576H698c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V744h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm0-384H746V104c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16z"}}]},name:"compress",theme:"outlined"},Rre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Ore}))},Ey=l.forwardRef(Rre),Ire={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Nre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Ire}))},Mre=l.forwardRef(Nre),Tre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm144 452H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm445.7 51.5l-93.3-93.3C814.7 780.7 828 743.9 828 704c0-97.2-78.8-176-176-176s-176 78.8-176 176 78.8 176 176 176c35.8 0 69-10.7 96.8-29l94.7 94.7c1.6 1.6 3.6 2.3 5.6 2.3s4.1-.8 5.6-2.3l31-31a7.9 7.9 0 000-11.2zM652 816c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"file-search",theme:"outlined"},jre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Tre}))},ZT=l.forwardRef(jre),Pre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},Dre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Pre}))},_re=l.forwardRef(Dre),zre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"},Are=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:zre}))},Bre=l.forwardRef(Are),Lre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},Hre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Lre}))},cS=l.forwardRef(Hre),kre={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},Fre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:kre}))},uS=l.forwardRef(Fre),Vre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Wre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Vre}))},Kre=l.forwardRef(Wre),Ure={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L255.8 713.6l-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l110.3 111.2c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.1 304.1 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112m161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2"}}]},name:"key",theme:"outlined"},qre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Ure}))},Gre=l.forwardRef(qre),Xre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},Yre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Xre}))},JT=l.forwardRef(Yre),Qre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm144.1 454.9L437.7 677.8a8.02 8.02 0 01-12.7-6.5V353.7a8 8 0 0112.7-6.5L656.1 506a7.9 7.9 0 010 12.9z"}}]},name:"play-circle",theme:"filled"},Zre=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:Qre}))},Jre=l.forwardRef(Zre),eae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},tae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:eae}))},Oy=l.forwardRef(tae),nae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"},rae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:nae}))},Ry=l.forwardRef(rae),aae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},oae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:aae}))},iae=l.forwardRef(oae),lae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},sae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:lae}))},cae=l.forwardRef(sae),uae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},dae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:uae}))},Rv=l.forwardRef(dae),fae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},mae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:fae}))},vae=l.forwardRef(mae),gae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"}}]},name:"undo",theme:"outlined"},pae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:gae}))},hae=l.forwardRef(pae),bae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},yae=function(t,n){return l.createElement(Bt,xe({},t,{ref:n,icon:bae}))},Cae=l.forwardRef(yae);async function Wt(e,t){const n=await fetch(e,t);if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error||"Something went wrong. Please try again.");return n.status===204?null:n.json()}const Sr={list:()=>Wt("/api/launchers"),running:()=>Wt("/api/launchers/running"),create:e=>Wt("/api/launchers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>Wt(`/api/launchers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>Wt(`/api/launchers/${e}`,{method:"DELETE"}),start:e=>Wt(`/api/launchers/${e}/start`,{method:"POST"}),run:(e,t)=>Wt(`/api/launchers/${e}/scripts/${t}/run`,{method:"POST"}),runInstall:e=>Wt(`/api/launchers/${e}/install/run`,{method:"POST"}),stop:async(e,t)=>{try{return await Wt(`/api/launchers/${e}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scriptId:t})})}catch{return Wt(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/stop`,{method:"POST"})}},logs:(e,t)=>Wt(`/api/launchers/${e}/scripts/${t}/logs`),errorLogs:(e,t)=>Wt(`/api/launchers/${e}/scripts/${t}/logs/error`),packageScripts:e=>Wt(`/api/launchers/${e}/package-scripts`),runPackageScript:(e,t)=>Wt(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/run`,{method:"POST"}),packageScriptLogs:(e,t)=>Wt(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`),packageScriptErrorLogs:(e,t)=>Wt(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs/error`)},Sae={list:()=>Wt("/api/plugins")},ec={list:e=>Wt(`/api/clipboard${e?`?date=${encodeURIComponent(e)}`:""}`),tagged:()=>Wt("/api/clipboard/tagged"),remove:(e,t)=>Wt(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}),uploadImage:e=>Wt("/api/clipboard/image",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),updateTags:(e,t,n)=>Wt(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/tags`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:n})})},di={list:()=>Wt("/api/group-tasks"),catalog:()=>Wt("/api/group-tasks/catalog"),create:e=>Wt("/api/group-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>Wt(`/api/group-tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>Wt(`/api/group-tasks/${e}`,{method:"DELETE"}),start:e=>Wt(`/api/group-tasks/${e}/start`,{method:"POST"}),stop:e=>Wt(`/api/group-tasks/${e}/stop`,{method:"POST"})},q0={list:()=>Wt("/api/port-diagnostics"),get:e=>Wt(`/api/port-diagnostics/${encodeURIComponent(e)}`),kill:(e,t)=>Wt("/api/port-diagnostics/kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e,pid:t})})},xae={open:e=>Wt("/api/settings/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})},Oa={status:()=>Wt("/api/settings"),saveDomain:e=>Wt("/api/settings/domain",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})}),saveJiraIssuePrefix:e=>Wt("/api/settings/jira-issue-prefix",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraIssuePrefix:e})}),saveDefaultEditor:e=>Wt("/api/settings/default-editor",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultEditor:e})}),saveDefaultBrowser:e=>Wt("/api/settings/default-browser",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultBrowser:e})}),saveAccessToken:(e,t)=>Wt(`/api/settings/${encodeURIComponent(e)}-access-token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),saveClipboardEnabled:e=>Wt("/api/settings/clipboard-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})},Om={check:e=>Wt("/api/pr-review/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prLink:e})}),myPrs:()=>Wt("/api/pr-review/my-prs"),reviewPrs:()=>Wt("/api/pr-review/review-prs"),comment:e=>Wt("/api/pr-review/comment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},Fu={list:()=>Wt("/api/jira-filters"),create:e=>Wt("/api/jira-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>Wt(`/api/jira-filters/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>Wt(`/api/jira-filters/${e}`,{method:"DELETE"}),issues:e=>Wt(`/api/jira-filters/${e}/issues`)},La={list:()=>Wt("/api/todos"),create:e=>Wt("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>Wt(`/api/todos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>Wt(`/api/todos/${e}`,{method:"DELETE"}),archive:e=>Wt(`/api/todos/${e}/archive`,{method:"POST"}),unarchive:e=>Wt(`/api/todos/${e}/unarchive`,{method:"POST"}),batch:(e,t)=>Wt("/api/todos/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,ids:t})})},ic={list:()=>Wt("/api/static-pages"),create:e=>Wt("/api/static-pages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>Wt(`/api/static-pages/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>Wt(`/api/static-pages/${e}`,{method:"DELETE"})},cd={list:()=>Wt("/api/errors"),log:e=>Wt("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),clear:()=>Wt("/api/errors",{method:"DELETE"}),remove:e=>Wt(`/api/errors/${e}`,{method:"DELETE"})},$ae="modulepreload",wae=function(e){return"/"+e},mR={},ej=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=c(n.map(f=>{if(f=wae(f),f in mR)return;mR[f]=!0;const v=f.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const p=document.createElement("link");if(p.rel=v?"stylesheet":$ae,v||(p.as="script"),p.crossOrigin="",p.href=f,d&&p.setAttribute("nonce",d),document.head.appendChild(p),v)return new Promise((y,C)=>{p.addEventListener("load",y),p.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return a.then(c=>{for(const u of c||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function tj(e,t,n){const r=URL.createObjectURL(e);try{const a=await new Promise((f,v)=>{const g=new Image;g.onload=()=>f(g),g.onerror=()=>v(new Error("Unable to read this image. Please choose a valid image file.")),g.src=r}),i=document.createElement("canvas"),c=Math.max(a.naturalWidth,a.naturalHeight);let u=1;t&&(u=t/c),n!=null&&n>0&&n<=100&&(u=u*(n/100)),i.width=Math.max(1,Math.round(a.naturalWidth*u)),i.height=Math.max(1,Math.round(a.naturalHeight*u));const d=i.getContext("2d",{willReadFrequently:!0});return d.drawImage(a,0,0,i.width,i.height),{imageData:d.getImageData(0,0,i.width,i.height),width:i.width,height:i.height}}finally{URL.revokeObjectURL(r)}}async function Eae(e,t={}){const{quality:n=75,progressive:r=!0,optimizeCoding:a=!0,autoSubsample:i=!0}=t,[{encode:c},{imageData:u}]=await Promise.all([ej(()=>import("./index-Dty-56mC.js"),[]),tj(e)]),d=await c(u,{quality:n,progressive:r,optimize_coding:a,auto_subsample:i}),f=new Blob([d],{type:"image/jpeg"}),v=(e.name||"clipboard-image.png").replace(/\.[^.]+$/,"")+".jpg";return new File([f],v,{type:"image/jpeg"})}const Oae=[{value:"chrome",label:"Google Chrome"},{value:"edge",label:"Microsoft Edge"},{value:"safari",label:"Safari"}];function $o(e){e&&xae.open(e).catch(()=>{window.open(e,"_blank")})}function dS(e,t){if(!e||!t)return"";const n=e.replace(/^https?:\/\//,"").replace(/\/+$/,"");return`https://${n.startsWith("jira.")?n:`jira.${n}`}/browse/${t.toUpperCase()}`}const{Title:Rae,Text:Rm,Paragraph:Iae}=Hr,Vu=()=>new Intl.DateTimeFormat("en-CA").format(new Date);function Nae({value:e,domain:t,jiraIssuePrefix:n}){const r=[],a=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let i=0;const c=(n||"").split(/[\s,]+/).filter(Boolean).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=c.length>0&&t?new RegExp(`\\b(?:${c.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,d=(f,v)=>{if(!u||!t)return f;const g=[];let p=0;u.lastIndex=0;for(const y of f.matchAll(u)){y.index>p&&g.push(f.slice(p,y.index));const C=y[0],S=dS(t,C);g.push(P.jsx("a",{href:S,target:"_blank",rel:"noreferrer",onClick:b=>{b.preventDefault(),$o(S)},children:C},`${v}-${y.index}`)),p=y.index+C.length}return p<f.length&&g.push(f.slice(p)),g};for(const f of e.matchAll(a)){f.index>i&&r.push(...d(e.slice(i,f.index),`txt-${f.index}`));const v=f[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(v)r.push(P.jsx("a",{href:v[2],target:"_blank",rel:"noreferrer",onClick:g=>{g.preventDefault(),$o(v[2])},children:v[1]},f.index));else{const g=f[0].replace(/[),.;:!?]+$/,"");r.push(P.jsx("a",{href:g,target:"_blank",rel:"noreferrer",onClick:p=>{p.preventDefault(),$o(g)},children:g},f.index)),f[0].length>g.length&&r.push(f[0].slice(g.length))}i=f.index+f[0].length}return i<e.length&&r.push(...d(e.slice(i),"txt-end")),r}const vR=e=>e.text||e.preview||"";function tc(e,t,n){const r=e.trim();if(!r)return!1;if(t==="account")return/^[AT]\d+.*$/i.test(r)&&r.length<=20||/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i.test(r)||/\b(?:account|username|user\s*name|login|εΈε·|账ε·|η¨ζ·ε)\s*[:=]/i.test(r);if(t==="id")return/\b[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+\b/i.test(r);if(t==="url")return/https?:\/\/[^\s]+/i.test(r);if(t==="jira"){const a=(n||"").split(/[\s,]+/).filter(Boolean).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return a.length>0?new RegExp(`\\b(?:${a.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"i").test(r):/\b[A-Z]{2,10}-[a-zA-Z0-9]{1,10}\b/i.test(r)}return t==="code"?/```[\s\S]*?```|\b(?:const|let|var|function|class|import|export|SELECT|INSERT|UPDATE|DELETE)\b|[{};][\s\S]*[{};]/.test(r):!0}function Mae(){const{message:e}=co.useApp(),[t,n]=l.useState(()=>{const V=localStorage.getItem("buddy_clipboard_enabled");return V!==null?V==="true":!0}),[r,a]=l.useState(!0),[i,c]=l.useState([]),[u,d]=l.useState(Vu()),[f,v]=l.useState([]),[g,p]=l.useState([]),[y,C]=l.useState(null),[S,b]=l.useState(""),[x,$]=l.useState("all"),[w,E]=l.useState(null),[O,I]=l.useState(""),[R,T]=l.useState("");l.useEffect(()=>{Oa.status().then(V=>{if(V){if(V.clipboardEnabled!==void 0){const H=V.clipboardEnabled!==!1;n(H),localStorage.setItem("buddy_clipboard_enabled",String(H))}V.domain&&I(V.domain),V.jiraIssuePrefix&&T(V.jiraIssuePrefix)}}).catch(()=>{}).finally(()=>a(!1))},[]);const N=async V=>{n(V),localStorage.setItem("buddy_clipboard_enabled",String(V));try{const U=(await Oa.saveClipboardEnabled(V)).clipboardEnabled!==!1;n(U),localStorage.setItem("buddy_clipboard_enabled",String(U)),e.success(V?"Clipboard history enabled":"Clipboard history disabled")}catch(H){e.error(H.message)}},j=async V=>{try{const[H,U]=await Promise.all([ec.list(V),ec.tagged().catch(()=>({items:[]}))]);c(H.dates),v(H.items),p(U.items||[])}catch(H){e.error(H.message)}},_=async(V,H)=>{const U=(H||"").trim();if(!U)return;const K=V.tags||[];if(K.includes(U)){C(null);return}const q=[...K,U],Z=V.date||u;try{await ec.updateTags(Z,V.id,q),v(X=>X.map(ee=>ee.id===V.id?{...ee,tags:q}:ee)),p(X=>X.some(te=>te.id===V.id)?X.map(te=>te.id===V.id?{...te,tags:q}:te):[{...V,tags:q,date:Z},...X]),e.success("Tag added")}catch(X){e.error(X.message)}finally{C(null),b("")}},B=async(V,H)=>{const K=(V.tags||[]).filter(Z=>Z!==H),q=V.date||u;try{await ec.updateTags(q,V.id,K),v(Z=>Z.map(X=>X.id===V.id?{...X,tags:K}:X)),p(Z=>K.length===0?Z.filter(X=>X.id!==V.id):Z.map(X=>X.id===V.id?{...X,tags:K}:X)),e.success("Tag removed")}catch(Z){e.error(Z.message)}},k=l.useRef(Vu());l.useEffect(()=>{if(!t)return;const V=()=>{const q=Vu();if(q!==k.current){const Z=k.current;if(k.current=q,u===Z)return d(q),!0}return!1};V()||j(u);const U=()=>{V()||j(u)};window.addEventListener("visibilitychange",U),window.addEventListener("focus",U);let K=null;return u===Vu()&&(K=setInterval(()=>{document.visibilityState==="visible"&&j(u)},3e3)),()=>{window.removeEventListener("visibilitychange",U),window.removeEventListener("focus",U),K&&clearInterval(K)}},[u,t]);const A=async V=>{try{await ec.remove(u,V),await j(u),e.success("Clipboard entry deleted.")}catch(H){e.error(H.message)}},F=async V=>{if(V.imageFile)try{const U=await(await fetch(`${window.location.origin}/api/clipboard/image/${V.imageFile}`)).blob();await navigator.clipboard.write([new ClipboardItem({[U.type]:U})]),E(V.id),setTimeout(()=>{E(K=>K===V.id?null:K)},1e3)}catch(H){e.error("Failed to copy image: "+H.message)}else navigator.clipboard.writeText(V.text||V.preview),E(V.id),setTimeout(()=>{E(H=>H===V.id?null:H)},1e3)};l.useEffect(()=>{if(!t)return;const V=H=>{const U=document.activeElement;if(!(U&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.isContentEditable))){if(H.key==="ArrowLeft"){const K=[...new Set([...i,u])].sort(),q=K.indexOf(u);q<K.length-1&&q!==-1&&d(K[q+1])}else if(H.key==="ArrowRight"){const K=[...new Set([...i,u])].sort(),q=K.indexOf(u);q>0&&d(K[q-1])}}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[i,u,t]),l.useEffect(()=>{if(!t)return;const V=async H=>{var q;const U=document.activeElement;if(U&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.isContentEditable))return;const K=(q=H.clipboardData)==null?void 0:q.items;if(K){for(const Z of K)if(Z.type.startsWith("image/")){const X=Z.getAsFile();if(X){try{e.loading({content:"Compressing and saving image from pasteβ¦",key:"paste-upload",duration:0});const ee=await Eae(X);await ec.uploadImage(ee);const te=Vu();d(te),await j(te),e.success({content:"Image pasted and saved to history!",key:"paste-upload"})}catch(ee){e.error({content:"Failed to save pasted image: "+ee.message,key:"paste-upload"})}break}}}};return window.addEventListener("paste",V),()=>window.removeEventListener("paste",V)},[u,t]);const z=i.reduce((V,H)=>{var Z;const[U,K,q]=H.split("-");return V[U]||(V[U]={}),(Z=V[U])[K]||(Z[K]=[]),V[U][K].push(q),V},{}),L=Object.entries(z).sort(([V],[H])=>H.localeCompare(V)).map(([V,H])=>({value:V,label:V,children:Object.entries(H).sort(([U],[K])=>K.localeCompare(U)).map(([U,K])=>({value:U,label:U,children:K.sort().reverse().map(q=>({value:q,label:q}))}))})),W=l.useMemo(()=>x==="tagged"?g:x==="all"?f:x==="image"?f.filter(V=>!!V.imageFile):f.filter(V=>!V.imageFile&&tc(vR(V),x,R)),[x,f,g,R]),G=l.useMemo(()=>{const V={all:f.length,tagged:g.length,jira:0,account:0,id:0,url:0,code:0,image:0};for(const H of f)if(H.imageFile)V.image++;else{const U=vR(H);tc(U,"jira",R)&&V.jira++,tc(U,"account")&&V.account++,tc(U,"id")&&V.id++,tc(U,"url")&&V.url++,tc(U,"code")&&V.code++}return[{key:"all",label:`All (${V.all})`},{key:"tagged",label:`Tagged (${V.tagged})`},{key:"jira",label:`Jira (${V.jira})`},{key:"account",label:`Account (${V.account})`},{key:"id",label:`ID (${V.id})`},{key:"url",label:`Url (${V.url})`},{key:"code",label:`Code (${V.code})`},{key:"image",label:`Img (${V.image})`}]},[f,g,R]);return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Rm,{type:"secondary",children:"LOCAL CLIPBOARD"}),P.jsx(Rae,{level:2,children:"Clipboard history"}),P.jsx(Iae,{type:"secondary",children:"Saved locally and archived by date."})]}),P.jsxs(sn,{size:16,align:"center",children:[P.jsx(Og,{loading:r,checked:t,onChange:N,checkedChildren:"On",unCheckedChildren:"Off"}),P.jsx(Hc,{className:"clipboard-picker",disabled:!t||r,options:L,value:u.split("-"),onChange:V=>(V==null?void 0:V.length)===3&&d(V.join("-")),placeholder:"Select date"})]})]}),t?P.jsxs(P.Fragment,{children:[P.jsx(ds,{className:"clipboard-tabs",activeKey:x,onChange:$,items:G}),W.length?P.jsx("div",{className:"clipboard-list",children:W.map(V=>{const H=V.date||u,U=`${window.location.origin}/api/clipboard/${H}/${V.id}`,K=new Date(V.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return P.jsxs(Bn,{size:"small",className:"clipboard-item",children:[P.jsxs("div",{children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[P.jsx(Rm,{type:"secondary",children:K}),V.date&&V.date!==u&&P.jsx(Vn,{style:{margin:0},children:V.date}),(V.tags||[]).map(q=>P.jsx(Vn,{color:"blue",closable:!0,onClose:Z=>{Z.preventDefault(),B(V,q)},style:{margin:0},children:q},q)),P.jsx(vC,{content:P.jsxs(sn.Compact,{style:{width:200},children:[P.jsx(sr,{size:"small",placeholder:"Tag name",value:S,onChange:q=>b(q.target.value),onPressEnter:()=>_(V,S)}),P.jsx($t,{size:"small",type:"primary",onClick:()=>_(V,S),children:"Add"})]}),title:"Add Tag",trigger:"click",open:y===V.id,onOpenChange:q=>{C(q?V.id:null),b("")},children:P.jsxs(Vn,{style:{cursor:"pointer",borderStyle:"dashed",margin:0},children:[P.jsx(Co,{})," Tag"]})})]}),V.imageFile?P.jsx("div",{style:{marginTop:8},children:P.jsx("img",{src:`${window.location.origin}/api/clipboard/image/${V.imageFile}`,alt:"Clipboard entry",style:{maxWidth:"100%",maxHeight:300,borderRadius:6,cursor:"pointer",border:"1px solid #eef0f6"},onClick:()=>window.open(`${window.location.origin}/api/clipboard/image/${V.imageFile}`,"_blank")})}):P.jsxs(P.Fragment,{children:[P.jsx("pre",{style:{marginTop:8},children:P.jsx(Nae,{value:V.preview||V.text,domain:O,jiraIssuePrefix:R})}),V.contentFile&&P.jsxs("span",{className:"clipboard-original",children:[P.jsx("a",{href:U,target:"_blank",rel:"noreferrer",children:"View original content"}),P.jsxs("a",{href:V.editorUrl,children:["Open in ",V.editorName||"editor"]})]})]})]}),P.jsxs("span",{className:"clipboard-actions",children:[P.jsx(fr,{title:w===V.id?"Copied!":"Copy",children:P.jsx($t,{type:"text",icon:w===V.id?P.jsx(is,{style:{color:"#52c41a"}}):P.jsx(ul,{}),onClick:()=>F(V)})}),P.jsx(fr,{title:"Delete",children:P.jsx($t,{type:"text",danger:!0,icon:P.jsx(fa,{}),onClick:()=>A(V.id)})})]})]},V.id)})}):P.jsx(lr,{description:`No ${x==="all"?"clipboard entries":`${x==="id"?"ID":x} entries`}${x==="tagged"?".":` for ${u}.`}`})]}):P.jsx(Bn,{style:{marginTop:24,textAlign:"center",padding:"48px 0"},children:P.jsx(lr,{image:P.jsx(Rv,{style:{fontSize:48,color:"#9ca3af"}}),description:P.jsxs("div",{style:{marginTop:8},children:[P.jsx(Rm,{strong:!0,style:{fontSize:16,display:"block",color:"#374151"},children:"Clipboard history is disabled"}),P.jsx(Rm,{type:"secondary",children:"Turn on the switch in the top-right corner to start capturing and viewing history."})]})})}),P.jsx(hl.BackTop,{visibilityHeight:240})]})}const nj=[{value:"vscode",label:"VS Code"},{value:"devin",label:"Devin"},{value:"idea",label:"IntelliJ IDEA"}];function rj(e="vscode"){const t=nj.find(n=>n.value===e);return t?t.label:"VS Code"}function aj(e="vscode",t="",n=""){if(!t)return"";let r="",a="";if(n){const i=n.split(":").filter(Boolean);i[0]&&(r=i[0]),i[1]&&(a=i[1])}if(e==="idea"){let i=`idea://open?file=${encodeURIComponent(t)}`;return r&&(i+=`&line=${r}`),a&&(i+=`&column=${a}`),i}return e==="devin"?`devin://file${encodeURI(t)}${n}`:`vscode://file${encodeURI(t)}${n}`}const{Text:G0}=Hr;function Tae({tasks:e,running:t,onCreate:n,onEdit:r,onStart:a,onStop:i,onRemove:c}){const u=[{title:"Name",dataIndex:"name",render:d=>P.jsx(G0,{strong:!0,children:d})},{title:"Scripts",dataIndex:"items",width:110,render:d=>P.jsxs(G0,{type:"secondary",children:[d.length," scripts"]})},{title:"Actions",width:236,render:(d,f)=>{const v=f.items.every(g=>t.has(`${g.launcherId}:${g.scriptId}`));return P.jsxs(sn,{children:[P.jsx($t,{size:"small",danger:v,icon:v?P.jsx(Rv,{}):P.jsx(Oy,{}),onClick:()=>v?i(f):a(f),children:v?"Stop":"Start"}),P.jsx($t,{size:"small",onClick:()=>r(f),children:"Edit"}),P.jsx($t,{size:"small",danger:!0,icon:P.jsx(fa,{}),onClick:()=>c(f),children:"Delete"})]})}}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"group-task-header",children:[P.jsx(G0,{type:"secondary",children:"Start selected scripts across multiple services."}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:n,children:"Add quick launch"})]}),e.length?P.jsx(va,{className:"group-task-table",rowKey:"id",dataSource:e,columns:u,pagination:!1,size:"small"}):P.jsx(lr,{description:"No quick launches yet.",className:"group-task-empty"})]})}const{Text:Bl}=Hr,Wu=(e,t)=>`${e}:${t}`,jae=()=>P.jsx("div",{style:{width:"0.8em",height:"0.8em",backgroundColor:"rgba(0,0,0,0.88)"}});function Pae({form:e,editing:t,executor:n,running:r,errorCounts:a={},packageScripts:i,onRun:c,onRunInstall:u,onRunPackage:d,onStop:f,onLogs:v,onPackageLogs:g}){const p=!!(t&&[...r].some(S=>S.startsWith(`${t.id}:`))),[y,C]=l.useState(()=>p);return l.useEffect(()=>{p&&C(!0)},[t==null?void 0:t.id]),l.useEffect(()=>{p||C(!1)},[p]),P.jsx(cn.List,{name:"scripts",children:(S,{add:b,remove:x})=>{const $=["npm","pnpm","yarn"].includes(n)?{id:"install",name:"Install",command:`${n} install${n==="npm"?" --legacy-peer-deps":""}`}:null,w=[...S.map(I=>({...I,key:`custom-${I.key}`,kind:"custom"})),...$?[{key:"install",kind:"install",script:$}]:[],...(i||[]).map(I=>({key:`package-${I.id}`,kind:"package",script:I}))],E=y?w.filter(I=>{const R=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script;return t&&(R==null?void 0:R.id)&&r.has(Wu(t.id,R.id))}):w,O=[{title:"Source",width:100,render:(I,R)=>P.jsx(Vn,{color:R.kind==="package"?"blue":R.kind==="install"?"green":"default",children:R.kind==="package"?"Package":R.kind==="install"?"Executor":"Custom"})},{title:"Script name",width:200,render:(I,R)=>{var _;const T=R.kind==="custom"?e.getFieldValue(["scripts",R.name]):R.script,N=(T==null?void 0:T.name)===e.getFieldValue("startCommand"),j=t&&(T==null?void 0:T.id)&&r.has(Wu(t.id,T.id));return P.jsxs(sn,{direction:"vertical",size:1,style:{width:"100%"},children:[R.kind!=="custom"||j?P.jsxs(sn,{size:4,children:[P.jsx(Bl,{strong:!0,children:(T==null?void 0:T.name)||((_=R.script)==null?void 0:_.name)}),N&&P.jsx(Ry,{className:"start-script-icon"})]}):P.jsx(cn.Item,{noStyle:!0,name:[R.name,"name"],rules:[{required:!0,message:"Required"}],children:P.jsx(sr,{placeholder:"serve",allowClear:!0,suffix:N?P.jsx(Ry,{className:"start-script-icon"}):null})}),j&&P.jsx(vi,{status:"success",text:P.jsx(Bl,{type:"secondary",style:{fontSize:11},children:"running"})})]})}},{title:"Command",render:(I,R)=>{const T=R.kind==="custom"?e.getFieldValue(["scripts",R.name]):R.script,N=t&&(T==null?void 0:T.id)&&r.has(Wu(t.id,T.id));return R.kind==="package"?P.jsxs(sn,{direction:"vertical",size:0,children:[P.jsxs(Bl,{code:!0,children:[n," run ",R.script.name]}),P.jsx(Bl,{type:"secondary",style:{fontSize:12},children:R.script.command})]}):R.kind==="install"?P.jsx(Bl,{code:!0,children:R.script.command}):N?P.jsx(Bl,{code:!0,children:T==null?void 0:T.command}):P.jsx(cn.Item,{noStyle:!0,name:[R.name,"command"],rules:[{required:!0,message:"Required"}],children:P.jsx(sr,{placeholder:"npm run dev",allowClear:!0})})}},{title:"Actions",width:132,render:(I,R)=>{const T=R.kind==="custom"?e.getFieldValue(["scripts",R.name]):R.script,N=t&&(T==null?void 0:T.id)&&r.has(Wu(t.id,T.id)),j=t&&(T!=null&&T.id)&&a[Wu(t.id,T.id)]||0;return P.jsxs(sn,{size:2,children:[t&&P.jsx(fr,{title:N?"Stop":"Start",children:P.jsx($t,{type:"text",danger:N,icon:N?P.jsx(jae,{}):P.jsx(Jre,{}),onClick:()=>N?f(T):R.kind==="package"?d(T):R.kind==="install"?u(T):c(T),disabled:!(T!=null&&T.id)})}),P.jsx(fr,{title:"Logs",children:P.jsx(vi,{count:j,size:"small",offset:[-2,2],children:P.jsx($t,{type:"text",icon:P.jsx(UC,{}),onClick:()=>R.kind==="package"?g(T):v(T),disabled:!t||!(T!=null&&T.id)})})}),R.kind==="custom"&&!N&&P.jsx(fr,{title:"Remove",children:P.jsx($t,{type:"text",danger:!0,icon:P.jsx(fa,{}),onClick:()=>x(R.name)})})]})}}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"script-header",children:[P.jsx(I4,{orientation:"left",children:"Scripts"}),P.jsxs(sn,{size:"middle",align:"center",children:[P.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",userSelect:"none"},children:[P.jsx(Og,{size:"small",checked:y,onChange:C,disabled:!t}),P.jsx(Bl,{type:"secondary",style:{fontSize:13},children:"Show running only"})]}),P.jsx($t,{icon:P.jsx(Co,{}),onClick:()=>{C(!1),b({name:"",command:""})},children:"Add script"})]})]}),P.jsx(va,{size:"small",rowKey:"key",pagination:!1,loading:i===null,dataSource:E,columns:O})]})}})}const Dae=()=>({alias:"",folder:"",groupName:"",executor:"npm",startCommand:void 0,scripts:[]});function _ae({open:e,editing:t,groups:n,running:r,errorCounts:a={},onCancel:i,onSave:c,onRun:u,onRunInstall:d,onRunPackage:f,onStop:v,onLogs:g,onDelete:p}){const{message:y,modal:C}=co.useApp(),[S]=cn.useForm(),[b,x]=l.useState(null),$=()=>{C.confirm({title:"Delete Service",content:`Are you sure you want to delete service "${t==null?void 0:t.alias}"?`,okText:"Delete",okButtonProps:{type:"primary",danger:!0},cancelText:"Cancel",onOk:async()=>{try{await p(t)}catch(E){y.error(E.message)}}})};l.useEffect(()=>{e&&(S.resetFields(),S.setFieldsValue(t?{...t,startCommand:t.startCommand||void 0,scripts:t.scripts}:Dae()),x(t?null:[]),t&&Sr.packageScripts(t.id).then(E=>x(E.scripts)).catch(()=>x([])))},[e,t,S]);const w=async()=>{try{const E=(S.getFieldValue("scripts")||[]).filter(R=>{var T,N;return((T=R==null?void 0:R.name)==null?void 0:T.trim())||((N=R==null?void 0:R.command)==null?void 0:N.trim())});S.setFieldValue("scripts",E);const O=await S.validateFields(["alias","folder","groupName","startCommand"]),I={...S.getFieldsValue(!0),...O,scripts:E};await c(I)}catch(E){if(E!=null&&E.errorFields)return;y.error(E.message)}};return P.jsx(qr,{title:t?`Service details Β· ${t.alias}`:"Add service",open:e,onCancel:i,onOk:w,okText:t?"Save":"Save service",width:860,destroyOnClose:!0,footer:P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t?P.jsx($t,{type:"primary",danger:!0,onClick:$,children:"Delete service"}):P.jsx("div",{}),P.jsxs(sn,{children:[P.jsx($t,{onClick:i,children:"Cancel"}),P.jsx($t,{type:"primary",onClick:w,children:t?"Save":"Save service"})]})]}),children:P.jsxs(cn,{form:S,layout:"vertical",children:[P.jsx(sv,{className:"service-config",defaultActiveKey:t?[]:["configuration"],items:[{key:"configuration",label:"Service configuration",children:P.jsxs(hv,{gutter:[16,0],children:[P.jsx(pa,{xs:24,sm:12,children:P.jsx(cn.Item,{label:"Name",name:"alias",rules:[{required:!0}],children:P.jsx(sr,{placeholder:"Service name",allowClear:!0})})}),P.jsx(pa,{xs:24,sm:12,children:P.jsx(cn.Item,{label:"Project folder",name:"folder",rules:[{required:!0}],children:P.jsx(sr,{prefix:P.jsx(_T,{}),placeholder:"Project folder path",allowClear:!0})})}),P.jsx(pa,{xs:24,sm:8,children:P.jsx(cn.Item,{label:"Group",name:"groupName",children:P.jsx(uv,{options:n.map(E=>({value:E})),placeholder:"Group name",allowClear:!0})})}),P.jsx(pa,{xs:24,sm:8,children:P.jsx(cn.Item,{label:"Executor",name:"executor",rules:[{required:!0}],children:P.jsx(uv,{options:["npm","pnpm","yarn"].map(E=>({value:E})),placeholder:"npm",allowClear:!0})})}),P.jsx(pa,{xs:24,sm:8,children:P.jsx(cn.Item,{noStyle:!0,shouldUpdate:(E,O)=>E.scripts!==O.scripts,children:()=>{const E=(S.getFieldValue("scripts")||[]).map(R=>R==null?void 0:R.name).filter(Boolean),O=(b||[]).map(R=>R.name),I=[...new Set([...E,...O])].map(R=>({label:R,value:R}));return P.jsx(cn.Item,{label:"Start script name",name:"startCommand",children:P.jsx(Mr,{placeholder:"Select start script",allowClear:!0,options:I})})}})})]})}]}),P.jsx(cn.Item,{noStyle:!0,shouldUpdate:(E,O)=>E.executor!==O.executor||E.startCommand!==O.startCommand||E.scripts!==O.scripts,children:()=>P.jsx(Pae,{form:S,editing:t,executor:S.getFieldValue("executor")||"npm",running:r,errorCounts:a,packageScripts:b,onRun:E=>u(t,E),onRunInstall:()=>d(t),onRunPackage:E=>f(t,E),onStop:E=>v(t,E.id),onLogs:E=>g(t,E),onPackageLogs:E=>g(t,E,!0)})})]})})}const{Text:zae}=Hr;function Aae({open:e,editingGroupTask:t,groupCatalog:n,onCancel:r,onSave:a}){const{message:i}=co.useApp(),[c]=cn.useForm();l.useEffect(()=>{e&&(c.resetFields(),c.setFieldsValue({name:(t==null?void 0:t.name)||"",items:(t==null?void 0:t.items.map(f=>`${f.launcherId}|${f.scriptId}`))||[]}))},[e,t,c]);const u=l.useMemo(()=>Object.entries(n.reduce((f,v)=>{const g=v.groupName||"Ungrouped";return(f[g]||(f[g]=[])).push(v),f},{})).sort(([f],[v])=>f.localeCompare(v)).map(([f,v])=>({key:f,label:f,children:P.jsx("div",{className:"group-task-projects",children:v.map(g=>P.jsx(Bn,{size:"small",title:g.alias,children:P.jsx(sn,{direction:"vertical",children:g.scripts.map(p=>P.jsxs(ka,{value:`${g.id}|${p.id}`,children:[p.name," ",P.jsxs(zae,{type:"secondary",children:["(",p.source,")"]})]},p.id))})},g.id))})})),[n]),d=async()=>{try{const f=await c.validateFields(),v={name:f.name,items:f.items.map(g=>{const[p,y]=g.split("|");return{launcherId:p,scriptId:y}})};await a(v)}catch(f){f!=null&&f.errorFields||i.error(f.message)}};return P.jsx(qr,{title:t?`Edit quick launch Β· ${t.name}`:"Add quick launch",open:e,onCancel:r,onOk:d,okText:t?"Save changes":"Save quick launch",width:760,destroyOnClose:!0,children:P.jsxs(cn,{form:c,layout:"vertical",children:[P.jsx(cn.Item,{label:"Name",name:"name",rules:[{required:!0}],children:P.jsx(sr,{placeholder:"Start local stack",allowClear:!0})}),P.jsx(cn.Item,{label:"Scripts",name:"items",rules:[{required:!0,message:"Select at least one script."}],children:P.jsx(ka.Group,{className:"group-task-selector",children:P.jsx(ds,{items:u})})})]})})}const gR={30:"ansi-black",31:"ansi-red",32:"ansi-green",33:"ansi-yellow",34:"ansi-blue",35:"ansi-magenta",36:"ansi-cyan",37:"ansi-white",90:"ansi-gray",91:"ansi-red",92:"ansi-green",93:"ansi-yellow",94:"ansi-blue",95:"ansi-magenta",96:"ansi-cyan",97:"ansi-white"};function Iy({value:e,editor:t}){const[n,r]=l.useState(t||"vscode"),[a,i]=l.useState(""),[c,u]=l.useState("");l.useEffect(()=>{t&&r(t),Oa.status().then(g=>{g!=null&&g.defaultEditor&&!t&&r(g.defaultEditor),g!=null&&g.domain&&i(g.domain),g!=null&&g.jiraIssuePrefix&&u(g.jiraIssuePrefix)}).catch(()=>{})},[t]);const d=(c||"").split(/[\s,]+/).filter(Boolean).map(g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),f=d.length>0&&a?new RegExp(`\\b(?:${d.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,v=(g,p)=>{let y="";const C=($,w)=>$.split(/(\u001b\[[0-9;]*m)/g).map((O,I)=>{const R=O.match(/^\u001b\[([0-9;]*)m$/);if(R){const N=R[1].split(";").map(Number);return y=N.includes(0)?"":gR[N.find(j=>gR[j])]||y,null}if(!O)return null;const T=y||(/\b(error|failed|fatal|exception|TS\d{4,5})\b/i.test(O)?"log-error":/\b(warn|warning)\b/i.test(O)?"log-warning":/\b(success|ready|started|listening)\b/i.test(O)?"log-success":"");return P.jsx("span",{className:T,children:O},`${w}-${I}`)}),S=/(https?:\/\/(?:[^\s<>'"`]|\u001b\[[0-9;]*m)+|\/(?:(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+\/)*(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+)?)?)/g,b=f&&f.test(g);return!g.includes("http")&&!g.includes("/")&&!b?C(g,`${p}-0`):g.split(S).map(($,w)=>{if(!$)return null;const E=`${p}-${w}`;if(/^https?:\/\//.test($.replace(/\u001b\[[0-9;]*m/g,""))){const I=$.replace(/\u001b\[[0-9;]*m/g,""),R=I.replace(/[),.;:!?]+$/,""),T=I.slice(R.length);return P.jsxs("span",{children:[P.jsx("a",{className:"log-link",href:R,target:"_blank",rel:"noreferrer",onClick:N=>{N.preventDefault(),$o(R)},children:C($.slice(0,$.length-T.length),`${E}-url`)}),T&&C(T,`${E}-suf`)]},E)}const O=$.replace(/\u001b\[[0-9;]*m/g,"");if(O.startsWith("/")){const[,I,R=""]=O.match(/^(.*?)(:\d+(?::\d+)?)?$/)||[];if(I){const T=aj(n,I,R);return P.jsx("a",{className:"log-link",href:T,target:"_blank",rel:"noreferrer",title:`Open in ${rj(n)}`,children:C($,E)},E)}}if(f&&a&&(f.lastIndex=0,f.test(O))){const I=[];let R=0;f.lastIndex=0;for(const T of O.matchAll(f)){T.index>R&&I.push(C(O.slice(R,T.index),`${E}-sub-${T.index}`));const N=T[0],j=dS(a,N);I.push(P.jsx("a",{className:"log-link",href:j,target:"_blank",rel:"noreferrer",onClick:_=>{_.preventDefault(),$o(j)},children:N},`${E}-jira-${T.index}`)),R=T.index+N.length}return R<O.length&&I.push(C(O.slice(R),`${E}-sub-end`)),P.jsx("span",{children:I},E)}return C($,E)})};return P.jsx("div",{className:"log-output",role:"log",children:e.split(`
|
|
497
|
-
`).map((g,p)=>P.jsx("div",{className:"log-line",children:P.jsx("code",{children:v(g,p)})},p))})}function Bae({open:e,logTarget:t,onCancel:n}){var u;const[r,a]=l.useState("output"),[i,c]=l.useState("");return l.useEffect(()=>{e&&(a("output"),c("Loadingβ¦"))},[e,t]),l.useEffect(()=>{if(!e||!t)return;const d=async()=>{try{const v=t.package?r==="error"?await Sr.packageScriptErrorLogs(t.launcher.id,t.script.name):await Sr.packageScriptLogs(t.launcher.id,t.script.name):r==="error"?await Sr.errorLogs(t.launcher.id,t.script.id):await Sr.logs(t.launcher.id,t.script.id);c(v.log||(r==="error"?"No error logs yet.":"No logs yet."))}catch(v){c(v.message)}};d();const f=setInterval(d,1e3);return()=>clearInterval(f)},[e,t,r]),P.jsx(qr,{title:t?`${(u=t.launcher)!=null&&u.alias?`${t.launcher.alias} / `:""}${t.script.name} Β· Logs`:"Logs",open:e,onCancel:n,footer:null,width:1080,zIndex:1200,children:P.jsx(ds,{activeKey:r,onChange:a,tabBarExtraContent:t&&P.jsx($t,{icon:P.jsx(cS,{}),onClick:()=>{const d=t.package?`#/logs/${t.launcher.id}/pkg/${encodeURIComponent(t.script.name)}`:`#/logs/${t.launcher.id}/${encodeURIComponent(t.script.id)}`;window.open(d,"_blank")},children:"Open in new tab"}),items:[{key:"output",label:"Logs",children:P.jsx(Iy,{value:i})},{key:"error",label:"Error logs",children:P.jsx(Iy,{value:i})}]})})}const{Title:Lae,Text:X0,Paragraph:Hae}=Hr;function kae({launchers:e,running:t,errorCounts:n={},refresh:r,loading:a}){const{message:i}=co.useApp(),[c,u]=l.useState("all"),[d,f]=l.useState([]),[v,g]=l.useState([]),[p,y]=l.useState(!1),[C,S]=l.useState(!1),[b,x]=l.useState(null),[$,w]=l.useState(!1),[E,O]=l.useState(null),[I,R]=l.useState(!1),[T,N]=l.useState(null),[j,_]=l.useState("vscode");l.useEffect(()=>{di.list().then(f).catch(oe=>i.error(oe.message)),Oa.status().then(oe=>{oe!=null&&oe.defaultEditor&&_(oe.defaultEditor)}).catch(()=>{})},[]);const B=l.useMemo(()=>[...new Set(e.map(oe=>oe.groupName).filter(Boolean))].sort((oe,ne)=>oe.localeCompare(ne)),[e]),k=c==="all"?e:e.filter(oe=>oe.groupName===c),A=(oe=null)=>{O(oe),w(!0)},F=async oe=>{if(E){const ne=await Sr.update(E.id,oe);O(ne)}else await Sr.create(oe),w(!1);i.success("Saved"),await r()},z=async oe=>{try{const ne=[...t].filter(Y=>Y.startsWith(`${oe.id}:`));if(ne.length>0){const Y=ne.map(le=>le.slice(`${oe.id}:`.length));await Promise.all(Y.map(le=>Sr.stop(oe.id,le)))}await Sr.remove(oe.id),w(!1),i.success("Deleted"),await r()}catch(ne){i.error(ne.message)}},L=async(oe,ne)=>{try{await Sr.run(oe.id,ne.id),await r()}catch(Y){i.error(Y.message)}},W=async oe=>{try{await Sr.runInstall(oe.id),await r()}catch(ne){i.error(ne.message)}},G=async(oe,ne)=>{try{await Sr.runPackageScript(oe.id,ne.name),await r()}catch(Y){i.error(Y.message)}},V=(oe,ne,Y=!1)=>{N({launcher:oe,script:ne,package:Y}),R(!0)},H=async oe=>{try{await Sr.start(oe.id),await r()}catch(ne){i.warning(ne.message)}},U=async(oe,ne)=>{try{await Sr.stop(oe.id,ne),await r()}catch(Y){await r(),i.error(Y.message)}},K=async(oe,ne)=>{try{await Promise.all(ne.map(Y=>Sr.stop(oe.id,Y))),await r()}catch(Y){await r(),i.error(Y.message)}},q=async(oe=null)=>{if(x(oe),S(!0),!v.length)try{g(await di.catalog())}catch(ne){i.error(ne.message)}},Z=async oe=>{b?await di.update(b.id,oe):await di.create(oe),S(!1),f(await di.list())},X=async oe=>{const ne=`group-task-${oe.id}`;i.loading({content:`Starting ${oe.name}β¦`,key:ne,duration:0});try{const Y=await di.start(oe.id),le=Y.results.filter(ue=>ue.error);le.length?i.warning({content:`${Y.results.length-le.length} started, ${le.length} failed.`,key:ne}):i.success({content:`${Y.results.length} scripts started.`,key:ne}),await r()}catch(Y){i.error({content:Y.message,key:ne})}},ee=async oe=>{const ne=`group-task-${oe.id}`;i.loading({content:`Stopping ${oe.name}β¦`,key:ne,duration:0});try{const le=(await di.stop(oe.id)).results.filter(ue=>ue.ok).length;i.success({content:`${le} scripts stopped.`,key:ne}),await r()}catch(Y){i.error({content:Y.message,key:ne})}},te=async oe=>{try{await di.remove(oe.id),f(await di.list())}catch(ne){i.error(ne.message)}},ie=[{title:"Service",dataIndex:"alias",render:(oe,ne)=>P.jsx("a",{href:aj(j,ne.folder),title:`Open ${ne.folder} in ${rj(j)}`,onClick:Y=>Y.stopPropagation(),style:{fontWeight:600},children:oe})},{title:"Current branch",dataIndex:"branch",width:400,render:oe=>oe?P.jsx(X0,{code:!0,children:oe}):P.jsx(X0,{type:"secondary",children:"β"})},{title:"Scripts",width:170,align:"center",render:(oe,ne)=>{const Y=[...t].filter(de=>de.startsWith(`${ne.id}:`)).length,le=ne.scripts.length+(ne.packageScriptCount||0),ue=Object.entries(n).filter(([de])=>de.startsWith(`${ne.id}:`)).reduce((de,[,ce])=>de+(ce||0),0);return P.jsxs(sn,{size:8,children:[P.jsx(vi,{status:Y?"success":"default",text:`${Y} / ${le} running`}),ue>0&&P.jsx(vi,{count:ue,overflowCount:999,style:{backgroundColor:"#ff4d4f"}})]})}},{title:"Action",width:108,align:"center",render:(oe,ne)=>{const Y=[...t].filter(ue=>ue.startsWith(`${ne.id}:`)),le=Y.length>0;return P.jsx($t,{size:"small",type:le?"default":"primary",danger:le,icon:le?P.jsx(Rv,{}):P.jsx(Oy,{}),onClick:ue=>{ue.stopPropagation(),le?K(ne,Y.map(de=>de.slice(`${ne.id}:`.length))):H(ne)},children:le?"Stop":"Start"})}}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(X0,{type:"secondary",children:"SERVICES"}),P.jsx(Lae,{level:2,children:"Launcher"}),P.jsx(Hae,{type:"secondary",children:"Manage and run local project scripts."})]}),P.jsxs(sn,{children:[P.jsx($t,{onClick:()=>y(!0),children:"Quick Launch"}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:()=>A(),children:"Add service"})]})]}),a?P.jsx("div",{style:{padding:"80px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):e.length?P.jsxs(P.Fragment,{children:[d.length>0&&P.jsx("div",{className:"quick-launch-bar",style:{marginBottom:20,padding:"12px 16px",background:"#fff",borderRadius:8,border:"1px solid #e4e8f1",boxShadow:"0 2px 8px rgba(31, 42, 68, 0.03)"},children:P.jsxs(sn,{wrap:!0,size:"middle",children:[P.jsx("span",{style:{fontSize:11,color:"#727b94",fontWeight:750,textTransform:"uppercase",letterSpacing:"0.08em"},children:"Quick Launch:"}),d.map(oe=>{const ne=oe.items.every(Y=>t.has(`${Y.launcherId}:${Y.scriptId}`));return P.jsxs($t,{type:ne?"default":"primary",danger:ne,icon:ne?P.jsx(Rv,{}):P.jsx(Oy,{}),onClick:()=>ne?ee(oe):X(oe),children:[ne?"Stop":"Start"," ",oe.name]},oe.id)})]})}),P.jsx(ds,{activeKey:c,onChange:u,className:"group-tabs",items:[{key:"all",label:`All (${e.length})`},...B.map(oe=>({key:oe,label:`${oe} (${e.filter(ne=>ne.groupName===oe).length})`}))]}),k.length?P.jsx(va,{className:"launcher-table",rowKey:"id",dataSource:k,columns:ie,pagination:!1,onRow:oe=>({onClick:()=>A(oe)})}):P.jsx(lr,{description:"No services in this group."})]}):P.jsx(lr,{description:"No services yet",children:P.jsx($t,{type:"primary",onClick:()=>A(),children:"Add service"})}),P.jsx(_ae,{open:$,editing:E,groups:B,running:t,errorCounts:n,onCancel:()=>w(!1),onSave:F,onRun:L,onRunInstall:W,onRunPackage:G,onStop:U,onLogs:V,onDelete:z}),P.jsx(qr,{title:"Quick Launch",open:p,onCancel:()=>y(!1),footer:null,width:760,destroyOnClose:!0,children:P.jsx(Tae,{tasks:d,running:t,onCreate:()=>q(),onEdit:q,onStart:X,onStop:ee,onRemove:te})}),P.jsx(Aae,{open:C,editingGroupTask:b,groupCatalog:v,onCancel:()=>S(!1),onSave:Z}),P.jsx(Bae,{open:I,logTarget:T,onCancel:()=>R(!1)})]})}const{Title:Fae,Text:Ho,Paragraph:Vae}=Hr;function Wae({refreshLaunchers:e}){const[t,n]=l.useState([]),[r,a]=l.useState(!1),[i,c]=l.useState(null),[u,d]=l.useState(!1),[f,v]=l.useState(!1),[g,p]=l.useState(null),y=async()=>{a(!0);try{n((await q0.list()).ports)}catch(x){gr.error(x.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const C=async()=>{if(i){d(!0);try{const x=(await q0.get(i)).process;p(x),v(!0)}catch(x){gr.error(x.message)}finally{d(!1)}}},S=async({port:x,pid:$})=>{try{await q0.kill(x,$),gr.success(`Process on port ${x} was killed.`),await y(),e&&await e()}catch(w){gr.error(w.message)}},b=[{title:"Port",dataIndex:"port",width:100,render:x=>P.jsx(Ho,{code:!0,children:x})},{title:"Last used",dataIndex:"launcher",render:(x,$)=>P.jsxs(sn,{direction:"vertical",size:0,children:[P.jsx(Ho,{strong:!0,children:x}),P.jsx(Ho,{type:"secondary",children:$.script})]})},{title:"Process",dataIndex:"command",render:(x,$)=>P.jsxs(sn,{direction:"vertical",size:0,children:[P.jsx(Ho,{code:!0,children:$.currentCommand||x}),P.jsxs(Ho,{type:"secondary",children:["PID ",$.currentPid||$.pid]})]})},{title:"Status",width:170,render:(x,$)=>$.ghost?P.jsx(Vn,{color:"error",children:"Ghost process"}):$.listening?P.jsx(Vn,{color:"success",children:"Script running"}):$.reused?P.jsx(Vn,{color:"warning",children:"Port reused"}):P.jsx(Vn,{children:"Port released"})},{title:"Action",width:100,render:(x,$)=>$.listening||$.reused?P.jsx(xo,{title:`Kill process on port ${$.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>S({port:$.port,pid:$.currentPid}),children:P.jsx($t,{danger:!0,icon:P.jsx(fa,{}),children:"Kill"})}):P.jsx($t,{disabled:!0,icon:P.jsx(fa,{}),children:"Kill"})}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Ho,{type:"secondary",children:"DIAGNOSTICS"}),P.jsx(Fae,{level:2,children:"Port Diagnostic"}),P.jsx(Vae,{type:"secondary",children:"Every port observed while a recent Launcher script was running. Ghost processes still listen after their script has stopped."})]}),P.jsx($t,{icon:P.jsx(Ec,{}),onClick:y,loading:r,children:"Refresh"})]}),P.jsxs(Bn,{className:"port-manual-query",size:"small",children:[P.jsxs(sn,{wrap:!0,children:[P.jsx(Ho,{strong:!0,children:"Query port"}),P.jsx(yv,{min:1,max:65535,controls:!1,value:i,onChange:c,onPressEnter:C,placeholder:"e.g. 3000"}),P.jsx($t,{type:"primary",onClick:C,loading:u,disabled:!i,children:"Query"})]}),f&&P.jsx("div",{className:"port-query-result",children:g?P.jsxs(sn,{wrap:!0,children:[P.jsx(Vn,{color:"success",children:"Listening"}),P.jsxs(Ho,{code:!0,children:["PID ",g.pid]}),P.jsx(Ho,{code:!0,children:g.command}),P.jsx(xo,{title:`Kill process on port ${g.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>S(g),children:P.jsx($t,{danger:!0,icon:P.jsx(fa,{}),children:"Kill"})})]}):P.jsxs(Ho,{type:"secondary",children:["No process is listening on port ",i,"."]})})]}),P.jsx(va,{className:"port-diagnostic-table",rowKey:x=>`${x.startedAt}-${x.port}-${x.pid}`,loading:r,dataSource:t,columns:b,pagination:!1,locale:{emptyText:P.jsx(lr,{description:"No ports have been observed from Launcher scripts yet."})}})]})}const{Title:Im,Paragraph:Y0,Text:vo}=Hr,Q0=[{id:"bitbucket",label:"Bitbucket"},{id:"jira",label:"Jira"},{id:"confluence",label:"Confluence"}];function Kae({onStaticPagesChange:e}){const[t]=cn.useForm(),[n]=cn.useForm(),[r,a]=l.useState({}),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[f,v]=l.useState([]),[g,p]=l.useState(!1),[y,C]=l.useState(null),[S,b]=l.useState(!1),x=async()=>{try{const N=await ic.list();v(N)}catch(N){gr.error(N.message)}};l.useEffect(()=>{Oa.status().then(N=>{a(N),t.setFieldsValue({domain:N.domain,jiraIssuePrefix:N.jiraIssuePrefix||"",defaultEditor:N.defaultEditor||"vscode",defaultBrowser:N.defaultBrowser||"chrome"})}).catch(N=>gr.error(N.message)),x()},[t]);const $=N=>r[`${N}TokenConfigured`],w=async()=>{try{await t.validateFields(["domain"]),c(!0);const N=t.getFieldsValue();if(N.domain!=null){const j=await Oa.saveDomain(N.domain);a(_=>({..._,...j})),t.setFieldValue("domain",j.domain)}if(N.jiraIssuePrefix!=null){const j=await Oa.saveJiraIssuePrefix(N.jiraIssuePrefix);a(_=>({..._,...j})),t.setFieldValue("jiraIssuePrefix",j.jiraIssuePrefix)}if(N.defaultEditor!=null){const j=await Oa.saveDefaultEditor(N.defaultEditor);a(_=>({..._,...j})),t.setFieldValue("defaultEditor",j.defaultEditor)}if(N.defaultBrowser!=null){const j=await Oa.saveDefaultBrowser(N.defaultBrowser);a(_=>({..._,...j})),t.setFieldValue("defaultBrowser",j.defaultBrowser)}for(const{id:j}of Q0)if(N[j]){const _=await Oa.saveAccessToken(j,N[j]);a(B=>({...B,..._})),t.resetFields([j])}c(!1),d(!0),setTimeout(()=>d(!1),1500)}catch(N){c(!1),N!=null&&N.errorFields||gr.error(N.message)}},E=async N=>{try{const j=await Oa.saveAccessToken(N,"");a(j),t.resetFields([N]),gr.success(`${Q0.find(_=>_.id===N).label} Access Token removed.`)}catch(j){gr.error(j.message)}},O=()=>{C(null),n.resetFields(),p(!0)},I=N=>{C(N),n.setFieldsValue({name:N.name,url:N.url}),p(!0)},R=async N=>{try{await ic.remove(N),gr.success("Static page deleted."),await x(),e==null||e()}catch(j){gr.error(j.message)}},T=async()=>{try{const N=await n.validateFields();b(!0),y?(await ic.update(y.id,N),gr.success("Static page updated.")):(await ic.create(N),gr.success("Static page created.")),b(!1),p(!1),await x(),e==null||e()}catch(N){b(!1),N!=null&&N.errorFields||gr.error(N.message)}};return P.jsxs("div",{className:"settings-page",children:[P.jsx(vo,{type:"secondary",children:"SETTINGS"}),P.jsxs("div",{className:"settings-page-header",children:[P.jsx(Im,{level:2,children:"Settings"}),P.jsx($t,{type:"primary",color:u?"green":"primary",variant:"solid",icon:u?P.jsx(is,{}):null,loading:!u&&i,onClick:w,children:u?"Saved":"Save"})]}),P.jsxs(cn,{form:t,layout:"vertical",children:[P.jsxs(Bn,{className:"settings-card",style:{marginBottom:20},children:[P.jsxs("div",{className:"settings-title",children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx($re,{className:"settings-icon"})}),P.jsxs("div",{children:[P.jsx(Im,{level:4,children:"Default Applications"}),P.jsx(Y0,{type:"secondary",children:"Choose your preferred editor and browser to open files, folders, and links."})]})]}),P.jsxs("div",{className:"token-settings-form",children:[P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Default Editor"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"VS Code, Devin, or IntelliJ IDEA"})]}),P.jsx(cn.Item,{name:"defaultEditor",children:P.jsx(Mr,{options:nj,style:{width:220}})})]}),P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Default Browser"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"Choose your default browser"})]}),P.jsx(cn.Item,{name:"defaultBrowser",style:{marginBottom:0},children:P.jsx(Mr,{options:Oae,style:{width:220}})})]})]})]}),P.jsxs(Bn,{className:"settings-card",style:{marginBottom:20},children:[P.jsxs("div",{className:"settings-title",style:{borderBottom:"none",marginBottom:12,paddingBottom:0},children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx(cS,{className:"settings-icon"})}),P.jsxs("div",{style:{flex:1},children:[P.jsx(Im,{level:4,children:"Static Pages"}),P.jsx(Y0,{type:"secondary",children:"Configure static pages (stored in data.static-pages.json) to display in the sidebar menu."})]}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:O,children:"Add Static Page"})]}),P.jsx(va,{dataSource:f,rowKey:"id",pagination:!1,size:"middle",columns:[{title:"Page Name",dataIndex:"name",key:"name",width:200},{title:"URL",dataIndex:"url",key:"url",render:N=>P.jsx("a",{href:N,target:"_blank",rel:"noreferrer",children:N})},{title:"Action",key:"action",width:140,align:"right",render:(N,j)=>P.jsxs(sn,{children:[P.jsx($t,{type:"link",size:"small",icon:P.jsx(Mg,{}),onClick:()=>I(j),children:"Edit"}),P.jsx(xo,{title:"Delete static page?",description:"Are you sure you want to delete this page?",onConfirm:()=>R(j.id),okText:"Yes",cancelText:"No",children:P.jsx($t,{type:"link",danger:!0,size:"small",icon:P.jsx(fa,{}),children:"Delete"})})]})}]})]}),P.jsxs(Bn,{className:"settings-card",children:[P.jsxs("div",{className:"settings-title",children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx(Gre,{className:"settings-icon"})}),P.jsxs("div",{children:[P.jsx(Im,{level:4,children:"Access Tokens & Domain"}),P.jsx(Y0,{type:"secondary",children:"Tokens are stored locally and are never shown again."})]})]}),P.jsxs("div",{className:"token-settings-form",children:[P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Domain"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"e.g. abc.com"})]}),P.jsx(cn.Item,{name:"domain",rules:[{pattern:/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:"Enter a valid domain, e.g. abc.com"}],children:P.jsx(sr,{placeholder:"abc.com",allowClear:!0})})]}),P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Jira Issue Prefix"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"e.g. PROJ"})]}),P.jsx(cn.Item,{name:"jiraIssuePrefix",children:P.jsx(sr,{placeholder:"PROJ",allowClear:!0})})]}),Q0.map(({id:N,label:j})=>P.jsxs("div",{className:`token-row ${$(N)?"is-configured":""}`,children:[P.jsxs("div",{className:"token-row-info",children:[P.jsxs("div",{className:"token-row-name-line",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:j}),$(N)&&P.jsx(Vn,{color:"success",closable:!0,onClose:_=>{_.preventDefault(),E(N)},className:"token-row-tag",children:"Configured"})]}),P.jsxs(vo,{type:"secondary",className:"token-row-hint",children:[j," API access token"]})]}),P.jsx(cn.Item,{name:N,children:P.jsx(sr.Password,{placeholder:$(N)?"Enter new token to replace":"Paste access token",autoComplete:"off",allowClear:!0})})]},N))]})]})]}),P.jsx(qr,{title:y?"Edit Static Page":"Add Static Page",open:g,onOk:T,onCancel:()=>p(!1),okText:"Save",confirmLoading:S,destroyOnClose:!0,children:P.jsxs(cn,{form:n,layout:"vertical",style:{marginTop:16},children:[P.jsx(cn.Item,{name:"name",label:"Page Name",rules:[{required:!0,message:"Please enter page name"}],children:P.jsx(sr,{placeholder:"e.g. test name"})}),P.jsx(cn.Item,{name:"url",label:"URL",rules:[{required:!0,message:"Please enter page URL"}],children:P.jsx(sr,{placeholder:"e.g. https://example.com"})})]})})]})}const{Title:pR,Text:Ea,Paragraph:Uae}=Hr,{Dragger:qae}=sS,hR=(e=0)=>{if(!e)return"0 B";const t=["B","KB","MB","GB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${(e/1024**n).toFixed(n?1:0)} ${t[n]}`},Gae=e=>({file:e,name:e.name||"clipboard-image.png",url:URL.createObjectURL(e),size:e.size});function Xae(){const[e,t]=l.useState(null),[n,r]=l.useState(null),[a,i]=l.useState(75),[c,u]=l.useState(!0),[d,f]=l.useState(!0),[v,g]=l.useState(!0),[p,y]=l.useState(2),[C,S]=l.useState(!1),[b,x]=l.useState(null),[$,w]=l.useState(100),[E,O]=l.useState(!1),[I,R]=l.useState(!1),[T,N]=gr.useMessage(),j=l.useRef(null),_=l.useRef(null),B=V=>{var H;(H=V.current)!=null&&H.url&&URL.revokeObjectURL(V.current.url)},k=V=>{var U;if(!((U=V==null?void 0:V.type)!=null&&U.startsWith("image/")))return T.error("Please choose an image file."),!1;B(j),B(_);const H=Gae(V);return j.current=H,_.current=null,t(H),r(null),L(V),!1},A=V=>{var H;return[...((H=V.dataTransfer)==null?void 0:H.types)||[]].includes("Files")},F=V=>{var U;V.preventDefault(),R(!1);const H=[...((U=V.dataTransfer)==null?void 0:U.files)||[]].find(K=>K.type.startsWith("image/"));H?k(H):T.error("Drop an image file to compress it.")};l.useEffect(()=>()=>{B(j),B(_)},[]),l.useEffect(()=>{const V=H=>{var q;const U=[...((q=H.clipboardData)==null?void 0:q.items)||[]].find(Z=>Z.type.startsWith("image/"));if(!U)return;H.preventDefault();const K=U.getAsFile();K&&(k(new File([K],`clipboard-${Date.now()}.${K.type.split("/")[1]||"png"}`,{type:K.type})),T.success("Image read from clipboard."))};return window.addEventListener("paste",V),()=>window.removeEventListener("paste",V)},[T]);const z=async()=>{var V;try{if(!((V=navigator.clipboard)!=null&&V.read))throw new Error("Direct clipboard reading is unavailable. Paste an image with β / Ctrl + V instead.");const H=await navigator.clipboard.read();for(const U of H){const K=U.types.find(q=>q.startsWith("image/"));if(K){const q=await U.getType(K);k(new File([q],`clipboard-${Date.now()}.${K.split("/")[1]||"png"}`,{type:K})),T.success("Image read from clipboard.");return}}throw new Error("No image was found in the clipboard.")}catch(H){T.warning(H.message||"Unable to read an image from the clipboard.")}},L=async(V=e==null?void 0:e.file)=>{if(V){O(!0);try{const[{encode:H},{imageData:U,width:K,height:q}]=await Promise.all([ej(()=>import("./index-Dty-56mC.js"),[]),tj(V,b,$)]),Z=await H(U,{quality:a,progressive:c,optimize_coding:d,auto_subsample:v,chroma_subsample:p,trellis_multipass:C});B(_);const X=new Blob([Z],{type:"image/jpeg"}),ee={url:URL.createObjectURL(X),size:X.size,width:K,height:q};_.current=ee,r(ee),T.success("MozJPEG compression complete.")}catch(H){T.error(H.message||"Image compression failed.")}finally{O(!1)}}},W=()=>{if(!n)return;const V=e.name.replace(/\.[^.]+$/,"")||"image",H=document.createElement("a");H.href=n.url,H.download=`${V}-mozjpeg.jpg`,H.click()},G=n&&e?Math.round((1-n.size/e.size)*100):null;return P.jsxs(P.Fragment,{children:[N,P.jsxs("div",{className:`squoosh-page ${I?"is-file-dragging":""}`,onDragOver:V=>{A(V)&&(V.preventDefault(),R(!0))},onDragLeave:V=>{V.currentTarget===V.target&&R(!1)},onDrop:F,children:[P.jsxs("header",{className:"squoosh-header",children:[P.jsxs("div",{children:[P.jsx(Ea,{children:"MOZJPEG WORKBENCH"}),P.jsx(pR,{level:2,children:"Image compression"})]}),P.jsxs(sn,{children:[P.jsx($t,{icon:P.jsx(ul,{}),onClick:z,children:"Read clipboard"}),P.jsx($t,{type:"primary",icon:P.jsx(Ey,{}),onClick:()=>L(),disabled:!e,loading:E,children:"Compress"})]})]}),P.jsxs("main",{className:"squoosh-studio",children:[P.jsxs("section",{className:"squoosh-preview-area",children:[P.jsx(bR,{title:"Original",detail:e?`${hR(e.size)} Β· ${e.name}`:"Choose an image to begin",children:e?P.jsx(yR,{label:"Original image",image:e.url}):P.jsxs(qae,{accept:"image/*",multiple:!1,showUploadList:!1,beforeUpload:k,className:"image-dropzone",children:[P.jsx("p",{className:"ant-upload-drag-icon",children:P.jsx(uS,{})}),P.jsx("p",{className:"ant-upload-text",children:"Drop an image or click to choose"}),P.jsx("p",{className:"ant-upload-hint",children:"Or paste an image with β / Ctrl + V."})]})}),P.jsx(bR,{title:"MozJPEG output",detail:n?`${hR(n.size)} Β· ${n.width} Γ ${n.height}`:"Waiting for compression",action:n&&P.jsx($t,{type:"primary",size:"small",icon:P.jsx(GT,{}),onClick:W,children:"Download"}),children:E?P.jsx("div",{className:"image-loading",children:P.jsx(bi,{tip:"Compressingβ¦"})}):n?P.jsxs(P.Fragment,{children:[P.jsx(yR,{label:"Compressed JPEG",image:n.url}),G!==null&&P.jsx("div",{className:`compression-saving ${G>0?"is-saving":""}`,children:G>0?`${G}% smaller`:"No size reduction at current settings."})]}):P.jsx(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:"Compressed preview"})})]}),P.jsxs("aside",{className:"squoosh-settings",children:[P.jsxs("div",{className:"settings-heading",children:[P.jsx(Ea,{children:"ENCODER"}),P.jsx(pR,{level:4,children:"MozJPEG"}),P.jsx(Uae,{children:"Fine-tune output size and image quality."})]}),P.jsxs("div",{className:"option-row",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Quality"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Higher values preserve more detail."})]}),P.jsx(Vn,{color:"blue",children:a})]}),P.jsx(gG,{min:1,max:100,value:a,onChange:i,tooltip:{formatter:V=>`${V}`}}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Long edge"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Scale the longest edge to this value. Never crops the image."})]}),P.jsx(yv,{min:1,max:16384,value:b,onChange:x,placeholder:"Original",addonAfter:"px"})]}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Scale"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Scale the image by percentage."})]}),P.jsx(yv,{min:1,max:100,value:$,onChange:w,placeholder:"100",addonAfter:"%",allowClear:!0})]}),P.jsx(Nm,{label:"Progressive JPEG",description:"Display a low-detail preview while loading.",checked:c,onChange:u}),P.jsx(Nm,{label:"Optimize coding",description:"Reduce size without changing image quality.",checked:d,onChange:f}),P.jsx(sv,{ghost:!0,className:"advanced-options",items:[{key:"advanced",label:"Advanced settings",children:P.jsxs(P.Fragment,{children:[P.jsx(Nm,{label:"Automatic chroma subsampling",description:"Pick sampling based on the image content.",checked:v,onChange:g}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Chroma subsampling"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Enabled when automatic mode is off."})]}),P.jsx(Mr,{disabled:v,value:p,onChange:y,options:[{value:0,label:"4:4:4 (colour detail)"},{value:1,label:"4:2:2 (balanced)"},{value:2,label:"4:2:0 (smaller file)"}]})]}),P.jsx(Nm,{label:"Trellis multi-pass",description:"Further size reduction with a longer encode time.",checked:C,onChange:S})]})}]}),P.jsx($t,{type:"primary",size:"large",block:!0,icon:P.jsx(Ey,{}),onClick:()=>L(),disabled:!e,loading:E,children:"Compress image"})]})]})]})]})}function bR({title:e,detail:t,action:n,children:r}){return P.jsxs("section",{className:"preview-pane",children:[P.jsxs("header",{children:[P.jsxs("div",{children:[P.jsx(Ea,{children:e}),P.jsx("span",{children:t})]}),n]}),P.jsx("div",{className:"preview-canvas",children:r})]})}function Nm({label:e,description:t,checked:n,onChange:r}){return P.jsxs("div",{className:"option-switch",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:e}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:t})]}),P.jsx(Og,{checked:n,onChange:r})]})}function yR({label:e,image:t,metadata:n}){return P.jsxs("div",{className:"image-panel",children:[P.jsx("img",{src:t,alt:e}),n&&P.jsx("div",{className:"image-panel-meta",children:P.jsx(Ea,{type:"secondary",children:n})})]})}const{Title:Yae,Text:Qr,Paragraph:CR}=Hr;function Qae({prs:e,selectedPrKeys:t,onToggleSelectPr:n,onSelectPr:r}){return e.length===0?P.jsx(lr,{description:"No open pull requests found.",style:{padding:"24px 0"}}):P.jsx("div",{style:{display:"grid",gap:"12px"},children:e.map(a=>{var d,f,v,g,p,y,C,S,b;const i=a.reviewUrl||"",c=a.reviewUrl||a.id,u=t.includes(c);return P.jsx(Bn,{size:"small",hoverable:!0,style:{borderColor:u?"#1677ff":"#e3e6ef",backgroundColor:u?"#f0f5ff":"#ffffff",transition:"all 0.2s"},onClick:()=>i&&r(i),children:P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px"},children:[P.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"12px"},children:[P.jsx(ka,{checked:u,onChange:x=>{x.stopPropagation(),n(c)},onClick:x=>x.stopPropagation()}),P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsxs(sn,{size:8,wrap:!0,children:[P.jsxs(Qr,{strong:!0,style:{fontSize:"14px"},children:["#",a.id," ",a.title]}),a.draft&&P.jsx(Vn,{color:"gold",children:"Draft"})]}),P.jsxs("div",{style:{marginTop:"6px",fontSize:"12px",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",color:"#727b94"},children:[P.jsxs(Qr,{type:"secondary",style:{fontWeight:500},children:[(v=(f=(d=a.fromRef)==null?void 0:d.repository)==null?void 0:f.project)==null?void 0:v.key," / ",(p=(g=a.fromRef)==null?void 0:g.repository)==null?void 0:p.slug]}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsx(Vn,{size:"small",color:"cyan",style:{margin:0},children:(y=a.fromRef)==null?void 0:y.displayId}),P.jsx(pre,{style:{fontSize:"10px",color:"#8c8c8c"}}),P.jsx(Vn,{size:"small",color:"blue",style:{margin:0},children:(C=a.toRef)==null?void 0:C.displayId}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsxs("span",{children:["Author: ",P.jsx("strong",{children:(b=(S=a.author)==null?void 0:S.user)==null?void 0:b.displayName})]}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsxs("span",{children:["Updated: ",new Date(a.updatedDate).toLocaleDateString()]})]})]})]}),P.jsxs(sn,{size:8,children:[P.jsx($t,{size:"small",icon:P.jsx(JT,{}),onClick:x=>{x.stopPropagation(),i&&$o(i)},children:"Open"}),P.jsx($t,{type:"primary",size:"small",onClick:x=>{x.stopPropagation(),i&&r(i)},children:"Review"})]})]})},c)})})}function Zae(){const[e]=cn.useForm(),[t,n]=l.useState(!1),[r,a]=l.useState(!0),[i,c]=l.useState(null),[u,d]=l.useState(!1),[f,v]=l.useState([]),[g,p]=l.useState([]),[y,C]=l.useState(!1),[S,b]=l.useState("review"),[x,$]=l.useState([]),[w,E]=l.useState(!1),[O,I]=l.useState(null),[R,T]=l.useState(""),[N,j]=l.useState(!1),[_,B]=l.useState(new Set),k=async()=>{C(!0);try{const[X,ee]=await Promise.all([Om.myPrs().catch(()=>({values:[]})),Om.reviewPrs().catch(()=>({values:[]}))]);v((X==null?void 0:X.values)||[]),p((ee==null?void 0:ee.values)||[])}catch{}C(!1)};l.useEffect(()=>{Oa.status().then(X=>{a(X.bitbucketTokenConfigured),X.bitbucketTokenConfigured&&k()}).catch(()=>{})},[]);const A=S==="review"?g:f,F=X=>{b(X),$([])},z=X=>{$(ee=>ee.includes(X)?ee.filter(te=>te!==X):[...ee,X])},L=X=>{if(X.target.checked){const ee=A.map(te=>te.reviewUrl||te.id);$(ee)}else $([])},W=()=>{const ee=A.filter(ie=>x.includes(ie.reviewUrl||ie.id)).map(ie=>ie.reviewUrl).filter(Boolean);if(ee.length===0){gr.warning("No PR URLs selected");return}const te=ee.join(`
|
|
497
|
+
`).map((g,p)=>P.jsx("div",{className:"log-line",children:P.jsx("code",{children:v(g,p)})},p))})}function Bae({open:e,logTarget:t,onCancel:n}){var u;const[r,a]=l.useState("output"),[i,c]=l.useState("");return l.useEffect(()=>{e&&(a("output"),c("Loadingβ¦"))},[e,t]),l.useEffect(()=>{if(!e||!t)return;const d=async()=>{try{const v=t.package?r==="error"?await Sr.packageScriptErrorLogs(t.launcher.id,t.script.name):await Sr.packageScriptLogs(t.launcher.id,t.script.name):r==="error"?await Sr.errorLogs(t.launcher.id,t.script.id):await Sr.logs(t.launcher.id,t.script.id);c(v.log||(r==="error"?"No error logs yet.":"No logs yet."))}catch(v){c(v.message)}};d();const f=setInterval(d,1e3);return()=>clearInterval(f)},[e,t,r]),P.jsx(qr,{title:t?`${(u=t.launcher)!=null&&u.alias?`${t.launcher.alias} / `:""}${t.script.name} Β· Logs`:"Logs",open:e,onCancel:n,footer:null,width:1080,zIndex:1200,children:P.jsx(ds,{activeKey:r,onChange:a,tabBarExtraContent:t&&P.jsx($t,{icon:P.jsx(cS,{}),onClick:()=>{const d=t.package?`#/logs/${t.launcher.id}/pkg/${encodeURIComponent(t.script.name)}`:`#/logs/${t.launcher.id}/${encodeURIComponent(t.script.id)}`;window.open(d,"_blank")},children:"Open in new tab"}),items:[{key:"output",label:"Logs",children:P.jsx(Iy,{value:i})},{key:"error",label:"Error logs",children:P.jsx(Iy,{value:i})}]})})}const{Title:Lae,Text:X0,Paragraph:Hae}=Hr;function kae({launchers:e,running:t,errorCounts:n={},refresh:r,loading:a}){const{message:i}=co.useApp(),[c,u]=l.useState("all"),[d,f]=l.useState([]),[v,g]=l.useState([]),[p,y]=l.useState(!1),[C,S]=l.useState(!1),[b,x]=l.useState(null),[$,w]=l.useState(!1),[E,O]=l.useState(null),[I,R]=l.useState(!1),[T,N]=l.useState(null),[j,_]=l.useState("vscode");l.useEffect(()=>{di.list().then(f).catch(oe=>i.error(oe.message)),Oa.status().then(oe=>{oe!=null&&oe.defaultEditor&&_(oe.defaultEditor)}).catch(()=>{})},[]);const B=l.useMemo(()=>[...new Set(e.map(oe=>oe.groupName).filter(Boolean))].sort((oe,ne)=>oe.localeCompare(ne)),[e]),k=c==="all"?e:e.filter(oe=>oe.groupName===c),A=(oe=null)=>{O(oe),w(!0)},F=async oe=>{if(E){const ne=await Sr.update(E.id,oe);O(ne)}else await Sr.create(oe),w(!1);i.success("Saved"),await r()},z=async oe=>{try{const ne=[...t].filter(Y=>Y.startsWith(`${oe.id}:`));if(ne.length>0){const Y=ne.map(le=>le.slice(`${oe.id}:`.length));await Promise.all(Y.map(le=>Sr.stop(oe.id,le)))}await Sr.remove(oe.id),w(!1),i.success("Deleted"),await r()}catch(ne){i.error(ne.message)}},L=async(oe,ne)=>{try{await Sr.run(oe.id,ne.id),await r()}catch(Y){i.error(Y.message)}},W=async oe=>{try{await Sr.runInstall(oe.id),await r()}catch(ne){i.error(ne.message)}},G=async(oe,ne)=>{try{await Sr.runPackageScript(oe.id,ne.name),await r()}catch(Y){i.error(Y.message)}},V=(oe,ne,Y=!1)=>{N({launcher:oe,script:ne,package:Y}),R(!0)},H=async oe=>{try{await Sr.start(oe.id),await r()}catch(ne){i.warning(ne.message)}},U=async(oe,ne)=>{try{await Sr.stop(oe.id,ne),await r()}catch(Y){await r(),i.error(Y.message)}},K=async(oe,ne)=>{try{await Promise.all(ne.map(Y=>Sr.stop(oe.id,Y))),await r()}catch(Y){await r(),i.error(Y.message)}},q=async(oe=null)=>{if(x(oe),S(!0),!v.length)try{g(await di.catalog())}catch(ne){i.error(ne.message)}},Z=async oe=>{b?await di.update(b.id,oe):await di.create(oe),S(!1),f(await di.list())},X=async oe=>{const ne=`group-task-${oe.id}`;i.loading({content:`Starting ${oe.name}β¦`,key:ne,duration:0});try{const Y=await di.start(oe.id),le=Y.results.filter(ue=>ue.error);le.length?i.warning({content:`${Y.results.length-le.length} started, ${le.length} failed.`,key:ne}):i.success({content:`${Y.results.length} scripts started.`,key:ne}),await r()}catch(Y){i.error({content:Y.message,key:ne})}},ee=async oe=>{const ne=`group-task-${oe.id}`;i.loading({content:`Stopping ${oe.name}β¦`,key:ne,duration:0});try{const le=(await di.stop(oe.id)).results.filter(ue=>ue.ok).length;i.success({content:`${le} scripts stopped.`,key:ne}),await r()}catch(Y){i.error({content:Y.message,key:ne})}},te=async oe=>{try{await di.remove(oe.id),f(await di.list())}catch(ne){i.error(ne.message)}},ie=[{title:"Service",dataIndex:"alias",render:(oe,ne)=>P.jsx("a",{href:aj(j,ne.folder),title:`Open ${ne.folder} in ${rj(j)}`,onClick:Y=>Y.stopPropagation(),style:{fontWeight:600},children:oe})},{title:"Current branch",dataIndex:"branch",width:400,render:oe=>oe?P.jsx(X0,{code:!0,children:oe}):P.jsx(X0,{type:"secondary",children:"β"})},{title:"Scripts",width:170,align:"center",render:(oe,ne)=>{const Y=[...t].filter(de=>de.startsWith(`${ne.id}:`)).length,le=ne.scripts.length+(ne.packageScriptCount||0),ue=Object.entries(n).filter(([de])=>de.startsWith(`${ne.id}:`)).reduce((de,[,ce])=>de+(ce||0),0);return P.jsxs(sn,{size:8,children:[P.jsx(vi,{status:Y?"success":"default",text:`${Y} / ${le} running`}),ue>0&&P.jsx(vi,{count:ue,overflowCount:999,style:{backgroundColor:"#ff4d4f"}})]})}},{title:"Action",width:108,align:"center",render:(oe,ne)=>{const Y=[...t].filter(ue=>ue.startsWith(`${ne.id}:`)),le=Y.length>0;return P.jsx($t,{size:"small",type:le?"default":"primary",danger:le,icon:le?P.jsx(Rv,{}):P.jsx(Oy,{}),onClick:ue=>{ue.stopPropagation(),le?K(ne,Y.map(de=>de.slice(`${ne.id}:`.length))):H(ne)},children:le?"Stop":"Start"})}}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(X0,{type:"secondary",children:"SERVICES"}),P.jsx(Lae,{level:2,children:"Launcher"}),P.jsx(Hae,{type:"secondary",children:"Manage and run local project scripts."})]}),P.jsxs(sn,{children:[P.jsx($t,{onClick:()=>y(!0),children:"Quick Launch"}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:()=>A(),children:"Add service"})]})]}),a?P.jsx("div",{style:{padding:"80px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):e.length?P.jsxs(P.Fragment,{children:[d.length>0&&P.jsx("div",{className:"quick-launch-bar",style:{marginBottom:20,padding:"12px 16px",background:"#fff",borderRadius:8,border:"1px solid #e4e8f1",boxShadow:"0 2px 8px rgba(31, 42, 68, 0.03)"},children:P.jsxs(sn,{wrap:!0,size:"middle",children:[P.jsx("span",{style:{fontSize:11,color:"#727b94",fontWeight:750,textTransform:"uppercase",letterSpacing:"0.08em"},children:"Quick Launch:"}),d.map(oe=>{const ne=oe.items.every(Y=>t.has(`${Y.launcherId}:${Y.scriptId}`));return P.jsxs($t,{type:ne?"default":"primary",danger:ne,icon:ne?P.jsx(Rv,{}):P.jsx(Oy,{}),onClick:()=>ne?ee(oe):X(oe),children:[ne?"Stop":"Start"," ",oe.name]},oe.id)})]})}),P.jsx(ds,{activeKey:c,onChange:u,className:"group-tabs",items:[{key:"all",label:`All (${e.length})`},...B.map(oe=>({key:oe,label:`${oe} (${e.filter(ne=>ne.groupName===oe).length})`}))]}),k.length?P.jsx(va,{className:"launcher-table",rowKey:"id",dataSource:k,columns:ie,pagination:!1,onRow:oe=>({onClick:()=>A(oe)})}):P.jsx(lr,{description:"No services in this group."})]}):P.jsx(lr,{description:"No services yet",children:P.jsx($t,{type:"primary",onClick:()=>A(),children:"Add service"})}),P.jsx(_ae,{open:$,editing:E,groups:B,running:t,errorCounts:n,onCancel:()=>w(!1),onSave:F,onRun:L,onRunInstall:W,onRunPackage:G,onStop:U,onLogs:V,onDelete:z}),P.jsx(qr,{title:"Quick Launch",open:p,onCancel:()=>y(!1),footer:null,width:760,destroyOnClose:!0,children:P.jsx(Tae,{tasks:d,running:t,onCreate:()=>q(),onEdit:q,onStart:X,onStop:ee,onRemove:te})}),P.jsx(Aae,{open:C,editingGroupTask:b,groupCatalog:v,onCancel:()=>S(!1),onSave:Z}),P.jsx(Bae,{open:I,logTarget:T,onCancel:()=>R(!1)})]})}const{Title:Fae,Text:Ho,Paragraph:Vae}=Hr;function Wae({refreshLaunchers:e}){const[t,n]=l.useState([]),[r,a]=l.useState(!1),[i,c]=l.useState(null),[u,d]=l.useState(!1),[f,v]=l.useState(!1),[g,p]=l.useState(null),y=async()=>{a(!0);try{n((await q0.list()).ports)}catch(x){gr.error(x.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const C=async()=>{if(i){d(!0);try{const x=(await q0.get(i)).process;p(x),v(!0)}catch(x){gr.error(x.message)}finally{d(!1)}}},S=async({port:x,pid:$})=>{try{await q0.kill(x,$),gr.success(`Process on port ${x} was killed.`),await y(),e&&await e()}catch(w){gr.error(w.message)}},b=[{title:"Port",dataIndex:"port",width:100,render:x=>P.jsx(Ho,{code:!0,children:x})},{title:"Last used",dataIndex:"launcher",render:(x,$)=>P.jsxs(sn,{direction:"vertical",size:0,children:[P.jsx(Ho,{strong:!0,children:x}),P.jsx(Ho,{type:"secondary",children:$.script})]})},{title:"Process",dataIndex:"command",render:(x,$)=>P.jsxs(sn,{direction:"vertical",size:0,children:[P.jsx(Ho,{code:!0,children:$.currentCommand||x}),P.jsxs(Ho,{type:"secondary",children:["PID ",$.currentPid||$.pid]})]})},{title:"Status",width:170,render:(x,$)=>$.ghost?P.jsx(Vn,{color:"error",children:"Ghost process"}):$.listening?P.jsx(Vn,{color:"success",children:"Script running"}):$.reused?P.jsx(Vn,{color:"warning",children:"Port reused"}):P.jsx(Vn,{children:"Port released"})},{title:"Action",width:100,render:(x,$)=>$.listening||$.reused?P.jsx(xo,{title:`Kill process on port ${$.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>S({port:$.port,pid:$.currentPid}),children:P.jsx($t,{danger:!0,icon:P.jsx(fa,{}),children:"Kill"})}):P.jsx($t,{disabled:!0,icon:P.jsx(fa,{}),children:"Kill"})}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Ho,{type:"secondary",children:"DIAGNOSTICS"}),P.jsx(Fae,{level:2,children:"Port Diagnostic"}),P.jsx(Vae,{type:"secondary",children:"Every port observed while a recent Launcher script was running. Ghost processes still listen after their script has stopped."})]}),P.jsx($t,{icon:P.jsx(Ec,{}),onClick:y,loading:r,children:"Refresh"})]}),P.jsxs(Bn,{className:"port-manual-query",size:"small",children:[P.jsxs(sn,{wrap:!0,children:[P.jsx(Ho,{strong:!0,children:"Query port"}),P.jsx(yv,{min:1,max:65535,controls:!1,value:i,onChange:c,onPressEnter:C,placeholder:"e.g. 3000"}),P.jsx($t,{type:"primary",onClick:C,loading:u,disabled:!i,children:"Query"})]}),f&&P.jsx("div",{className:"port-query-result",children:g?P.jsxs(sn,{wrap:!0,children:[P.jsx(Vn,{color:"success",children:"Listening"}),P.jsxs(Ho,{code:!0,children:["PID ",g.pid]}),P.jsx(Ho,{code:!0,children:g.command}),P.jsx(xo,{title:`Kill process on port ${g.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>S(g),children:P.jsx($t,{danger:!0,icon:P.jsx(fa,{}),children:"Kill"})})]}):P.jsxs(Ho,{type:"secondary",children:["No process is listening on port ",i,"."]})})]}),P.jsx(va,{className:"port-diagnostic-table",rowKey:x=>`${x.startedAt}-${x.port}-${x.pid}`,loading:r,dataSource:t,columns:b,pagination:!1,locale:{emptyText:P.jsx(lr,{description:"No ports have been observed from Launcher scripts yet."})}})]})}const{Title:Im,Paragraph:Y0,Text:vo}=Hr,Q0=[{id:"bitbucket",label:"Bitbucket"},{id:"jira",label:"Jira"},{id:"confluence",label:"Confluence"}];function Kae({onStaticPagesChange:e}){const[t]=cn.useForm(),[n]=cn.useForm(),[r,a]=l.useState({}),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[f,v]=l.useState([]),[g,p]=l.useState(!1),[y,C]=l.useState(null),[S,b]=l.useState(!1),x=async()=>{try{const N=await ic.list();v(N)}catch(N){gr.error(N.message)}};l.useEffect(()=>{Oa.status().then(N=>{a(N),t.setFieldsValue({domain:N.domain,jiraIssuePrefix:N.jiraIssuePrefix||"",defaultEditor:N.defaultEditor||"vscode",defaultBrowser:N.defaultBrowser||"chrome"})}).catch(N=>gr.error(N.message)),x()},[t]);const $=N=>r[`${N}TokenConfigured`],w=async()=>{try{await t.validateFields(["domain"]),c(!0);const N=t.getFieldsValue();if(N.domain!=null){const j=await Oa.saveDomain(N.domain);a(_=>({..._,...j})),t.setFieldValue("domain",j.domain)}if(N.jiraIssuePrefix!=null){const j=await Oa.saveJiraIssuePrefix(N.jiraIssuePrefix);a(_=>({..._,...j})),t.setFieldValue("jiraIssuePrefix",j.jiraIssuePrefix)}if(N.defaultEditor!=null){const j=await Oa.saveDefaultEditor(N.defaultEditor);a(_=>({..._,...j})),t.setFieldValue("defaultEditor",j.defaultEditor)}if(N.defaultBrowser!=null){const j=await Oa.saveDefaultBrowser(N.defaultBrowser);a(_=>({..._,...j})),t.setFieldValue("defaultBrowser",j.defaultBrowser)}for(const{id:j}of Q0)if(N[j]){const _=await Oa.saveAccessToken(j,N[j]);a(B=>({...B,..._})),t.resetFields([j])}c(!1),d(!0),setTimeout(()=>d(!1),1500)}catch(N){c(!1),N!=null&&N.errorFields||gr.error(N.message)}},E=async N=>{try{const j=await Oa.saveAccessToken(N,"");a(j),t.resetFields([N]),gr.success(`${Q0.find(_=>_.id===N).label} Access Token removed.`)}catch(j){gr.error(j.message)}},O=()=>{C(null),n.resetFields(),p(!0)},I=N=>{C(N),n.setFieldsValue({name:N.name,url:N.url}),p(!0)},R=async N=>{try{await ic.remove(N),gr.success("Static page deleted."),await x(),e==null||e()}catch(j){gr.error(j.message)}},T=async()=>{try{const N=await n.validateFields();b(!0),y?(await ic.update(y.id,N),gr.success("Static page updated.")):(await ic.create(N),gr.success("Static page created.")),b(!1),p(!1),await x(),e==null||e()}catch(N){b(!1),N!=null&&N.errorFields||gr.error(N.message)}};return P.jsxs("div",{className:"settings-page",children:[P.jsx(vo,{type:"secondary",children:"SETTINGS"}),P.jsxs("div",{className:"settings-page-header",children:[P.jsx(Im,{level:2,children:"Settings"}),P.jsx($t,{type:"primary",color:u?"green":"primary",variant:"solid",icon:u?P.jsx(is,{}):null,loading:!u&&i,onClick:w,children:u?"Saved":"Save"})]}),P.jsxs(cn,{form:t,layout:"vertical",children:[P.jsxs(Bn,{className:"settings-card",style:{marginBottom:20},children:[P.jsxs("div",{className:"settings-title",children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx($re,{className:"settings-icon"})}),P.jsxs("div",{children:[P.jsx(Im,{level:4,children:"Default Applications"}),P.jsx(Y0,{type:"secondary",children:"Choose your preferred editor and browser to open files, folders, and links."})]})]}),P.jsxs("div",{className:"token-settings-form",children:[P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Default Editor"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"VS Code, Devin, or IntelliJ IDEA"})]}),P.jsx(cn.Item,{name:"defaultEditor",children:P.jsx(Mr,{options:nj,style:{width:220}})})]}),P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Default Browser"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"Choose your default browser"})]}),P.jsx(cn.Item,{name:"defaultBrowser",style:{marginBottom:0},children:P.jsx(Mr,{options:Oae,style:{width:220}})})]})]})]}),P.jsxs(Bn,{className:"settings-card",style:{marginBottom:20},children:[P.jsxs("div",{className:"settings-title",style:{borderBottom:"none",marginBottom:12,paddingBottom:0},children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx(cS,{className:"settings-icon"})}),P.jsxs("div",{style:{flex:1},children:[P.jsx(Im,{level:4,children:"Static Pages"}),P.jsx(Y0,{type:"secondary",children:"Configure static pages (configuration saved in data/static-pages.json). Static page files can be placed in pages/ or data/pages/ directory or use external URLs."})]}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:O,children:"Add Static Page"})]}),P.jsx(va,{dataSource:f,rowKey:"id",pagination:!1,size:"middle",columns:[{title:"Page Name",dataIndex:"name",key:"name",width:200},{title:"URL",dataIndex:"url",key:"url",render:N=>P.jsx("a",{href:N,target:"_blank",rel:"noreferrer",children:N})},{title:"Action",key:"action",width:140,align:"right",render:(N,j)=>P.jsxs(sn,{children:[P.jsx($t,{type:"link",size:"small",icon:P.jsx(Mg,{}),onClick:()=>I(j),children:"Edit"}),P.jsx(xo,{title:"Delete static page?",description:"Are you sure you want to delete this page?",onConfirm:()=>R(j.id),okText:"Yes",cancelText:"No",children:P.jsx($t,{type:"link",danger:!0,size:"small",icon:P.jsx(fa,{}),children:"Delete"})})]})}]})]}),P.jsxs(Bn,{className:"settings-card",children:[P.jsxs("div",{className:"settings-title",children:[P.jsx("div",{className:"settings-icon-wrap",children:P.jsx(Gre,{className:"settings-icon"})}),P.jsxs("div",{children:[P.jsx(Im,{level:4,children:"Access Tokens & Domain"}),P.jsx(Y0,{type:"secondary",children:"Tokens are stored locally and are never shown again."})]})]}),P.jsxs("div",{className:"token-settings-form",children:[P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Domain"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"e.g. abc.com"})]}),P.jsx(cn.Item,{name:"domain",rules:[{pattern:/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:"Enter a valid domain, e.g. abc.com"}],children:P.jsx(sr,{placeholder:"abc.com",allowClear:!0})})]}),P.jsxs("div",{className:"token-row",children:[P.jsxs("div",{className:"token-row-info",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:"Jira Issue Prefix"}),P.jsx(vo,{type:"secondary",className:"token-row-hint",children:"e.g. PROJ"})]}),P.jsx(cn.Item,{name:"jiraIssuePrefix",children:P.jsx(sr,{placeholder:"PROJ",allowClear:!0})})]}),Q0.map(({id:N,label:j})=>P.jsxs("div",{className:`token-row ${$(N)?"is-configured":""}`,children:[P.jsxs("div",{className:"token-row-info",children:[P.jsxs("div",{className:"token-row-name-line",children:[P.jsx(vo,{strong:!0,className:"token-row-name",children:j}),$(N)&&P.jsx(Vn,{color:"success",closable:!0,onClose:_=>{_.preventDefault(),E(N)},className:"token-row-tag",children:"Configured"})]}),P.jsxs(vo,{type:"secondary",className:"token-row-hint",children:[j," API access token"]})]}),P.jsx(cn.Item,{name:N,children:P.jsx(sr.Password,{placeholder:$(N)?"Enter new token to replace":"Paste access token",autoComplete:"off",allowClear:!0})})]},N))]})]})]}),P.jsx(qr,{title:y?"Edit Static Page":"Add Static Page",open:g,onOk:T,onCancel:()=>p(!1),okText:"Save",confirmLoading:S,destroyOnClose:!0,children:P.jsxs(cn,{form:n,layout:"vertical",style:{marginTop:16},children:[P.jsx(cn.Item,{name:"name",label:"Page Name",rules:[{required:!0,message:"Please enter page name"}],children:P.jsx(sr,{placeholder:"e.g. test name"})}),P.jsx(cn.Item,{name:"url",label:"URL",extra:"Local pages in pages/ or data/pages/ directory can be accessed via /pages/<path> or /data/pages/<path>",rules:[{required:!0,message:"Please enter page URL"}],children:P.jsx(sr,{placeholder:"e.g. /pages/welcome/index.html or https://example.com"})})]})})]})}const{Title:pR,Text:Ea,Paragraph:Uae}=Hr,{Dragger:qae}=sS,hR=(e=0)=>{if(!e)return"0 B";const t=["B","KB","MB","GB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${(e/1024**n).toFixed(n?1:0)} ${t[n]}`},Gae=e=>({file:e,name:e.name||"clipboard-image.png",url:URL.createObjectURL(e),size:e.size});function Xae(){const[e,t]=l.useState(null),[n,r]=l.useState(null),[a,i]=l.useState(75),[c,u]=l.useState(!0),[d,f]=l.useState(!0),[v,g]=l.useState(!0),[p,y]=l.useState(2),[C,S]=l.useState(!1),[b,x]=l.useState(null),[$,w]=l.useState(100),[E,O]=l.useState(!1),[I,R]=l.useState(!1),[T,N]=gr.useMessage(),j=l.useRef(null),_=l.useRef(null),B=V=>{var H;(H=V.current)!=null&&H.url&&URL.revokeObjectURL(V.current.url)},k=V=>{var U;if(!((U=V==null?void 0:V.type)!=null&&U.startsWith("image/")))return T.error("Please choose an image file."),!1;B(j),B(_);const H=Gae(V);return j.current=H,_.current=null,t(H),r(null),L(V),!1},A=V=>{var H;return[...((H=V.dataTransfer)==null?void 0:H.types)||[]].includes("Files")},F=V=>{var U;V.preventDefault(),R(!1);const H=[...((U=V.dataTransfer)==null?void 0:U.files)||[]].find(K=>K.type.startsWith("image/"));H?k(H):T.error("Drop an image file to compress it.")};l.useEffect(()=>()=>{B(j),B(_)},[]),l.useEffect(()=>{const V=H=>{var q;const U=[...((q=H.clipboardData)==null?void 0:q.items)||[]].find(Z=>Z.type.startsWith("image/"));if(!U)return;H.preventDefault();const K=U.getAsFile();K&&(k(new File([K],`clipboard-${Date.now()}.${K.type.split("/")[1]||"png"}`,{type:K.type})),T.success("Image read from clipboard."))};return window.addEventListener("paste",V),()=>window.removeEventListener("paste",V)},[T]);const z=async()=>{var V;try{if(!((V=navigator.clipboard)!=null&&V.read))throw new Error("Direct clipboard reading is unavailable. Paste an image with β / Ctrl + V instead.");const H=await navigator.clipboard.read();for(const U of H){const K=U.types.find(q=>q.startsWith("image/"));if(K){const q=await U.getType(K);k(new File([q],`clipboard-${Date.now()}.${K.split("/")[1]||"png"}`,{type:K})),T.success("Image read from clipboard.");return}}throw new Error("No image was found in the clipboard.")}catch(H){T.warning(H.message||"Unable to read an image from the clipboard.")}},L=async(V=e==null?void 0:e.file)=>{if(V){O(!0);try{const[{encode:H},{imageData:U,width:K,height:q}]=await Promise.all([ej(()=>import("./index-Dty-56mC.js"),[]),tj(V,b,$)]),Z=await H(U,{quality:a,progressive:c,optimize_coding:d,auto_subsample:v,chroma_subsample:p,trellis_multipass:C});B(_);const X=new Blob([Z],{type:"image/jpeg"}),ee={url:URL.createObjectURL(X),size:X.size,width:K,height:q};_.current=ee,r(ee),T.success("MozJPEG compression complete.")}catch(H){T.error(H.message||"Image compression failed.")}finally{O(!1)}}},W=()=>{if(!n)return;const V=e.name.replace(/\.[^.]+$/,"")||"image",H=document.createElement("a");H.href=n.url,H.download=`${V}-mozjpeg.jpg`,H.click()},G=n&&e?Math.round((1-n.size/e.size)*100):null;return P.jsxs(P.Fragment,{children:[N,P.jsxs("div",{className:`squoosh-page ${I?"is-file-dragging":""}`,onDragOver:V=>{A(V)&&(V.preventDefault(),R(!0))},onDragLeave:V=>{V.currentTarget===V.target&&R(!1)},onDrop:F,children:[P.jsxs("header",{className:"squoosh-header",children:[P.jsxs("div",{children:[P.jsx(Ea,{children:"MOZJPEG WORKBENCH"}),P.jsx(pR,{level:2,children:"Image compression"})]}),P.jsxs(sn,{children:[P.jsx($t,{icon:P.jsx(ul,{}),onClick:z,children:"Read clipboard"}),P.jsx($t,{type:"primary",icon:P.jsx(Ey,{}),onClick:()=>L(),disabled:!e,loading:E,children:"Compress"})]})]}),P.jsxs("main",{className:"squoosh-studio",children:[P.jsxs("section",{className:"squoosh-preview-area",children:[P.jsx(bR,{title:"Original",detail:e?`${hR(e.size)} Β· ${e.name}`:"Choose an image to begin",children:e?P.jsx(yR,{label:"Original image",image:e.url}):P.jsxs(qae,{accept:"image/*",multiple:!1,showUploadList:!1,beforeUpload:k,className:"image-dropzone",children:[P.jsx("p",{className:"ant-upload-drag-icon",children:P.jsx(uS,{})}),P.jsx("p",{className:"ant-upload-text",children:"Drop an image or click to choose"}),P.jsx("p",{className:"ant-upload-hint",children:"Or paste an image with β / Ctrl + V."})]})}),P.jsx(bR,{title:"MozJPEG output",detail:n?`${hR(n.size)} Β· ${n.width} Γ ${n.height}`:"Waiting for compression",action:n&&P.jsx($t,{type:"primary",size:"small",icon:P.jsx(GT,{}),onClick:W,children:"Download"}),children:E?P.jsx("div",{className:"image-loading",children:P.jsx(bi,{tip:"Compressingβ¦"})}):n?P.jsxs(P.Fragment,{children:[P.jsx(yR,{label:"Compressed JPEG",image:n.url}),G!==null&&P.jsx("div",{className:`compression-saving ${G>0?"is-saving":""}`,children:G>0?`${G}% smaller`:"No size reduction at current settings."})]}):P.jsx(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:"Compressed preview"})})]}),P.jsxs("aside",{className:"squoosh-settings",children:[P.jsxs("div",{className:"settings-heading",children:[P.jsx(Ea,{children:"ENCODER"}),P.jsx(pR,{level:4,children:"MozJPEG"}),P.jsx(Uae,{children:"Fine-tune output size and image quality."})]}),P.jsxs("div",{className:"option-row",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Quality"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Higher values preserve more detail."})]}),P.jsx(Vn,{color:"blue",children:a})]}),P.jsx(gG,{min:1,max:100,value:a,onChange:i,tooltip:{formatter:V=>`${V}`}}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Long edge"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Scale the longest edge to this value. Never crops the image."})]}),P.jsx(yv,{min:1,max:16384,value:b,onChange:x,placeholder:"Original",addonAfter:"px"})]}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Scale"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Scale the image by percentage."})]}),P.jsx(yv,{min:1,max:100,value:$,onChange:w,placeholder:"100",addonAfter:"%",allowClear:!0})]}),P.jsx(Nm,{label:"Progressive JPEG",description:"Display a low-detail preview while loading.",checked:c,onChange:u}),P.jsx(Nm,{label:"Optimize coding",description:"Reduce size without changing image quality.",checked:d,onChange:f}),P.jsx(sv,{ghost:!0,className:"advanced-options",items:[{key:"advanced",label:"Advanced settings",children:P.jsxs(P.Fragment,{children:[P.jsx(Nm,{label:"Automatic chroma subsampling",description:"Pick sampling based on the image content.",checked:v,onChange:g}),P.jsxs("div",{className:"option-select",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:"Chroma subsampling"}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:"Enabled when automatic mode is off."})]}),P.jsx(Mr,{disabled:v,value:p,onChange:y,options:[{value:0,label:"4:4:4 (colour detail)"},{value:1,label:"4:2:2 (balanced)"},{value:2,label:"4:2:0 (smaller file)"}]})]}),P.jsx(Nm,{label:"Trellis multi-pass",description:"Further size reduction with a longer encode time.",checked:C,onChange:S})]})}]}),P.jsx($t,{type:"primary",size:"large",block:!0,icon:P.jsx(Ey,{}),onClick:()=>L(),disabled:!e,loading:E,children:"Compress image"})]})]})]})]})}function bR({title:e,detail:t,action:n,children:r}){return P.jsxs("section",{className:"preview-pane",children:[P.jsxs("header",{children:[P.jsxs("div",{children:[P.jsx(Ea,{children:e}),P.jsx("span",{children:t})]}),n]}),P.jsx("div",{className:"preview-canvas",children:r})]})}function Nm({label:e,description:t,checked:n,onChange:r}){return P.jsxs("div",{className:"option-switch",children:[P.jsxs("div",{children:[P.jsx(Ea,{strong:!0,children:e}),P.jsx("br",{}),P.jsx(Ea,{type:"secondary",children:t})]}),P.jsx(Og,{checked:n,onChange:r})]})}function yR({label:e,image:t,metadata:n}){return P.jsxs("div",{className:"image-panel",children:[P.jsx("img",{src:t,alt:e}),n&&P.jsx("div",{className:"image-panel-meta",children:P.jsx(Ea,{type:"secondary",children:n})})]})}const{Title:Yae,Text:Qr,Paragraph:CR}=Hr;function Qae({prs:e,selectedPrKeys:t,onToggleSelectPr:n,onSelectPr:r}){return e.length===0?P.jsx(lr,{description:"No open pull requests found.",style:{padding:"24px 0"}}):P.jsx("div",{style:{display:"grid",gap:"12px"},children:e.map(a=>{var d,f,v,g,p,y,C,S,b;const i=a.reviewUrl||"",c=a.reviewUrl||a.id,u=t.includes(c);return P.jsx(Bn,{size:"small",hoverable:!0,style:{borderColor:u?"#1677ff":"#e3e6ef",backgroundColor:u?"#f0f5ff":"#ffffff",transition:"all 0.2s"},onClick:()=>i&&r(i),children:P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px"},children:[P.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"12px"},children:[P.jsx(ka,{checked:u,onChange:x=>{x.stopPropagation(),n(c)},onClick:x=>x.stopPropagation()}),P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsxs(sn,{size:8,wrap:!0,children:[P.jsxs(Qr,{strong:!0,style:{fontSize:"14px"},children:["#",a.id," ",a.title]}),a.draft&&P.jsx(Vn,{color:"gold",children:"Draft"})]}),P.jsxs("div",{style:{marginTop:"6px",fontSize:"12px",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",color:"#727b94"},children:[P.jsxs(Qr,{type:"secondary",style:{fontWeight:500},children:[(v=(f=(d=a.fromRef)==null?void 0:d.repository)==null?void 0:f.project)==null?void 0:v.key," / ",(p=(g=a.fromRef)==null?void 0:g.repository)==null?void 0:p.slug]}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsx(Vn,{size:"small",color:"cyan",style:{margin:0},children:(y=a.fromRef)==null?void 0:y.displayId}),P.jsx(pre,{style:{fontSize:"10px",color:"#8c8c8c"}}),P.jsx(Vn,{size:"small",color:"blue",style:{margin:0},children:(C=a.toRef)==null?void 0:C.displayId}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsxs("span",{children:["Author: ",P.jsx("strong",{children:(b=(S=a.author)==null?void 0:S.user)==null?void 0:b.displayName})]}),P.jsx("span",{style:{color:"#d9d9d9"},children:"|"}),P.jsxs("span",{children:["Updated: ",new Date(a.updatedDate).toLocaleDateString()]})]})]})]}),P.jsxs(sn,{size:8,children:[P.jsx($t,{size:"small",icon:P.jsx(JT,{}),onClick:x=>{x.stopPropagation(),i&&$o(i)},children:"Open"}),P.jsx($t,{type:"primary",size:"small",onClick:x=>{x.stopPropagation(),i&&r(i)},children:"Review"})]})]})},c)})})}function Zae(){const[e]=cn.useForm(),[t,n]=l.useState(!1),[r,a]=l.useState(!0),[i,c]=l.useState(null),[u,d]=l.useState(!1),[f,v]=l.useState([]),[g,p]=l.useState([]),[y,C]=l.useState(!1),[S,b]=l.useState("review"),[x,$]=l.useState([]),[w,E]=l.useState(!1),[O,I]=l.useState(null),[R,T]=l.useState(""),[N,j]=l.useState(!1),[_,B]=l.useState(new Set),k=async()=>{C(!0);try{const[X,ee]=await Promise.all([Om.myPrs().catch(()=>({values:[]})),Om.reviewPrs().catch(()=>({values:[]}))]);v((X==null?void 0:X.values)||[]),p((ee==null?void 0:ee.values)||[])}catch{}C(!1)};l.useEffect(()=>{Oa.status().then(X=>{a(X.bitbucketTokenConfigured),X.bitbucketTokenConfigured&&k()}).catch(()=>{})},[]);const A=S==="review"?g:f,F=X=>{b(X),$([])},z=X=>{$(ee=>ee.includes(X)?ee.filter(te=>te!==X):[...ee,X])},L=X=>{if(X.target.checked){const ee=A.map(te=>te.reviewUrl||te.id);$(ee)}else $([])},W=()=>{const ee=A.filter(ie=>x.includes(ie.reviewUrl||ie.id)).map(ie=>ie.reviewUrl).filter(Boolean);if(ee.length===0){gr.warning("No PR URLs selected");return}const te=ee.join(`
|
|
498
498
|
`);navigator.clipboard.writeText(te),gr.success(`Copied ${ee.length} PR URL(s) to clipboard`)},G=A.length>0&&A.every(X=>x.includes(X.reviewUrl||X.id)),V=x.length>0&&!G,H=async X=>{const ee=typeof X=="string"?X:X.prLink;if(ee){n(!0),c(null),e.setFieldsValue({prLink:ee});try{const te=await Om.check(ee.trim());c(te),B(new Set),gr.success("PR Review completed successfully.")}catch(te){gr.error(te.message)}finally{n(!1)}}},U=(X,ee)=>{const te=`${X}:${ee.line}:${ee.rule}`,ie=`β οΈ [${ee.severity.toUpperCase()}] ${ee.rule}: ${ee.message}
|
|
499
499
|
\`\`\`javascript
|
|
500
500
|
${ee.code.trim()}
|
|
@@ -518,4 +518,4 @@ ${ee.code.trim()}
|
|
|
518
518
|
`}ie+=`
|
|
519
519
|
`}}navigator.clipboard.writeText(ie),d(!0),gr.success("Markdown report copied to clipboard."),setTimeout(()=>d(!1),2e3)},Z=X=>X==="critical"?P.jsx(Vn,{color:"error",icon:P.jsx(Mre,{}),children:"Critical"}):X==="warning"?P.jsx(Vn,{color:"warning",icon:P.jsx(Cae,{}),children:"Warning"}):P.jsx(Vn,{color:"processing",icon:P.jsx(Kre,{}),children:"Suggestion"});return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"page-header",children:P.jsxs("div",{children:[P.jsx(Qr,{type:"secondary",children:"CODE QUALITY"}),P.jsx(Yae,{level:2,children:"PR Review"}),P.jsx(CR,{type:"secondary",children:"Analyze pull requests on Bitbucket for quality issues, leaks, and debug flags."})]})}),!r&&P.jsx(VI,{className:"service-config",message:"Bitbucket Token Required",description:P.jsxs("span",{children:["Please configure your ",P.jsx("strong",{children:"Bitbucket Access Token"})," in the ",P.jsx("a",{href:"#/settings",children:"Settings"})," page to review internal PRs."]}),type:"warning",showIcon:!0,closable:!1}),P.jsx(Bn,{className:"service-config",children:P.jsx(cn,{form:e,layout:"vertical",onFinish:H,children:P.jsx(cn.Item,{name:"prLink",label:"Pull Request URL",rules:[{required:!0,message:"Please enter a Bitbucket Pull Request link."},{type:"url",message:"Please enter a valid URL."}],children:P.jsx(sr,{placeholder:"https://bitbucket.xxx.com/projects/PROJ/repos/repo/pull-requests/123",disabled:t,allowClear:!0,addonAfter:P.jsxs(sn,{size:8,children:[P.jsx($t,{type:"link",size:"small",onClick:()=>e.submit(),disabled:t,style:{padding:0,height:"auto"},children:"Review"}),P.jsx(I4,{type:"vertical",style:{margin:"0 2px"}}),P.jsx($t,{type:"link",size:"small",icon:P.jsx(JT,{}),onClick:()=>{const X=e.getFieldValue("prLink");X&&X.trim()?$o(X.trim()):gr.warning("Please enter a Pull Request URL first.")},disabled:t,style:{padding:0,height:"auto"},children:"Open"})]})})})})}),t&&P.jsx(Bn,{style:{textAlign:"center",padding:"40px 0"},children:P.jsxs(sn,{direction:"vertical",size:"middle",children:[P.jsx(Ro,{style:{fontSize:32,color:"#6d5ce7"},spin:!0}),P.jsx(Qr,{type:"secondary",children:"Fetching diffs and reviewing code changes..."})]})}),!i&&!t&&r&&P.jsxs(Bn,{tabList:[{key:"review",tab:`Waiting for my Review (${g.length})`},{key:"mine",tab:`Authored by Me (${f.length})`}],activeTabKey:S,onTabChange:F,loading:y,style:{borderColor:"#e3e6ef",marginTop:16},children:[A.length>0&&P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0"},children:[P.jsxs(sn,{size:12,children:[P.jsxs(ka,{checked:G,indeterminate:V,onChange:L,children:["Select All (",A.length,")"]}),x.length>0&&P.jsxs(Qr,{type:"secondary",style:{fontSize:"13px"},children:[x.length," selected"]})]}),P.jsxs($t,{icon:P.jsx(ul,{}),disabled:x.length===0,onClick:W,children:["Copy Selected URLs ",x.length>0?`(${x.length})`:""]})]}),P.jsx(Qae,{prs:A,selectedPrKeys:x,onToggleSelectPr:z,onSelectPr:H})]}),i&&P.jsxs(sn,{direction:"vertical",size:"large",style:{width:"100%",paddingBottom:24},children:[P.jsx("div",{children:P.jsx($t,{onClick:()=>c(null),children:"β Back to PR list"})}),P.jsx(Bn,{title:P.jsxs(sn,{children:[P.jsx(ZT,{}),P.jsx("span",{children:i.pr.title})]}),extra:P.jsx($t,{icon:P.jsx(ul,{}),onClick:q,children:u?"Copied":"Copy Report"}),children:P.jsxs(hv,{gutter:[16,16],children:[P.jsx(pa,{xs:24,sm:12,md:6,children:P.jsxs(sn,{direction:"vertical",size:2,children:[P.jsx(Qr,{type:"secondary",style:{fontSize:12},children:"Author"}),P.jsx(Qr,{strong:!0,children:i.pr.author})]})}),P.jsx(pa,{xs:24,sm:12,md:6,children:P.jsxs(sn,{direction:"vertical",size:2,children:[P.jsx(Qr,{type:"secondary",style:{fontSize:12},children:"Repository"}),P.jsx(Qr,{strong:!0,children:i.pr.repositorySlug})]})}),P.jsx(pa,{xs:24,sm:12,md:6,children:P.jsxs(sn,{direction:"vertical",size:2,children:[P.jsx(Qr,{type:"secondary",style:{fontSize:12},children:"Source Branch"}),P.jsx(Vn,{color:"cyan",style:{margin:0},children:i.pr.sourceBranch})]})}),P.jsx(pa,{xs:24,sm:12,md:6,children:P.jsxs(sn,{direction:"vertical",size:2,children:[P.jsx(Qr,{type:"secondary",style:{fontSize:12},children:"Target Branch"}),P.jsx(Vn,{color:"blue",style:{margin:0},children:i.pr.targetBranch})]})})]})}),P.jsxs(hv,{gutter:[16,16],children:[P.jsx(pa,{xs:12,md:6,children:P.jsx(Bn,{size:"small",style:{textAlign:"center"},children:P.jsx(Ul,{title:"Total Changed",value:i.stats.totalFilesChanged})})}),P.jsx(pa,{xs:12,md:6,children:P.jsx(Bn,{size:"small",style:{textAlign:"center"},children:P.jsx(Ul,{title:"Filtered (Ignored)",value:i.stats.filteredCount,valueStyle:{color:"#8c8c8c"}})})}),P.jsx(pa,{xs:12,md:6,children:P.jsx(Bn,{size:"small",style:{textAlign:"center"},children:P.jsx(Ul,{title:"Reviewed Files",value:i.stats.reviewedCount,valueStyle:{color:"#6d5ce7"}})})}),P.jsx(pa,{xs:12,md:6,children:P.jsx(Bn,{size:"small",style:{textAlign:"center"},children:P.jsx(Ul,{title:"Total Issues",value:i.stats.totalIssues,valueStyle:{color:i.stats.totalIssues>0?"#ff4d4f":"#52c41a"}})})})]}),P.jsx(Bn,{title:"Review Findings",children:i.files.length===0?P.jsx(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:P.jsxs(sn,{direction:"vertical",size:"small",children:[P.jsxs(Qr,{strong:!0,style:{color:"#52c41a",fontSize:"16px"},children:[P.jsx(Ov,{})," LGTM! No issues found."]}),P.jsxs(Qr,{type:"secondary",children:["Review completed on ",i.stats.reviewedCount," files (filtered out ",i.stats.filteredCount," build/test configs)."]})]})}):P.jsx(sv,{defaultActiveKey:i.files.map(X=>X.filePath),expandIconPosition:"end",children:i.files.map(X=>{const ee=X.issues.filter(ne=>ne.severity==="critical").length,te=X.issues.filter(ne=>ne.severity==="warning").length,ie=X.issues.filter(ne=>ne.severity==="info").length,oe=P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"92%",flexWrap:"wrap",gap:"8px"},children:[P.jsx(Qr,{strong:!0,children:X.filePath}),P.jsxs(sn,{children:[ee>0&&P.jsx(vi,{count:ee,style:{backgroundColor:"#ff4d4f"},title:"Critical Issues"}),te>0&&P.jsx(vi,{count:te,style:{backgroundColor:"#faad14"},title:"Warnings"}),ie>0&&P.jsx(vi,{count:ie,style:{backgroundColor:"#1890ff"},title:"Suggestions"})]})]});return P.jsx(sv.Panel,{header:oe,children:P.jsx(va,{dataSource:X.issues.map((ne,Y)=>({...ne,key:Y})),pagination:!1,size:"small",columns:[{title:"Severity",dataIndex:"severity",width:110,render:ne=>Z(ne)},{title:"Line",dataIndex:"line",width:80,render:ne=>P.jsxs(Qr,{code:!0,children:["L",ne]})},{title:"Issue Description",dataIndex:"message",render:(ne,Y)=>P.jsxs(sn,{direction:"vertical",size:2,style:{width:"100%"},children:[P.jsx(Qr,{strong:!0,children:Y.rule}),P.jsx(Qr,{type:"secondary",children:ne}),P.jsx("pre",{style:{margin:"4px 0 0",padding:"6px 10px",background:"#f5f5f5",borderRadius:"4px",fontSize:"12px",overflowX:"auto"},children:P.jsx("code",{children:Y.code})})]})},{title:"Action",key:"action",width:120,align:"center",render:(ne,Y)=>{const le=`${X.filePath}:${Y.line}:${Y.rule}`;return _.has(le)?P.jsx(Vn,{color:"green",icon:P.jsx(Ov,{}),children:"Commented"}):P.jsx($t,{size:"small",icon:P.jsx(fR,{}),onClick:()=>U(X.filePath,Y),children:"Comment"})}}]})},X.filePath)})})}),i.filteredOut.length>0&&P.jsx(Bn,{title:`Ignored Files (${i.filteredOut.length})`,size:"small",children:P.jsx("div",{style:{maxHeight:200,overflowY:"auto"},children:P.jsx(sn,{size:[4,8],wrap:!0,children:i.filteredOut.map(X=>P.jsx(Vn,{style:{color:"#8c8c8c"},children:X},X))})})}),P.jsx(qr,{title:P.jsxs(sn,{children:[P.jsx(fR,{}),P.jsx("span",{children:"Post Comment to Bitbucket PR"})]}),open:w,onCancel:()=>!N&&E(!1),onOk:K,okText:"Submit Comment",cancelText:"Cancel",confirmLoading:N,okButtonProps:{icon:P.jsx(iae,{})},width:600,children:O&&P.jsxs("div",{style:{marginTop:12},children:[P.jsxs(CR,{type:"secondary",style:{marginBottom:12,fontSize:13},children:["File: ",P.jsx(Qr,{code:!0,children:O.filePath})," (Line ",O.issue.line,")"]}),P.jsx(sr.TextArea,{rows:6,value:R,onChange:X=>T(X.target.value),placeholder:"Write your review comment..."})]})})]})]})}function Jae({open:e,editingFilter:t,onCancel:n,onSave:r}){const[a]=cn.useForm();l.useEffect(()=>{e&&(t?a.setFieldsValue({name:t.name,filterId:t.filterId}):a.resetFields())},[e,t,a]);const i=async()=>{try{const c=await a.validateFields();await r(c),a.resetFields()}catch{}};return P.jsx(qr,{title:t?"Edit Filter":"Add Filter",open:e,onCancel:n,onOk:i,destroyOnClose:!0,children:P.jsxs(cn,{form:a,layout:"vertical",style:{marginTop:16},children:[P.jsx(cn.Item,{name:"name",label:"Filter Name",rules:[{required:!0,message:"Please enter filter name"}],children:P.jsx(sr,{placeholder:"e.g. My Sprint Issues"})}),P.jsx(cn.Item,{name:"filterId",label:"Filter ID",rules:[{required:!0,message:"Please enter Jira Filter ID"}],children:P.jsx(sr,{placeholder:"e.g. 12345"})})]})})}const{Text:SR}=Hr;function eoe({open:e,filters:t,onCancel:n,onCreate:r,onEdit:a,onDelete:i}){const c=[{title:"Filter Name",dataIndex:"name",key:"name",render:u=>P.jsx(SR,{strong:!0,children:u})},{title:"Filter ID",dataIndex:"filterId",key:"filterId",width:150,render:u=>P.jsx(SR,{code:!0,children:u})},{title:"Action",key:"action",width:130,align:"right",render:(u,d)=>P.jsxs(sn,{size:"small",children:[P.jsx($t,{type:"text",icon:P.jsx(Mg,{}),onClick:()=>a(d)}),P.jsx(xo,{title:"Delete filter?",description:"Are you sure you want to delete this filter?",onConfirm:()=>i(d.id),okText:"Yes",cancelText:"No",children:P.jsx($t,{type:"text",danger:!0,icon:P.jsx(fa,{})})})]})}];return P.jsx(qr,{title:"Filter List",open:e,onCancel:n,footer:[P.jsx($t,{onClick:n,children:"Close"},"close"),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:r,children:"Add Filter"},"add")],width:640,children:P.jsx(va,{rowKey:"id",dataSource:t,columns:c,pagination:!1,size:"small",style:{marginTop:16}})})}const{Title:toe,Text:Ku,Paragraph:noe}=Hr,roe=e=>{if(!e)return"default";const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?"red":t.includes("critical")||t.includes("high")||t.includes("p1")?"volcano":t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?"orange":t.includes("minor")||t.includes("low")||t.includes("p3")?"blue":t.includes("trivial")||t.includes("lowest")||t.includes("p4")?"cyan":"default"},aoe=e=>e?typeof e=="string"?e:e.name||"β":"β";function ooe(){const{message:e}=co.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(null),[i,c]=l.useState([]),[u,d]=l.useState(!0),[f,v]=l.useState(!1),[g,p]=l.useState(""),[y,C]=l.useState(!1),[S,b]=l.useState(null),[x,$]=l.useState(!1),w=l.useCallback(async()=>{try{const j=await Fu.list();n(j),j.length>0?(!r||!j.some(_=>_.id===r))&&a(j[0].id):(a(null),c([]))}catch(j){e.error(j.message)}finally{d(!1)}},[r,e]),E=l.useCallback(async j=>{if(j){v(!0),p("");try{const _=await Fu.issues(j);c(_.issues||[])}catch(_){p(_.message),c([])}finally{v(!1)}}},[]);l.useEffect(()=>{w()},[]),l.useEffect(()=>{r&&E(r)},[r,E]);const O=()=>{b(null),C(!0)},I=j=>{b(j),C(!0)},R=async j=>{try{if(S)await Fu.update(S.id,j),e.success("Filter updated");else{const _=await Fu.create(j);e.success("Filter created"),a(_.id)}C(!1),await w()}catch(_){e.error(_.message)}},T=async j=>{try{await Fu.remove(j),e.success("Filter deleted"),await w()}catch(_){e.error(_.message)}},N=[{title:"Summary",dataIndex:"summary",key:"summary",render:(j,_)=>P.jsxs(sn,{align:"start",style:{wordBreak:"break-word"},children:[P.jsx(Ku,{code:!0,style:{fontSize:12,flexShrink:0},children:_.key}),P.jsx("a",{style:{fontWeight:500},onClick:B=>{B.preventDefault(),$o(_.url)},children:j})]})},{title:"Priority",dataIndex:"priority",key:"priority",width:140,align:"center",render:j=>{const _=aoe(j),B=roe(j);return P.jsx(Vn,{color:B,children:_})}},{title:"Due Date",dataIndex:"dueDate",key:"dueDate",width:160,align:"center",render:j=>j?P.jsx(Ku,{type:"secondary",children:j}):P.jsx(Ku,{type:"secondary",children:"β"})}];return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Ku,{type:"secondary",children:"JIRA"}),P.jsx(toe,{level:2,children:"Jira Filters"}),P.jsx(noe,{type:"secondary",children:"Track issues across configured Jira filters."})]}),P.jsxs(sn,{children:[P.jsx($t,{onClick:()=>$(!0),children:"Filter List"}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:O,children:"+ Filter"})]})]}),u?P.jsx("div",{style:{padding:"80px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):t.length?P.jsxs(P.Fragment,{children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[P.jsx(ds,{activeKey:r,onChange:a,style:{marginBottom:0,flex:1},items:t.map(j=>({key:j.id,label:j.name}))}),r&&P.jsx($t,{icon:P.jsx(Ec,{}),loading:f,onClick:()=>E(r),style:{marginLeft:16},children:"Refresh"})]}),f?P.jsx("div",{style:{padding:"60px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):g?P.jsxs("div",{style:{padding:"40px 0",textAlign:"center"},children:[P.jsx(Ku,{danger:!0,children:g}),P.jsx("div",{style:{marginTop:12},children:P.jsx($t,{size:"small",icon:P.jsx(Ec,{}),onClick:()=>E(r),children:"Retry"})})]}):P.jsx(va,{className:"jira-filters-table",rowKey:"id",dataSource:i,columns:N,pagination:!1})]}):P.jsx(lr,{description:"No Jira filters configured yet.",style:{marginTop:80}}),P.jsx(Jae,{open:y,editingFilter:S,onCancel:()=>C(!1),onSave:R}),P.jsx(eoe,{open:x,filters:t,onCancel:()=>$(!1),onCreate:()=>{$(!1),O()},onEdit:j=>{$(!1),I(j)},onDelete:T})]})}const{TextArea:ioe}=sr;function loe({open:e,editingTodo:t,onCancel:n,onSave:r}){const[a]=cn.useForm();l.useEffect(()=>{e&&(t?a.setFieldsValue({title:t.title||"",description:t.description||"",priority:t.priority||"medium",category:t.category||"work",dueDate:t.dueDate?ia(t.dueDate):null}):(a.resetFields(),a.setFieldsValue({priority:"medium",category:"work"})))},[e,t,a]);const i=async()=>{try{const c=await a.validateFields();r({...c,dueDate:c.dueDate?c.dueDate.format("YYYY-MM-DD"):null})}catch{}};return P.jsx(qr,{title:t?"Edit Task":"New Task",open:e,onOk:i,onCancel:n,destroyOnClose:!0,okText:t?"Save":"Create",cancelText:"Cancel",children:P.jsxs(cn,{form:a,layout:"vertical",style:{marginTop:16},children:[P.jsx(cn.Item,{name:"title",label:"Task Title",rules:[{required:!0,message:"Please enter task title"}],children:P.jsx(sr,{placeholder:"Enter task title...",maxLength:100,showCount:!0})}),P.jsx(cn.Item,{name:"description",label:"Description / Notes",children:P.jsx(ioe,{rows:3,placeholder:"Add relevant details, background, or notes...",maxLength:500,showCount:!0})}),P.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:12},children:[P.jsx(cn.Item,{name:"priority",label:"Priority",children:P.jsx(Mr,{options:[{value:"high",label:"π΄ High"},{value:"medium",label:"π‘ Medium"},{value:"low",label:"π΅ Low"}]})}),P.jsx(cn.Item,{name:"category",label:"Category",children:P.jsx(Mr,{options:[{value:"work",label:"πΌ Work"},{value:"dev",label:"π» Dev"},{value:"bug",label:"π Bug"},{value:"feature",label:"β¨ Feature"},{value:"personal",label:"π Personal"}]})}),P.jsx(cn.Item,{name:"dueDate",label:"Due Date",children:P.jsx(kc,{style:{width:"100%"},placeholder:"Select date"})})]})]})})}function Iv({text:e,domain:t,jiraIssuePrefix:n,style:r,className:a}){if(!e)return null;const i=[],c=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let u=0;const d=(n||"").split(/[\s,]+/).filter(Boolean).map(g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),f=d.length>0?new RegExp(`\\b(?:${d.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):/\b[A-Z]{2,10}-\d+\b/g,v=(g,p)=>{const y=[];let C=0;f.lastIndex=0;for(const S of g.matchAll(f)){S.index>C&&y.push(g.slice(C,S.index));const b=S[0],x=t?dS(t,b):null;x?y.push(P.jsx("a",{href:x,target:"_blank",rel:"noreferrer",onClick:$=>{$.preventDefault(),$.stopPropagation(),$o(x)},style:{color:"#1677ff",textDecoration:"underline",fontWeight:500},children:b},`${p}-${S.index}`)):y.push(b),C=S.index+b.length}return C<g.length&&y.push(g.slice(C)),y};for(const g of e.matchAll(c)){g.index>u&&i.push(...v(e.slice(u,g.index),`txt-${g.index}`));const p=g[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(p)i.push(P.jsx("a",{href:p[2],target:"_blank",rel:"noreferrer",onClick:y=>{y.preventDefault(),y.stopPropagation(),$o(p[2])},style:{color:"#1677ff",textDecoration:"underline"},children:p[1]},g.index));else{const y=g[0].replace(/[),.;:!?]+$/,"");i.push(P.jsx("a",{href:y,target:"_blank",rel:"noreferrer",onClick:C=>{C.preventDefault(),C.stopPropagation(),$o(y)},style:{color:"#1677ff",textDecoration:"underline"},children:y},g.index)),g[0].length>y.length&&i.push(g[0].slice(y.length))}u=g.index+g[0].length}return u<e.length&&i.push(...v(e.slice(u),"txt-end")),P.jsx("span",{style:r,className:a,children:i})}const{Title:soe,Text:Gi,Paragraph:coe}=Hr,uoe={work:{label:"πΌ Work",color:"blue"},dev:{label:"π» Dev",color:"purple"},bug:{label:"π Bug",color:"red"},feature:{label:"β¨ Feature",color:"green"},personal:{label:"π Personal",color:"orange"}},doe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}};function foe(){const{message:e}=co.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[i,c]=l.useState(""),[u,d]=l.useState("all"),[f,v]=l.useState("all"),[g,p]=l.useState("all"),[y,C]=l.useState("createdDesc"),[S,b]=l.useState(""),[x,$]=l.useState("medium"),[w,E]=l.useState("work"),[O,I]=l.useState(!1),[R,T]=l.useState([]),[N,j]=l.useState({domain:"",jiraIssuePrefix:""}),[_,B]=l.useState(!1),[k,A]=l.useState(null),F=l.useCallback(async()=>{a(!0);try{const Y=await La.list();n(Y)}catch(Y){e.error(Y.message)}finally{a(!1)}},[e]);l.useEffect(()=>{F(),Oa.status().then(Y=>{Y&&j(Y)}).catch(()=>{})},[F]);const z=l.useMemo(()=>t.filter(Y=>!Y.archived),[t]),L=l.useMemo(()=>t.filter(Y=>Y.archived).length,[t]),W=l.useMemo(()=>{const Y=z.length,le=z.filter(ge=>ge.completed).length,ue=Y-le,de=Y>0?Math.round(le/Y*100):0,ce=z.filter(ge=>!ge.completed&&ge.priority==="high").length;return{total:Y,completed:le,active:ue,rate:de,highPriorityCount:ce}},[z]),G=async()=>{const Y=S.trim();if(Y)try{const le=await La.create({title:Y,priority:x,category:w,completed:!1});n(ue=>[le,...ue]),b(""),e.success("Task added")}catch(le){e.error(le.message)}},V=async Y=>{try{if(k){const le=await La.update(k.id,Y);n(ue=>ue.map(de=>de.id===le.id?le:de)),e.success("Task updated")}else{const le=await La.create(Y);n(ue=>[le,...ue]),e.success("Task created")}B(!1)}catch(le){e.error(le.message)}},H=async Y=>{try{const le=await La.update(Y.id,{...Y,completed:!Y.completed});n(ue=>ue.map(de=>de.id===le.id?le:de))}catch(le){e.error(le.message)}},U=async Y=>{try{await La.archive(Y),n(le=>le.map(ue=>ue.id===Y?{...ue,archived:!0,archivedAt:new Date().toISOString()}:ue)),e.success("Task archived")}catch(le){e.error(le.message)}},K=async Y=>{try{await La.remove(Y),n(le=>le.filter(ue=>ue.id!==Y)),T(le=>le.filter(ue=>ue!==Y)),e.success("Task deleted")}catch(le){e.error(le.message)}},q=async Y=>{if(Y==="clearCompleted"){try{const le=await La.batch("clearCompleted");n(le),T([]),e.success("Completed tasks cleared")}catch(le){e.error(le.message)}return}if(R.length)try{const le=await La.batch(Y,R);n(le),T([]),e.success("Batch action succeeded")}catch(le){e.error(le.message)}},Z=l.useMemo(()=>{let Y=z;if(i.trim()){const le=i.toLowerCase().trim();Y=Y.filter(ue=>ue.title.toLowerCase().includes(le)||(ue.description||"").toLowerCase().includes(le))}return u==="active"?Y=Y.filter(le=>!le.completed):u==="completed"&&(Y=Y.filter(le=>le.completed)),f!=="all"&&(Y=Y.filter(le=>le.priority===f)),g!=="all"&&(Y=Y.filter(le=>le.category===g)),[...Y].sort((le,ue)=>{if(y==="dueAsc")return le.dueDate?ue.dueDate?le.dueDate.localeCompare(ue.dueDate):-1:1;if(y==="priorityDesc"){const de={high:3,medium:2,low:1};return(de[ue.priority]||0)-(de[le.priority]||0)}return new Date(ue.createdAt||0)-new Date(le.createdAt||0)})},[z,i,u,f,g,y]),X=l.useMemo(()=>Z.map(Y=>Y.id),[Z]),ee=X.length>0&&X.every(Y=>R.includes(Y)),te=R.length>0,ie=Y=>{Y.target.checked?T(X):T([])},oe=Y=>{T(le=>le.includes(Y)?le.filter(ue=>ue!==Y):[...le,Y])},ne=ia().format("YYYY-MM-DD");return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Gi,{type:"secondary",children:"WORKBENCH"}),P.jsx(soe,{level:2,children:"To-Do List"}),P.jsx(coe,{type:"secondary",children:"Manage and track development tasks, bug fixes, and feature items efficiently."})]}),P.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:8},children:[P.jsxs(sn,{children:[P.jsx($t,{icon:P.jsx(Ec,{}),onClick:F,loading:r,children:"Refresh"}),P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:()=>{A(null),B(!0)},children:"New Task"})]}),P.jsxs($t,{icon:P.jsx(uS,{}),onClick:()=>{window.location.hash="#/todo-list/archived"},style:{marginTop:8},children:["Archived (",L,")"]})]})]}),P.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:16,marginBottom:24},children:[P.jsxs(Bn,{size:"small",style:{borderRadius:8},children:[P.jsx(Gi,{type:"secondary",style:{fontSize:13},children:"Total Tasks"}),P.jsx("div",{style:{fontSize:24,fontWeight:600,marginTop:4},children:W.total})]}),P.jsxs(Bn,{size:"small",style:{borderRadius:8},children:[P.jsx(Gi,{type:"secondary",style:{fontSize:13},children:"Active (Pending)"}),P.jsxs("div",{style:{fontSize:24,fontWeight:600,marginTop:4,color:W.active>0?"#fa8c16":"inherit"},children:[W.active,W.highPriorityCount>0&&P.jsxs("span",{style:{fontSize:12,fontWeight:"normal",color:"#ff4d4f",marginLeft:8},children:["(",W.highPriorityCount," high priority)"]})]})]}),P.jsxs(Bn,{size:"small",style:{borderRadius:8},children:[P.jsx(Gi,{type:"secondary",style:{fontSize:13},children:"Completed"}),P.jsx("div",{style:{fontSize:24,fontWeight:600,marginTop:4,color:"#52c41a"},children:W.completed})]}),P.jsxs(Bn,{size:"small",style:{borderRadius:8},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[P.jsx(Gi,{type:"secondary",style:{fontSize:13},children:"Completion Rate"}),P.jsxs(Gi,{style:{fontSize:13,fontWeight:600},children:[W.rate,"%"]})]}),P.jsx(fT,{percent:W.rate,showInfo:!1,size:"small",status:"active",style:{marginTop:12}})]})]}),P.jsx(Bn,{size:"small",style:{marginBottom:20,borderRadius:8,backgroundColor:"rgba(255, 255, 255, 0.02)"},children:P.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[P.jsx(sr,{placeholder:"Quickly add a task... (Press Enter to submit)",value:S,onChange:Y=>b(Y.target.value),onPressEnter:G,size:"large",style:{flex:1}}),P.jsx(Mr,{value:x,onChange:$,size:"large",style:{width:130},options:[{value:"high",label:"π΄ High"},{value:"medium",label:"π‘ Medium"},{value:"low",label:"π΅ Low"}]}),P.jsx(Mr,{value:w,onChange:E,size:"large",style:{width:130},options:[{value:"work",label:"πΌ Work"},{value:"dev",label:"π» Dev"},{value:"bug",label:"π Bug"},{value:"feature",label:"β¨ Feature"},{value:"personal",label:"π Personal"}]}),P.jsx($t,{type:"primary",size:"large",icon:P.jsx(Co,{}),onClick:G,children:"Add"})]})}),P.jsx(Bn,{size:"small",style:{marginBottom:16,borderRadius:8},children:P.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:16,alignItems:"center",justifyContent:"space-between"},children:[P.jsxs(ao.Group,{value:u,onChange:Y=>d(Y.target.value),optionType:"button",buttonStyle:"solid",children:[P.jsxs(ao.Button,{value:"all",children:["All (",W.total,")"]}),P.jsxs(ao.Button,{value:"active",children:["Active (",W.active,")"]}),P.jsxs(ao.Button,{value:"completed",children:["Completed (",W.completed,")"]})]}),P.jsxs(sn,{wrap:!0,children:[P.jsx(sr,{prefix:P.jsx(Dc,{}),placeholder:"Search tasks...",value:i,onChange:Y=>c(Y.target.value),allowClear:!0,style:{width:220}}),P.jsx(Mr,{value:y,onChange:C,style:{width:140},options:[{value:"createdDesc",label:"Sort: Created"},{value:"dueAsc",label:"Sort: Due Date"},{value:"priorityDesc",label:"Sort: Priority"}]})]})]})}),(O||te)&&P.jsxs("div",{style:{padding:"10px 16px",marginBottom:16,backgroundColor:"#e6f4ff",border:"1px solid #91caff",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[P.jsxs(Gi,{style:{color:"#0958d9"},children:[P.jsx("strong",{style:{color:"#0958d9",fontWeight:600},children:R.length})," items selected"]}),P.jsxs(sn,{wrap:!0,children:[P.jsx($t,{size:"small",onClick:()=>{T(ee?[]:X)},children:ee?"Deselect All":"Select All"}),P.jsx($t,{size:"small",icon:P.jsx(Ov,{}),disabled:!R.length,onClick:()=>q("markCompleted"),children:"Mark Completed"}),P.jsx($t,{size:"small",icon:P.jsx(Cv,{}),disabled:!R.length,onClick:()=>q("markPending"),children:"Mark Active"}),P.jsx(xo,{title:"Are you sure you want to delete selected tasks?",onConfirm:()=>q("delete"),okText:"Delete",cancelText:"Cancel",disabled:!R.length,children:P.jsx($t,{size:"small",danger:!0,icon:P.jsx(fa,{}),disabled:!R.length,children:"Delete Selected"})}),P.jsx($t,{size:"small",type:"link",onClick:()=>{I(!1),T([])},children:"Exit Select Mode"})]})]}),t.length>0&&P.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 16px",color:"#727b94",fontSize:12,borderBottom:"1px solid #e8e8e8",marginBottom:8},children:[O?P.jsx(ka,{checked:ee,onChange:ie,style:{marginRight:10}}):P.jsx(fr,{title:"Enter Select Mode",children:P.jsx(QT,{style:{fontSize:15,marginRight:10,cursor:"pointer",color:O?"#1677ff":"#727b94",transition:"color 0.2s"},onClick:()=>I(!0)})}),P.jsx("span",{style:{flex:1,fontWeight:500},children:"Task Content"}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Mr,{size:"small",variant:"borderless",value:g,onChange:p,style:{fontSize:12,fontWeight:600,color:"#727b94"},options:[{value:"all",label:"Category"},{value:"work",label:"πΌ Work"},{value:"dev",label:"π» Dev"},{value:"bug",label:"π Bug"},{value:"feature",label:"β¨ Feature"},{value:"personal",label:"π Personal"}]})}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Mr,{size:"small",variant:"borderless",value:f,onChange:v,style:{fontSize:12,fontWeight:600,color:"#727b94"},options:[{value:"all",label:"Priority"},{value:"high",label:"π΄ High"},{value:"medium",label:"π‘ Medium"},{value:"low",label:"π΅ Low"}]})}),P.jsx("span",{style:{width:120,textAlign:"center"},children:"Due Date"}),P.jsx("span",{style:{width:120,textAlign:"right"},children:"Actions"})]}),r?P.jsx("div",{style:{padding:"80px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):Z.length===0?P.jsx(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:t.length===0?"No tasks yet. Create your first task!":"No matching tasks found.",children:t.length===0&&P.jsx($t,{type:"primary",icon:P.jsx(Co,{}),onClick:()=>{A(null),B(!0)},children:"New Task"})}):P.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Z.map(Y=>{var ce;const le=uoe[Y.category]||{label:Y.category,color:"default"},ue=doe[Y.priority]||{label:Y.priority,color:"default"},de=Y.dueDate&&Y.dueDate<ne&&!Y.completed;return P.jsx(Bn,{size:"small",style:{borderRadius:8,borderColor:R.includes(Y.id)?"#1677ff":void 0,opacity:Y.completed?.65:1,transition:"all 0.2s ease"},bodyStyle:{padding:"12px 16px"},children:P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[O?P.jsx(ka,{checked:R.includes(Y.id),onChange:()=>oe(Y.id)}):P.jsx(fr,{title:Y.completed?"Mark as active":"Mark as completed",children:P.jsx(ka,{checked:Y.completed,onChange:()=>H(Y),style:{transform:"scale(1.1)"}})}),P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsx("div",{style:{fontWeight:500,fontSize:15,lineHeight:"1.4",textDecoration:Y.completed?"line-through":"none",color:Y.completed?"rgba(0, 0, 0, 0.35)":"inherit",wordBreak:"break-word"},children:P.jsx(Iv,{text:Y.title,domain:N.domain,jiraIssuePrefix:N.jiraIssuePrefix})}),!!((ce=Y.description)!=null&&ce.trim())&&P.jsx("div",{style:{fontSize:12,color:Y.completed?"rgba(0, 0, 0, 0.35)":"#666666",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.jsx(Iv,{text:Y.description.trim(),domain:N.domain,jiraIssuePrefix:N.jiraIssuePrefix})})]}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Vn,{color:le.color,style:{margin:0},children:le.label})}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Vn,{color:ue.color,style:{margin:0},children:ue.label})}),P.jsx("div",{style:{width:120,textAlign:"center"},children:Y.dueDate?P.jsxs(Vn,{color:de?"error":"default",style:{margin:0},children:[P.jsx(Cv,{style:{marginRight:4}}),Y.dueDate,de&&" (Overdue)"]}):P.jsx(Gi,{type:"secondary",style:{fontSize:12},children:"β"})}),P.jsx("div",{style:{width:120,textAlign:"right"},children:P.jsxs(sn,{size:"small",children:[Y.completed&&P.jsx(fr,{title:"Archive task",children:P.jsx($t,{type:"text",size:"small",icon:P.jsx(Bre,{style:{color:"#fa8c16"}}),onClick:()=>U(Y.id)})}),P.jsx($t,{type:"text",size:"small",icon:P.jsx(Mg,{}),onClick:()=>{A(Y),B(!0)}}),P.jsx(xo,{title:"Are you sure you want to delete this task?",onConfirm:()=>K(Y.id),okText:"Delete",cancelText:"Cancel",children:P.jsx($t,{type:"text",danger:!0,size:"small",icon:P.jsx(fa,{})})})]})})]})},Y.id)})}),u==="completed"&&W.completed>0&&P.jsx("div",{style:{marginTop:24,textAlign:"right"},children:P.jsx(xo,{title:`Are you sure you want to clear all ${W.completed} completed tasks?`,onConfirm:()=>q("clearCompleted"),okText:"Clear",cancelText:"Cancel",children:P.jsxs($t,{type:"dashed",danger:!0,icon:P.jsx(fa,{}),children:["Clear all completed tasks (",W.completed,")"]})})}),P.jsx(loe,{open:_,editingTodo:k,onCancel:()=>B(!1),onSave:V})]})}const{Title:moe,Text:xR,Paragraph:voe}=Hr,goe={work:{label:"πΌ Work",color:"blue"},dev:{label:"π» Dev",color:"purple"},bug:{label:"π Bug",color:"red"},feature:{label:"β¨ Feature",color:"green"},personal:{label:"π Personal",color:"orange"}},poe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}};function hoe(){const{message:e}=co.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[i,c]=l.useState(""),[u,d]=l.useState({domain:"",jiraIssuePrefix:""}),f=l.useCallback(async()=>{a(!0);try{const C=await La.list();n(C)}catch(C){e.error(C.message)}finally{a(!1)}},[e]);l.useEffect(()=>{f(),Oa.status().then(C=>{C&&d(C)}).catch(()=>{})},[f]);const v=l.useMemo(()=>{let C=t.filter(S=>S.archived);if(i.trim()){const S=i.toLowerCase().trim();C=C.filter(b=>b.title.toLowerCase().includes(S)||(b.description||"").toLowerCase().includes(S))}return C.sort((S,b)=>new Date(b.archivedAt||0)-new Date(S.archivedAt||0))},[t,i]),g=async C=>{try{await La.unarchive(C),n(S=>S.map(b=>b.id===C?{...b,archived:!1,archivedAt:null}:b)),e.success("Task restored to To-Do List")}catch(S){e.error(S.message)}},p=async C=>{try{await La.remove(C),n(S=>S.filter(b=>b.id!==C)),e.success("Task permanently deleted")}catch(S){e.error(S.message)}},y=async()=>{try{const C=await La.batch("clearArchived");n(C),e.success("All archived tasks cleared")}catch(C){e.error(C.message)}};return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(xR,{type:"secondary",children:"WORKBENCH"}),P.jsxs(moe,{level:2,children:[P.jsx(uS,{style:{marginRight:8,color:"#1677ff"}}),"Archived Tasks"]}),P.jsx(voe,{type:"secondary",children:"View and manage archived tasks. Archived items can be restored back to your active To-Do list."})]}),P.jsxs(sn,{children:[P.jsx($t,{icon:P.jsx(dR,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do List"}),P.jsx($t,{icon:P.jsx(Ec,{}),onClick:f,loading:r,children:"Refresh"})]})]}),P.jsx(Bn,{size:"small",style:{marginBottom:16,borderRadius:8},children:P.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[P.jsxs(xR,{type:"secondary",children:["Total Archived: ",P.jsx("strong",{style:{color:"#1677ff"},children:v.length})," items"]}),P.jsx(sr,{prefix:P.jsx(Dc,{}),placeholder:"Search archived tasks...",value:i,onChange:C=>c(C.target.value),allowClear:!0,style:{width:240}})]})}),v.length>0&&P.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 16px",color:"#727b94",fontSize:12,borderBottom:"1px solid #e8e8e8",marginBottom:8},children:[P.jsx("span",{style:{flex:1,fontWeight:500},children:"Task Content"}),P.jsx("span",{style:{width:110,textAlign:"center"},children:"Category"}),P.jsx("span",{style:{width:110,textAlign:"center"},children:"Priority"}),P.jsx("span",{style:{width:140,textAlign:"center"},children:"Archived At"}),P.jsx("span",{style:{width:100,textAlign:"right"},children:"Actions"})]}),r?P.jsx("div",{style:{padding:"80px 0",textAlign:"center"},children:P.jsx(bi,{size:"large"})}):v.length===0?P.jsx(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:"No archived tasks found.",children:P.jsx($t,{icon:P.jsx(dR,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do List"})}):P.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.map(C=>{var $;const S=goe[C.category]||{label:C.category,color:"default"},b=poe[C.priority]||{label:C.priority,color:"default"},x=C.archivedAt?ia(C.archivedAt).format("YYYY-MM-DD HH:mm"):"β";return P.jsx(Bn,{size:"small",style:{borderRadius:8,opacity:.85},bodyStyle:{padding:"12px 16px"},children:P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsx("div",{style:{fontWeight:500,fontSize:15,lineHeight:"1.4",textDecoration:C.completed?"line-through":"none",color:"inherit",wordBreak:"break-word"},children:P.jsx(Iv,{text:C.title,domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})}),!!(($=C.description)!=null&&$.trim())&&P.jsx("div",{style:{fontSize:12,color:"#666666",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.jsx(Iv,{text:C.description.trim(),domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})})]}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Vn,{color:S.color,style:{margin:0},children:S.label})}),P.jsx("div",{style:{width:110,textAlign:"center"},children:P.jsx(Vn,{color:b.color,style:{margin:0},children:b.label})}),P.jsx("div",{style:{width:140,textAlign:"center"},children:P.jsxs(Vn,{color:"default",style:{margin:0},children:[P.jsx(Cv,{style:{marginRight:4}}),x]})}),P.jsx("div",{style:{width:100,textAlign:"right"},children:P.jsxs(sn,{size:"small",children:[P.jsx(fr,{title:"Restore to To-Do List",children:P.jsx($t,{type:"text",size:"small",icon:P.jsx(hae,{style:{color:"#1677ff"}}),onClick:()=>g(C.id)})}),P.jsx(xo,{title:"Permanently delete this archived task?",onConfirm:()=>p(C.id),okText:"Delete",cancelText:"Cancel",children:P.jsx($t,{type:"text",danger:!0,size:"small",icon:P.jsx(fa,{})})})]})})]})},C.id)})}),v.length>0&&P.jsx("div",{style:{marginTop:24,textAlign:"right"},children:P.jsx(xo,{title:`Are you sure you want to permanently delete all ${v.length} archived tasks?`,onConfirm:y,okText:"Delete All",cancelText:"Cancel",children:P.jsxs($t,{type:"dashed",danger:!0,icon:P.jsx(fa,{}),children:["Clear all archived tasks (",v.length,")"]})})})]})}const{Title:boe}=Hr,yoe=()=>{const n=(window.location.hash||"").slice(2).split("/");if(n[0]==="logs"){const r=n[1]||"",a=n[2]==="pkg",i=a?n[3]:n[2];return{launcherId:r,isPackage:a,scriptIdOrName:i}}return{launcherId:null,isPackage:!1,scriptIdOrName:null}};function Coe(){const{message:e}=co.useApp(),{launcherId:t,isPackage:n,scriptIdOrName:r}=yoe(),[a,i]=l.useState("output"),[c,u]=l.useState(""),[d,f]=l.useState(!0),[v,g]=l.useState(!1),[p,y]=l.useState(""),[C,S]=l.useState(r),b=l.useRef(null);l.useEffect(()=>{t&&Sr.list().then(w=>{var O;const E=w.find(I=>I.id===t);if(E&&(E.alias&&y(E.alias),!n&&r))if(r==="install")S("Install");else{const I=(O=E.scripts)==null?void 0:O.find(R=>R.id===r);I!=null&&I.name&&S(I.name)}}).catch(()=>{})},[t,n,r]),l.useEffect(()=>{const w=p?`${p} Β· `:"",E=C||r||"Logs";return document.title=`${w}${E} Β· DevBuddy`,()=>{document.title="DevBuddy Β· Workbench"}},[p,C,r]),l.useEffect(()=>{if(!t||!r)return;const w=async()=>{try{const O=n?a==="error"?await Sr.packageScriptErrorLogs(t,r):await Sr.packageScriptLogs(t,r):a==="error"?await Sr.errorLogs(t,r):await Sr.logs(t,r);u(O.log||(a==="error"?"No error logs yet.":"No logs yet."))}catch(O){u(O.message)}finally{f(!1)}};w();const E=setInterval(w,1e3);return()=>clearInterval(E)},[t,n,r,a]),l.useEffect(()=>{if(b.current){const w=b.current.querySelector(".log-output");w&&(w.scrollTop=w.scrollHeight)}},[c]);const x=async()=>{try{await navigator.clipboard.writeText(window.location.href),g(!0),e.success("URL copied to clipboard"),setTimeout(()=>g(!1),2e3)}catch{e.error("Failed to copy URL")}},$=()=>{window.close()};return!t||!r?P.jsx("div",{className:"standalone-log-container",style:{display:"grid",placeItems:"center",height:"100vh",background:"#111827",color:"#ef4444"},children:P.jsx("div",{children:"Invalid log target specified in URL."})}):P.jsxs("div",{className:"standalone-log-container",ref:b,children:[P.jsxs("header",{className:"standalone-log-header",children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[P.jsxs(boe,{level:4,style:{margin:0,color:"#f3f4f6",fontSize:16},children:[p||t," ",P.jsx("span",{style:{color:"#9ca3af",fontWeight:"normal"},children:"/"})," ",C||r]}),d&&P.jsx(bi,{size:"small"})]}),P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[P.jsxs(ao.Group,{value:a,onChange:w=>i(w.target.value),size:"small",buttonStyle:"solid",children:[P.jsx(ao.Button,{value:"output",children:"Output"}),P.jsx(ao.Button,{value:"error",children:"Errors"})]}),P.jsx($t,{size:"small",icon:v?P.jsx(is,{}):P.jsx(ul,{}),onClick:x,children:v?"Copied":"Copy URL"}),P.jsx($t,{type:"text",icon:P.jsx(To,{}),onClick:$,style:{color:"#9ca3af"},title:"Close Tab"})]})]}),P.jsx("div",{className:"standalone-log-body",children:P.jsx(Iy,{value:c,className:"standalone-log-output"})})]})}const{Title:Soe,Text:Uu,Paragraph:xoe}=Hr;function $oe(){const{message:e}=co.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[i,c]=l.useState(""),[u,d]=l.useState("All"),[f,v]=l.useState(new Set),[g,p]=l.useState(null),y=async()=>{a(!0);try{const I=await cd.list();n(I||[])}catch(I){e.error(I.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const C=async()=>{try{await cd.clear(),n([]),e.success("All error records cleared")}catch(I){e.error(I.message)}},S=async I=>{try{await cd.remove(I),n(R=>R.filter(T=>T.id!==I)),e.success("Error record deleted")}catch(R){e.error(R.message)}},b=I=>{const R=`[${I.timestamp}] [${I.source}] ${I.message}
|
|
520
520
|
|
|
521
|
-
${I.details||""}`;navigator.clipboard.writeText(R),p(I.id),setTimeout(()=>{p(T=>T===I.id?null:T)},1200)},x=I=>{v(R=>{const T=new Set(R);return T.has(I)?T.delete(I):T.add(I),T})},$=l.useMemo(()=>{const I=new Set;for(const R of t)R.source&&(R.source.startsWith("Launcher")?I.add("Launcher"):R.source.startsWith("Backend")?I.add("Backend API"):R.source.startsWith("Frontend")?I.add("Frontend"):I.add(R.source));return["All",...Array.from(I)]},[t]),w=l.useMemo(()=>t.filter(I=>{var R,T,N;if(u!=="All"&&(u==="Launcher"&&!((R=I.source)!=null&&R.startsWith("Launcher"))||u==="Backend API"&&!((T=I.source)!=null&&T.startsWith("Backend"))||u==="Frontend"&&!((N=I.source)!=null&&N.startsWith("Frontend"))||!["Launcher","Backend API","Frontend"].includes(u)&&I.source!==u))return!1;if(i.trim()){const j=i.toLowerCase(),_=(I.message||"").toLowerCase(),B=(I.source||"").toLowerCase(),k=(I.details||"").toLowerCase();return _.includes(j)||B.includes(j)||k.includes(j)}return!0}),[t,u,i]),E=(I="")=>I.startsWith("Launcher")?"orange":I.startsWith("Backend")?"processing":I.startsWith("Frontend")?"purple":"default",O=I=>{if(!I)return"";try{return new Date(I).toLocaleString("sv-SE").replace(" "," ")}catch{return I}};return P.jsxs("div",{className:"error-logs-page",children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Uu,{type:"secondary",children:"SYSTEM LOGS"}),P.jsx(Soe,{level:2,children:"Error history"}),P.jsx(xoe,{type:"secondary",children:"Captures the 100 most recent errors from launchers, backend APIs, and frontend execution."})]}),P.jsxs(sn,{size:12,align:"center",children:[P.jsx($t,{icon:P.jsx(Ec,{}),loading:r,onClick:y,children:"Refresh"}),P.jsx(xo,{title:"Clear all error logs?",description:"This action will permanently delete all stored error records.",onConfirm:C,okText:"Yes, clear",cancelText:"Cancel",okButtonProps:{danger:!0},children:P.jsxs($t,{danger:!0,icon:P.jsx(fa,{}),disabled:t.length===0,children:["Clear All (",t.length,")"]})})]})]}),P.jsxs("div",{style:{marginBottom:16,display:"flex",gap:12,flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[P.jsx(pq,{options:$.map(I=>{const R=I==="All"?t.length:t.filter(T=>{var N,j,_;return I==="Launcher"?(N=T.source)==null?void 0:N.startsWith("Launcher"):I==="Backend API"?(j=T.source)==null?void 0:j.startsWith("Backend"):I==="Frontend"?(_=T.source)==null?void 0:_.startsWith("Frontend"):T.source===I}).length;return{label:`${I} (${R})`,value:I}}),value:u,onChange:d}),P.jsx(sr,{placeholder:"Search error message or details...",prefix:P.jsx(Dc,{style:{color:"#8c8c8c"}}),allowClear:!0,value:i,onChange:I=>c(I.target.value),style:{width:280}})]}),w.length>0?P.jsx("div",{style:{display:"grid",gap:10},children:w.map(I=>{const R=f.has(I.id);return P.jsxs(Bn,{size:"small",className:"error-log-item",style:{borderLeft:"4px solid #ff4d4f"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12},children:[P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:4},children:[P.jsxs(Vn,{color:"error",style:{margin:0},children:[P.jsx(YT,{})," ERROR"]}),P.jsx(Vn,{color:E(I.source),style:{margin:0},children:I.source}),P.jsx(Uu,{type:"secondary",style:{fontSize:12},children:O(I.timestamp)})]}),P.jsx(Uu,{strong:!0,style:{fontSize:14,color:"#111827",display:"block",wordBreak:"break-word"},children:I.message})]}),P.jsxs(sn,{size:4,style:{flexShrink:0},children:[I.details&&P.jsx($t,{type:"text",size:"small",icon:R?P.jsx(ag,{}):P.jsx(il,{}),onClick:()=>x(I.id),children:R?"Hide Details":"Details"}),P.jsx(fr,{title:g===I.id?"Copied!":"Copy error",children:P.jsx($t,{type:"text",size:"small",icon:g===I.id?P.jsx(is,{style:{color:"#52c41a"}}):P.jsx(ul,{}),onClick:()=>b(I)})}),P.jsx(fr,{title:"Delete entry",children:P.jsx($t,{type:"text",size:"small",danger:!0,icon:P.jsx(fa,{}),onClick:()=>S(I.id)})})]})]}),I.details&&R&&P.jsx("div",{style:{marginTop:10},children:P.jsx("pre",{className:"log-output",style:{minHeight:"auto",maxHeight:360,margin:0,padding:10,borderRadius:6,fontSize:12},children:P.jsx("code",{style:{color:"#fca5a5"},children:I.details})})})]},I.id)})}):P.jsx(Bn,{style:{marginTop:16,textAlign:"center",padding:"48px 0"},children:P.jsx(lr,{image:P.jsx(Ov,{style:{fontSize:48,color:"#52c41a"}}),description:P.jsxs("div",{style:{marginTop:8},children:[P.jsx(Uu,{strong:!0,style:{fontSize:16,display:"block",color:"#374151"},children:t.length===0?"No error records":"No matching error records"}),P.jsx(Uu,{type:"secondary",children:t.length===0?"Recent error events (up to 100) will be automatically captured and listed here.":"Try clearing your search query or switching filters."})]})})}),P.jsx(hl.BackTop,{visibilityHeight:240})]})}const{Content:woe,Sider:Eoe}=sl,{Title:Ooe,Text:Roe}=Hr,Ioe=()=>{const t=(window.location.hash||"#/launcher").slice(2);return t.startsWith("plugin:")?{page:"plugin",pluginId:t.slice(7)}:t.startsWith("static:")?{page:"static-page",staticId:t.slice(7)}:t.startsWith("logs/")?{page:"logs",pluginId:null}:["todo-list/archived","todo-archived"].includes(t)?{page:"todo-archived",pluginId:null}:["launcher","clipboard","ports","image-compress","pr-review","jira-filters","todo-list","settings","errors"].includes(t)?{page:t,pluginId:null}:{page:"launcher",pluginId:null}};function Noe(){const{message:e}=co.useApp(),t=Ioe(),[n,r]=l.useState([]),[a,i]=l.useState(new Set),[c,u]=l.useState({}),[d,f]=l.useState(!0),[v,g]=l.useState([]),[p,y]=l.useState([]),[C,S]=l.useState(t.page),[b,x]=l.useState(t.pluginId?{id:t.pluginId,name:"Plugin"}:null),[$,w]=l.useState(null),[E,O]=l.useState(""),I=async()=>{try{const[_,B]=await Promise.all([Sr.list(),Sr.running()]);r(_),Array.isArray(B)?(i(new Set(B)),u({})):(i(new Set((B==null?void 0:B.running)||[])),u((B==null?void 0:B.errorCounts)||{}))}catch(_){e.error(_.message)}finally{f(!1)}},R=async _=>{if(_){O("Loading pluginβ¦");try{O(_.view?await(await fetch(_.view)).text():"This plugin does not provide a view yet.")}catch{O("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([I(),Sae.list().then(g),ic.list().then(y)]).catch(_=>e.error(_.message))},[]),l.useEffect(()=>{const _=()=>{const k=(window.location.hash||"#/launcher").slice(2);if(k.startsWith("plugin:")){const A=k.slice(7),F=v.find(z=>z.id===A);F?(w(null),S("plugin"),x(F),R(F)):v.length>0&&(window.location.hash="#/launcher")}else if(k.startsWith("static:")){const A=k.slice(7),F=p.find(z=>String(z.id)===String(A));F?(x(null),S("static-page"),w(F)):p.length>0&&(window.location.hash="#/launcher")}else k.startsWith("logs/")?(x(null),w(null),S("logs")):["todo-list/archived","todo-archived"].includes(k)?(x(null),w(null),S("todo-archived")):["launcher","clipboard","ports","image-compress","pr-review","jira-filters","todo-list","settings","errors"].includes(k)?(x(null),w(null),S(k)):window.location.hash="#/launcher"};return window.addEventListener("hashchange",_),v.length>0||p.length>0||window.location.hash?_():window.location.hash="#/launcher",()=>window.removeEventListener("hashchange",_)},[v,p]),l.useEffect(()=>{const _=k=>{var A;(k.error||k.message)&&cd.log({source:"Frontend",message:k.message||"Uncaught JavaScript Error",details:((A=k.error)==null?void 0:A.stack)||`${k.filename}:${k.lineno}:${k.colno}`}).catch(()=>{})},B=k=>{var A,F;cd.log({source:"Frontend (Promise)",message:((A=k.reason)==null?void 0:A.message)||String(k.reason||"Unhandled Promise Rejection"),details:((F=k.reason)==null?void 0:F.stack)||String(k.reason)}).catch(()=>{})};return window.addEventListener("error",_),window.addEventListener("unhandledrejection",B),()=>{window.removeEventListener("error",_),window.removeEventListener("unhandledrejection",B)}},[]),l.useEffect(()=>{if(C!=="launcher"&&C!=="ports")return;const _=setInterval(I,2e3);return()=>clearInterval(_)},[C]);const T=l.useMemo(()=>[{key:"launcher",icon:P.jsx(Ry,{}),label:"Launcher"},{key:"ports",icon:P.jsx(vae,{}),label:"Port Diagnostic"},{key:"image-compress",icon:P.jsx(Ey,{}),label:"Image compression"},{key:"clipboard",icon:P.jsx(ul,{}),label:"Clipboard history"},{key:"pr-review",icon:P.jsx(ZT,{}),label:"PR Review"},{key:"jira-filters",icon:P.jsx(_re,{}),label:"Jira Filters"},{key:"todo-list",icon:P.jsx(QT,{}),label:"To-Do List"},...p.map(_=>({key:`static:${_.id}`,icon:P.jsx(cS,{}),label:_.name}))],[p]),N=({key:_})=>{window.location.hash=`#/${_}`},j=b?`plugin:${b.id}`:$?`static:${$.id}`:C==="todo-archived"?"todo-list":C;return C==="logs"?P.jsx(Coe,{}):P.jsxs(sl,{className:"workbench",children:[P.jsxs(Eoe,{className:"sidebar",width:240,children:[P.jsxs("div",{className:"brand",children:[P.jsx("span",{children:"β¦"})," DevBuddy ",P.jsx("span",{style:{fontSize:"11px",fontWeight:"400",color:"#727b94",marginLeft:"6px",letterSpacing:"normal",verticalAlign:"middle"},children:"v0.1.11"})]}),P.jsx(ll,{theme:"dark",mode:"inline",selectedKeys:[j],items:T,onClick:N}),P.jsx("div",{className:"sidebar-bottom",children:P.jsxs("div",{className:"sidebar-bottom-inner",children:[P.jsx(ll,{theme:"dark",mode:"inline",selectedKeys:b||$?[]:[C],items:[{key:"settings",icon:P.jsx(cae,{}),label:"Settings"}],onClick:N}),P.jsx(fr,{title:"Error Logs (Recent 100 Errors)",placement:"right",children:P.jsx($t,{type:C==="errors"?"primary":"text",icon:P.jsx(YT,{}),size:"small",className:`sidebar-error-btn ${C==="errors"?"is-active":""}`,onClick:()=>{window.location.hash="#/errors"}})})]})})]}),P.jsx(sl,{children:P.jsx(woe,{className:`page ${C==="static-page"?"is-static-page":""}`,children:b?P.jsxs(P.Fragment,{children:[P.jsx(Roe,{type:"secondary",children:"PLUGIN"}),P.jsx(Ooe,{level:2,children:b.name}),P.jsx(Bn,{children:P.jsx("div",{dangerouslySetInnerHTML:{__html:E}})})]}):C==="static-page"&&$?P.jsx("div",{className:"static-page-container",children:P.jsx("iframe",{src:$.url,title:$.name,className:"static-page-iframe"})}):C==="image-compress"?P.jsx(Xae,{}):C==="clipboard"?P.jsx(Mae,{}):C==="ports"?P.jsx(Wae,{refreshLaunchers:I}):C==="pr-review"?P.jsx(Zae,{}):C==="jira-filters"?P.jsx(ooe,{}):C==="todo-list"?P.jsx(foe,{}):C==="todo-archived"?P.jsx(hoe,{}):C==="errors"?P.jsx($oe,{}):C==="settings"?P.jsx(Kae,{onStaticPagesChange:()=>ic.list().then(y)}):P.jsx(kae,{launchers:n,running:a,errorCounts:c,refresh:I,loading:d})})})]})}function Moe(){return P.jsx(co,{children:P.jsx(Noe,{})})}g6.createRoot(document.getElementById("app")).render(P.jsx(ve.StrictMode,{children:P.jsx(Moe,{})}));
|
|
521
|
+
${I.details||""}`;navigator.clipboard.writeText(R),p(I.id),setTimeout(()=>{p(T=>T===I.id?null:T)},1200)},x=I=>{v(R=>{const T=new Set(R);return T.has(I)?T.delete(I):T.add(I),T})},$=l.useMemo(()=>{const I=new Set;for(const R of t)R.source&&(R.source.startsWith("Launcher")?I.add("Launcher"):R.source.startsWith("Backend")?I.add("Backend API"):R.source.startsWith("Frontend")?I.add("Frontend"):I.add(R.source));return["All",...Array.from(I)]},[t]),w=l.useMemo(()=>t.filter(I=>{var R,T,N;if(u!=="All"&&(u==="Launcher"&&!((R=I.source)!=null&&R.startsWith("Launcher"))||u==="Backend API"&&!((T=I.source)!=null&&T.startsWith("Backend"))||u==="Frontend"&&!((N=I.source)!=null&&N.startsWith("Frontend"))||!["Launcher","Backend API","Frontend"].includes(u)&&I.source!==u))return!1;if(i.trim()){const j=i.toLowerCase(),_=(I.message||"").toLowerCase(),B=(I.source||"").toLowerCase(),k=(I.details||"").toLowerCase();return _.includes(j)||B.includes(j)||k.includes(j)}return!0}),[t,u,i]),E=(I="")=>I.startsWith("Launcher")?"orange":I.startsWith("Backend")?"processing":I.startsWith("Frontend")?"purple":"default",O=I=>{if(!I)return"";try{return new Date(I).toLocaleString("sv-SE").replace(" "," ")}catch{return I}};return P.jsxs("div",{className:"error-logs-page",children:[P.jsxs("div",{className:"page-header",children:[P.jsxs("div",{children:[P.jsx(Uu,{type:"secondary",children:"SYSTEM LOGS"}),P.jsx(Soe,{level:2,children:"Error history"}),P.jsx(xoe,{type:"secondary",children:"Captures the 100 most recent errors from launchers, backend APIs, and frontend execution."})]}),P.jsxs(sn,{size:12,align:"center",children:[P.jsx($t,{icon:P.jsx(Ec,{}),loading:r,onClick:y,children:"Refresh"}),P.jsx(xo,{title:"Clear all error logs?",description:"This action will permanently delete all stored error records.",onConfirm:C,okText:"Yes, clear",cancelText:"Cancel",okButtonProps:{danger:!0},children:P.jsxs($t,{danger:!0,icon:P.jsx(fa,{}),disabled:t.length===0,children:["Clear All (",t.length,")"]})})]})]}),P.jsxs("div",{style:{marginBottom:16,display:"flex",gap:12,flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[P.jsx(pq,{options:$.map(I=>{const R=I==="All"?t.length:t.filter(T=>{var N,j,_;return I==="Launcher"?(N=T.source)==null?void 0:N.startsWith("Launcher"):I==="Backend API"?(j=T.source)==null?void 0:j.startsWith("Backend"):I==="Frontend"?(_=T.source)==null?void 0:_.startsWith("Frontend"):T.source===I}).length;return{label:`${I} (${R})`,value:I}}),value:u,onChange:d}),P.jsx(sr,{placeholder:"Search error message or details...",prefix:P.jsx(Dc,{style:{color:"#8c8c8c"}}),allowClear:!0,value:i,onChange:I=>c(I.target.value),style:{width:280}})]}),w.length>0?P.jsx("div",{style:{display:"grid",gap:10},children:w.map(I=>{const R=f.has(I.id);return P.jsxs(Bn,{size:"small",className:"error-log-item",style:{borderLeft:"4px solid #ff4d4f"},children:[P.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12},children:[P.jsxs("div",{style:{flex:1,minWidth:0},children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:4},children:[P.jsxs(Vn,{color:"error",style:{margin:0},children:[P.jsx(YT,{})," ERROR"]}),P.jsx(Vn,{color:E(I.source),style:{margin:0},children:I.source}),P.jsx(Uu,{type:"secondary",style:{fontSize:12},children:O(I.timestamp)})]}),P.jsx(Uu,{strong:!0,style:{fontSize:14,color:"#111827",display:"block",wordBreak:"break-word"},children:I.message})]}),P.jsxs(sn,{size:4,style:{flexShrink:0},children:[I.details&&P.jsx($t,{type:"text",size:"small",icon:R?P.jsx(ag,{}):P.jsx(il,{}),onClick:()=>x(I.id),children:R?"Hide Details":"Details"}),P.jsx(fr,{title:g===I.id?"Copied!":"Copy error",children:P.jsx($t,{type:"text",size:"small",icon:g===I.id?P.jsx(is,{style:{color:"#52c41a"}}):P.jsx(ul,{}),onClick:()=>b(I)})}),P.jsx(fr,{title:"Delete entry",children:P.jsx($t,{type:"text",size:"small",danger:!0,icon:P.jsx(fa,{}),onClick:()=>S(I.id)})})]})]}),I.details&&R&&P.jsx("div",{style:{marginTop:10},children:P.jsx("pre",{className:"log-output",style:{minHeight:"auto",maxHeight:360,margin:0,padding:10,borderRadius:6,fontSize:12},children:P.jsx("code",{style:{color:"#fca5a5"},children:I.details})})})]},I.id)})}):P.jsx(Bn,{style:{marginTop:16,textAlign:"center",padding:"48px 0"},children:P.jsx(lr,{image:P.jsx(Ov,{style:{fontSize:48,color:"#52c41a"}}),description:P.jsxs("div",{style:{marginTop:8},children:[P.jsx(Uu,{strong:!0,style:{fontSize:16,display:"block",color:"#374151"},children:t.length===0?"No error records":"No matching error records"}),P.jsx(Uu,{type:"secondary",children:t.length===0?"Recent error events (up to 100) will be automatically captured and listed here.":"Try clearing your search query or switching filters."})]})})}),P.jsx(hl.BackTop,{visibilityHeight:240})]})}const{Content:woe,Sider:Eoe}=sl,{Title:Ooe,Text:Roe}=Hr,Ioe=()=>{const t=(window.location.hash||"#/launcher").slice(2);return t.startsWith("plugin:")?{page:"plugin",pluginId:t.slice(7)}:t.startsWith("static:")?{page:"static-page",staticId:t.slice(7)}:t.startsWith("logs/")?{page:"logs",pluginId:null}:["todo-list/archived","todo-archived"].includes(t)?{page:"todo-archived",pluginId:null}:["launcher","clipboard","ports","image-compress","pr-review","jira-filters","todo-list","settings","errors"].includes(t)?{page:t,pluginId:null}:{page:"launcher",pluginId:null}};function Noe(){const{message:e}=co.useApp(),t=Ioe(),[n,r]=l.useState([]),[a,i]=l.useState(new Set),[c,u]=l.useState({}),[d,f]=l.useState(!0),[v,g]=l.useState([]),[p,y]=l.useState([]),[C,S]=l.useState(t.page),[b,x]=l.useState(t.pluginId?{id:t.pluginId,name:"Plugin"}:null),[$,w]=l.useState(null),[E,O]=l.useState(""),I=async()=>{try{const[_,B]=await Promise.all([Sr.list(),Sr.running()]);r(_),Array.isArray(B)?(i(new Set(B)),u({})):(i(new Set((B==null?void 0:B.running)||[])),u((B==null?void 0:B.errorCounts)||{}))}catch(_){e.error(_.message)}finally{f(!1)}},R=async _=>{if(_){O("Loading pluginβ¦");try{O(_.view?await(await fetch(_.view)).text():"This plugin does not provide a view yet.")}catch{O("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([I(),Sae.list().then(g),ic.list().then(y)]).catch(_=>e.error(_.message))},[]),l.useEffect(()=>{const _=()=>{const k=(window.location.hash||"#/launcher").slice(2);if(k.startsWith("plugin:")){const A=k.slice(7),F=v.find(z=>z.id===A);F?(w(null),S("plugin"),x(F),R(F)):v.length>0&&(window.location.hash="#/launcher")}else if(k.startsWith("static:")){const A=k.slice(7),F=p.find(z=>String(z.id)===String(A));F?(x(null),S("static-page"),w(F)):p.length>0&&(window.location.hash="#/launcher")}else k.startsWith("logs/")?(x(null),w(null),S("logs")):["todo-list/archived","todo-archived"].includes(k)?(x(null),w(null),S("todo-archived")):["launcher","clipboard","ports","image-compress","pr-review","jira-filters","todo-list","settings","errors"].includes(k)?(x(null),w(null),S(k)):window.location.hash="#/launcher"};return window.addEventListener("hashchange",_),v.length>0||p.length>0||window.location.hash?_():window.location.hash="#/launcher",()=>window.removeEventListener("hashchange",_)},[v,p]),l.useEffect(()=>{const _=k=>{var A;(k.error||k.message)&&cd.log({source:"Frontend",message:k.message||"Uncaught JavaScript Error",details:((A=k.error)==null?void 0:A.stack)||`${k.filename}:${k.lineno}:${k.colno}`}).catch(()=>{})},B=k=>{var A,F;cd.log({source:"Frontend (Promise)",message:((A=k.reason)==null?void 0:A.message)||String(k.reason||"Unhandled Promise Rejection"),details:((F=k.reason)==null?void 0:F.stack)||String(k.reason)}).catch(()=>{})};return window.addEventListener("error",_),window.addEventListener("unhandledrejection",B),()=>{window.removeEventListener("error",_),window.removeEventListener("unhandledrejection",B)}},[]),l.useEffect(()=>{if(C!=="launcher"&&C!=="ports")return;const _=setInterval(I,2e3);return()=>clearInterval(_)},[C]);const T=l.useMemo(()=>[{key:"launcher",icon:P.jsx(Ry,{}),label:"Launcher"},{key:"ports",icon:P.jsx(vae,{}),label:"Port Diagnostic"},{key:"image-compress",icon:P.jsx(Ey,{}),label:"Image compression"},{key:"clipboard",icon:P.jsx(ul,{}),label:"Clipboard history"},{key:"pr-review",icon:P.jsx(ZT,{}),label:"PR Review"},{key:"jira-filters",icon:P.jsx(_re,{}),label:"Jira Filters"},{key:"todo-list",icon:P.jsx(QT,{}),label:"To-Do List"},...p.map(_=>({key:`static:${_.id}`,icon:P.jsx(cS,{}),label:_.name}))],[p]),N=({key:_})=>{window.location.hash=`#/${_}`},j=b?`plugin:${b.id}`:$?`static:${$.id}`:C==="todo-archived"?"todo-list":C;return C==="logs"?P.jsx(Coe,{}):P.jsxs(sl,{className:"workbench",children:[P.jsxs(Eoe,{className:"sidebar",width:240,children:[P.jsxs("div",{className:"brand",children:[P.jsx("span",{children:"β¦"})," DevBuddy ",P.jsx("span",{style:{fontSize:"11px",fontWeight:"400",color:"#727b94",marginLeft:"6px",letterSpacing:"normal",verticalAlign:"middle"},children:"v0.1.12"})]}),P.jsx(ll,{theme:"dark",mode:"inline",selectedKeys:[j],items:T,onClick:N}),P.jsx("div",{className:"sidebar-bottom",children:P.jsxs("div",{className:"sidebar-bottom-inner",children:[P.jsx(ll,{theme:"dark",mode:"inline",selectedKeys:b||$?[]:[C],items:[{key:"settings",icon:P.jsx(cae,{}),label:"Settings"}],onClick:N}),P.jsx(fr,{title:"Error Logs (Recent 100 Errors)",placement:"right",children:P.jsx($t,{type:C==="errors"?"primary":"text",icon:P.jsx(YT,{}),size:"small",className:`sidebar-error-btn ${C==="errors"?"is-active":""}`,onClick:()=>{window.location.hash="#/errors"}})})]})})]}),P.jsx(sl,{children:P.jsx(woe,{className:`page ${C==="static-page"?"is-static-page":""}`,children:b?P.jsxs(P.Fragment,{children:[P.jsx(Roe,{type:"secondary",children:"PLUGIN"}),P.jsx(Ooe,{level:2,children:b.name}),P.jsx(Bn,{children:P.jsx("div",{dangerouslySetInnerHTML:{__html:E}})})]}):C==="static-page"&&$?P.jsx("div",{className:"static-page-container",children:P.jsx("iframe",{src:$.url,title:$.name,className:"static-page-iframe"})}):C==="image-compress"?P.jsx(Xae,{}):C==="clipboard"?P.jsx(Mae,{}):C==="ports"?P.jsx(Wae,{refreshLaunchers:I}):C==="pr-review"?P.jsx(Zae,{}):C==="jira-filters"?P.jsx(ooe,{}):C==="todo-list"?P.jsx(foe,{}):C==="todo-archived"?P.jsx(hoe,{}):C==="errors"?P.jsx($oe,{}):C==="settings"?P.jsx(Kae,{onStaticPagesChange:()=>ic.list().then(y)}):P.jsx(kae,{launchers:n,running:a,errorCounts:c,refresh:I,loading:d})})})]})}function Moe(){return P.jsx(co,{children:P.jsx(Noe,{})})}g6.createRoot(document.getElementById("app")).render(P.jsx(ve.StrictMode,{children:P.jsx(Moe,{})}));
|
package/ui/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="apple-touch-icon" href="/devbuddy-180.png" />
|
|
10
10
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
11
11
|
<title>DevBuddy Β· Workbench</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-BfTsErqX.js"></script>
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-BuBK4DeN.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|