buddy-workbench 0.2.12 → 0.2.13

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.
@@ -493,7 +493,7 @@ html body {
493
493
  ${n}-eye,
494
494
  ${n}-download,
495
495
  ${n}-delete
496
- `]:{zIndex:10,width:r,margin:`0 ${de(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% - ${de(o(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% - ${de(o(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},lpe=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},spe=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},On(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"}})}},cpe=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),upe=pn("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:a,calc:o}=e,s=sn(e,{uploadThumbnailSize:o(t).mul(2).equal(),uploadProgressOffset:o(o(n).div(2)).add(r).equal(),uploadPicCardSize:a});return[spe(s),npe(s),ope(s),ipe(s),rpe(s),ape(s),lpe(s),Yh(s)]},cpe);var dpe={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"},fpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:dpe}))},mpe=l.forwardRef(fpe),hpe={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"},ppe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hpe}))},gpe=l.forwardRef(ppe),vpe={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"},ype=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:vpe}))},bpe=l.forwardRef(ype);function uv(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 dv(e,t){const n=Ze(t),r=n.findIndex(({uid:a})=>a===e.uid);return r===-1?n.push(e):n[r]=e,n}function MC(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function xpe(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 Cpe=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},$9=e=>e.indexOf("image/")===0,Spe=e=>{if(e.type&&!e.thumbUrl)return $9(e.type);const t=e.thumbUrl||e.url||"",n=Cpe(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)},Ns=200;function wpe(e){return new Promise(t=>{if(!e.type||!$9(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ns,n.height=Ns,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ns}px; height: ${Ns}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:o,height:s}=a;let u=Ns,f=Ns,m=0,h=0;o>s?(f=s*(Ns/o),h=-(f-u)/2):(u=o*(Ns/s),m=-(u-f)/2),r.drawImage(a,m,h,u,f);const p=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(a.src),t(p)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(a.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}var $pe={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"},Epe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$pe}))},ql=l.forwardRef(Epe);const jpe=l.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:a,file:o,items:s,progress:u,iconRender:f,actionIconRender:m,itemRender:h,isImgUrl:p,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,previewIcon:C,removeIcon:x,downloadIcon:w,extra:$,onPreview:E,onDownload:R,onClose:N},O)=>{var I,j;const{status:k}=o,[T,z]=l.useState(k);l.useEffect(()=>{k!=="removed"&&z(k)},[k]);const[P,B]=l.useState(!1);l.useEffect(()=>{const re=setTimeout(()=>{B(!0)},300);return()=>{clearTimeout(re)}},[]);const H=f(o);let A=l.createElement("div",{className:`${e}-icon`},H);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!o.thumbUrl&&!o.url){const re=ge(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:T!=="uploading"});A=l.createElement("div",{className:re},H)}else{const re=p!=null&&p(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${e}-list-item-image`,crossOrigin:o.crossOrigin}):H,oe=ge(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(o)});A=l.createElement("a",{className:oe,onClick:ue=>E(o,ue),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},re)}const _=ge(`${e}-list-item`,`${e}-list-item-${T}`),F=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,U=(typeof y=="function"?y(o):y)?m((typeof x=="function"?x(o):x)||l.createElement(Hn,null),()=>N(o),e,r.removeFile,!0):null,q=(typeof b=="function"?b(o):b)&&T==="done"?m((typeof w=="function"?w(o):w)||l.createElement(ql,null),()=>R(o),e,r.downloadFile):null,L=a!=="picture-card"&&a!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ge(`${e}-list-item-actions`,{picture:a==="picture"})},q,U),K=typeof $=="function"?$(o):$,X=K&&l.createElement("span",{className:`${e}-list-item-extra`},K),V=ge(`${e}-list-item-name`),W=o.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:V,title:o.name},F,{href:o.url,onClick:re=>E(o,re)}),o.name,X):l.createElement("span",{key:"view",className:V,onClick:re=>E(o,re),title:o.name},o.name,X),G=(typeof v=="function"?v(o):v)&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:re=>E(o,re),title:r.previewFile},typeof C=="function"?C(o):C||l.createElement(jf,null)):null,Y=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},G,T==="done"&&q,U),{getPrefixCls:te}=l.useContext(Lt),ne=te(),ce=l.createElement("div",{className:_},A,W,L,Y,P&&l.createElement(ra,{motionName:`${ne}-fade`,visible:T==="uploading",motionDeadline:2e3},({className:re})=>{const oe="percent"in o?l.createElement(mp,Object.assign({type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]},u)):null;return l.createElement("div",{className:ge(`${e}-list-item-progress`,re)},oe)})),Z=o.response&&typeof o.response=="string"?o.response:((I=o.error)===null||I===void 0?void 0:I.statusText)||((j=o.error)===null||j===void 0?void 0:j.message)||r.uploadError,ee=T==="error"?l.createElement(yn,{title:Z,getPopupContainer:re=>re.parentNode},ce):ce;return l.createElement("div",{className:ge(`${e}-list-item-container`,t),style:n,ref:O},h?h(ee,o,s,{download:R.bind(null,o),preview:E.bind(null,o),remove:N.bind(null,o)}):ee)}),Npe=(e,t)=>{const{listType:n="text",previewFile:r=wpe,onPreview:a,onDownload:o,onRemove:s,locale:u,iconRender:f,isImageUrl:m=Spe,prefixCls:h,items:p=[],showPreviewIcon:v=!0,showRemoveIcon:y=!0,showDownloadIcon:b=!1,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,progress:E={size:[-1,2],showInfo:!1},appendAction:R,appendActionVisible:N=!0,itemRender:O,disabled:I}=e,[,j]=k2(),[k,T]=l.useState(!1),z=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(p||[]).forEach(V=>{!(V.originFileObj instanceof File||V.originFileObj instanceof Blob)||V.thumbUrl!==void 0||(V.thumbUrl="",r==null||r(V.originFileObj).then(W=>{V.thumbUrl=W||"",j()}))})},[n,p,r]),l.useEffect(()=>{T(!0)},[]);const P=(V,W)=>{if(a)return W==null||W.preventDefault(),a(V)},B=V=>{typeof o=="function"?o(V):V.url&&window.open(V.url)},H=V=>{s==null||s(V)},A=V=>{if(f)return f(V,n);const W=V.status==="uploading";if(n.startsWith("picture")){const G=n==="picture"?l.createElement(Vo,null):u.uploading,Y=m!=null&&m(V)?l.createElement(bpe,null):l.createElement(mpe,null);return W?G:Y}return W?l.createElement(Vo,null):l.createElement(gpe,null)},_=(V,W,G,Y,te)=>{const ne={type:"text",size:"small",title:Y,onClick:ce=>{var Z,ee;W(),l.isValidElement(V)&&((ee=(Z=V.props).onClick)===null||ee===void 0||ee.call(Z,ce))},className:`${G}-list-item-action`,disabled:te?I:!1};return l.isValidElement(V)?l.createElement(Re,Object.assign({},ne,{icon:Qr(V,Object.assign(Object.assign({},V.props),{onClick:()=>{}}))})):l.createElement(Re,Object.assign({},ne),l.createElement("span",null,V))};l.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:B}));const{getPrefixCls:F}=l.useContext(Lt),U=F("upload",h),q=F(),L=ge(`${U}-list`,`${U}-list-${n}`),K=l.useMemo(()=>Bn(tf(q),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[q]),X=Object.assign(Object.assign({},z?{}:K),{motionDeadline:2e3,motionName:`${U}-${z?"animate-inline":"animate"}`,keys:Ze(p.map(V=>({key:V.uid,file:V}))),motionAppear:k});return l.createElement("div",{className:L},l.createElement(O2,Object.assign({},X,{component:!1}),({key:V,file:W,className:G,style:Y})=>l.createElement(jpe,{key:V,locale:u,prefixCls:U,className:G,style:Y,file:W,items:p,progress:E,listType:n,isImgUrl:m,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,iconRender:A,actionIconRender:_,itemRender:O,onPreview:P,onDownload:B,onClose:H})),R&&l.createElement(ra,Object.assign({},X,{visible:N,forceRender:!0}),({className:V,style:W})=>Qr(R,G=>({className:ge(G.className,V),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:V?"none":void 0}),G.style)}))))},Ope=l.forwardRef(Npe);var Rpe=function(e,t,n,r){function a(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(h){try{m(r.next(h))}catch(p){s(p)}}function f(h){try{m(r.throw(h))}catch(p){s(p)}}function m(h){h.done?o(h.value):a(h.value).then(u,f)}m((r=r.apply(e,[])).next())})};const Jm=`__LIST_IGNORE_${Date.now()}__`,Ipe=(e,t)=>{const n=pr("upload"),{fileList:r,defaultFileList:a,onRemove:o,showUploadList:s=!0,listType:u="text",onPreview:f,onDownload:m,onChange:h,onDrop:p,previewFile:v,disabled:y,locale:b,iconRender:C,isImageUrl:x,progress:w,prefixCls:$,className:E,type:R="select",children:N,style:O,itemRender:I,maxCount:j,data:k={},multiple:T=!1,hasControlInside:z=!0,action:P="",accept:B="",supportServerRender:H=!0,rootClassName:A}=e,_=l.useContext(va),F=y??_,U=e.customRequest||n.customRequest,[q,L]=kn(a||[],{value:r,postState:$e=>$e??[]}),[K,X]=l.useState("drop"),V=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const $e=Date.now();(r||[]).forEach((Ae,We)=>{!Ae.uid&&!Object.isFrozen(Ae)&&(Ae.uid=`__AUTO__${$e}_${We}__`)})},[r]);const G=($e,Ae,We)=>{let Le=Ze(Ae),tt=!1;j===1?Le=Le.slice(-1):j&&(tt=Le.length>j,Le=Le.slice(0,j)),mi.flushSync(()=>{L(Le)});const Je={file:$e,fileList:Le};We&&(Je.event=We),(!tt||$e.status==="removed"||Le.some(Ye=>Ye.uid===$e.uid))&&mi.flushSync(()=>{h==null||h(Je)})},Y=($e,Ae)=>Rpe(void 0,void 0,void 0,function*(){const{beforeUpload:We,transformFile:Le}=e;let tt=$e;if(We){const Je=yield We($e,Ae);if(Je===!1)return!1;if(delete $e[Jm],Je===Jm)return Object.defineProperty($e,Jm,{value:!0,configurable:!0}),!1;typeof Je=="object"&&Je&&(tt=Je)}return Le&&(tt=yield Le(tt)),tt}),te=$e=>{const Ae=$e.filter(tt=>!tt.file[Jm]);if(!Ae.length)return;const We=Ae.map(tt=>uv(tt.file));let Le=Ze(q);We.forEach(tt=>{Le=dv(tt,Le)}),We.forEach((tt,Je)=>{let Ye=tt;if(Ae[Je].parsedFile)tt.status="uploading";else{const{originFileObj:He}=tt;let nt;try{nt=new File([He],He.name,{type:He.type})}catch{nt=new Blob([He],{type:He.type}),nt.name=He.name,nt.lastModifiedDate=new Date,nt.lastModified=new Date().getTime()}nt.uid=tt.uid,Ye=nt}G(Ye,Le)})},ne=($e,Ae,We)=>{try{typeof $e=="string"&&($e=JSON.parse($e))}catch{}if(!MC(Ae,q))return;const Le=uv(Ae);Le.status="done",Le.percent=100,Le.response=$e,Le.xhr=We;const tt=dv(Le,q);G(Le,tt)},ce=($e,Ae)=>{if(!MC(Ae,q))return;const We=uv(Ae);We.status="uploading",We.percent=$e.percent;const Le=dv(We,q);G(We,Le,$e)},Z=($e,Ae,We)=>{if(!MC(We,q))return;const Le=uv(We);Le.error=$e,Le.response=Ae,Le.status="error";const tt=dv(Le,q);G(Le,tt)},ee=$e=>{let Ae;Promise.resolve(typeof o=="function"?o($e):o).then(We=>{var Le;if(We===!1)return;const tt=xpe($e,q);tt&&(Ae=Object.assign(Object.assign({},$e),{status:"removed"}),q==null||q.forEach(Je=>{const Ye=Ae.uid!==void 0?"uid":"name";Je[Ye]===Ae[Ye]&&!Object.isFrozen(Je)&&(Je.status="removed")}),(Le=V.current)===null||Le===void 0||Le.abort(Ae),G(Ae,tt))})},re=$e=>{X($e.type),$e.type==="drop"&&(p==null||p($e))};l.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:ne,onProgress:ce,onError:Z,fileList:q,upload:V.current,nativeElement:W.current}));const{getPrefixCls:oe,direction:ue,upload:ye}=l.useContext(Lt),J=oe("upload",$),ve=Object.assign(Object.assign({onBatchStart:te,onError:Z,onProgress:ce,onSuccess:ne},e),{customRequest:U,data:k,multiple:T,action:P,accept:B,supportServerRender:H,prefixCls:J,disabled:F,beforeUpload:Y,onChange:void 0,hasControlInside:z});delete ve.className,delete ve.style,(!N||F)&&delete ve.id;const xe=`${J}-wrapper`,[ze,fe,se]=upe(J,xe),[le]=mo("Upload",gi.Upload),{showRemoveIcon:ae,showPreviewIcon:pe,showDownloadIcon:Ie,removeIcon:Ce,previewIcon:me,downloadIcon:be,extra:Ee}=typeof s=="boolean"?{}:s,Me=typeof ae>"u"?!F:ae,De=($e,Ae)=>s?l.createElement(Ope,{prefixCls:J,listType:u,items:q,previewFile:v,onPreview:f,onDownload:m,onRemove:ee,showRemoveIcon:Me,showPreviewIcon:pe,showDownloadIcon:Ie,removeIcon:Ce,previewIcon:me,downloadIcon:be,iconRender:C,extra:Ee,locale:Object.assign(Object.assign({},le),b),isImageUrl:x,progress:w,appendAction:$e,appendActionVisible:Ae,itemRender:I,disabled:F}):$e,Te=ge(xe,E,A,fe,se,ye==null?void 0:ye.className,{[`${J}-rtl`]:ue==="rtl",[`${J}-picture-card-wrapper`]:u==="picture-card",[`${J}-picture-circle-wrapper`]:u==="picture-circle"}),Ve=Object.assign(Object.assign({},ye==null?void 0:ye.style),O);if(R==="drag"){const $e=ge(fe,J,`${J}-drag`,{[`${J}-drag-uploading`]:q.some(Ae=>Ae.status==="uploading"),[`${J}-drag-hover`]:K==="dragover",[`${J}-disabled`]:F,[`${J}-rtl`]:ue==="rtl"});return ze(l.createElement("span",{className:Te,ref:W},l.createElement("div",{className:$e,style:Ve,onDrop:re,onDragOver:re,onDragLeave:re},l.createElement(Gw,Object.assign({},ve,{ref:V,className:`${J}-btn`}),l.createElement("div",{className:`${J}-drag-container`},N))),De()))}const _e=ge(J,`${J}-select`,{[`${J}-disabled`]:F,[`${J}-hidden`]:!N}),Ne=l.createElement("div",{className:_e,style:Ve},l.createElement(Gw,Object.assign({},ve,{ref:V})));return ze(u==="picture-card"||u==="picture-circle"?l.createElement("span",{className:Te,ref:W},De(Ne,!!N)):l.createElement("span",{className:Te,ref:W},Ne,De()))},E9=l.forwardRef(Ipe);var kpe=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 Mpe=l.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:a=!1,children:o}=e,s=kpe(e,["style","height","hasControlInside","children"]),u=Object.assign(Object.assign({},n),{height:r});return l.createElement(E9,Object.assign({ref:t,hasControlInside:a},s,{style:u,type:"drag"}),o)}),gp=E9;gp.Dragger=Mpe;gp.LIST_IGNORE=Jm;var Tpe={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"},Ppe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Tpe}))},uf=l.forwardRef(Ppe),Dpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},zpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Dpe}))},Ape=l.forwardRef(zpe),Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},_pe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Lpe}))},Bpe=l.forwardRef(_pe),Hpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},Fpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Hpe}))},j9=l.forwardRef(Fpe),Vpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Upe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Vpe}))},N9=l.forwardRef(Upe),Wpe={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"},qpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Wpe}))},ec=l.forwardRef(qpe),Kpe={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"},Gpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kpe}))},Qc=l.forwardRef(Gpe),Ype={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},Xpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Ype}))},O9=l.forwardRef(Xpe),Jpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},Qpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Jpe}))},Kd=l.forwardRef(Qpe),Zpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"},ege=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zpe}))},ou=l.forwardRef(ege),tge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},nge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:tge}))},Ph=l.forwardRef(nge),rge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},age=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rge}))},TC=l.forwardRef(age),oge={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"},ige=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:oge}))},vi=l.forwardRef(ige),lge={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"},sge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:lge}))},mu=l.forwardRef(sge),cge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z"}}]},name:"chrome",theme:"outlined"},uge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:cge}))},dge=l.forwardRef(uge),fge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},mge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:fge}))},R9=l.forwardRef(mge),hge={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 64zm176.5 585.7l-28.6 39a7.99 7.99 0 01-11.2 1.7L483.3 569.8a7.92 7.92 0 01-3.3-6.5V288c0-4.4 3.6-8 8-8h48.1c4.4 0 8 3.6 8 8v247.5l142.6 103.1c3.6 2.5 4.4 7.5 1.8 11.1z"}}]},name:"clock-circle",theme:"filled"},pge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hge}))},gge=l.forwardRef(pge),vge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},yge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:vge}))},YR=l.forwardRef(yge),bge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},xge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:bge}))},Cge=l.forwardRef(xge),Sge={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"},wge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Sge}))},wa=l.forwardRef(wge),$ge={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"},Ege=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$ge}))},PC=l.forwardRef(Ege),jge={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 372zm198.4-588.1a32 32 0 00-24.5.5L414.9 415 296.4 686c-3.6 8.2-3.6 17.5 0 25.7 3.4 7.8 9.7 13.9 17.7 17 3.8 1.5 7.7 2.2 11.7 2.2 4.4 0 8.7-.9 12.8-2.7l271-118.6 118.5-271a32.06 32.06 0 00-17.7-42.7zM576.8 534.4l26.2 26.2-42.4 42.4-26.2-26.2L380 644.4 447.5 490 422 464.4l42.4-42.4 25.5 25.5L644.4 380l-67.6 154.4zM464.4 422L422 464.4l25.5 25.6 86.9 86.8 26.2 26.2 42.4-42.4-26.2-26.2-86.8-86.9z"}}]},name:"compass",theme:"outlined"},Nge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:jge}))},Oge=l.forwardRef(Nge),Rge={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"},Ige=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Rge}))},Yw=l.forwardRef(Ige),kge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"}}]},name:"customer-service",theme:"outlined"},Mge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:kge}))},Tge=l.forwardRef(Mge),Pge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},Dge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Pge}))},zge=l.forwardRef(Dge),Age={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}}]},name:"desktop",theme:"outlined"},Lge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Age}))},_ge=l.forwardRef(Lge),Bge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"},Hge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Bge}))},XR=l.forwardRef(Hge),Fge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 289.1a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 880.2c-65.9-41.9-300-207.8-300-449.1 0-77.9 31.1-151.1 87.6-206.3C356.3 169.5 431.7 139 512 139s155.7 30.5 212.4 85.9C780.9 280 812 353.2 812 431.1c0 241.3-234.1 407.2-300 449.1zm0-617.2c-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 551c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 439c0-29.9 11.7-58 32.8-79.2C454 338.6 482.1 327 512 327c29.9 0 58 11.6 79.2 32.8C612.4 381 624 409.1 624 439c0 29.9-11.6 58-32.8 79.2z"}}]},name:"environment",theme:"outlined"},Vge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Fge}))},Uge=l.forwardRef(Vge),Wge={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"},qge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Wge}))},Dh=l.forwardRef(qge),Kge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Gge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kge}))},Ay=l.forwardRef(Gge),Yge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},Xge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Yge}))},Qm=l.forwardRef(Xge),Jge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.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.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"},Qge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Jge}))},qv=l.forwardRef(Qge),Zge={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"},eve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zge}))},Ly=l.forwardRef(eve),tve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 392h64v64h-64zm0 190v160h128V582h-64v-62h-64v62zm80 48v64h-32v-64h32zm-16-302h64v64h-64zm-64-64h64v64h-64zm64 192h64v64h-64zm0-256h64v64h-64zm494.6 88.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.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h64v64h64v-64h174v216a42 42 0 0042 42h216v494z"}}]},name:"file-zip",theme:"outlined"},nve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:tve}))},JR=l.forwardRef(nve),rve={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"},ave=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rve}))},ove=l.forwardRef(ave),ive={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"},lve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:ive}))},sve=l.forwardRef(lve),cve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"},uve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:cve}))},dve=l.forwardRef(uve),fve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},mve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:fve}))},I9=l.forwardRef(mve),hve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},pve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hve}))},k9=l.forwardRef(pve),gve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M312.1 591.5c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.1-3.1 3.1-8.2 0-11.3l-36.8-36.8a8.03 8.03 0 00-11.3 0L517 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L275.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8z"}},{tag:"path",attrs:{d:"M904 160H548V96c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H120c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h356.4v32L311.6 884.1a7.92 7.92 0 00-2.3 11l30.3 47.2v.1c2.4 3.7 7.4 4.7 11.1 2.3L512 838.9l161.3 105.8c3.7 2.4 8.7 1.4 11.1-2.3v-.1l30.3-47.2a8 8 0 00-2.3-11L548 776.3V744h356c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 512H160V232h704v440z"}}]},name:"fund-projection-screen",theme:"outlined"},vve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:gve}))},yve=l.forwardRef(vve),bve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},xve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:bve}))},Cve=l.forwardRef(xve),Sve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M913.9 552.2L805 181.4v-.1c-7.6-22.9-25.7-36.5-48.3-36.5-23.4 0-42.5 13.5-49.7 35.2l-71.4 213H388.8l-71.4-213c-7.2-21.7-26.3-35.2-49.7-35.2-23.1 0-42.5 14.8-48.4 36.6L110.5 552.2c-4.4 14.7 1.2 31.4 13.5 40.7l368.5 276.4c2.6 3.6 6.2 6.3 10.4 7.8l8.6 6.4 8.5-6.4c4.9-1.7 9-4.7 11.9-8.9l368.4-275.4c12.4-9.2 18-25.9 13.6-40.6zM751.7 193.4c1-1.8 2.9-1.9 3.5-1.9 1.1 0 2.5.3 3.4 3L818 394.3H684.5l67.2-200.9zm-487.4 1c.9-2.6 2.3-2.9 3.4-2.9 2.7 0 2.9.1 3.4 1.7l67.3 201.2H206.5l57.8-200zM158.8 558.7l28.2-97.3 202.4 270.2-230.6-172.9zm73.9-116.4h122.1l90.8 284.3-212.9-284.3zM512.9 776L405.7 442.3H620L512.9 776zm157.9-333.7h119.5L580 723.1l90.8-280.8zm-40.7 293.9l207.3-276.7 29.5 99.2-236.8 177.5z"}}]},name:"gitlab",theme:"outlined"},wve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Sve}))},w0=l.forwardRef(wve),$ve={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"},Eve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$ve}))},Mf=l.forwardRef(Eve),jve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-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-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"},Nve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:jve}))},Ove=l.forwardRef(Nve),Rve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"},Ive=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Rve}))},M9=l.forwardRef(Ive),kve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"}}]},name:"home",theme:"outlined"},Mve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:kve}))},zh=l.forwardRef(Mve),Tve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Pve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Tve}))},X$=l.forwardRef(Pve),Dve={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"},zve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Dve}))},Ah=l.forwardRef(zve),Ave={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"},Lve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Ave}))},_y=l.forwardRef(Lve),_ve={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"},Bve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:_ve}))},Hve=l.forwardRef(Bve),Fve={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"},Vve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Fve}))},ul=l.forwardRef(Vve),Uve={icon:{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 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},Wve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Uve}))},qve=l.forwardRef(Wve),Kve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},Gve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kve}))},Yve=l.forwardRef(Gve),Xve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},Jve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Xve}))},Qve=l.forwardRef(Jve),Zve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"},e0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zve}))},t0e=l.forwardRef(e0e),n0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},r0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:n0e}))},Kv=l.forwardRef(r0e),a0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7.2 3.5.3 5.2.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-.8-6.6-1.5-7.8-1.8l-3.1-.6c-2.2-.3-5.9-.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2a83.3 83.3 0 11.01-166.61 83.3 83.3 0 01-.01 166.61zM695.6 845a83.3 83.3 0 11.01-166.61A83.3 83.3 0 01695.6 845z"}}]},name:"node-index",theme:"outlined"},o0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:a0e}))},QR=l.forwardRef(o0e),i0e={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 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"},l0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:i0e}))},s0e=l.forwardRef(l0e),c0e={icon:{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.2zM304 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"}}]},name:"picture",theme:"outlined"},u0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:c0e}))},ZR=l.forwardRef(u0e),d0e={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"},f0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:d0e}))},m0e=l.forwardRef(f0e),h0e={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"},p0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:h0e}))},Kl=l.forwardRef(p0e),g0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M280 752h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8zm192-280h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8zm192 72h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v256c0 4.4 3.6 8 8 8zm216-432H144c-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:"project",theme:"outlined"},v0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:g0e}))},Lh=l.forwardRef(v0e),y0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 00324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"}}]},name:"read",theme:"outlined"},b0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:y0e}))},x0e=l.forwardRef(b0e),C0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.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-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},S0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:C0e}))},w0e=l.forwardRef(S0e),$0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},E0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$0e}))},j0e=l.forwardRef(E0e),N0e={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"},O0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:N0e}))},qo=l.forwardRef(O0e),R0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"},I0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:R0e}))},J$=l.forwardRef(I0e),k0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},M0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:k0e}))},Q$=l.forwardRef(M0e),T0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M136 384h56c4.4 0 8-3.6 8-8V200h176c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H196c-37.6 0-68 30.4-68 68v180c0 4.4 3.6 8 8 8zm512-184h176v176c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V196c0-37.6-30.4-68-68-68H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM376 824H200V648c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v180c0 37.6 30.4 68 68 68h180c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm512-184h-56c-4.4 0-8 3.6-8 8v176H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h180c37.6 0 68-30.4 68-68V648c0-4.4-3.6-8-8-8zm16-164H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"scan",theme:"outlined"},P0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:T0e}))},eI=l.forwardRef(P0e),D0e={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"},z0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:D0e}))},hu=l.forwardRef(z0e),A0e={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"},L0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:A0e}))},Gl=l.forwardRef(L0e),_0e={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"},B0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:_0e}))},H0e=l.forwardRef(B0e),F0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"},V0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:F0e}))},tI=l.forwardRef(V0e),U0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},W0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:U0e}))},_h=l.forwardRef(W0e),q0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"},K0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:q0e}))},Z$=l.forwardRef(K0e),G0e={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"},Y0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:G0e}))},e4=l.forwardRef(Y0e),X0e={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"},J0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:X0e}))},T9=l.forwardRef(J0e),Q0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 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:"upload",theme:"outlined"},Z0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Q0e}))},$0=l.forwardRef(Z0e),eye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"video-camera",theme:"outlined"},tye=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:eye}))},nye=l.forwardRef(tye),rye={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"},aye=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rye}))},P9=l.forwardRef(aye);const oye="0.2.12",jd={version:oye};async function ot(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 Br={list:()=>ot("/api/launchers"),running:()=>ot("/api/launchers/running"),create:e=>ot("/api/launchers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/launchers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/launchers/${e}`,{method:"DELETE"}),start:e=>ot(`/api/launchers/${e}/start`,{method:"POST"}),openTerminal:e=>ot(`/api/launchers/${e}/open-terminal`,{method:"POST"}),run:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/run`,{method:"POST"}),runInstall:e=>ot(`/api/launchers/${e}/install/run`,{method:"POST"}),stop:async(e,t)=>{try{return await ot(`/api/launchers/${e}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scriptId:t})})}catch{return ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/stop`,{method:"POST"})}},logs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs`),errorLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs/error`),clearLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"}),packageScripts:e=>ot(`/api/launchers/${e}/package-scripts`),runPackageScript:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/run`,{method:"POST"}),packageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`),packageScriptErrorLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs/error`),clearPackageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"})},Xw={get:()=>ot("/api/overview"),version:()=>ot("/api/overview/version"),notifications:()=>ot("/api/overview/notifications")},iye={list:()=>ot("/api/plugins")},rl={list:e=>ot(`/api/clipboard${e?`?date=${encodeURIComponent(e)}`:""}`),search:e=>ot(`/api/clipboard/search?q=${encodeURIComponent(e)}`),tagged:()=>ot("/api/clipboard/tagged"),remove:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}),uploadImage:e=>ot("/api/clipboard/image",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),updateTags:(e,t,n)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/tags`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:n})}),copied:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copied`,{method:"POST"}),copyImage:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copy-image`,{method:"POST"})},ji={list:()=>ot("/api/group-tasks"),catalog:()=>ot("/api/group-tasks/catalog"),create:e=>ot("/api/group-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/group-tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),reorder:e=>ot("/api/group-tasks/reorder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),move:(e,t)=>ot(`/api/group-tasks/${e}/move`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:t})}),remove:e=>ot(`/api/group-tasks/${e}`,{method:"DELETE"}),start:e=>ot(`/api/group-tasks/${e}/start`,{method:"POST"}),stop:e=>ot(`/api/group-tasks/${e}/stop`,{method:"POST"})},DC={list:()=>ot("/api/port-diagnostics"),get:e=>ot(`/api/port-diagnostics/${encodeURIComponent(e)}`),kill:(e,t)=>ot("/api/port-diagnostics/kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e,pid:t})})},D9={open:e=>ot("/api/settings/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),openPath:(e,t="")=>ot("/api/settings/open-editor",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,location:t})}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Un={status:()=>ot("/api/settings"),devConfigurations:()=>ot("/api/settings/dev-configurations"),selectDirectory:()=>ot("/api/settings/select-directory",{method:"POST"}),selectFile:()=>ot("/api/settings/select-file",{method:"POST"}),openDataDir:()=>ot("/api/settings/open-data-dir",{method:"POST"}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),revealFolder:e=>ot("/api/settings/reveal-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),saveDomain:e=>ot("/api/settings/domain",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})}),saveAiApiHost:e=>ot("/api/settings/ai-api-host",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aiApiHost:e})}),saveJiraIssuePrefix:e=>ot("/api/settings/jira-issue-prefix",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraIssuePrefix:e})}),saveMindMapNodeMaxWidth:e=>ot("/api/settings/mind-map-node-max-width",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({width:e})}),saveDefaultEditor:e=>ot("/api/settings/default-editor",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultEditor:e})}),saveDefaultBrowser:e=>ot("/api/settings/default-browser",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultBrowser:e})}),saveTheme:e=>ot("/api/settings/theme",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:e})}),saveDevConfigurations:e=>ot("/api/settings/dev-configurations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),saveAccessToken:(e,t)=>ot(`/api/settings/${encodeURIComponent(e)}-access-token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),saveClipboardEnabled:e=>ot("/api/settings/clipboard-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardImageEnabled:e=>ot("/api/settings/clipboard-image-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardDeduplicateMinutes:e=>ot("/api/settings/clipboard-deduplicate-minutes",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({minutes:e})})},nI={status:(e=!1)=>ot(`/api/updates${e?"?refresh=1":""}`),selfUpdate:(e="latest")=>ot("/api/updates/self-update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},lye={install:e=>ot("/api/settings/dev-configurations/nvm/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},qc={manage:(e,t)=>ot(`/api/settings/dev-configurations/npm/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:t})}),versions:e=>ot("/api/settings/dev-configurations/npm/versions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:e})}),useSuggestedPrefix:()=>ot("/api/settings/dev-configurations/npm/use-prefix-suggestion",{method:"POST"})};qc.search=e=>ot("/api/settings/dev-configurations/npm/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e})});const zC={stats:()=>ot("/api/data-backup/stats"),export:async()=>{var r;const e=await fetch("/api/data-backup/export");if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error||"Unable to export data backup.");const n=((r=(e.headers.get("Content-Disposition")||"").match(/filename="([^"]+)"/))==null?void 0:r[1])||"devbuddy-data-backup.tar.gz";return{blob:await e.blob(),filename:n}},import:e=>ot("/api/data-backup/import",{method:"POST",headers:{"Content-Type":"application/gzip"},body:e})},ch={get:()=>ot("/api/presentations"),save:e=>ot("/api/presentations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plans:e})}),setActive:e=>ot("/api/presentations/active",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e})})},Tc={check:e=>ot("/api/pr-review/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prLink:e})}),aiReview:e=>ot(`/api/pr-review/ai-review/${encodeURIComponent(e)}`),rules:()=>ot("/api/pr-review/rules"),saveRules:(e,t,n)=>ot("/api/pr-review/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:e,customRules:t,fileFilters:n})}),myPrs:()=>ot("/api/pr-review/my-prs"),reviewPrs:()=>ot("/api/pr-review/review-prs"),comment:e=>ot("/api/pr-review/comment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},fv={load:e=>ot("/api/pr-conflicts/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prUrl:e})}),myConflicts:()=>ot("/api/pr-conflicts/my-conflicts"),resolve:e=>ot("/api/pr-conflicts/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),checkBranch:e=>ot("/api/pr-conflicts/check-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},Va={list:()=>ot("/api/jira-filters"),create:e=>ot("/api/jira-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/${e}`,{method:"DELETE"}),issues:e=>ot(`/api/jira-filters/${e}/issues`),cloneIssue:e=>ot("/api/jira-filters/issues/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),templates:{list:()=>ot("/api/jira-filters/templates"),create:e=>ot("/api/jira-filters/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/templates/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/templates/${e}`,{method:"DELETE"})},recentlyCreated:()=>ot("/api/jira-filters/recently-created"),recentlyCommented:()=>ot("/api/jira-filters/recently-commented"),recentlyMentioned:()=>ot("/api/jira-filters/recently-mentioned"),recentlyUpdated:()=>ot("/api/jira-filters/recently-updated")},Wa={list:()=>ot("/api/todos"),create:e=>ot("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/todos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/todos/${e}`,{method:"DELETE"}),archive:e=>ot(`/api/todos/${e}/archive`,{method:"POST"}),unarchive:e=>ot(`/api/todos/${e}/unarchive`,{method:"POST"}),batch:(e,t)=>ot("/api/todos/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,ids:t})})},Td={list:()=>ot("/api/reminders"),create:e=>ot("/api/reminders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/reminders/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/reminders/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),remove:e=>ot(`/api/reminders/${e}`,{method:"DELETE"}),claimDue:()=>ot("/api/reminders/claim-due",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({now:new Date().toISOString()})})},Pc={list:()=>ot("/api/cron-jobs"),catalog:()=>ot("/api/cron-jobs/catalog"),create:e=>ot("/api/cron-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/cron-jobs/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/cron-jobs/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),run:e=>ot(`/api/cron-jobs/${e}/run`,{method:"POST"}),remove:e=>ot(`/api/cron-jobs/${e}`,{method:"DELETE"})},Al={list:()=>ot("/api/memos"),listImages:()=>ot("/api/memos/images"),uploadImage:e=>ot("/api/memos/images",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),create:e=>ot("/api/memos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/memos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/memos/${e}`,{method:"DELETE"}),removeImage:e=>ot(`/api/memos/images/${encodeURIComponent(e)}`,{method:"DELETE"})},sl={list:()=>ot("/api/mind-maps"),get:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`),resolveJiraIssue:e=>ot("/api/mind-maps/jira-issues/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),create:e=>ot("/api/mind-maps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"DELETE"})},Kc={list:()=>ot("/api/static-pages"),create:e=>ot("/api/static-pages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/static-pages/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/static-pages/${e}`,{method:"DELETE"})},Zc={list:()=>ot("/api/errors"),log:e=>ot("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),clear:()=>ot("/api/errors",{method:"DELETE"}),remove:e=>ot(`/api/errors/${e}`,{method:"DELETE"})},Os={getData:()=>ot("/api/postman"),importCollection:e=>ot("/api/postman/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionJson:e})}),createCollection:e=>ot("/api/postman/collections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateCollection:(e,t)=>ot(`/api/postman/collections/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteCollection:e=>ot(`/api/postman/collections/${e}`,{method:"DELETE"}),saveEnvironments:e=>ot("/api/postman/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sendRequest:e=>ot("/api/postman/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},AC={status:()=>ot("/api/bookmark-sync/status"),preview:e=>ot(`/api/bookmark-sync/preview?mode=${encodeURIComponent(e)}`),sync:e=>ot("/api/bookmark-sync/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})})},Zm={scan:e=>ot("/api/file-organizer/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),execute:e=>ot("/api/file-organizer/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getHistory:()=>ot("/api/file-organizer/history"),undo:e=>ot("/api/file-organizer/undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})}),browse:e=>ot("/api/file-organizer/browse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Ml={listApps:()=>ot("/api/branch-sync/apps"),createApp:e=>ot("/api/branch-sync/apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateApp:(e,t)=>ot(`/api/branch-sync/apps/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteApp:e=>ot(`/api/branch-sync/apps/${e}`,{method:"DELETE"}),check:e=>ot("/api/branch-sync/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:e})}),createPr:e=>ot("/api/branch-sync/create-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),createBranch:e=>ot("/api/branch-sync/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getBranches:e=>ot(`/api/branch-sync/branches?repo=${encodeURIComponent(e)}`)},Tm={repositories:e=>ot(`/api/branch-health/repositories?workspaceDir=${encodeURIComponent(e)}`),history:()=>ot("/api/branch-health/history"),scan:e=>ot("/api/branch-health/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e})}),preflight:(e,t)=>ot("/api/branch-health/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t})}),remove:(e,t,n)=>ot("/api/branch-health/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t,...n})})},So={config:()=>ot("/api/package-upgrade/config"),dependencyScan:()=>ot("/api/package-upgrade/dependency-scan"),dependencyRepositories:()=>ot("/api/package-upgrade/dependency-repositories"),saveDependencyRepositories:e=>ot("/api/package-upgrade/dependency-repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({directories:e})}),saveConfig:e=>ot("/api/package-upgrade/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceDir:e})}),addRepo:e=>ot("/api/package-upgrade/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),packageNames:e=>ot("/api/package-upgrade/repos/packages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),branches:e=>ot("/api/package-upgrade/repos/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),cloneRepo:e=>ot(`/api/package-upgrade/repos/${e}/clone`,{method:"POST"}),removeRepo:e=>ot(`/api/package-upgrade/repos/${e}`,{method:"DELETE"}),createTask:e=>ot("/api/package-upgrade/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},sye="modulepreload",cye=function(e){return"/"+e},rI={},pu=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=s(n.map(m=>{if(m=cye(m),m in rI)return;rI[m]=!0;const h=m.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":sye,h||(v.as="script"),v.crossOrigin="",v.href=m,f&&v.setAttribute("nonce",f),document.head.appendChild(v),h)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(s){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=s,window.dispatchEvent(u),!u.defaultPrevented)throw s}return a.then(s=>{for(const u of s||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};async function z9(e,t,n){const r=URL.createObjectURL(e);try{const a=await new Promise((m,h)=>{const p=new Image;p.onload=()=>m(p),p.onerror=()=>h(new Error("Unable to read this image. Please choose a valid image file.")),p.src=r}),o=document.createElement("canvas"),s=Math.max(a.naturalWidth,a.naturalHeight);let u=1;t&&(u=t/s),n!=null&&n>0&&n<=100&&(u=u*(n/100)),o.width=Math.max(1,Math.round(a.naturalWidth*u)),o.height=Math.max(1,Math.round(a.naturalHeight*u));const f=o.getContext("2d",{willReadFrequently:!0});return f.drawImage(a,0,0,o.width,o.height),{imageData:f.getImageData(0,0,o.width,o.height),width:o.width,height:o.height}}finally{URL.revokeObjectURL(r)}}async function uye(e,t={}){const{quality:n=75,progressive:r=!0,optimizeCoding:a=!0,autoSubsample:o=!0}=t,[{encode:s},{imageData:u}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),z9(e)]),f=await s(u,{quality:n,progressive:r,optimize_coding:a,auto_subsample:o}),m=new Blob([f],{type:"image/jpeg"}),h=(e.name||"clipboard-image.png").replace(/\.[^.]+$/,"")+".jpg";return new File([m],h,{type:"image/jpeg"})}const{Paragraph:dye,Text:fye,Title:mye}=Cn;function Ur({actions:e,className:t="",copyClassName:n="",description:r,descriptionClassName:a="",eyebrow:o="WORKBENCH",title:s,titleClassName:u="",titlePrefix:f,titleSuffix:m,titleRowClassName:h=""}){const p=c.jsx(mye,{className:u||void 0,level:2,children:s});return c.jsxs("header",{className:["page-header","workspace-page-header",t].filter(Boolean).join(" "),children:[c.jsxs("div",{className:n||void 0,children:[c.jsx(fye,{className:"workspace-page-eyebrow",children:o}),f||m?c.jsxs("div",{className:h||void 0,children:[f,p,m]}):p,r?c.jsx(dye,{className:["workspace-page-description",a].filter(Boolean).join(" "),type:"secondary",children:r}):null]}),e||null]})}const aI=[{value:"chrome",label:"Google Chrome"},{value:"edge",label:"Microsoft Edge"},{value:"safari",label:"Safari"}];function hye(e=!0){return e?aI:aI.filter(t=>t.value!=="safari")}function hr(e){e&&D9.open(e).catch(()=>{window.open(e,"_blank")})}function By(e,t){if(!e||!t)return"";const n=e.replace(/^https?:\/\//,"").replace(/\/+$/,"");return`https://${n.startsWith("jira.")?n:`jira.${n}`}/browse/${t.toUpperCase()}`}function pye(e,t){if(!t)return"";if(!e)return`https://jira.example.com/issues/?filter=${encodeURIComponent(t)}`;const n=e.replace(/^https?:\/\//i,"").replace(/\/+$/,"");return`https://${n.includes("jira")||n.includes(".atlassian.net")?n:`jira.${n}`}/issues/?filter=${encodeURIComponent(t)}`}const{Text:al}=Cn,Rs=()=>new Intl.DateTimeFormat("en-CA").format(new Date),gye=e=>{if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},vye=[{value:0,label:"No deduplication (0 min)"},{value:5,label:"5 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour (Default)"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"24 hours"}];function yye({value:e,domain:t,jiraIssuePrefix:n}){const r=[],a=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let o=0;const s=(n||"").split(/[\s,]+/).filter(Boolean).map(m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=s.length>0&&t?new RegExp(`\\b(?:${s.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,f=(m,h)=>{if(!u||!t)return m;const p=[];let v=0;u.lastIndex=0;for(const y of m.matchAll(u)){y.index>v&&p.push(m.slice(v,y.index));const b=y[0],C=By(t,b);p.push(c.jsx("a",{href:C,target:"_blank",rel:"noreferrer",onClick:x=>{x.preventDefault(),hr(C)},children:b},`${h}-${y.index}`)),v=y.index+b.length}return v<m.length&&p.push(m.slice(v)),p};for(const m of e.matchAll(a)){m.index>o&&r.push(...f(e.slice(o,m.index),`txt-${m.index}`));const h=m[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(h)r.push(c.jsx("a",{href:h[2],target:"_blank",rel:"noreferrer",onClick:p=>{p.preventDefault(),hr(h[2])},children:h[1]},m.index));else{const p=m[0].replace(/[),.;:!?]+$/,"");r.push(c.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:v=>{v.preventDefault(),hr(p)},children:p},m.index)),m[0].length>p.length&&r.push(m[0].slice(p.length))}o=m.index+m[0].length}return o<e.length&&r.push(...f(e.slice(o),"txt-end")),r}const oI=e=>e.text||e.preview||"",LC=e=>`/api/clipboard/image/${encodeURIComponent(e)}`;async function bye(e){if(e.type==="image/png")return e;const t=URL.createObjectURL(e);try{const n=await new Promise((o,s)=>{const u=new window.Image;u.onload=()=>o(u),u.onerror=()=>s(new Error("Unable to decode clipboard image.")),u.src=t}),r=document.createElement("canvas");r.width=n.naturalWidth,r.height=n.naturalHeight;const a=r.getContext("2d");if(!a)throw new Error("Image canvas is unavailable.");return a.drawImage(n,0,0),await new Promise((o,s)=>{r.toBlob(u=>{u?o(u):s(new Error("Unable to encode clipboard image as PNG."))},"image/png")})}finally{URL.revokeObjectURL(t)}}function Nd(e,t,n){const r=e.trim();if(!r)return!1;if(t==="account")return r.length<=20&&(/^[AT]\d+/i.test(r)||/\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/^[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/i.test(r);if(t==="url")return/^https?:\/\/[^\s]+$/i.test(r);if(t==="json"){if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{return JSON.parse(r),!0}catch{return!1}return!1}if(t==="jira"){const a=(n||"").split(/[\s,]+/).filter(Boolean).map(o=>o.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!0}function xye({children:e}){const t=l.useRef(null),[n,r]=l.useState(!1);return l.useEffect(()=>{const a=t.current;if(!a)return;const o=()=>{r(a.scrollTop+a.clientHeight<a.scrollHeight-1)};o(),a.addEventListener("scroll",o,{passive:!0});const s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;return s==null||s.observe(a),()=>{a.removeEventListener("scroll",o),s==null||s.disconnect()}},[e]),c.jsxs("div",{className:`clipboard-preview-wrap${n?" has-more":""}`,children:[c.jsx("pre",{ref:t,className:"clipboard-preview",children:e}),c.jsx("span",{className:"clipboard-preview-fade","aria-hidden":"true"})]})}function Cye(){const{message:e}=Pr.useApp(),[t,n]=l.useState(()=>{const me=localStorage.getItem("buddy_clipboard_enabled");return me!==null?me==="true":!0}),[r,a]=l.useState(!0),[o,s]=l.useState([]),[u,f]=l.useState(Rs()),[m,h]=l.useState([]),[p,v]=l.useState([]),[y,b]=l.useState(null),[C,x]=l.useState(""),[w,$]=l.useState("all"),[E,R]=l.useState(null),[N,O]=l.useState(!1),[I,j]=l.useState(!1),k=l.useRef(null),[T,z]=l.useState(""),[P,B]=l.useState(""),[H,A]=l.useState([]),[_,F]=l.useState(!1),[U,q]=l.useState({}),L=l.useRef(new Set),[K,X]=l.useState(""),[V,W]=l.useState(""),[G,Y]=l.useState(60),[te,ne]=l.useState(!1),[ce,Z]=l.useState(!0);l.useEffect(()=>{const me=[...m,...p,...H];for(const be of me){if(!be.imageFile)continue;const Me=`${be.date||u}-${be.id}`;if(U[Me]||L.current.has(Me))continue;L.current.add(Me);const De=new window.Image;De.onload=()=>{q(Te=>({...Te,[Me]:{width:De.naturalWidth,height:De.naturalHeight}})),L.current.delete(Me)},De.onerror=()=>L.current.delete(Me),De.src=LC(be.imageFile)}},[m,p,H,u,U]),l.useEffect(()=>{Un.status().then(me=>{if(me){if(me.isMac!==void 0&&ne(me.isMac),me.clipboardEnabled!==void 0){const be=me.clipboardEnabled!==!1;n(be),localStorage.setItem("buddy_clipboard_enabled",String(be))}me.clipboardImageEnabled!==void 0&&Z(me.clipboardImageEnabled!==!1),me.clipboardDeduplicateMinutes!==void 0&&Y(me.clipboardDeduplicateMinutes),me.domain&&X(me.domain),me.jiraIssuePrefix&&W(me.jiraIssuePrefix)}}).catch(()=>{}).finally(()=>a(!1))},[]);const ee=async me=>{n(me),localStorage.setItem("buddy_clipboard_enabled",String(me));try{const Ee=(await Un.saveClipboardEnabled(me)).clipboardEnabled!==!1;n(Ee),localStorage.setItem("buddy_clipboard_enabled",String(Ee)),e.success(me?"Clipboard history enabled":"Clipboard history disabled")}catch(be){e.error(be.message)}},re=async me=>{Z(me);try{const be=await Un.saveClipboardImageEnabled(me);be&&be.clipboardImageEnabled!==void 0&&Z(be.clipboardImageEnabled!==!1),e.success(me?"Image clipboard monitoring enabled":"Image clipboard monitoring disabled")}catch(be){e.error(be.message)}},oe=async me=>{Y(me);try{await Un.saveClipboardDeduplicateMinutes(me),e.success("Duplicate filter window updated.")}catch(be){e.error(be.message)}};l.useEffect(()=>{const me=P.trim();if(!me){A([]),F(!1);return}let be=!1,Ee=null;const Me=Date.now();F(!0);const De=setTimeout(async()=>{try{const Te=await rl.search(me);be||A(Te.items||[])}catch(Te){be||e.error(Te.message)}finally{const Te=Math.max(0,500-(Date.now()-Me));Ee=setTimeout(()=>{be||F(!1)},Te)}},250);return()=>{be=!0,clearTimeout(De),Ee&&clearTimeout(Ee)}},[P]);const ue=async me=>{try{const[be,Ee]=await Promise.all([rl.list(me),rl.tagged().catch(()=>({items:[]}))]);s(be.dates),h(be.items),v(Ee.items||[])}catch(be){e.error(be.message)}},ye=async(me,be)=>{const Ee=(be||"").trim();if(!Ee)return;const Me=me.tags||[];if(Me.includes(Ee)){b(null);return}const De=[...Me,Ee],Te=me.date||u;try{await rl.updateTags(Te,me.id,De),h(Ve=>Ve.map(_e=>_e.id===me.id?{..._e,tags:De}:_e)),A(Ve=>Ve.map(_e=>_e.id===me.id?{..._e,tags:De}:_e)),v(Ve=>Ve.some(Ne=>Ne.id===me.id)?Ve.map(Ne=>Ne.id===me.id?{...Ne,tags:De}:Ne):[{...me,tags:De,date:Te},...Ve]),e.success("Tag added")}catch(Ve){e.error(Ve.message)}finally{b(null),x("")}},J=async(me,be)=>{const Me=(me.tags||[]).filter(Te=>Te!==be),De=me.date||u;try{await rl.updateTags(De,me.id,Me),h(Te=>Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),A(Te=>Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),v(Te=>Me.length===0?Te.filter(Ve=>Ve.id!==me.id):Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),e.success("Tag removed")}catch(Te){e.error(Te.message)}},ve=l.useRef(Rs());l.useEffect(()=>{if(!t)return;const me=()=>{const De=Rs();if(De!==ve.current){const Te=ve.current;if(ve.current=De,u===Te)return f(De),!0}return!1};me()||ue(u);const Ee=()=>{me()||ue(u)};window.addEventListener("visibilitychange",Ee),window.addEventListener("focus",Ee);let Me=null;return u===Rs()&&(Me=setInterval(()=>{document.visibilityState==="visible"&&ue(u)},3e3)),()=>{window.removeEventListener("visibilitychange",Ee),window.removeEventListener("focus",Ee),Me&&clearInterval(Me)}},[u,t]);const xe=async me=>{const be=typeof me=="object"?me:{id:me},Ee=be.date||u;try{await rl.remove(Ee,be.id),A(Me=>Me.filter(De=>De.id!==be.id)),await ue(u),e.success("Clipboard entry deleted.")}catch(Me){e.error(Me.message)}},ze=async me=>{var Ee;const be=me.date||u;if(me.imageFile)try{if(!((Ee=navigator.clipboard)!=null&&Ee.write)||typeof window.ClipboardItem>"u")throw new Error("Image clipboard is not supported by this browser.");await rl.copied(be,me.id);const Me=await fetch(LC(me.imageFile));if(!Me.ok)throw new Error("Unable to load image.");const De=await bye(await Me.blob());try{await navigator.clipboard.write([new ClipboardItem({"image/png":De})])}catch(Te){await rl.copyImage(be,me.id).catch(()=>{throw Te})}R(me.id),setTimeout(()=>{R(Te=>Te===me.id?null:Te)},1e3)}catch(Me){e.error("Failed to copy image: "+Me.message)}else try{const Me=await rl.copied(be,me.id);await navigator.clipboard.writeText(Me.copyText??me.text??me.preview??""),R(me.id),setTimeout(()=>{R(De=>De===me.id?null:De)},1e3),u===Rs()&&be!==Rs()&&await ue(u)}catch(Me){e.error("Failed to copy text: "+Me.message)}},fe=l.useMemo(()=>[...new Set([Rs(),...o,u])],[o,u]);l.useEffect(()=>{if(!t)return;const me=be=>{const Ee=document.activeElement;if(Ee&&(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA"||Ee.isContentEditable||Ee.closest(".clipboard-tabs")))return;const Me=[...fe].sort(),De=Me.indexOf(u);be.key==="ArrowLeft"?De>0&&f(Me[De-1]):be.key==="ArrowRight"&&De<Me.length-1&&De!==-1&&f(Me[De+1])};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[fe,u,t]),l.useEffect(()=>{if(!t)return;const me=async be=>{var De;const Ee=document.activeElement;if(Ee&&(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA"||Ee.isContentEditable))return;const Me=(De=be.clipboardData)==null?void 0:De.items;if(Me){for(const Te of Me)if(Te.type.startsWith("image/")){const Ve=Te.getAsFile();if(Ve){try{e.loading({content:"Compressing and saving image from paste…",key:"paste-upload",duration:0});const _e=await uye(Ve);await rl.uploadImage(_e);const Ne=Rs();f(Ne),await ue(Ne),e.success({content:"Image pasted and saved to history!",key:"paste-upload"})}catch(_e){e.error({content:"Failed to save pasted image: "+_e.message,key:"paste-upload"})}break}}}};return window.addEventListener("paste",me),()=>window.removeEventListener("paste",me)},[u,t]);const se=fe.reduce((me,be)=>{var Te;const[Ee,Me,De]=be.split("-");return me[Ee]||(me[Ee]={}),(Te=me[Ee])[Me]||(Te[Me]=[]),me[Ee][Me].includes(De)||me[Ee][Me].push(De),me},{}),le=Object.entries(se).sort(([me],[be])=>be.localeCompare(me)).map(([me,be])=>({value:me,label:me,children:Object.entries(be).sort(([Ee],[Me])=>Me.localeCompare(Ee)).map(([Ee,Me])=>({value:Ee,label:Ee,children:Me.sort().reverse().map(De=>({value:De,label:De}))}))})),ae=P.trim(),pe=l.useMemo(()=>w==="tagged"?p:w==="all"?m:w==="image"?m.filter(me=>!!me.imageFile):m.filter(me=>!me.imageFile&&Nd(oI(me),w,V)),[w,m,p,V]),Ie=l.useMemo(()=>{const me={all:m.length,tagged:p.length,jira:0,account:0,id:0,url:0,json:0,image:0};for(const Me of m)if(Me.imageFile)me.image++;else{const De=oI(Me);Nd(De,"jira",V)&&me.jira++,Nd(De,"account")&&me.account++,Nd(De,"id")&&me.id++,Nd(De,"url")&&me.url++,Nd(De,"json")&&me.json++}const be=(Me,De)=>({key:Me,label:c.jsxs("span",{className:"clipboard-tab-label",children:[c.jsx("span",{children:De}),c.jsxs("span",{className:"clipboard-tab-count",children:["(",me[Me],")"]})]})}),Ee=[be("all","All"),be("tagged","Tagged"),be("jira","Jira"),be("account","Account"),be("id","ID"),be("url","Url"),be("json","JSON")];return te&&Ee.push(be("image","Img")),Ee},[m,p,V,te]);l.useEffect(()=>{!te&&w==="image"&&$("all")},[te,w]);const Ce=(me,be=!1)=>{const Ee=me.date||u,Me=U[`${Ee}-${me.id}`],De=(Me==null?void 0:Me.width)>0&&(Me==null?void 0:Me.height)>0?Me.width/Me.height:null,Te=De?Math.min(Me.width,300*De):null,Ve=`/api/clipboard/${encodeURIComponent(Ee)}/${encodeURIComponent(me.id)}`,_e=new Date(me.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return c.jsxs(It,{size:"small",className:`clipboard-item${me.imageFile?" clipboard-image-item":""}`,children:[c.jsxs("div",{children:[c.jsxs("div",{className:"clipboard-item-meta",children:[c.jsx(al,{type:"secondary",children:_e}),(be||me.date&&me.date!==u)&&c.jsx($t,{style:{margin:0},children:Ee}),(me.tags||[]).map(Ne=>c.jsx($t,{color:"purple",closable:!0,onClose:$e=>{$e.preventDefault(),J(me,Ne)},style:{margin:0},children:Ne},Ne)),c.jsx(Z2,{content:c.jsxs(ct.Compact,{style:{width:200},children:[c.jsx(Ct,{size:"small",placeholder:"Tag name",value:C,onChange:Ne=>x(Ne.target.value),onPressEnter:()=>ye(me,C)}),c.jsx(Re,{size:"small",type:"primary",onClick:()=>ye(me,C),children:"Add"})]}),title:"Add Tag",trigger:"click",open:y===me.id,onOpenChange:Ne=>{b(Ne?me.id:null),x("")},children:c.jsxs($t,{className:"clipboard-add-tag",children:[c.jsx(Xn,{})," Tag"]})})]}),me.imageFile?c.jsx("div",{className:`clipboard-image-wrap${De?" has-dimensions":""}`,style:Te?{width:`${Te}px`,maxWidth:"100%",aspectRatio:`${Me.width} / ${Me.height}`}:void 0,children:c.jsx(P$,{src:LC(me.imageFile),alt:"Clipboard entry",className:"clipboard-image",preview:!0,onError:()=>e.error("Unable to load clipboard image.")})}):c.jsxs(c.Fragment,{children:[c.jsx(xye,{children:c.jsx(yye,{value:me.preview||me.text,domain:K,jiraIssuePrefix:V})}),me.contentFile&&c.jsxs("span",{className:"clipboard-original",children:[c.jsx("a",{href:Ve,target:"_blank",rel:"noreferrer",children:"View original content"}),c.jsxs("a",{href:me.editorUrl,children:["Open in ",me.editorName||"editor"]})]})]})]}),c.jsxs("span",{className:"clipboard-actions",children:[U[`${Ee}-${me.id}`]&&c.jsxs(al,{type:"secondary",className:"clipboard-image-dimensions",children:[U[`${Ee}-${me.id}`].width," × ",U[`${Ee}-${me.id}`].height," px"]}),U[`${Ee}-${me.id}`]&&me.imageFile&&Number.isFinite(me.imageSize)&&c.jsx("span",{className:"clipboard-image-meta-separator","aria-hidden":"true",children:"·"}),me.imageFile&&Number.isFinite(me.imageSize)&&c.jsx(al,{type:"secondary",className:"clipboard-image-size",children:gye(me.imageSize)}),c.jsx(Re,{type:"text",icon:E===me.id?c.jsx(Vl,{style:{color:"#52c41a"}}):c.jsx(fo,{}),onClick:()=>ze(me)}),me.imageFile?c.jsx(Gr,{title:"Delete this clipboard image?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>xe(me),children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{})})}):c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>xe(me)})]})]},`${Ee}-${me.id}`)};return c.jsxs("div",{className:"clipboard-page",children:[c.jsx(Ur,{titleSuffix:c.jsx(Re,{"aria-label":"Search clipboard history",disabled:!t||r,icon:c.jsx(jo,{}),onClick:()=>O(!0),type:"text"}),titleRowClassName:"clipboard-title-row",actions:c.jsx("div",{className:"clipboard-controls",children:c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Jl,{allowClear:!1,className:"clipboard-picker",disabled:!t||r,options:le,value:u.split("-"),onChange:me=>(me==null?void 0:me.length)===3&&f(me.join("-")),placeholder:"Select date"}),c.jsx(Re,{"aria-label":"Clipboard history settings",icon:c.jsx(Gl,{}),onClick:()=>j(!0),type:"text"})]})}),description:"Saved locally and archived by date.",title:"Clipboard History"}),t?c.jsxs(c.Fragment,{children:[c.jsx(Qa,{className:"clipboard-tabs",activeKey:w,onChange:me=>{$(me),requestAnimationFrame(()=>{var be;return(be=document.activeElement)==null?void 0:be.blur()})},onKeyDown:me=>{var be;["ArrowLeft","ArrowRight"].includes(me.key)&&(me.preventDefault(),(be=document.activeElement)==null||be.blur())},items:Ie}),pe.length?c.jsx("div",{className:"clipboard-list",children:pe.map(me=>Ce(me))}):c.jsx(Xt,{description:`No ${w==="all"?"clipboard entries":`${w==="id"?"ID":w} entries`}${w==="tagged"?".":` for ${u}.`}`})]}):c.jsx(It,{className:"clipboard-disabled-card",children:c.jsx(Xt,{image:c.jsx(H0e,{style:{fontSize:48,color:"#9ca3af"}}),description:c.jsxs("div",{className:"clipboard-disabled-copy",children:[c.jsx(al,{strong:!0,className:"clipboard-disabled-title",children:"Clipboard history is disabled"}),c.jsx(al,{type:"secondary",children:"Open settings to turn on clipboard history and start capturing."})]})})}),c.jsx(xn,{className:"clipboard-settings-modal",open:I,title:"Clipboard History Settings",footer:null,width:480,onCancel:()=>j(!1),children:c.jsxs("div",{className:"clipboard-settings",children:[c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Clipboard history:"}),c.jsx(Ja,{loading:r,checked:t,onChange:ee,checkedChildren:"On",unCheckedChildren:"Off"})]}),c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Deduplicate filter:"}),c.jsx($n,{size:"small",disabled:!t||r,value:G,onChange:oe,className:"clipboard-deduplicate-select",options:vye})]}),te&&c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Monitor image clipboard:"}),c.jsx(Ja,{size:"small",disabled:!t||r,checked:ce,onChange:re,checkedChildren:"On",unCheckedChildren:"Off"})]})]})}),c.jsxs(xn,{open:N,afterOpenChange:me=>{var be;me&&((be=k.current)==null||be.focus())},title:"Search Clipboard History",footer:null,width:760,onCancel:()=>O(!1),children:[c.jsxs("div",{className:"clipboard-search-control",children:[c.jsx(Ct,{ref:k,allowClear:!0,className:"clipboard-search-field",placeholder:"Search all clipboard history",value:T,onChange:me=>{const be=me.target.value;z(be),be||(B(""),A([]))},onPressEnter:()=>{const me=T.trim();me!==ae&&A([]),B(me)}}),c.jsx(Re,{className:"clipboard-search-button",loading:_,onClick:()=>{const me=T.trim();me!==ae&&A([]),B(me)},type:"primary",children:"Search"})]}),ae&&!_&&c.jsxs(al,{type:"secondary",className:"clipboard-search-summary",children:[H.length," result",H.length===1?"":"s"," for “",ae,"”"]}),ae?_?c.jsx(_a,{active:!0,className:"clipboard-search-loading",paragraph:{rows:4}}):H.length?c.jsx("div",{className:"clipboard-search-results clipboard-list",children:H.map(me=>Ce(me,!0))}):c.jsx(Xt,{className:"clipboard-search-empty",description:`No results for “${ae}”.`}):c.jsx(al,{type:"secondary",className:"clipboard-search-hint",children:"Search across all clipboard history."})]}),c.jsx(oc.BackTop,{visibilityHeight:240})]})}const{Text:Tl,Title:Sye}=Cn,A9=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],L9=[1,2,3,4,5,6,0],iI=[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"},{value:"once",label:"One time"},{value:"cron",label:"Custom cron expression"}],lI=[{value:"custom",label:"Custom script",icon:c.jsx(wa,{})},{value:"quick-launch",label:"Quick Launch",icon:c.jsx(Z$,{})},{value:"launcher-script",label:"Launcher script",icon:c.jsx(Kl,{})}],sI=()=>({name:"",scheduleType:"daily",time:dr().hour(9).minute(0).second(0),weekday:1,scheduledAt:dr().add(1,"day").startOf("day").hour(9),cronExpression:"0 9 * * *",targetType:"custom",command:"",args:"",workingDirectory:"",launcherId:null,scriptId:null,quickLaunchId:null,enabled:!0});function Gv(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function wye(e){return e.scheduleType==="once"?`One time · ${Gv(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:e.scheduleType==="weekly"?`Every ${A9[L9.indexOf(e.weekday)]||"week"} · ${e.time}`:`Cron · ${e.cronExpression}`}function $ye(e){return{name:e.name,scheduleType:e.scheduleType,time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"day").startOf("day").hour(9),cronExpression:e.cronExpression||"0 9 * * *",targetType:e.targetType,command:e.command||"",args:e.args||"",workingDirectory:e.workingDirectory||"",launcherId:e.launcherId||null,scriptId:e.scriptId||null,quickLaunchId:e.quickLaunchId||null,enabled:e.enabled}}function Eye(e,t){var a;if(e.targetType==="custom")return`${e.command} · ${e.workingDirectory}`;if(e.targetType==="quick-launch")return((a=t.quickLaunches.find(o=>o.id===e.quickLaunchId))==null?void 0:a.name)||"Quick Launch";const n=t.launchers.find(o=>o.id===e.launcherId),r=n==null?void 0:n.scripts.find(o=>o.id===e.scriptId);return n&&r?`${n.alias} · ${r.name}`:"Launcher script"}function jye(){var k,T,z;const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState({launchers:[],quickLaunches:[]}),[o,s]=l.useState(sI),[u,f]=l.useState(null),[m,h]=l.useState(!0),[p,v]=l.useState(!1),[y,b]=l.useState(null),C=l.useCallback(async(P=!0)=>{P&&h(!0);try{const[B,H]=await Promise.all([Pc.list(),Pc.catalog()]);n(B),a(H)}catch(B){e.error(B.message)}finally{P&&h(!1)}},[e]);l.useEffect(()=>{C()},[C]);const x=l.useMemo(()=>r.launchers.find(P=>P.id===o.launcherId),[r.launchers,o.launcherId]),w=lI.find(P=>P.value===o.targetType),$=l.useMemo(()=>({total:t.length,active:t.filter(P=>P.enabled).length,failed:t.filter(P=>P.lastStatus==="failed").length}),[t]),E=()=>{f(null),s(sI())},R=(P,B)=>s(H=>({...H,[P]:B})),N=async()=>{var P,B;if(!o.name.trim()){e.warning("Enter a Cron Job name");return}if(o.scheduleType==="once"&&!((P=o.scheduledAt)!=null&&P.isValid())){e.warning("Choose a future date and time");return}if(!["once","cron"].includes(o.scheduleType)&&!((B=o.time)!=null&&B.isValid())){e.warning("Choose a run time");return}if(o.scheduleType==="cron"&&!o.cronExpression.trim()){e.warning("Enter a cron expression");return}if(o.targetType==="custom"&&(!o.command.trim()||!o.workingDirectory.trim())){e.warning("Enter a command and working directory");return}if(o.targetType==="quick-launch"&&!o.quickLaunchId){e.warning("Choose a Quick Launch");return}if(o.targetType==="launcher-script"&&(!o.launcherId||!o.scriptId)){e.warning("Choose a Launcher script");return}v(!0);try{const H={name:o.name,scheduleType:o.scheduleType,time:["once","cron"].includes(o.scheduleType)?void 0:o.time.format("HH:mm"),weekday:o.scheduleType==="weekly"?o.weekday:void 0,scheduledAt:o.scheduleType==="once"?o.scheduledAt.second(0).millisecond(0).toISOString():void 0,cronExpression:o.scheduleType==="cron"?o.cronExpression:void 0,targetType:o.targetType,args:o.args,command:o.targetType==="custom"?o.command:void 0,workingDirectory:o.targetType==="custom"?o.workingDirectory:void 0,launcherId:o.targetType==="launcher-script"?o.launcherId:void 0,scriptId:o.targetType==="launcher-script"?o.scriptId:void 0,quickLaunchId:o.targetType==="quick-launch"?o.quickLaunchId:void 0,enabled:o.enabled},A=u?await Pc.update(u,H):await Pc.create(H);n(_=>u?_.map(F=>F.id===A.id?A:F):[A,..._]),E(),e.success(u?"Cron Job updated":"Cron Job created")}catch(H){e.error(H.message)}finally{v(!1)}},O=async(P,B)=>{try{const H=await Pc.toggle(P.id,B);n(A=>A.map(_=>_.id===H.id?H:_))}catch(H){e.error(H.message)}},I=async P=>{b(P.id);try{await Pc.run(P.id),e.success(`Started ${P.name}`),await C(!1)}catch(B){e.error(B.message)}finally{b(null)}},j=async P=>{try{await Pc.remove(P),n(B=>B.filter(H=>H.id!==P)),u===P&&E(),e.success("Cron Job deleted")}catch(B){e.error(B.message)}};return c.jsxs("div",{className:"cron-jobs-page",children:[c.jsx(Ur,{eyebrow:"AUTOMATION",title:"Cron Jobs",description:"Run custom commands, Quick Launch groups, or Launcher scripts on a schedule.",actions:c.jsx(ct,{wrap:!0,children:c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:()=>C(!1),children:"Refresh"})})}),c.jsxs("div",{className:"cron-job-stats",children:[c.jsxs(It,{children:[c.jsx(Tl,{type:"secondary",children:"All jobs"}),c.jsx("strong",{children:$.total}),c.jsx("span",{children:"Saved schedules"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Tl,{type:"secondary",children:"Active"}),c.jsx("strong",{children:$.active}),c.jsx("span",{children:"Waiting for the next run"})]}),c.jsxs(It,{className:$.failed?"is-failed":"",children:[c.jsx(Tl,{type:"secondary",children:"Recent failures"}),c.jsx("strong",{children:$.failed}),c.jsx("span",{children:"Jobs that failed to start"})]})]}),c.jsxs("div",{className:"cron-jobs-layout",children:[c.jsx(It,{className:"cron-job-editor",title:c.jsxs("span",{children:[c.jsx(Qm,{})," ",u?"Edit Cron Job":"New Cron Job"]}),extra:u&&c.jsx(Re,{type:"link",onClick:E,children:"New"}),children:c.jsxs("div",{className:"cron-job-form",children:[c.jsxs("label",{children:["Job name",c.jsx(Ct,{value:o.name,maxLength:50,showCount:!0,placeholder:"For example: Start the local API",onChange:P=>R("name",P.target.value)})]}),c.jsxs("label",{children:["Schedule",c.jsx($n,{value:o.scheduleType,options:iI,onChange:P=>R("scheduleType",P)})]}),o.scheduleType==="once"&&c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"cron-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:o.scheduledAt,onChange:P=>R("scheduledAt",P&&P.second(0).millisecond(0))})]}),!["once","cron"].includes(o.scheduleType)&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(kf,{className:"cron-wide-control",format:"HH:mm",minuteStep:1,value:o.time,onChange:P=>R("time",P&&P.second(0).millisecond(0))})]}),o.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:o.weekday,options:A9.map((P,B)=>({label:P,value:L9[B]})),onChange:P=>R("weekday",P)})]})]}),o.scheduleType==="cron"&&c.jsxs("label",{children:["Cron expression",c.jsx(Ct,{value:o.cronExpression,placeholder:"0 9 * * 1-5",onChange:P=>R("cronExpression",P.target.value)}),c.jsxs(Tl,{type:"secondary",className:"cron-help",children:["Five fields: minute hour day-of-month month day-of-week. Example: ",c.jsx("code",{children:"*/15 * * * *"})]})]}),c.jsx("div",{className:"cron-section-label",children:"Execution target"}),c.jsx("div",{className:"cron-target-options",children:lI.map(P=>c.jsx(Re,{type:o.targetType===P.value?"primary":"default",icon:P.icon,onClick:()=>R("targetType",P.value),children:P.label},P.value))}),o.targetType==="custom"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Command",c.jsx(Ct.TextArea,{value:o.command,maxLength:2e3,showCount:!0,autoSize:{minRows:3,maxRows:6},placeholder:"npm run build",onChange:P=>R("command",P.target.value)})]}),c.jsxs("label",{children:["Working directory",c.jsx(Ct,{value:o.workingDirectory,placeholder:"/path/to/project",onChange:P=>R("workingDirectory",P.target.value)})]})]}),o.targetType==="quick-launch"&&c.jsxs("label",{children:["Quick Launch",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Quick Launch",value:o.quickLaunchId,options:r.quickLaunches.map(P=>({value:P.id,label:`${P.name} · ${P.scriptCount} scripts`})),onChange:P=>R("quickLaunchId",P)})]}),o.targetType==="launcher-script"&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Launcher",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Launcher",value:o.launcherId,options:r.launchers.map(P=>({value:P.id,label:P.alias})),onChange:P=>s(B=>({...B,launcherId:P,scriptId:null}))})]}),c.jsxs("label",{children:["Script",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a script",value:o.scriptId,options:((x==null?void 0:x.scripts)||[]).map(P=>({value:P.id,label:c.jsxs("span",{className:"cron-script-option",children:[c.jsx("span",{children:P.name}),c.jsxs("span",{className:"cron-script-source",children:["· ",P.source]})]})})),onChange:P=>R("scriptId",P)})]})]}),c.jsxs("label",{children:["Arguments",c.jsx(Ct,{value:o.args,maxLength:1e3,showCount:!0,placeholder:"--port 3000 --mode production",onChange:P=>R("args",P.target.value)}),c.jsx(Tl,{type:"secondary",className:"cron-help",children:"These arguments are appended to the selected command when it runs."})]}),c.jsxs("div",{className:"cron-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Tl,{strong:!0,children:"Enable job"}),c.jsx(Tl,{type:"secondary",children:"Run automatically after saving"})]}),c.jsx(Ja,{checked:o.enabled,onChange:P=>R("enabled",P)})]}),c.jsxs("div",{className:"cron-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Schedule preview"}),c.jsx(Ny,{})]}),c.jsx("strong",{children:o.scheduleType==="cron"?`Cron · ${o.cronExpression||"—"}`:o.scheduleType==="once"?`One time · ${o.scheduledAt?Gv(o.scheduledAt.toISOString()):"—"}`:`${(k=iI.find(P=>P.value===o.scheduleType))==null?void 0:k.label} · ${((T=o.time)==null?void 0:T.format("HH:mm"))||"—"}`}),c.jsxs("p",{children:[w==null?void 0:w.label," · ",o.targetType==="custom"?o.command||"No command yet":o.targetType==="quick-launch"?((z=r.quickLaunches.find(P=>P.id===o.quickLaunchId))==null?void 0:z.name)||"No Quick Launch selected":(x==null?void 0:x.alias)||"No Launcher selected"]})]}),c.jsxs(ct,{className:"cron-form-actions",children:[c.jsx(Re,{onClick:E,children:u?"Cancel":"Clear"}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),loading:p,onClick:N,children:u?"Save changes":"Create Cron Job"})]})]})}),c.jsx(It,{className:"cron-job-list-card",title:c.jsxs("span",{children:[c.jsx(Qm,{})," Scheduled jobs"]}),children:m?c.jsx("div",{className:"cron-list-state",children:"Loading Cron Jobs…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No Cron Jobs yet. Create your first schedule."}):c.jsx("div",{className:"cron-job-list",children:t.map(P=>c.jsxs("article",{className:`cron-job-item ${P.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"cron-job-icon",children:c.jsx(Qm,{})}),c.jsxs("div",{className:"cron-job-main",children:[c.jsxs("div",{className:"cron-job-heading",children:[c.jsx(Sye,{level:4,children:P.name}),c.jsx($t,{color:P.enabled?"green":"default",children:P.enabled?"Active":"Paused"}),P.lastStatus==="failed"&&c.jsx($t,{color:"error",children:"Failed"})]}),c.jsx(Tl,{className:"cron-job-target",children:Eye(P,r)}),c.jsxs("div",{className:"cron-job-meta",children:[c.jsx("span",{children:wye(P)}),P.enabled&&P.nextRunAt&&c.jsxs("span",{children:["Next: ",Gv(P.nextRunAt)]}),P.lastRunAt&&c.jsxs("span",{children:["Last: ",Gv(P.lastRunAt)]})]}),P.lastError&&c.jsx(Tl,{type:"danger",className:"cron-job-error",children:P.lastError})]}),c.jsxs("div",{className:"cron-job-actions",children:[c.jsx(Ja,{size:"small",checked:P.enabled,onChange:B=>O(P,B)}),c.jsx(Re,{type:"text",icon:c.jsx(Kl,{}),"aria-label":"Run Cron Job now",title:"Run now",loading:y===P.id,onClick:()=>I(P)}),c.jsx(Re,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit Cron Job",onClick:()=>{f(P.id),s($ye(P))}}),c.jsx(Gr,{title:"Delete this Cron Job?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>j(P.id),children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),"aria-label":"Delete Cron Job"})})]})]},P.id))})})]}),c.jsxs("div",{className:"cron-job-footnote",children:[c.jsx(Qm,{})," Cron Jobs run from the DevBuddy server, so the browser page does not need to stay on this screen. The DevBuddy server itself must remain running."]})]})}const _9=[{value:"vscode",label:"VS Code"},{value:"devin",label:"Devin"},{value:"idea",label:"IntelliJ IDEA"}];function B9(e="vscode"){const t=_9.find(n=>n.value===e);return t?t.label:"VS Code"}function H9(e="vscode",t="",n="",r={}){if(!t)return"";const a=typeof r=="boolean"?r:!!(r!=null&&r.newWindow);let o="",s="";if(n){const u=n.split(":").filter(Boolean);u[0]&&(o=u[0]),u[1]&&(s=u[1])}if(e==="idea"){let u=`idea://open?file=${encodeURIComponent(t)}`;return o&&(u+=`&line=${o}`),s&&(u+=`&column=${s}`),u}return e==="devin"?`devin://file${encodeURI(t)}${n}`:a?`vscode://vscode.open-folder${encodeURI(t)}?forceNewWindow=true`:`vscode://file${encodeURI(t)}${n}`}const{Text:mv}=Cn;function Nye({tasks:e,running:t,onCreate:n,onEdit:r,onStart:a,onStop:o,onRemove:s,onReorder:u}){const[f,m]=l.useState(null),[h,p]=l.useState(null),v=()=>{m(null),p(null)},y=async(C,x)=>{x.preventDefault();const w=x.dataTransfer.getData("text/plain")||f;if(!w||w===C){v();return}const $=[...e],E=$.findIndex(O=>O.id===w),R=$.findIndex(O=>O.id===C);if(E<0||R<0){v();return}const[N]=$.splice(E,1);$.splice(R,0,N),v(),await u($.map(O=>O.id))},b=[{title:"",width:44,render:(C,x)=>c.jsx("span",{className:"group-task-drag-handle",draggable:!0,"aria-label":`Drag ${x.name} to reorder`,title:"Drag to reorder",onDragStart:w=>{w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",x.id),m(x.id)},onDragEnd:v,children:c.jsx(XR,{})})},{title:"Name",dataIndex:"name",render:C=>c.jsx(mv,{strong:!0,children:C})},{title:"Scripts",dataIndex:"items",width:110,render:C=>c.jsxs(mv,{type:"secondary",children:[C.length," scripts"]})},{title:"Actions",width:230,render:(C,x)=>{const w=x.items.every($=>t.has(`${$.launcherId}:${$.scriptId}`));return c.jsxs(ct,{children:[c.jsx(Re,{size:"small",className:w?"launcher-running-button":void 0,icon:w?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:()=>w?o(x):a(x),children:w?"Stop":"Start"}),c.jsx(Re,{size:"small",onClick:()=>r(x),children:"Edit"}),c.jsx(Re,{size:"small",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>s(x),children:"Delete"})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group-task-header",children:[c.jsxs("div",{className:"group-task-header-copy",children:[c.jsx(mv,{type:"secondary",children:"Start selected scripts across multiple services."}),c.jsxs(mv,{type:"secondary",className:"group-task-drag-hint",children:[c.jsx(XR,{})," Drag the handle to reorder."]})]}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:n,children:"Add quick launch"})]}),e.length?c.jsx(or,{className:"group-task-table",rowKey:"id",dataSource:e,columns:b,pagination:!1,size:"small",onRow:C=>({className:`${f===C.id?"is-dragging":""} ${h===C.id?"is-drag-over":""}`.trim(),onDragOver:x=>{x.preventDefault(),x.dataTransfer.dropEffect="move",f!==C.id&&p(C.id)},onDragLeave:()=>p(x=>x===C.id?null:x),onDrop:x=>{y(C.id,x)}})}):c.jsx(Xt,{description:"No quick launches yet.",className:"group-task-empty"})]})}function df({open:e,initialPath:t="~",onCancel:n,onSelect:r,title:a="Browse Directory",selectionType:o="directory"}){const{message:s}=Pr.useApp(),[u,f]=l.useState(t),[m,h]=l.useState(null),[p,v]=l.useState(!1),y=async b=>{v(!0);try{const C=await Zm.browse(b||"~");h(C),f(C.currentPath)}catch(C){s.error(C.message||"Failed to read directory")}finally{v(!1)}};return l.useEffect(()=>{e&&y(t||"~")},[e,t]),c.jsx(xn,{title:a,open:e,onCancel:n,footer:null,width:640,destroyOnClose:!0,children:c.jsxs(ar,{spinning:p,children:[c.jsx("div",{className:"file-browser-path-row",children:c.jsx(Ct,{value:u,onChange:b=>f(b.target.value),onPressEnter:()=>y(u),addonAfter:c.jsx(Re,{size:"small",type:"text",onClick:()=>y(u),children:"Go"})})}),m&&c.jsxs("div",{children:[c.jsx("div",{className:"file-browser-parent-row",children:c.jsxs(Re,{size:"small",onClick:()=>y(m.parentPath),disabled:m.currentPath===m.parentPath,children:[c.jsx(ec,{}),"Parent Directory"]})}),c.jsx("div",{className:"file-browser-list",children:m.subdirectories.length===0&&(o!=="file"||(m.files||[]).length===0)?c.jsx("div",{className:"file-browser-empty",children:"No items found"}):c.jsxs(c.Fragment,{children:[m.subdirectories.map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>y(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Fr,{className:"file-browser-icon"}),b.name]}),o==="directory"&&c.jsx(Re,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select Folder"})]},b.fullPath)),o==="file"&&(m.files||[]).map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>r(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Zs,{className:"file-browser-icon"}),b.name]}),c.jsx(Re,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select File"})]},b.fullPath))]})}),o==="directory"&&c.jsx("div",{className:"file-browser-confirm-row",children:c.jsxs(Re,{type:"primary",onClick:()=>r(m.currentPath),children:["Confirm Path: ",m.currentPath]})})]})]})})}const{Text:Dc}=Cn,Pm=(e,t)=>`${e}:${t}`,Oye=()=>c.jsx("div",{style:{width:"0.8em",height:"0.8em",backgroundColor:"rgba(0,0,0,0.88)"}});function Rye({form:e,editing:t,executor:n,running:r,errorCounts:a={},packageScripts:o,onRun:s,onRunInstall:u,onRunPackage:f,onStop:m,onLogs:h,onPackageLogs:p}){const v=!!(t&&[...r].some(C=>C.startsWith(`${t.id}:`))),[y,b]=l.useState(()=>v);return l.useEffect(()=>{v&&b(!0)},[t==null?void 0:t.id]),l.useEffect(()=>{v||b(!1)},[v]),c.jsx(wt.List,{name:"scripts",children:(C,{add:x,remove:w})=>{const $=["npm","pnpm","yarn"].includes(n)?{id:"install",name:"Install",command:`${n} install${n==="npm"?" --legacy-peer-deps":""}`}:null,E=[...C.map(O=>({...O,key:`custom-${O.key}`,kind:"custom"})),...$?[{key:"install",kind:"install",script:$}]:[],...(o||[]).map(O=>({key:`package-${O.id}`,kind:"package",script:O}))],R=y?E.filter(O=>{const I=O.kind==="custom"?e.getFieldValue(["scripts",O.name]):O.script;return t&&(I==null?void 0:I.id)&&r.has(Pm(t.id,I.id))}):E,N=[{title:"Source",width:100,render:(O,I)=>c.jsx($t,{color:I.kind==="package"?"purple":I.kind==="install"?"green":"default",children:I.kind==="package"?"Package":I.kind==="install"?"Executor":"Custom"})},{title:"Script name",width:200,render:(O,I)=>{var z;const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=(j==null?void 0:j.name)===e.getFieldValue("startCommand"),T=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id));return c.jsxs(ct,{direction:"vertical",size:1,style:{width:"100%"},children:[I.kind!=="custom"||T?c.jsxs(ct,{size:4,children:[c.jsx(Dc,{strong:!0,children:(j==null?void 0:j.name)||((z=I.script)==null?void 0:z.name)}),k&&c.jsx(qo,{className:"start-script-icon"})]}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"name"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"serve",allowClear:!0,suffix:k?c.jsx(qo,{className:"start-script-icon"}):null})}),T&&c.jsx(sa,{status:"success",text:c.jsx(Dc,{type:"secondary",style:{fontSize:11},children:"running"})})]})}},{title:"Command",render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id));return I.kind==="package"?c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsxs(Dc,{code:!0,children:[n," run ",I.script.name]}),c.jsx(Dc,{type:"secondary",style:{fontSize:12},children:I.script.command})]}):I.kind==="install"?c.jsx(Dc,{code:!0,children:I.script.command}):k?c.jsx(Dc,{code:!0,children:j==null?void 0:j.command}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"command"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"npm run dev",allowClear:!0})})}},{title:"Actions",width:132,render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id)),T=t&&(j!=null&&j.id)&&a[Pm(t.id,j.id)]||0;return c.jsxs(ct,{size:2,children:[t&&c.jsx(yn,{title:k?"Stop":"Start",children:c.jsx(Re,{type:"text",danger:k,icon:k?c.jsx(Oye,{}):c.jsx(m0e,{}),onClick:()=>k?m(j):I.kind==="package"?f(j):I.kind==="install"?u(j):s(j),disabled:!(j!=null&&j.id)})}),c.jsx(yn,{title:"Logs",children:c.jsx(sa,{count:T,size:"small",offset:[-2,2],children:c.jsx(Re,{type:"text",icon:c.jsx(Ui,{}),onClick:()=>I.kind==="package"?p(j):h(j),disabled:!t||!(j!=null&&j.id)})})}),I.kind==="custom"&&c.jsx(yn,{title:"Remove",children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>w(I.name),disabled:!!k})})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"script-header",children:[c.jsx(cp,{orientation:"left",children:"Scripts"}),c.jsxs(ct,{size:"middle",align:"center",children:[c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:y,onChange:b,disabled:!t}),c.jsx(Dc,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]}),c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:()=>{b(!1),x({name:"",command:""})},children:"Add script"})]})]}),c.jsx(or,{size:"small",rowKey:"key",pagination:!1,loading:o===null,dataSource:R,columns:N})]})}})}const Iye=e=>c.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",style:{verticalAlign:"-0.125em",...e.style},...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.75 2.5a.75.75 0 01.742-.647h21.016a.75.75 0 01.742.853l-2.622 17.5a.75.75 0 01-.742.644H4.114a.75.75 0 01-.742-.644L.75 2.5zm13.1 11.2h-3.7l-.76-3.8h5.22l-.76 3.8z"})});function kye(e){if(!e)return null;const t=e.toLowerCase();return t.includes("bitbucket")?c.jsx(Iye,{style:{color:"#2584FF"}}):t.includes("github")?c.jsx(Cve,{style:{color:"#24292e"}}):t.includes("gitlab")?c.jsx(w0,{style:{color:"#fc6d26"}}):c.jsx(Mf,{className:"repo-generic-icon"})}function F9({repoUrl:e,style:t}){if(!e)return null;const n=kye(e);return n?c.jsx(yn,{title:"Open repository in browser",children:c.jsx(Re,{className:"repo-icon-button",type:"text",size:"small",icon:n,onClick:r=>{r.preventDefault(),r.stopPropagation(),hr(e)},style:t})}):null}const Mye=()=>({alias:"",folder:"",groupName:"",executor:"npm",startCommand:void 0,scripts:[]});function Tye({open:e,editing:t,groups:n,running:r,errorCounts:a={},onCancel:o,onSave:s,onRun:u,onRunInstall:f,onRunPackage:m,onStop:h,onLogs:p,onDelete:v}){const{message:y,modal:b}=Pr.useApp(),[C]=wt.useForm(),[x,w]=l.useState(null),[$,E]=l.useState(!1),R=l.useRef(null),N=()=>{const T=document.querySelector(".service-modal.is-editing"),z=T==null?void 0:T.querySelector(".ant-modal-body"),P=T==null?void 0:T.closest(".ant-modal-wrap");R.current=[z,P].filter(Boolean).map(B=>({element:B,top:B.scrollTop}))};l.useLayoutEffect(()=>{const T=R.current;T&&(T.forEach(({element:z,top:P})=>{z.isConnected&&(z.scrollTop=P)}),R.current=null)},[x]);const O=T=>{if(T&&(C.setFieldValue("folder",T),!C.getFieldValue("alias"))){const P=T.split(/[/\\]/).filter(Boolean);P.length>0&&C.setFieldValue("alias",P[P.length-1])}E(!1)},I=async()=>{const T=String(C.getFieldValue("folder")||"").trim();if(!T){y.warning("Set a project folder first.");return}try{await Un.openFolder(T)}catch(z){y.error(z.message)}},j=()=>{b.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 v(t)}catch(T){y.error(T.message)}}})};l.useEffect(()=>{e&&(C.resetFields(),C.setFieldsValue(t?{...t,startCommand:t.startCommand||void 0,scripts:t.scripts}:Mye()),w(t?null:[]),t&&Br.packageScripts(t.id).then(T=>{N(),w(T.scripts)}).catch(()=>{N(),w([])}))},[e,t==null?void 0:t.id,C]);const k=async()=>{try{const T=(C.getFieldValue("scripts")||[]).filter(B=>{var H,A;return((H=B==null?void 0:B.name)==null?void 0:H.trim())||((A=B==null?void 0:B.command)==null?void 0:A.trim())});C.setFieldValue("scripts",T);const z=await C.validateFields(["alias","folder","groupName","startCommand"]),P={...C.getFieldsValue(!0),...z,scripts:T};await s(P)}catch(T){if(T!=null&&T.errorFields)return;y.error(T.message)}};return c.jsxs(xn,{className:`service-modal${t?" is-editing":""}`,title:t?c.jsxs(ct,{align:"center",size:6,children:[c.jsxs("span",{children:["Service details · ",t.alias]}),c.jsx(F9,{repoUrl:t.repoUrl})]}):"Add service",open:e,onCancel:o,onOk:k,okText:t?"Save":"Save service",width:860,destroyOnClose:!0,footer:c.jsxs("div",{className:"service-modal-footer",children:[t?c.jsx(Re,{type:"primary",danger:!0,onClick:j,children:"Delete service"}):c.jsx("div",{}),c.jsxs(ct,{children:[c.jsx(Re,{onClick:o,children:"Cancel"}),c.jsx(Re,{type:"primary",onClick:k,children:t?"Save":"Save service"})]})]}),children:[c.jsxs(wt,{form:C,layout:"vertical",children:[c.jsx(Q0,{className:"service-config",defaultActiveKey:t?[]:["configuration"],items:[{key:"configuration",label:"Service configuration",children:c.jsxs(Uo,{gutter:[16,0],children:[c.jsx(Wn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Name",name:"alias",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Service name",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Project folder",name:"folder",rules:[{required:!0}],children:c.jsx(Ct,{prefix:c.jsx(Re,{type:"text",htmlType:"button",icon:c.jsx(Fr,{}),onClick:I,"aria-label":"Open project folder",title:"Open project folder",style:{color:"#8c8c8c",padding:"0 4px"}}),suffix:c.jsx(Re,{type:"text",size:"small",icon:c.jsx(Fr,{}),onClick:()=>E(!0),style:{fontSize:12,padding:"0 4px"},children:"Browse"}),placeholder:"Project folder path",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Group",name:"groupName",children:c.jsx(rf,{options:n.map(T=>({value:T})),placeholder:"Group name",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Executor",name:"executor",rules:[{required:!0}],children:c.jsx(rf,{options:["npm","pnpm","yarn"].map(T=>({value:T})),placeholder:"npm",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.scripts!==z.scripts,children:()=>{const T=(C.getFieldValue("scripts")||[]).map(B=>B==null?void 0:B.name).filter(Boolean),z=(x||[]).map(B=>B.name),P=[...new Set([...T,...z])].map(B=>({label:B,value:B}));return c.jsx(wt.Item,{label:"Start script name",name:"startCommand",children:c.jsx($n,{placeholder:"Select start script",allowClear:!0,options:P})})}})})]})}]}),c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.executor!==z.executor||T.startCommand!==z.startCommand||T.scripts!==z.scripts,children:()=>c.jsx(Rye,{form:C,editing:t,executor:C.getFieldValue("executor")||"npm",running:r,errorCounts:a,packageScripts:x,onRun:T=>u(t,T),onRunInstall:()=>f(t),onRunPackage:T=>m(t,T),onStop:T=>h(t,T.id),onLogs:T=>p(t,T),onPackageLogs:T=>p(t,T,!0)})})]}),c.jsx(df,{open:$,initialPath:C.getFieldValue("folder")||"~",onCancel:()=>E(!1),onSelect:O,title:"Select Project Directory"})]})}const{Text:Pye}=Cn;function Dye({open:e,editingGroupTask:t,groupCatalog:n,onCancel:r,onSave:a}){const{message:o}=Pr.useApp(),[s]=wt.useForm();l.useEffect(()=>{e&&(s.resetFields(),s.setFieldsValue({name:(t==null?void 0:t.name)||"",items:(t==null?void 0:t.items.map(m=>`${m.launcherId}|${m.scriptId}`))||[]}))},[e,t,s]);const u=l.useMemo(()=>Object.entries(n.reduce((m,h)=>{const p=h.groupName||"Ungrouped";return(m[p]||(m[p]=[])).push(h),m},{})).sort(([m],[h])=>m.localeCompare(h)).map(([m,h])=>({key:m,label:m,children:c.jsx("div",{className:"group-task-projects",children:h.map(p=>c.jsx(It,{size:"small",title:p.alias,children:c.jsx(ct,{direction:"vertical",children:p.scripts.map(v=>c.jsxs(nr,{value:`${p.id}|${v.id}`,children:[v.name," ",c.jsxs(Pye,{type:"secondary",children:["(",v.source,")"]})]},v.id))})},p.id))})})),[n]),f=async()=>{try{const m=await s.validateFields(),h={name:m.name,items:m.items.map(p=>{const[v,y]=p.split("|");return{launcherId:v,scriptId:y}})};await a(h)}catch(m){m!=null&&m.errorFields||o.error(m.message)}};return c.jsx(xn,{title:t?`Edit quick launch · ${t.name}`:"Add quick launch",open:e,onCancel:r,onOk:f,okText:t?"Save changes":"Save quick launch",width:760,destroyOnClose:!0,children:c.jsxs(wt,{form:s,layout:"vertical",children:[c.jsx(wt.Item,{label:"Name",name:"name",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Start local stack",allowClear:!0})}),c.jsx(wt.Item,{label:"Scripts",name:"items",rules:[{required:!0,message:"Select at least one script."}],children:c.jsx(nr.Group,{className:"group-task-selector",children:c.jsx(Qa,{items:u})})})]})})}const cI={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"},E0=()=>{const e=window.getSelection();return!e||e.isCollapsed||!e.toString()?!1:[e.anchorNode,e.focusNode].some(t=>{var r;const n=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement;return(r=n==null?void 0:n.closest)==null?void 0:r.call(n,".log-output")})};function Jw({value:e,editor:t,className:n="",onScroll:r}){const[a,o]=l.useState(t||"vscode"),[s,u]=l.useState(""),[f,m]=l.useState("");l.useEffect(()=>{t&&o(t),Un.status().then(C=>{C!=null&&C.defaultEditor&&!t&&o(C.defaultEditor),C!=null&&C.domain&&u(C.domain),C!=null&&C.jiraIssuePrefix&&m(C.jiraIssuePrefix)}).catch(()=>{})},[t]);const h=(f||"").split(/[\s,]+/).filter(Boolean).map(C=>C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=h.length>0&&s?new RegExp(`\\b(?:${h.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,v=(C,x)=>{let w="";const $=(O,I)=>O.split(/(\u001b\[[0-9;]*m)/g).map((k,T)=>{const z=k.match(/^\u001b\[([0-9;]*)m$/);if(z){const B=z[1].split(";").map(Number);return w=B.includes(0)?"":cI[B.find(H=>cI[H])]||w,null}if(!k)return null;const P=w||(/\b(error|failed|fatal|exception|TS\d{4,5})\b/i.test(k)?"log-error":/\b(warn|warning)\b/i.test(k)?"log-warning":/\b(success|ready|started|listening)\b/i.test(k)?"log-success":"");return c.jsx("span",{className:P,children:k},`${I}-${T}`)}),E=/(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,R=p&&p.test(C);return!C.includes("http")&&!C.includes("/")&&!R?$(C,`${x}-0`):C.split(E).map((O,I)=>{if(!O)return null;const j=`${x}-${I}`;if(/^https?:\/\//.test(O.replace(/\u001b\[[0-9;]*m/g,""))){const T=O.replace(/\u001b\[[0-9;]*m/g,""),z=T.replace(/[),.;:!?]+$/,""),P=T.slice(z.length);return c.jsxs("span",{children:[c.jsx("a",{className:"log-link",href:z,target:"_blank",rel:"noreferrer",onClick:B=>{B.preventDefault(),hr(z)},children:$(O.slice(0,O.length-P.length),`${j}-url`)}),P&&$(P,`${j}-suf`)]},j)}const k=O.replace(/\u001b\[[0-9;]*m/g,"");if(k.startsWith("/")){const[,T,z=""]=k.match(/^(.*?)(:\d+(?::\d+)?)?$/)||[];if(T){const P=H9(a,T,z);return c.jsx("a",{className:"log-link",href:P,target:"_blank",rel:"noreferrer",title:`Open in ${B9(a)}`,children:$(O,j)},j)}}if(p&&s&&(p.lastIndex=0,p.test(k))){const T=[];let z=0;p.lastIndex=0;for(const P of k.matchAll(p)){P.index>z&&T.push($(k.slice(z,P.index),`${j}-sub-${P.index}`));const B=P[0],H=By(s,B);T.push(c.jsx("a",{className:"log-link",href:H,target:"_blank",rel:"noreferrer",onClick:A=>{A.preventDefault(),hr(H)},children:B},`${j}-jira-${P.index}`)),z=P.index+B.length}return z<k.length&&T.push($(k.slice(z),`${j}-sub-end`)),c.jsx("span",{children:T},j)}return $(O,j)})},y=C=>{C.preventDefault(),C.stopPropagation()},b=C=>{C.metaKey||C.ctrlKey||C.altKey||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Shift","Tab","Escape"].includes(C.key)||C.preventDefault()};return c.jsx("div",{className:`log-output ${n}`.trim(),role:"log",contentEditable:!0,suppressContentEditableWarning:!0,onBeforeInput:y,onPaste:y,onDrop:y,onKeyDown:b,onMouseDown:C=>C.stopPropagation(),onScroll:r,children:e.split(`
496
+ `]:{zIndex:10,width:r,margin:`0 ${de(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% - ${de(o(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% - ${de(o(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},lpe=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},spe=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},On(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"}})}},cpe=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),upe=pn("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:a,calc:o}=e,s=sn(e,{uploadThumbnailSize:o(t).mul(2).equal(),uploadProgressOffset:o(o(n).div(2)).add(r).equal(),uploadPicCardSize:a});return[spe(s),npe(s),ope(s),ipe(s),rpe(s),ape(s),lpe(s),Yh(s)]},cpe);var dpe={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"},fpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:dpe}))},mpe=l.forwardRef(fpe),hpe={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"},ppe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hpe}))},gpe=l.forwardRef(ppe),vpe={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"},ype=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:vpe}))},bpe=l.forwardRef(ype);function uv(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 dv(e,t){const n=Ze(t),r=n.findIndex(({uid:a})=>a===e.uid);return r===-1?n.push(e):n[r]=e,n}function MC(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function xpe(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 Cpe=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},$9=e=>e.indexOf("image/")===0,Spe=e=>{if(e.type&&!e.thumbUrl)return $9(e.type);const t=e.thumbUrl||e.url||"",n=Cpe(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)},Ns=200;function wpe(e){return new Promise(t=>{if(!e.type||!$9(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ns,n.height=Ns,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ns}px; height: ${Ns}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:o,height:s}=a;let u=Ns,f=Ns,m=0,h=0;o>s?(f=s*(Ns/o),h=-(f-u)/2):(u=o*(Ns/s),m=-(u-f)/2),r.drawImage(a,m,h,u,f);const p=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(a.src),t(p)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(a.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}var $pe={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"},Epe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$pe}))},ql=l.forwardRef(Epe);const jpe=l.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:a,file:o,items:s,progress:u,iconRender:f,actionIconRender:m,itemRender:h,isImgUrl:p,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,previewIcon:C,removeIcon:x,downloadIcon:w,extra:$,onPreview:E,onDownload:R,onClose:N},O)=>{var I,j;const{status:k}=o,[T,z]=l.useState(k);l.useEffect(()=>{k!=="removed"&&z(k)},[k]);const[P,B]=l.useState(!1);l.useEffect(()=>{const re=setTimeout(()=>{B(!0)},300);return()=>{clearTimeout(re)}},[]);const H=f(o);let A=l.createElement("div",{className:`${e}-icon`},H);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!o.thumbUrl&&!o.url){const re=ge(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:T!=="uploading"});A=l.createElement("div",{className:re},H)}else{const re=p!=null&&p(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${e}-list-item-image`,crossOrigin:o.crossOrigin}):H,oe=ge(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(o)});A=l.createElement("a",{className:oe,onClick:ue=>E(o,ue),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},re)}const _=ge(`${e}-list-item`,`${e}-list-item-${T}`),F=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,U=(typeof y=="function"?y(o):y)?m((typeof x=="function"?x(o):x)||l.createElement(Hn,null),()=>N(o),e,r.removeFile,!0):null,q=(typeof b=="function"?b(o):b)&&T==="done"?m((typeof w=="function"?w(o):w)||l.createElement(ql,null),()=>R(o),e,r.downloadFile):null,L=a!=="picture-card"&&a!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ge(`${e}-list-item-actions`,{picture:a==="picture"})},q,U),K=typeof $=="function"?$(o):$,X=K&&l.createElement("span",{className:`${e}-list-item-extra`},K),V=ge(`${e}-list-item-name`),W=o.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:V,title:o.name},F,{href:o.url,onClick:re=>E(o,re)}),o.name,X):l.createElement("span",{key:"view",className:V,onClick:re=>E(o,re),title:o.name},o.name,X),G=(typeof v=="function"?v(o):v)&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:re=>E(o,re),title:r.previewFile},typeof C=="function"?C(o):C||l.createElement(jf,null)):null,Y=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},G,T==="done"&&q,U),{getPrefixCls:te}=l.useContext(Lt),ne=te(),ce=l.createElement("div",{className:_},A,W,L,Y,P&&l.createElement(ra,{motionName:`${ne}-fade`,visible:T==="uploading",motionDeadline:2e3},({className:re})=>{const oe="percent"in o?l.createElement(mp,Object.assign({type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]},u)):null;return l.createElement("div",{className:ge(`${e}-list-item-progress`,re)},oe)})),Z=o.response&&typeof o.response=="string"?o.response:((I=o.error)===null||I===void 0?void 0:I.statusText)||((j=o.error)===null||j===void 0?void 0:j.message)||r.uploadError,ee=T==="error"?l.createElement(yn,{title:Z,getPopupContainer:re=>re.parentNode},ce):ce;return l.createElement("div",{className:ge(`${e}-list-item-container`,t),style:n,ref:O},h?h(ee,o,s,{download:R.bind(null,o),preview:E.bind(null,o),remove:N.bind(null,o)}):ee)}),Npe=(e,t)=>{const{listType:n="text",previewFile:r=wpe,onPreview:a,onDownload:o,onRemove:s,locale:u,iconRender:f,isImageUrl:m=Spe,prefixCls:h,items:p=[],showPreviewIcon:v=!0,showRemoveIcon:y=!0,showDownloadIcon:b=!1,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,progress:E={size:[-1,2],showInfo:!1},appendAction:R,appendActionVisible:N=!0,itemRender:O,disabled:I}=e,[,j]=k2(),[k,T]=l.useState(!1),z=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(p||[]).forEach(V=>{!(V.originFileObj instanceof File||V.originFileObj instanceof Blob)||V.thumbUrl!==void 0||(V.thumbUrl="",r==null||r(V.originFileObj).then(W=>{V.thumbUrl=W||"",j()}))})},[n,p,r]),l.useEffect(()=>{T(!0)},[]);const P=(V,W)=>{if(a)return W==null||W.preventDefault(),a(V)},B=V=>{typeof o=="function"?o(V):V.url&&window.open(V.url)},H=V=>{s==null||s(V)},A=V=>{if(f)return f(V,n);const W=V.status==="uploading";if(n.startsWith("picture")){const G=n==="picture"?l.createElement(Vo,null):u.uploading,Y=m!=null&&m(V)?l.createElement(bpe,null):l.createElement(mpe,null);return W?G:Y}return W?l.createElement(Vo,null):l.createElement(gpe,null)},_=(V,W,G,Y,te)=>{const ne={type:"text",size:"small",title:Y,onClick:ce=>{var Z,ee;W(),l.isValidElement(V)&&((ee=(Z=V.props).onClick)===null||ee===void 0||ee.call(Z,ce))},className:`${G}-list-item-action`,disabled:te?I:!1};return l.isValidElement(V)?l.createElement(Re,Object.assign({},ne,{icon:Qr(V,Object.assign(Object.assign({},V.props),{onClick:()=>{}}))})):l.createElement(Re,Object.assign({},ne),l.createElement("span",null,V))};l.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:B}));const{getPrefixCls:F}=l.useContext(Lt),U=F("upload",h),q=F(),L=ge(`${U}-list`,`${U}-list-${n}`),K=l.useMemo(()=>Bn(tf(q),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[q]),X=Object.assign(Object.assign({},z?{}:K),{motionDeadline:2e3,motionName:`${U}-${z?"animate-inline":"animate"}`,keys:Ze(p.map(V=>({key:V.uid,file:V}))),motionAppear:k});return l.createElement("div",{className:L},l.createElement(O2,Object.assign({},X,{component:!1}),({key:V,file:W,className:G,style:Y})=>l.createElement(jpe,{key:V,locale:u,prefixCls:U,className:G,style:Y,file:W,items:p,progress:E,listType:n,isImgUrl:m,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,iconRender:A,actionIconRender:_,itemRender:O,onPreview:P,onDownload:B,onClose:H})),R&&l.createElement(ra,Object.assign({},X,{visible:N,forceRender:!0}),({className:V,style:W})=>Qr(R,G=>({className:ge(G.className,V),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:V?"none":void 0}),G.style)}))))},Ope=l.forwardRef(Npe);var Rpe=function(e,t,n,r){function a(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(h){try{m(r.next(h))}catch(p){s(p)}}function f(h){try{m(r.throw(h))}catch(p){s(p)}}function m(h){h.done?o(h.value):a(h.value).then(u,f)}m((r=r.apply(e,[])).next())})};const Jm=`__LIST_IGNORE_${Date.now()}__`,Ipe=(e,t)=>{const n=pr("upload"),{fileList:r,defaultFileList:a,onRemove:o,showUploadList:s=!0,listType:u="text",onPreview:f,onDownload:m,onChange:h,onDrop:p,previewFile:v,disabled:y,locale:b,iconRender:C,isImageUrl:x,progress:w,prefixCls:$,className:E,type:R="select",children:N,style:O,itemRender:I,maxCount:j,data:k={},multiple:T=!1,hasControlInside:z=!0,action:P="",accept:B="",supportServerRender:H=!0,rootClassName:A}=e,_=l.useContext(va),F=y??_,U=e.customRequest||n.customRequest,[q,L]=kn(a||[],{value:r,postState:$e=>$e??[]}),[K,X]=l.useState("drop"),V=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const $e=Date.now();(r||[]).forEach((Ae,We)=>{!Ae.uid&&!Object.isFrozen(Ae)&&(Ae.uid=`__AUTO__${$e}_${We}__`)})},[r]);const G=($e,Ae,We)=>{let Le=Ze(Ae),tt=!1;j===1?Le=Le.slice(-1):j&&(tt=Le.length>j,Le=Le.slice(0,j)),mi.flushSync(()=>{L(Le)});const Je={file:$e,fileList:Le};We&&(Je.event=We),(!tt||$e.status==="removed"||Le.some(Ye=>Ye.uid===$e.uid))&&mi.flushSync(()=>{h==null||h(Je)})},Y=($e,Ae)=>Rpe(void 0,void 0,void 0,function*(){const{beforeUpload:We,transformFile:Le}=e;let tt=$e;if(We){const Je=yield We($e,Ae);if(Je===!1)return!1;if(delete $e[Jm],Je===Jm)return Object.defineProperty($e,Jm,{value:!0,configurable:!0}),!1;typeof Je=="object"&&Je&&(tt=Je)}return Le&&(tt=yield Le(tt)),tt}),te=$e=>{const Ae=$e.filter(tt=>!tt.file[Jm]);if(!Ae.length)return;const We=Ae.map(tt=>uv(tt.file));let Le=Ze(q);We.forEach(tt=>{Le=dv(tt,Le)}),We.forEach((tt,Je)=>{let Ye=tt;if(Ae[Je].parsedFile)tt.status="uploading";else{const{originFileObj:He}=tt;let nt;try{nt=new File([He],He.name,{type:He.type})}catch{nt=new Blob([He],{type:He.type}),nt.name=He.name,nt.lastModifiedDate=new Date,nt.lastModified=new Date().getTime()}nt.uid=tt.uid,Ye=nt}G(Ye,Le)})},ne=($e,Ae,We)=>{try{typeof $e=="string"&&($e=JSON.parse($e))}catch{}if(!MC(Ae,q))return;const Le=uv(Ae);Le.status="done",Le.percent=100,Le.response=$e,Le.xhr=We;const tt=dv(Le,q);G(Le,tt)},ce=($e,Ae)=>{if(!MC(Ae,q))return;const We=uv(Ae);We.status="uploading",We.percent=$e.percent;const Le=dv(We,q);G(We,Le,$e)},Z=($e,Ae,We)=>{if(!MC(We,q))return;const Le=uv(We);Le.error=$e,Le.response=Ae,Le.status="error";const tt=dv(Le,q);G(Le,tt)},ee=$e=>{let Ae;Promise.resolve(typeof o=="function"?o($e):o).then(We=>{var Le;if(We===!1)return;const tt=xpe($e,q);tt&&(Ae=Object.assign(Object.assign({},$e),{status:"removed"}),q==null||q.forEach(Je=>{const Ye=Ae.uid!==void 0?"uid":"name";Je[Ye]===Ae[Ye]&&!Object.isFrozen(Je)&&(Je.status="removed")}),(Le=V.current)===null||Le===void 0||Le.abort(Ae),G(Ae,tt))})},re=$e=>{X($e.type),$e.type==="drop"&&(p==null||p($e))};l.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:ne,onProgress:ce,onError:Z,fileList:q,upload:V.current,nativeElement:W.current}));const{getPrefixCls:oe,direction:ue,upload:ye}=l.useContext(Lt),J=oe("upload",$),ve=Object.assign(Object.assign({onBatchStart:te,onError:Z,onProgress:ce,onSuccess:ne},e),{customRequest:U,data:k,multiple:T,action:P,accept:B,supportServerRender:H,prefixCls:J,disabled:F,beforeUpload:Y,onChange:void 0,hasControlInside:z});delete ve.className,delete ve.style,(!N||F)&&delete ve.id;const xe=`${J}-wrapper`,[ze,fe,se]=upe(J,xe),[le]=mo("Upload",gi.Upload),{showRemoveIcon:ae,showPreviewIcon:pe,showDownloadIcon:Ie,removeIcon:Ce,previewIcon:me,downloadIcon:be,extra:Ee}=typeof s=="boolean"?{}:s,Me=typeof ae>"u"?!F:ae,De=($e,Ae)=>s?l.createElement(Ope,{prefixCls:J,listType:u,items:q,previewFile:v,onPreview:f,onDownload:m,onRemove:ee,showRemoveIcon:Me,showPreviewIcon:pe,showDownloadIcon:Ie,removeIcon:Ce,previewIcon:me,downloadIcon:be,iconRender:C,extra:Ee,locale:Object.assign(Object.assign({},le),b),isImageUrl:x,progress:w,appendAction:$e,appendActionVisible:Ae,itemRender:I,disabled:F}):$e,Te=ge(xe,E,A,fe,se,ye==null?void 0:ye.className,{[`${J}-rtl`]:ue==="rtl",[`${J}-picture-card-wrapper`]:u==="picture-card",[`${J}-picture-circle-wrapper`]:u==="picture-circle"}),Ve=Object.assign(Object.assign({},ye==null?void 0:ye.style),O);if(R==="drag"){const $e=ge(fe,J,`${J}-drag`,{[`${J}-drag-uploading`]:q.some(Ae=>Ae.status==="uploading"),[`${J}-drag-hover`]:K==="dragover",[`${J}-disabled`]:F,[`${J}-rtl`]:ue==="rtl"});return ze(l.createElement("span",{className:Te,ref:W},l.createElement("div",{className:$e,style:Ve,onDrop:re,onDragOver:re,onDragLeave:re},l.createElement(Gw,Object.assign({},ve,{ref:V,className:`${J}-btn`}),l.createElement("div",{className:`${J}-drag-container`},N))),De()))}const _e=ge(J,`${J}-select`,{[`${J}-disabled`]:F,[`${J}-hidden`]:!N}),Ne=l.createElement("div",{className:_e,style:Ve},l.createElement(Gw,Object.assign({},ve,{ref:V})));return ze(u==="picture-card"||u==="picture-circle"?l.createElement("span",{className:Te,ref:W},De(Ne,!!N)):l.createElement("span",{className:Te,ref:W},Ne,De()))},E9=l.forwardRef(Ipe);var kpe=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 Mpe=l.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:a=!1,children:o}=e,s=kpe(e,["style","height","hasControlInside","children"]),u=Object.assign(Object.assign({},n),{height:r});return l.createElement(E9,Object.assign({ref:t,hasControlInside:a},s,{style:u,type:"drag"}),o)}),gp=E9;gp.Dragger=Mpe;gp.LIST_IGNORE=Jm;var Tpe={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"},Ppe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Tpe}))},uf=l.forwardRef(Ppe),Dpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},zpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Dpe}))},Ape=l.forwardRef(zpe),Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},_pe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Lpe}))},Bpe=l.forwardRef(_pe),Hpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},Fpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Hpe}))},j9=l.forwardRef(Fpe),Vpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Upe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Vpe}))},N9=l.forwardRef(Upe),Wpe={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"},qpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Wpe}))},ec=l.forwardRef(qpe),Kpe={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"},Gpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kpe}))},Qc=l.forwardRef(Gpe),Ype={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},Xpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Ype}))},O9=l.forwardRef(Xpe),Jpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},Qpe=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Jpe}))},Kd=l.forwardRef(Qpe),Zpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"},ege=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zpe}))},ou=l.forwardRef(ege),tge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},nge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:tge}))},Ph=l.forwardRef(nge),rge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},age=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rge}))},TC=l.forwardRef(age),oge={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"},ige=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:oge}))},vi=l.forwardRef(ige),lge={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"},sge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:lge}))},mu=l.forwardRef(sge),cge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z"}}]},name:"chrome",theme:"outlined"},uge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:cge}))},dge=l.forwardRef(uge),fge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},mge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:fge}))},R9=l.forwardRef(mge),hge={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 64zm176.5 585.7l-28.6 39a7.99 7.99 0 01-11.2 1.7L483.3 569.8a7.92 7.92 0 01-3.3-6.5V288c0-4.4 3.6-8 8-8h48.1c4.4 0 8 3.6 8 8v247.5l142.6 103.1c3.6 2.5 4.4 7.5 1.8 11.1z"}}]},name:"clock-circle",theme:"filled"},pge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hge}))},gge=l.forwardRef(pge),vge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},yge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:vge}))},YR=l.forwardRef(yge),bge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},xge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:bge}))},Cge=l.forwardRef(xge),Sge={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"},wge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Sge}))},wa=l.forwardRef(wge),$ge={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"},Ege=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$ge}))},PC=l.forwardRef(Ege),jge={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 372zm198.4-588.1a32 32 0 00-24.5.5L414.9 415 296.4 686c-3.6 8.2-3.6 17.5 0 25.7 3.4 7.8 9.7 13.9 17.7 17 3.8 1.5 7.7 2.2 11.7 2.2 4.4 0 8.7-.9 12.8-2.7l271-118.6 118.5-271a32.06 32.06 0 00-17.7-42.7zM576.8 534.4l26.2 26.2-42.4 42.4-26.2-26.2L380 644.4 447.5 490 422 464.4l42.4-42.4 25.5 25.5L644.4 380l-67.6 154.4zM464.4 422L422 464.4l25.5 25.6 86.9 86.8 26.2 26.2 42.4-42.4-26.2-26.2-86.8-86.9z"}}]},name:"compass",theme:"outlined"},Nge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:jge}))},Oge=l.forwardRef(Nge),Rge={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"},Ige=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Rge}))},Yw=l.forwardRef(Ige),kge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"}}]},name:"customer-service",theme:"outlined"},Mge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:kge}))},Tge=l.forwardRef(Mge),Pge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},Dge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Pge}))},zge=l.forwardRef(Dge),Age={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}}]},name:"desktop",theme:"outlined"},Lge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Age}))},_ge=l.forwardRef(Lge),Bge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"},Hge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Bge}))},XR=l.forwardRef(Hge),Fge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 289.1a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 880.2c-65.9-41.9-300-207.8-300-449.1 0-77.9 31.1-151.1 87.6-206.3C356.3 169.5 431.7 139 512 139s155.7 30.5 212.4 85.9C780.9 280 812 353.2 812 431.1c0 241.3-234.1 407.2-300 449.1zm0-617.2c-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 551c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 439c0-29.9 11.7-58 32.8-79.2C454 338.6 482.1 327 512 327c29.9 0 58 11.6 79.2 32.8C612.4 381 624 409.1 624 439c0 29.9-11.6 58-32.8 79.2z"}}]},name:"environment",theme:"outlined"},Vge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Fge}))},Uge=l.forwardRef(Vge),Wge={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"},qge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Wge}))},Dh=l.forwardRef(qge),Kge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Gge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kge}))},Ay=l.forwardRef(Gge),Yge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},Xge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Yge}))},Qm=l.forwardRef(Xge),Jge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.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.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"},Qge=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Jge}))},qv=l.forwardRef(Qge),Zge={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"},eve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zge}))},Ly=l.forwardRef(eve),tve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 392h64v64h-64zm0 190v160h128V582h-64v-62h-64v62zm80 48v64h-32v-64h32zm-16-302h64v64h-64zm-64-64h64v64h-64zm64 192h64v64h-64zm0-256h64v64h-64zm494.6 88.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.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h64v64h64v-64h174v216a42 42 0 0042 42h216v494z"}}]},name:"file-zip",theme:"outlined"},nve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:tve}))},JR=l.forwardRef(nve),rve={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"},ave=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rve}))},ove=l.forwardRef(ave),ive={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"},lve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:ive}))},sve=l.forwardRef(lve),cve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"},uve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:cve}))},dve=l.forwardRef(uve),fve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},mve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:fve}))},I9=l.forwardRef(mve),hve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},pve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:hve}))},k9=l.forwardRef(pve),gve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M312.1 591.5c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.1-3.1 3.1-8.2 0-11.3l-36.8-36.8a8.03 8.03 0 00-11.3 0L517 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L275.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8z"}},{tag:"path",attrs:{d:"M904 160H548V96c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H120c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h356.4v32L311.6 884.1a7.92 7.92 0 00-2.3 11l30.3 47.2v.1c2.4 3.7 7.4 4.7 11.1 2.3L512 838.9l161.3 105.8c3.7 2.4 8.7 1.4 11.1-2.3v-.1l30.3-47.2a8 8 0 00-2.3-11L548 776.3V744h356c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 512H160V232h704v440z"}}]},name:"fund-projection-screen",theme:"outlined"},vve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:gve}))},yve=l.forwardRef(vve),bve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},xve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:bve}))},Cve=l.forwardRef(xve),Sve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M913.9 552.2L805 181.4v-.1c-7.6-22.9-25.7-36.5-48.3-36.5-23.4 0-42.5 13.5-49.7 35.2l-71.4 213H388.8l-71.4-213c-7.2-21.7-26.3-35.2-49.7-35.2-23.1 0-42.5 14.8-48.4 36.6L110.5 552.2c-4.4 14.7 1.2 31.4 13.5 40.7l368.5 276.4c2.6 3.6 6.2 6.3 10.4 7.8l8.6 6.4 8.5-6.4c4.9-1.7 9-4.7 11.9-8.9l368.4-275.4c12.4-9.2 18-25.9 13.6-40.6zM751.7 193.4c1-1.8 2.9-1.9 3.5-1.9 1.1 0 2.5.3 3.4 3L818 394.3H684.5l67.2-200.9zm-487.4 1c.9-2.6 2.3-2.9 3.4-2.9 2.7 0 2.9.1 3.4 1.7l67.3 201.2H206.5l57.8-200zM158.8 558.7l28.2-97.3 202.4 270.2-230.6-172.9zm73.9-116.4h122.1l90.8 284.3-212.9-284.3zM512.9 776L405.7 442.3H620L512.9 776zm157.9-333.7h119.5L580 723.1l90.8-280.8zm-40.7 293.9l207.3-276.7 29.5 99.2-236.8 177.5z"}}]},name:"gitlab",theme:"outlined"},wve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Sve}))},w0=l.forwardRef(wve),$ve={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"},Eve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$ve}))},Mf=l.forwardRef(Eve),jve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-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-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"},Nve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:jve}))},Ove=l.forwardRef(Nve),Rve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"},Ive=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Rve}))},M9=l.forwardRef(Ive),kve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"}}]},name:"home",theme:"outlined"},Mve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:kve}))},zh=l.forwardRef(Mve),Tve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Pve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Tve}))},X$=l.forwardRef(Pve),Dve={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"},zve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Dve}))},Ah=l.forwardRef(zve),Ave={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"},Lve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Ave}))},_y=l.forwardRef(Lve),_ve={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"},Bve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:_ve}))},Hve=l.forwardRef(Bve),Fve={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"},Vve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Fve}))},ul=l.forwardRef(Vve),Uve={icon:{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 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},Wve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Uve}))},qve=l.forwardRef(Wve),Kve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},Gve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Kve}))},Yve=l.forwardRef(Gve),Xve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},Jve=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Xve}))},Qve=l.forwardRef(Jve),Zve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"},e0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Zve}))},t0e=l.forwardRef(e0e),n0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},r0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:n0e}))},Kv=l.forwardRef(r0e),a0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7.2 3.5.3 5.2.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-.8-6.6-1.5-7.8-1.8l-3.1-.6c-2.2-.3-5.9-.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2a83.3 83.3 0 11.01-166.61 83.3 83.3 0 01-.01 166.61zM695.6 845a83.3 83.3 0 11.01-166.61A83.3 83.3 0 01695.6 845z"}}]},name:"node-index",theme:"outlined"},o0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:a0e}))},QR=l.forwardRef(o0e),i0e={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 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"},l0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:i0e}))},s0e=l.forwardRef(l0e),c0e={icon:{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.2zM304 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"}}]},name:"picture",theme:"outlined"},u0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:c0e}))},ZR=l.forwardRef(u0e),d0e={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"},f0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:d0e}))},m0e=l.forwardRef(f0e),h0e={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"},p0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:h0e}))},Kl=l.forwardRef(p0e),g0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M280 752h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8zm192-280h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8zm192 72h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v256c0 4.4 3.6 8 8 8zm216-432H144c-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:"project",theme:"outlined"},v0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:g0e}))},Lh=l.forwardRef(v0e),y0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 00324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"}}]},name:"read",theme:"outlined"},b0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:y0e}))},x0e=l.forwardRef(b0e),C0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.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-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},S0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:C0e}))},w0e=l.forwardRef(S0e),$0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},E0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:$0e}))},j0e=l.forwardRef(E0e),N0e={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"},O0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:N0e}))},qo=l.forwardRef(O0e),R0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"},I0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:R0e}))},J$=l.forwardRef(I0e),k0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},M0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:k0e}))},Q$=l.forwardRef(M0e),T0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M136 384h56c4.4 0 8-3.6 8-8V200h176c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H196c-37.6 0-68 30.4-68 68v180c0 4.4 3.6 8 8 8zm512-184h176v176c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V196c0-37.6-30.4-68-68-68H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM376 824H200V648c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v180c0 37.6 30.4 68 68 68h180c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm512-184h-56c-4.4 0-8 3.6-8 8v176H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h180c37.6 0 68-30.4 68-68V648c0-4.4-3.6-8-8-8zm16-164H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"scan",theme:"outlined"},P0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:T0e}))},eI=l.forwardRef(P0e),D0e={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"},z0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:D0e}))},hu=l.forwardRef(z0e),A0e={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"},L0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:A0e}))},Gl=l.forwardRef(L0e),_0e={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"},B0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:_0e}))},H0e=l.forwardRef(B0e),F0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"},V0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:F0e}))},tI=l.forwardRef(V0e),U0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},W0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:U0e}))},_h=l.forwardRef(W0e),q0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"},K0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:q0e}))},Z$=l.forwardRef(K0e),G0e={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"},Y0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:G0e}))},e4=l.forwardRef(Y0e),X0e={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"},J0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:X0e}))},T9=l.forwardRef(J0e),Q0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 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:"upload",theme:"outlined"},Z0e=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:Q0e}))},$0=l.forwardRef(Z0e),eye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"video-camera",theme:"outlined"},tye=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:eye}))},nye=l.forwardRef(tye),rye={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"},aye=function(t,n){return l.createElement(ht,Pe({},t,{ref:n,icon:rye}))},P9=l.forwardRef(aye);const oye="0.2.13",jd={version:oye};async function ot(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 Br={list:()=>ot("/api/launchers"),running:()=>ot("/api/launchers/running"),create:e=>ot("/api/launchers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/launchers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/launchers/${e}`,{method:"DELETE"}),start:e=>ot(`/api/launchers/${e}/start`,{method:"POST"}),openTerminal:e=>ot(`/api/launchers/${e}/open-terminal`,{method:"POST"}),run:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/run`,{method:"POST"}),runInstall:e=>ot(`/api/launchers/${e}/install/run`,{method:"POST"}),stop:async(e,t)=>{try{return await ot(`/api/launchers/${e}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scriptId:t})})}catch{return ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/stop`,{method:"POST"})}},logs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs`),errorLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs/error`),clearLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"}),packageScripts:e=>ot(`/api/launchers/${e}/package-scripts`),runPackageScript:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/run`,{method:"POST"}),packageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`),packageScriptErrorLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs/error`),clearPackageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"})},Xw={get:()=>ot("/api/overview"),version:()=>ot("/api/overview/version"),notifications:()=>ot("/api/overview/notifications")},iye={list:()=>ot("/api/plugins")},rl={list:e=>ot(`/api/clipboard${e?`?date=${encodeURIComponent(e)}`:""}`),search:e=>ot(`/api/clipboard/search?q=${encodeURIComponent(e)}`),tagged:()=>ot("/api/clipboard/tagged"),remove:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}),uploadImage:e=>ot("/api/clipboard/image",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),updateTags:(e,t,n)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/tags`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:n})}),copied:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copied`,{method:"POST"}),copyImage:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copy-image`,{method:"POST"})},ji={list:()=>ot("/api/group-tasks"),catalog:()=>ot("/api/group-tasks/catalog"),create:e=>ot("/api/group-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/group-tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),reorder:e=>ot("/api/group-tasks/reorder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),move:(e,t)=>ot(`/api/group-tasks/${e}/move`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:t})}),remove:e=>ot(`/api/group-tasks/${e}`,{method:"DELETE"}),start:e=>ot(`/api/group-tasks/${e}/start`,{method:"POST"}),stop:e=>ot(`/api/group-tasks/${e}/stop`,{method:"POST"})},DC={list:()=>ot("/api/port-diagnostics"),get:e=>ot(`/api/port-diagnostics/${encodeURIComponent(e)}`),kill:(e,t)=>ot("/api/port-diagnostics/kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e,pid:t})})},D9={open:e=>ot("/api/settings/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),openPath:(e,t="")=>ot("/api/settings/open-editor",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,location:t})}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Un={status:()=>ot("/api/settings"),devConfigurations:()=>ot("/api/settings/dev-configurations"),selectDirectory:()=>ot("/api/settings/select-directory",{method:"POST"}),selectFile:()=>ot("/api/settings/select-file",{method:"POST"}),openDataDir:()=>ot("/api/settings/open-data-dir",{method:"POST"}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),revealFolder:e=>ot("/api/settings/reveal-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),saveDomain:e=>ot("/api/settings/domain",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})}),saveAiApiHost:e=>ot("/api/settings/ai-api-host",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aiApiHost:e})}),saveJiraIssuePrefix:e=>ot("/api/settings/jira-issue-prefix",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraIssuePrefix:e})}),saveMindMapNodeMaxWidth:e=>ot("/api/settings/mind-map-node-max-width",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({width:e})}),saveDefaultEditor:e=>ot("/api/settings/default-editor",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultEditor:e})}),saveDefaultBrowser:e=>ot("/api/settings/default-browser",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultBrowser:e})}),saveTheme:e=>ot("/api/settings/theme",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:e})}),saveDevConfigurations:e=>ot("/api/settings/dev-configurations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),saveAccessToken:(e,t)=>ot(`/api/settings/${encodeURIComponent(e)}-access-token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),saveClipboardEnabled:e=>ot("/api/settings/clipboard-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardImageEnabled:e=>ot("/api/settings/clipboard-image-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardDeduplicateMinutes:e=>ot("/api/settings/clipboard-deduplicate-minutes",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({minutes:e})})},nI={status:(e=!1)=>ot(`/api/updates${e?"?refresh=1":""}`),selfUpdate:(e="latest")=>ot("/api/updates/self-update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},lye={install:e=>ot("/api/settings/dev-configurations/nvm/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},qc={manage:(e,t)=>ot(`/api/settings/dev-configurations/npm/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:t})}),versions:e=>ot("/api/settings/dev-configurations/npm/versions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:e})}),useSuggestedPrefix:()=>ot("/api/settings/dev-configurations/npm/use-prefix-suggestion",{method:"POST"})};qc.search=e=>ot("/api/settings/dev-configurations/npm/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e})});const zC={stats:()=>ot("/api/data-backup/stats"),export:async()=>{var r;const e=await fetch("/api/data-backup/export");if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error||"Unable to export data backup.");const n=((r=(e.headers.get("Content-Disposition")||"").match(/filename="([^"]+)"/))==null?void 0:r[1])||"devbuddy-data-backup.tar.gz";return{blob:await e.blob(),filename:n}},import:e=>ot("/api/data-backup/import",{method:"POST",headers:{"Content-Type":"application/gzip"},body:e})},ch={get:()=>ot("/api/presentations"),save:e=>ot("/api/presentations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plans:e})}),setActive:e=>ot("/api/presentations/active",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e})})},Tc={check:e=>ot("/api/pr-review/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prLink:e})}),aiReview:e=>ot(`/api/pr-review/ai-review/${encodeURIComponent(e)}`),rules:()=>ot("/api/pr-review/rules"),saveRules:(e,t,n)=>ot("/api/pr-review/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:e,customRules:t,fileFilters:n})}),myPrs:()=>ot("/api/pr-review/my-prs"),reviewPrs:()=>ot("/api/pr-review/review-prs"),comment:e=>ot("/api/pr-review/comment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},fv={load:e=>ot("/api/pr-conflicts/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prUrl:e})}),myConflicts:()=>ot("/api/pr-conflicts/my-conflicts"),resolve:e=>ot("/api/pr-conflicts/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),checkBranch:e=>ot("/api/pr-conflicts/check-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},Va={list:()=>ot("/api/jira-filters"),create:e=>ot("/api/jira-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/${e}`,{method:"DELETE"}),issues:e=>ot(`/api/jira-filters/${e}/issues`),cloneIssue:e=>ot("/api/jira-filters/issues/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),templates:{list:()=>ot("/api/jira-filters/templates"),create:e=>ot("/api/jira-filters/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/templates/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/templates/${e}`,{method:"DELETE"})},recentlyCreated:()=>ot("/api/jira-filters/recently-created"),recentlyCommented:()=>ot("/api/jira-filters/recently-commented"),recentlyMentioned:()=>ot("/api/jira-filters/recently-mentioned"),recentlyUpdated:()=>ot("/api/jira-filters/recently-updated")},Wa={list:()=>ot("/api/todos"),create:e=>ot("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/todos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/todos/${e}`,{method:"DELETE"}),archive:e=>ot(`/api/todos/${e}/archive`,{method:"POST"}),unarchive:e=>ot(`/api/todos/${e}/unarchive`,{method:"POST"}),batch:(e,t)=>ot("/api/todos/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,ids:t})})},Td={list:()=>ot("/api/reminders"),create:e=>ot("/api/reminders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/reminders/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/reminders/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),remove:e=>ot(`/api/reminders/${e}`,{method:"DELETE"}),claimDue:()=>ot("/api/reminders/claim-due",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({now:new Date().toISOString()})})},Pc={list:()=>ot("/api/cron-jobs"),catalog:()=>ot("/api/cron-jobs/catalog"),create:e=>ot("/api/cron-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/cron-jobs/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/cron-jobs/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),run:e=>ot(`/api/cron-jobs/${e}/run`,{method:"POST"}),remove:e=>ot(`/api/cron-jobs/${e}`,{method:"DELETE"})},Al={list:()=>ot("/api/memos"),listImages:()=>ot("/api/memos/images"),uploadImage:e=>ot("/api/memos/images",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),create:e=>ot("/api/memos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/memos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/memos/${e}`,{method:"DELETE"}),removeImage:e=>ot(`/api/memos/images/${encodeURIComponent(e)}`,{method:"DELETE"})},sl={list:()=>ot("/api/mind-maps"),get:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`),resolveJiraIssue:e=>ot("/api/mind-maps/jira-issues/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),create:e=>ot("/api/mind-maps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"DELETE"})},Kc={list:()=>ot("/api/static-pages"),create:e=>ot("/api/static-pages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/static-pages/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/static-pages/${e}`,{method:"DELETE"})},Zc={list:()=>ot("/api/errors"),log:e=>ot("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),clear:()=>ot("/api/errors",{method:"DELETE"}),remove:e=>ot(`/api/errors/${e}`,{method:"DELETE"})},Os={getData:()=>ot("/api/postman"),importCollection:e=>ot("/api/postman/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionJson:e})}),createCollection:e=>ot("/api/postman/collections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateCollection:(e,t)=>ot(`/api/postman/collections/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteCollection:e=>ot(`/api/postman/collections/${e}`,{method:"DELETE"}),saveEnvironments:e=>ot("/api/postman/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sendRequest:e=>ot("/api/postman/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},AC={status:()=>ot("/api/bookmark-sync/status"),preview:e=>ot(`/api/bookmark-sync/preview?mode=${encodeURIComponent(e)}`),sync:e=>ot("/api/bookmark-sync/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})})},Zm={scan:e=>ot("/api/file-organizer/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),execute:e=>ot("/api/file-organizer/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getHistory:()=>ot("/api/file-organizer/history"),undo:e=>ot("/api/file-organizer/undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})}),browse:e=>ot("/api/file-organizer/browse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Ml={listApps:()=>ot("/api/branch-sync/apps"),createApp:e=>ot("/api/branch-sync/apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateApp:(e,t)=>ot(`/api/branch-sync/apps/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteApp:e=>ot(`/api/branch-sync/apps/${e}`,{method:"DELETE"}),check:e=>ot("/api/branch-sync/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:e})}),createPr:e=>ot("/api/branch-sync/create-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),createBranch:e=>ot("/api/branch-sync/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getBranches:e=>ot(`/api/branch-sync/branches?repo=${encodeURIComponent(e)}`)},Tm={repositories:e=>ot(`/api/branch-health/repositories?workspaceDir=${encodeURIComponent(e)}`),history:()=>ot("/api/branch-health/history"),scan:e=>ot("/api/branch-health/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e})}),preflight:(e,t)=>ot("/api/branch-health/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t})}),remove:(e,t,n)=>ot("/api/branch-health/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t,...n})})},So={config:()=>ot("/api/package-upgrade/config"),dependencyScan:()=>ot("/api/package-upgrade/dependency-scan"),dependencyRepositories:()=>ot("/api/package-upgrade/dependency-repositories"),saveDependencyRepositories:e=>ot("/api/package-upgrade/dependency-repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({directories:e})}),saveConfig:e=>ot("/api/package-upgrade/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceDir:e})}),addRepo:e=>ot("/api/package-upgrade/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),packageNames:e=>ot("/api/package-upgrade/repos/packages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),branches:e=>ot("/api/package-upgrade/repos/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),cloneRepo:e=>ot(`/api/package-upgrade/repos/${e}/clone`,{method:"POST"}),removeRepo:e=>ot(`/api/package-upgrade/repos/${e}`,{method:"DELETE"}),createTask:e=>ot("/api/package-upgrade/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},sye="modulepreload",cye=function(e){return"/"+e},rI={},pu=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=s(n.map(m=>{if(m=cye(m),m in rI)return;rI[m]=!0;const h=m.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":sye,h||(v.as="script"),v.crossOrigin="",v.href=m,f&&v.setAttribute("nonce",f),document.head.appendChild(v),h)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(s){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=s,window.dispatchEvent(u),!u.defaultPrevented)throw s}return a.then(s=>{for(const u of s||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};async function z9(e,t,n){const r=URL.createObjectURL(e);try{const a=await new Promise((m,h)=>{const p=new Image;p.onload=()=>m(p),p.onerror=()=>h(new Error("Unable to read this image. Please choose a valid image file.")),p.src=r}),o=document.createElement("canvas"),s=Math.max(a.naturalWidth,a.naturalHeight);let u=1;t&&(u=t/s),n!=null&&n>0&&n<=100&&(u=u*(n/100)),o.width=Math.max(1,Math.round(a.naturalWidth*u)),o.height=Math.max(1,Math.round(a.naturalHeight*u));const f=o.getContext("2d",{willReadFrequently:!0});return f.drawImage(a,0,0,o.width,o.height),{imageData:f.getImageData(0,0,o.width,o.height),width:o.width,height:o.height}}finally{URL.revokeObjectURL(r)}}async function uye(e,t={}){const{quality:n=75,progressive:r=!0,optimizeCoding:a=!0,autoSubsample:o=!0}=t,[{encode:s},{imageData:u}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),z9(e)]),f=await s(u,{quality:n,progressive:r,optimize_coding:a,auto_subsample:o}),m=new Blob([f],{type:"image/jpeg"}),h=(e.name||"clipboard-image.png").replace(/\.[^.]+$/,"")+".jpg";return new File([m],h,{type:"image/jpeg"})}const{Paragraph:dye,Text:fye,Title:mye}=Cn;function Ur({actions:e,className:t="",copyClassName:n="",description:r,descriptionClassName:a="",eyebrow:o="WORKBENCH",title:s,titleClassName:u="",titlePrefix:f,titleSuffix:m,titleRowClassName:h=""}){const p=c.jsx(mye,{className:u||void 0,level:2,children:s});return c.jsxs("header",{className:["page-header","workspace-page-header",t].filter(Boolean).join(" "),children:[c.jsxs("div",{className:n||void 0,children:[c.jsx(fye,{className:"workspace-page-eyebrow",children:o}),f||m?c.jsxs("div",{className:h||void 0,children:[f,p,m]}):p,r?c.jsx(dye,{className:["workspace-page-description",a].filter(Boolean).join(" "),type:"secondary",children:r}):null]}),e||null]})}const aI=[{value:"chrome",label:"Google Chrome"},{value:"edge",label:"Microsoft Edge"},{value:"safari",label:"Safari"}];function hye(e=!0){return e?aI:aI.filter(t=>t.value!=="safari")}function hr(e){e&&D9.open(e).catch(()=>{window.open(e,"_blank")})}function By(e,t){if(!e||!t)return"";const n=e.replace(/^https?:\/\//,"").replace(/\/+$/,"");return`https://${n.startsWith("jira.")?n:`jira.${n}`}/browse/${t.toUpperCase()}`}function pye(e,t){if(!t)return"";if(!e)return`https://jira.example.com/issues/?filter=${encodeURIComponent(t)}`;const n=e.replace(/^https?:\/\//i,"").replace(/\/+$/,"");return`https://${n.includes("jira")||n.includes(".atlassian.net")?n:`jira.${n}`}/issues/?filter=${encodeURIComponent(t)}`}const{Text:al}=Cn,Rs=()=>new Intl.DateTimeFormat("en-CA").format(new Date),gye=e=>{if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},vye=[{value:0,label:"No deduplication (0 min)"},{value:5,label:"5 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour (Default)"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"24 hours"}];function yye({value:e,domain:t,jiraIssuePrefix:n}){const r=[],a=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let o=0;const s=(n||"").split(/[\s,]+/).filter(Boolean).map(m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=s.length>0&&t?new RegExp(`\\b(?:${s.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,f=(m,h)=>{if(!u||!t)return m;const p=[];let v=0;u.lastIndex=0;for(const y of m.matchAll(u)){y.index>v&&p.push(m.slice(v,y.index));const b=y[0],C=By(t,b);p.push(c.jsx("a",{href:C,target:"_blank",rel:"noreferrer",onClick:x=>{x.preventDefault(),hr(C)},children:b},`${h}-${y.index}`)),v=y.index+b.length}return v<m.length&&p.push(m.slice(v)),p};for(const m of e.matchAll(a)){m.index>o&&r.push(...f(e.slice(o,m.index),`txt-${m.index}`));const h=m[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(h)r.push(c.jsx("a",{href:h[2],target:"_blank",rel:"noreferrer",onClick:p=>{p.preventDefault(),hr(h[2])},children:h[1]},m.index));else{const p=m[0].replace(/[),.;:!?]+$/,"");r.push(c.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:v=>{v.preventDefault(),hr(p)},children:p},m.index)),m[0].length>p.length&&r.push(m[0].slice(p.length))}o=m.index+m[0].length}return o<e.length&&r.push(...f(e.slice(o),"txt-end")),r}const oI=e=>e.text||e.preview||"",LC=e=>`/api/clipboard/image/${encodeURIComponent(e)}`;async function bye(e){if(e.type==="image/png")return e;const t=URL.createObjectURL(e);try{const n=await new Promise((o,s)=>{const u=new window.Image;u.onload=()=>o(u),u.onerror=()=>s(new Error("Unable to decode clipboard image.")),u.src=t}),r=document.createElement("canvas");r.width=n.naturalWidth,r.height=n.naturalHeight;const a=r.getContext("2d");if(!a)throw new Error("Image canvas is unavailable.");return a.drawImage(n,0,0),await new Promise((o,s)=>{r.toBlob(u=>{u?o(u):s(new Error("Unable to encode clipboard image as PNG."))},"image/png")})}finally{URL.revokeObjectURL(t)}}function Nd(e,t,n){const r=e.trim();if(!r)return!1;if(t==="account")return r.length<=20&&(/^[AT]\d+/i.test(r)||/\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/^[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/i.test(r);if(t==="url")return/^https?:\/\/[^\s]+$/i.test(r);if(t==="json"){if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{return JSON.parse(r),!0}catch{return!1}return!1}if(t==="jira"){const a=(n||"").split(/[\s,]+/).filter(Boolean).map(o=>o.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!0}function xye({children:e}){const t=l.useRef(null),[n,r]=l.useState(!1);return l.useEffect(()=>{const a=t.current;if(!a)return;const o=()=>{r(a.scrollTop+a.clientHeight<a.scrollHeight-1)};o(),a.addEventListener("scroll",o,{passive:!0});const s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;return s==null||s.observe(a),()=>{a.removeEventListener("scroll",o),s==null||s.disconnect()}},[e]),c.jsxs("div",{className:`clipboard-preview-wrap${n?" has-more":""}`,children:[c.jsx("pre",{ref:t,className:"clipboard-preview",children:e}),c.jsx("span",{className:"clipboard-preview-fade","aria-hidden":"true"})]})}function Cye(){const{message:e}=Pr.useApp(),[t,n]=l.useState(()=>{const me=localStorage.getItem("buddy_clipboard_enabled");return me!==null?me==="true":!0}),[r,a]=l.useState(!0),[o,s]=l.useState([]),[u,f]=l.useState(Rs()),[m,h]=l.useState([]),[p,v]=l.useState([]),[y,b]=l.useState(null),[C,x]=l.useState(""),[w,$]=l.useState("all"),[E,R]=l.useState(null),[N,O]=l.useState(!1),[I,j]=l.useState(!1),k=l.useRef(null),[T,z]=l.useState(""),[P,B]=l.useState(""),[H,A]=l.useState([]),[_,F]=l.useState(!1),[U,q]=l.useState({}),L=l.useRef(new Set),[K,X]=l.useState(""),[V,W]=l.useState(""),[G,Y]=l.useState(60),[te,ne]=l.useState(!1),[ce,Z]=l.useState(!0);l.useEffect(()=>{const me=[...m,...p,...H];for(const be of me){if(!be.imageFile)continue;const Me=`${be.date||u}-${be.id}`;if(U[Me]||L.current.has(Me))continue;L.current.add(Me);const De=new window.Image;De.onload=()=>{q(Te=>({...Te,[Me]:{width:De.naturalWidth,height:De.naturalHeight}})),L.current.delete(Me)},De.onerror=()=>L.current.delete(Me),De.src=LC(be.imageFile)}},[m,p,H,u,U]),l.useEffect(()=>{Un.status().then(me=>{if(me){if(me.isMac!==void 0&&ne(me.isMac),me.clipboardEnabled!==void 0){const be=me.clipboardEnabled!==!1;n(be),localStorage.setItem("buddy_clipboard_enabled",String(be))}me.clipboardImageEnabled!==void 0&&Z(me.clipboardImageEnabled!==!1),me.clipboardDeduplicateMinutes!==void 0&&Y(me.clipboardDeduplicateMinutes),me.domain&&X(me.domain),me.jiraIssuePrefix&&W(me.jiraIssuePrefix)}}).catch(()=>{}).finally(()=>a(!1))},[]);const ee=async me=>{n(me),localStorage.setItem("buddy_clipboard_enabled",String(me));try{const Ee=(await Un.saveClipboardEnabled(me)).clipboardEnabled!==!1;n(Ee),localStorage.setItem("buddy_clipboard_enabled",String(Ee)),e.success(me?"Clipboard history enabled":"Clipboard history disabled")}catch(be){e.error(be.message)}},re=async me=>{Z(me);try{const be=await Un.saveClipboardImageEnabled(me);be&&be.clipboardImageEnabled!==void 0&&Z(be.clipboardImageEnabled!==!1),e.success(me?"Image clipboard monitoring enabled":"Image clipboard monitoring disabled")}catch(be){e.error(be.message)}},oe=async me=>{Y(me);try{await Un.saveClipboardDeduplicateMinutes(me),e.success("Duplicate filter window updated.")}catch(be){e.error(be.message)}};l.useEffect(()=>{const me=P.trim();if(!me){A([]),F(!1);return}let be=!1,Ee=null;const Me=Date.now();F(!0);const De=setTimeout(async()=>{try{const Te=await rl.search(me);be||A(Te.items||[])}catch(Te){be||e.error(Te.message)}finally{const Te=Math.max(0,500-(Date.now()-Me));Ee=setTimeout(()=>{be||F(!1)},Te)}},250);return()=>{be=!0,clearTimeout(De),Ee&&clearTimeout(Ee)}},[P]);const ue=async me=>{try{const[be,Ee]=await Promise.all([rl.list(me),rl.tagged().catch(()=>({items:[]}))]);s(be.dates),h(be.items),v(Ee.items||[])}catch(be){e.error(be.message)}},ye=async(me,be)=>{const Ee=(be||"").trim();if(!Ee)return;const Me=me.tags||[];if(Me.includes(Ee)){b(null);return}const De=[...Me,Ee],Te=me.date||u;try{await rl.updateTags(Te,me.id,De),h(Ve=>Ve.map(_e=>_e.id===me.id?{..._e,tags:De}:_e)),A(Ve=>Ve.map(_e=>_e.id===me.id?{..._e,tags:De}:_e)),v(Ve=>Ve.some(Ne=>Ne.id===me.id)?Ve.map(Ne=>Ne.id===me.id?{...Ne,tags:De}:Ne):[{...me,tags:De,date:Te},...Ve]),e.success("Tag added")}catch(Ve){e.error(Ve.message)}finally{b(null),x("")}},J=async(me,be)=>{const Me=(me.tags||[]).filter(Te=>Te!==be),De=me.date||u;try{await rl.updateTags(De,me.id,Me),h(Te=>Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),A(Te=>Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),v(Te=>Me.length===0?Te.filter(Ve=>Ve.id!==me.id):Te.map(Ve=>Ve.id===me.id?{...Ve,tags:Me}:Ve)),e.success("Tag removed")}catch(Te){e.error(Te.message)}},ve=l.useRef(Rs());l.useEffect(()=>{if(!t)return;const me=()=>{const De=Rs();if(De!==ve.current){const Te=ve.current;if(ve.current=De,u===Te)return f(De),!0}return!1};me()||ue(u);const Ee=()=>{me()||ue(u)};window.addEventListener("visibilitychange",Ee),window.addEventListener("focus",Ee);let Me=null;return u===Rs()&&(Me=setInterval(()=>{document.visibilityState==="visible"&&ue(u)},3e3)),()=>{window.removeEventListener("visibilitychange",Ee),window.removeEventListener("focus",Ee),Me&&clearInterval(Me)}},[u,t]);const xe=async me=>{const be=typeof me=="object"?me:{id:me},Ee=be.date||u;try{await rl.remove(Ee,be.id),A(Me=>Me.filter(De=>De.id!==be.id)),await ue(u),e.success("Clipboard entry deleted.")}catch(Me){e.error(Me.message)}},ze=async me=>{var Ee;const be=me.date||u;if(me.imageFile)try{if(!((Ee=navigator.clipboard)!=null&&Ee.write)||typeof window.ClipboardItem>"u")throw new Error("Image clipboard is not supported by this browser.");await rl.copied(be,me.id);const Me=await fetch(LC(me.imageFile));if(!Me.ok)throw new Error("Unable to load image.");const De=await bye(await Me.blob());try{await navigator.clipboard.write([new ClipboardItem({"image/png":De})])}catch(Te){await rl.copyImage(be,me.id).catch(()=>{throw Te})}R(me.id),setTimeout(()=>{R(Te=>Te===me.id?null:Te)},1e3)}catch(Me){e.error("Failed to copy image: "+Me.message)}else try{const Me=await rl.copied(be,me.id);await navigator.clipboard.writeText(Me.copyText??me.text??me.preview??""),R(me.id),setTimeout(()=>{R(De=>De===me.id?null:De)},1e3),u===Rs()&&be!==Rs()&&await ue(u)}catch(Me){e.error("Failed to copy text: "+Me.message)}},fe=l.useMemo(()=>[...new Set([Rs(),...o,u])],[o,u]);l.useEffect(()=>{if(!t)return;const me=be=>{const Ee=document.activeElement;if(Ee&&(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA"||Ee.isContentEditable||Ee.closest(".clipboard-tabs")))return;const Me=[...fe].sort(),De=Me.indexOf(u);be.key==="ArrowLeft"?De>0&&f(Me[De-1]):be.key==="ArrowRight"&&De<Me.length-1&&De!==-1&&f(Me[De+1])};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[fe,u,t]),l.useEffect(()=>{if(!t)return;const me=async be=>{var De;const Ee=document.activeElement;if(Ee&&(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA"||Ee.isContentEditable))return;const Me=(De=be.clipboardData)==null?void 0:De.items;if(Me){for(const Te of Me)if(Te.type.startsWith("image/")){const Ve=Te.getAsFile();if(Ve){try{e.loading({content:"Compressing and saving image from paste…",key:"paste-upload",duration:0});const _e=await uye(Ve);await rl.uploadImage(_e);const Ne=Rs();f(Ne),await ue(Ne),e.success({content:"Image pasted and saved to history!",key:"paste-upload"})}catch(_e){e.error({content:"Failed to save pasted image: "+_e.message,key:"paste-upload"})}break}}}};return window.addEventListener("paste",me),()=>window.removeEventListener("paste",me)},[u,t]);const se=fe.reduce((me,be)=>{var Te;const[Ee,Me,De]=be.split("-");return me[Ee]||(me[Ee]={}),(Te=me[Ee])[Me]||(Te[Me]=[]),me[Ee][Me].includes(De)||me[Ee][Me].push(De),me},{}),le=Object.entries(se).sort(([me],[be])=>be.localeCompare(me)).map(([me,be])=>({value:me,label:me,children:Object.entries(be).sort(([Ee],[Me])=>Me.localeCompare(Ee)).map(([Ee,Me])=>({value:Ee,label:Ee,children:Me.sort().reverse().map(De=>({value:De,label:De}))}))})),ae=P.trim(),pe=l.useMemo(()=>w==="tagged"?p:w==="all"?m:w==="image"?m.filter(me=>!!me.imageFile):m.filter(me=>!me.imageFile&&Nd(oI(me),w,V)),[w,m,p,V]),Ie=l.useMemo(()=>{const me={all:m.length,tagged:p.length,jira:0,account:0,id:0,url:0,json:0,image:0};for(const Me of m)if(Me.imageFile)me.image++;else{const De=oI(Me);Nd(De,"jira",V)&&me.jira++,Nd(De,"account")&&me.account++,Nd(De,"id")&&me.id++,Nd(De,"url")&&me.url++,Nd(De,"json")&&me.json++}const be=(Me,De)=>({key:Me,label:c.jsxs("span",{className:"clipboard-tab-label",children:[c.jsx("span",{children:De}),c.jsxs("span",{className:"clipboard-tab-count",children:["(",me[Me],")"]})]})}),Ee=[be("all","All"),be("tagged","Tagged"),be("jira","Jira"),be("account","Account"),be("id","ID"),be("url","Url"),be("json","JSON")];return te&&Ee.push(be("image","Img")),Ee},[m,p,V,te]);l.useEffect(()=>{!te&&w==="image"&&$("all")},[te,w]);const Ce=(me,be=!1)=>{const Ee=me.date||u,Me=U[`${Ee}-${me.id}`],De=(Me==null?void 0:Me.width)>0&&(Me==null?void 0:Me.height)>0?Me.width/Me.height:null,Te=De?Math.min(Me.width,300*De):null,Ve=`/api/clipboard/${encodeURIComponent(Ee)}/${encodeURIComponent(me.id)}`,_e=new Date(me.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return c.jsxs(It,{size:"small",className:`clipboard-item${me.imageFile?" clipboard-image-item":""}`,children:[c.jsxs("div",{children:[c.jsxs("div",{className:"clipboard-item-meta",children:[c.jsx(al,{type:"secondary",children:_e}),(be||me.date&&me.date!==u)&&c.jsx($t,{style:{margin:0},children:Ee}),(me.tags||[]).map(Ne=>c.jsx($t,{color:"purple",closable:!0,onClose:$e=>{$e.preventDefault(),J(me,Ne)},style:{margin:0},children:Ne},Ne)),c.jsx(Z2,{content:c.jsxs(ct.Compact,{style:{width:200},children:[c.jsx(Ct,{size:"small",placeholder:"Tag name",value:C,onChange:Ne=>x(Ne.target.value),onPressEnter:()=>ye(me,C)}),c.jsx(Re,{size:"small",type:"primary",onClick:()=>ye(me,C),children:"Add"})]}),title:"Add Tag",trigger:"click",open:y===me.id,onOpenChange:Ne=>{b(Ne?me.id:null),x("")},children:c.jsxs($t,{className:"clipboard-add-tag",children:[c.jsx(Xn,{})," Tag"]})})]}),me.imageFile?c.jsx("div",{className:`clipboard-image-wrap${De?" has-dimensions":""}`,style:Te?{width:`${Te}px`,maxWidth:"100%",aspectRatio:`${Me.width} / ${Me.height}`}:void 0,children:c.jsx(P$,{src:LC(me.imageFile),alt:"Clipboard entry",className:"clipboard-image",preview:!0,onError:()=>e.error("Unable to load clipboard image.")})}):c.jsxs(c.Fragment,{children:[c.jsx(xye,{children:c.jsx(yye,{value:me.preview||me.text,domain:K,jiraIssuePrefix:V})}),me.contentFile&&c.jsxs("span",{className:"clipboard-original",children:[c.jsx("a",{href:Ve,target:"_blank",rel:"noreferrer",children:"View original content"}),c.jsxs("a",{href:me.editorUrl,children:["Open in ",me.editorName||"editor"]})]})]})]}),c.jsxs("span",{className:"clipboard-actions",children:[U[`${Ee}-${me.id}`]&&c.jsxs(al,{type:"secondary",className:"clipboard-image-dimensions",children:[U[`${Ee}-${me.id}`].width," × ",U[`${Ee}-${me.id}`].height," px"]}),U[`${Ee}-${me.id}`]&&me.imageFile&&Number.isFinite(me.imageSize)&&c.jsx("span",{className:"clipboard-image-meta-separator","aria-hidden":"true",children:"·"}),me.imageFile&&Number.isFinite(me.imageSize)&&c.jsx(al,{type:"secondary",className:"clipboard-image-size",children:gye(me.imageSize)}),c.jsx(Re,{type:"text",icon:E===me.id?c.jsx(Vl,{style:{color:"#52c41a"}}):c.jsx(fo,{}),onClick:()=>ze(me)}),me.imageFile?c.jsx(Gr,{title:"Delete this clipboard image?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>xe(me),children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{})})}):c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>xe(me)})]})]},`${Ee}-${me.id}`)};return c.jsxs("div",{className:"clipboard-page",children:[c.jsx(Ur,{titleSuffix:c.jsx(Re,{"aria-label":"Search clipboard history",disabled:!t||r,icon:c.jsx(jo,{}),onClick:()=>O(!0),type:"text"}),titleRowClassName:"clipboard-title-row",actions:c.jsx("div",{className:"clipboard-controls",children:c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Jl,{allowClear:!1,className:"clipboard-picker",disabled:!t||r,options:le,value:u.split("-"),onChange:me=>(me==null?void 0:me.length)===3&&f(me.join("-")),placeholder:"Select date"}),c.jsx(Re,{"aria-label":"Clipboard history settings",icon:c.jsx(Gl,{}),onClick:()=>j(!0),type:"text"})]})}),description:"Saved locally and archived by date.",title:"Clipboard History"}),t?c.jsxs(c.Fragment,{children:[c.jsx(Qa,{className:"clipboard-tabs",activeKey:w,onChange:me=>{$(me),requestAnimationFrame(()=>{var be;return(be=document.activeElement)==null?void 0:be.blur()})},onKeyDown:me=>{var be;["ArrowLeft","ArrowRight"].includes(me.key)&&(me.preventDefault(),(be=document.activeElement)==null||be.blur())},items:Ie}),pe.length?c.jsx("div",{className:"clipboard-list",children:pe.map(me=>Ce(me))}):c.jsx(Xt,{description:`No ${w==="all"?"clipboard entries":`${w==="id"?"ID":w} entries`}${w==="tagged"?".":` for ${u}.`}`})]}):c.jsx(It,{className:"clipboard-disabled-card",children:c.jsx(Xt,{image:c.jsx(H0e,{style:{fontSize:48,color:"#9ca3af"}}),description:c.jsxs("div",{className:"clipboard-disabled-copy",children:[c.jsx(al,{strong:!0,className:"clipboard-disabled-title",children:"Clipboard history is disabled"}),c.jsx(al,{type:"secondary",children:"Open settings to turn on clipboard history and start capturing."})]})})}),c.jsx(xn,{className:"clipboard-settings-modal",open:I,title:"Clipboard History Settings",footer:null,width:480,onCancel:()=>j(!1),children:c.jsxs("div",{className:"clipboard-settings",children:[c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Clipboard history:"}),c.jsx(Ja,{loading:r,checked:t,onChange:ee,checkedChildren:"On",unCheckedChildren:"Off"})]}),c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Deduplicate filter:"}),c.jsx($n,{size:"small",disabled:!t||r,value:G,onChange:oe,className:"clipboard-deduplicate-select",options:vye})]}),te&&c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Monitor image clipboard:"}),c.jsx(Ja,{size:"small",disabled:!t||r,checked:ce,onChange:re,checkedChildren:"On",unCheckedChildren:"Off"})]})]})}),c.jsxs(xn,{open:N,afterOpenChange:me=>{var be;me&&((be=k.current)==null||be.focus())},title:"Search Clipboard History",footer:null,width:760,onCancel:()=>O(!1),children:[c.jsxs("div",{className:"clipboard-search-control",children:[c.jsx(Ct,{ref:k,allowClear:!0,className:"clipboard-search-field",placeholder:"Search all clipboard history",value:T,onChange:me=>{const be=me.target.value;z(be),be||(B(""),A([]))},onPressEnter:()=>{const me=T.trim();me!==ae&&A([]),B(me)}}),c.jsx(Re,{className:"clipboard-search-button",loading:_,onClick:()=>{const me=T.trim();me!==ae&&A([]),B(me)},type:"primary",children:"Search"})]}),ae&&!_&&c.jsxs(al,{type:"secondary",className:"clipboard-search-summary",children:[H.length," result",H.length===1?"":"s"," for “",ae,"”"]}),ae?_?c.jsx(_a,{active:!0,className:"clipboard-search-loading",paragraph:{rows:4}}):H.length?c.jsx("div",{className:"clipboard-search-results clipboard-list",children:H.map(me=>Ce(me,!0))}):c.jsx(Xt,{className:"clipboard-search-empty",description:`No results for “${ae}”.`}):c.jsx(al,{type:"secondary",className:"clipboard-search-hint",children:"Search across all clipboard history."})]}),c.jsx(oc.BackTop,{visibilityHeight:240})]})}const{Text:Tl,Title:Sye}=Cn,A9=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],L9=[1,2,3,4,5,6,0],iI=[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"},{value:"once",label:"One time"},{value:"cron",label:"Custom cron expression"}],lI=[{value:"custom",label:"Custom script",icon:c.jsx(wa,{})},{value:"quick-launch",label:"Quick Launch",icon:c.jsx(Z$,{})},{value:"launcher-script",label:"Launcher script",icon:c.jsx(Kl,{})}],sI=()=>({name:"",scheduleType:"daily",time:dr().hour(9).minute(0).second(0),weekday:1,scheduledAt:dr().add(1,"day").startOf("day").hour(9),cronExpression:"0 9 * * *",targetType:"custom",command:"",args:"",workingDirectory:"",launcherId:null,scriptId:null,quickLaunchId:null,enabled:!0});function Gv(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function wye(e){return e.scheduleType==="once"?`One time · ${Gv(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:e.scheduleType==="weekly"?`Every ${A9[L9.indexOf(e.weekday)]||"week"} · ${e.time}`:`Cron · ${e.cronExpression}`}function $ye(e){return{name:e.name,scheduleType:e.scheduleType,time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"day").startOf("day").hour(9),cronExpression:e.cronExpression||"0 9 * * *",targetType:e.targetType,command:e.command||"",args:e.args||"",workingDirectory:e.workingDirectory||"",launcherId:e.launcherId||null,scriptId:e.scriptId||null,quickLaunchId:e.quickLaunchId||null,enabled:e.enabled}}function Eye(e,t){var a;if(e.targetType==="custom")return`${e.command} · ${e.workingDirectory}`;if(e.targetType==="quick-launch")return((a=t.quickLaunches.find(o=>o.id===e.quickLaunchId))==null?void 0:a.name)||"Quick Launch";const n=t.launchers.find(o=>o.id===e.launcherId),r=n==null?void 0:n.scripts.find(o=>o.id===e.scriptId);return n&&r?`${n.alias} · ${r.name}`:"Launcher script"}function jye(){var k,T,z;const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState({launchers:[],quickLaunches:[]}),[o,s]=l.useState(sI),[u,f]=l.useState(null),[m,h]=l.useState(!0),[p,v]=l.useState(!1),[y,b]=l.useState(null),C=l.useCallback(async(P=!0)=>{P&&h(!0);try{const[B,H]=await Promise.all([Pc.list(),Pc.catalog()]);n(B),a(H)}catch(B){e.error(B.message)}finally{P&&h(!1)}},[e]);l.useEffect(()=>{C()},[C]);const x=l.useMemo(()=>r.launchers.find(P=>P.id===o.launcherId),[r.launchers,o.launcherId]),w=lI.find(P=>P.value===o.targetType),$=l.useMemo(()=>({total:t.length,active:t.filter(P=>P.enabled).length,failed:t.filter(P=>P.lastStatus==="failed").length}),[t]),E=()=>{f(null),s(sI())},R=(P,B)=>s(H=>({...H,[P]:B})),N=async()=>{var P,B;if(!o.name.trim()){e.warning("Enter a Cron Job name");return}if(o.scheduleType==="once"&&!((P=o.scheduledAt)!=null&&P.isValid())){e.warning("Choose a future date and time");return}if(!["once","cron"].includes(o.scheduleType)&&!((B=o.time)!=null&&B.isValid())){e.warning("Choose a run time");return}if(o.scheduleType==="cron"&&!o.cronExpression.trim()){e.warning("Enter a cron expression");return}if(o.targetType==="custom"&&(!o.command.trim()||!o.workingDirectory.trim())){e.warning("Enter a command and working directory");return}if(o.targetType==="quick-launch"&&!o.quickLaunchId){e.warning("Choose a Quick Launch");return}if(o.targetType==="launcher-script"&&(!o.launcherId||!o.scriptId)){e.warning("Choose a Launcher script");return}v(!0);try{const H={name:o.name,scheduleType:o.scheduleType,time:["once","cron"].includes(o.scheduleType)?void 0:o.time.format("HH:mm"),weekday:o.scheduleType==="weekly"?o.weekday:void 0,scheduledAt:o.scheduleType==="once"?o.scheduledAt.second(0).millisecond(0).toISOString():void 0,cronExpression:o.scheduleType==="cron"?o.cronExpression:void 0,targetType:o.targetType,args:o.args,command:o.targetType==="custom"?o.command:void 0,workingDirectory:o.targetType==="custom"?o.workingDirectory:void 0,launcherId:o.targetType==="launcher-script"?o.launcherId:void 0,scriptId:o.targetType==="launcher-script"?o.scriptId:void 0,quickLaunchId:o.targetType==="quick-launch"?o.quickLaunchId:void 0,enabled:o.enabled},A=u?await Pc.update(u,H):await Pc.create(H);n(_=>u?_.map(F=>F.id===A.id?A:F):[A,..._]),E(),e.success(u?"Cron Job updated":"Cron Job created")}catch(H){e.error(H.message)}finally{v(!1)}},O=async(P,B)=>{try{const H=await Pc.toggle(P.id,B);n(A=>A.map(_=>_.id===H.id?H:_))}catch(H){e.error(H.message)}},I=async P=>{b(P.id);try{await Pc.run(P.id),e.success(`Started ${P.name}`),await C(!1)}catch(B){e.error(B.message)}finally{b(null)}},j=async P=>{try{await Pc.remove(P),n(B=>B.filter(H=>H.id!==P)),u===P&&E(),e.success("Cron Job deleted")}catch(B){e.error(B.message)}};return c.jsxs("div",{className:"cron-jobs-page",children:[c.jsx(Ur,{eyebrow:"AUTOMATION",title:"Cron Jobs",description:"Run custom commands, Quick Launch groups, or Launcher scripts on a schedule.",actions:c.jsx(ct,{wrap:!0,children:c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:()=>C(!1),children:"Refresh"})})}),c.jsxs("div",{className:"cron-job-stats",children:[c.jsxs(It,{children:[c.jsx(Tl,{type:"secondary",children:"All jobs"}),c.jsx("strong",{children:$.total}),c.jsx("span",{children:"Saved schedules"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Tl,{type:"secondary",children:"Active"}),c.jsx("strong",{children:$.active}),c.jsx("span",{children:"Waiting for the next run"})]}),c.jsxs(It,{className:$.failed?"is-failed":"",children:[c.jsx(Tl,{type:"secondary",children:"Recent failures"}),c.jsx("strong",{children:$.failed}),c.jsx("span",{children:"Jobs that failed to start"})]})]}),c.jsxs("div",{className:"cron-jobs-layout",children:[c.jsx(It,{className:"cron-job-editor",title:c.jsxs("span",{children:[c.jsx(Qm,{})," ",u?"Edit Cron Job":"New Cron Job"]}),extra:u&&c.jsx(Re,{type:"link",onClick:E,children:"New"}),children:c.jsxs("div",{className:"cron-job-form",children:[c.jsxs("label",{children:["Job name",c.jsx(Ct,{value:o.name,maxLength:50,showCount:!0,placeholder:"For example: Start the local API",onChange:P=>R("name",P.target.value)})]}),c.jsxs("label",{children:["Schedule",c.jsx($n,{value:o.scheduleType,options:iI,onChange:P=>R("scheduleType",P)})]}),o.scheduleType==="once"&&c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"cron-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:o.scheduledAt,onChange:P=>R("scheduledAt",P&&P.second(0).millisecond(0))})]}),!["once","cron"].includes(o.scheduleType)&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(kf,{className:"cron-wide-control",format:"HH:mm",minuteStep:1,value:o.time,onChange:P=>R("time",P&&P.second(0).millisecond(0))})]}),o.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:o.weekday,options:A9.map((P,B)=>({label:P,value:L9[B]})),onChange:P=>R("weekday",P)})]})]}),o.scheduleType==="cron"&&c.jsxs("label",{children:["Cron expression",c.jsx(Ct,{value:o.cronExpression,placeholder:"0 9 * * 1-5",onChange:P=>R("cronExpression",P.target.value)}),c.jsxs(Tl,{type:"secondary",className:"cron-help",children:["Five fields: minute hour day-of-month month day-of-week. Example: ",c.jsx("code",{children:"*/15 * * * *"})]})]}),c.jsx("div",{className:"cron-section-label",children:"Execution target"}),c.jsx("div",{className:"cron-target-options",children:lI.map(P=>c.jsx(Re,{type:o.targetType===P.value?"primary":"default",icon:P.icon,onClick:()=>R("targetType",P.value),children:P.label},P.value))}),o.targetType==="custom"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Command",c.jsx(Ct.TextArea,{value:o.command,maxLength:2e3,showCount:!0,autoSize:{minRows:3,maxRows:6},placeholder:"npm run build",onChange:P=>R("command",P.target.value)})]}),c.jsxs("label",{children:["Working directory",c.jsx(Ct,{value:o.workingDirectory,placeholder:"/path/to/project",onChange:P=>R("workingDirectory",P.target.value)})]})]}),o.targetType==="quick-launch"&&c.jsxs("label",{children:["Quick Launch",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Quick Launch",value:o.quickLaunchId,options:r.quickLaunches.map(P=>({value:P.id,label:`${P.name} · ${P.scriptCount} scripts`})),onChange:P=>R("quickLaunchId",P)})]}),o.targetType==="launcher-script"&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Launcher",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Launcher",value:o.launcherId,options:r.launchers.map(P=>({value:P.id,label:P.alias})),onChange:P=>s(B=>({...B,launcherId:P,scriptId:null}))})]}),c.jsxs("label",{children:["Script",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a script",value:o.scriptId,options:((x==null?void 0:x.scripts)||[]).map(P=>({value:P.id,label:c.jsxs("span",{className:"cron-script-option",children:[c.jsx("span",{children:P.name}),c.jsxs("span",{className:"cron-script-source",children:["· ",P.source]})]})})),onChange:P=>R("scriptId",P)})]})]}),c.jsxs("label",{children:["Arguments",c.jsx(Ct,{value:o.args,maxLength:1e3,showCount:!0,placeholder:"--port 3000 --mode production",onChange:P=>R("args",P.target.value)}),c.jsx(Tl,{type:"secondary",className:"cron-help",children:"These arguments are appended to the selected command when it runs."})]}),c.jsxs("div",{className:"cron-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Tl,{strong:!0,children:"Enable job"}),c.jsx(Tl,{type:"secondary",children:"Run automatically after saving"})]}),c.jsx(Ja,{checked:o.enabled,onChange:P=>R("enabled",P)})]}),c.jsxs("div",{className:"cron-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Schedule preview"}),c.jsx(Ny,{})]}),c.jsx("strong",{children:o.scheduleType==="cron"?`Cron · ${o.cronExpression||"—"}`:o.scheduleType==="once"?`One time · ${o.scheduledAt?Gv(o.scheduledAt.toISOString()):"—"}`:`${(k=iI.find(P=>P.value===o.scheduleType))==null?void 0:k.label} · ${((T=o.time)==null?void 0:T.format("HH:mm"))||"—"}`}),c.jsxs("p",{children:[w==null?void 0:w.label," · ",o.targetType==="custom"?o.command||"No command yet":o.targetType==="quick-launch"?((z=r.quickLaunches.find(P=>P.id===o.quickLaunchId))==null?void 0:z.name)||"No Quick Launch selected":(x==null?void 0:x.alias)||"No Launcher selected"]})]}),c.jsxs(ct,{className:"cron-form-actions",children:[c.jsx(Re,{onClick:E,children:u?"Cancel":"Clear"}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),loading:p,onClick:N,children:u?"Save changes":"Create Cron Job"})]})]})}),c.jsx(It,{className:"cron-job-list-card",title:c.jsxs("span",{children:[c.jsx(Qm,{})," Scheduled jobs"]}),children:m?c.jsx("div",{className:"cron-list-state",children:"Loading Cron Jobs…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No Cron Jobs yet. Create your first schedule."}):c.jsx("div",{className:"cron-job-list",children:t.map(P=>c.jsxs("article",{className:`cron-job-item ${P.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"cron-job-icon",children:c.jsx(Qm,{})}),c.jsxs("div",{className:"cron-job-main",children:[c.jsxs("div",{className:"cron-job-heading",children:[c.jsx(Sye,{level:4,children:P.name}),c.jsx($t,{color:P.enabled?"green":"default",children:P.enabled?"Active":"Paused"}),P.lastStatus==="failed"&&c.jsx($t,{color:"error",children:"Failed"})]}),c.jsx(Tl,{className:"cron-job-target",children:Eye(P,r)}),c.jsxs("div",{className:"cron-job-meta",children:[c.jsx("span",{children:wye(P)}),P.enabled&&P.nextRunAt&&c.jsxs("span",{children:["Next: ",Gv(P.nextRunAt)]}),P.lastRunAt&&c.jsxs("span",{children:["Last: ",Gv(P.lastRunAt)]})]}),P.lastError&&c.jsx(Tl,{type:"danger",className:"cron-job-error",children:P.lastError})]}),c.jsxs("div",{className:"cron-job-actions",children:[c.jsx(Ja,{size:"small",checked:P.enabled,onChange:B=>O(P,B)}),c.jsx(Re,{type:"text",icon:c.jsx(Kl,{}),"aria-label":"Run Cron Job now",title:"Run now",loading:y===P.id,onClick:()=>I(P)}),c.jsx(Re,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit Cron Job",onClick:()=>{f(P.id),s($ye(P))}}),c.jsx(Gr,{title:"Delete this Cron Job?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>j(P.id),children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),"aria-label":"Delete Cron Job"})})]})]},P.id))})})]}),c.jsxs("div",{className:"cron-job-footnote",children:[c.jsx(Qm,{})," Cron Jobs run from the DevBuddy server, so the browser page does not need to stay on this screen. The DevBuddy server itself must remain running."]})]})}const _9=[{value:"vscode",label:"VS Code"},{value:"devin",label:"Devin"},{value:"idea",label:"IntelliJ IDEA"}];function B9(e="vscode"){const t=_9.find(n=>n.value===e);return t?t.label:"VS Code"}function H9(e="vscode",t="",n="",r={}){if(!t)return"";const a=typeof r=="boolean"?r:!!(r!=null&&r.newWindow);let o="",s="";if(n){const u=n.split(":").filter(Boolean);u[0]&&(o=u[0]),u[1]&&(s=u[1])}if(e==="idea"){let u=`idea://open?file=${encodeURIComponent(t)}`;return o&&(u+=`&line=${o}`),s&&(u+=`&column=${s}`),u}return e==="devin"?`devin://file${encodeURI(t)}${n}`:a?`vscode://vscode.open-folder${encodeURI(t)}?forceNewWindow=true`:`vscode://file${encodeURI(t)}${n}`}const{Text:mv}=Cn;function Nye({tasks:e,running:t,onCreate:n,onEdit:r,onStart:a,onStop:o,onRemove:s,onReorder:u}){const[f,m]=l.useState(null),[h,p]=l.useState(null),v=()=>{m(null),p(null)},y=async(C,x)=>{x.preventDefault();const w=x.dataTransfer.getData("text/plain")||f;if(!w||w===C){v();return}const $=[...e],E=$.findIndex(O=>O.id===w),R=$.findIndex(O=>O.id===C);if(E<0||R<0){v();return}const[N]=$.splice(E,1);$.splice(R,0,N),v(),await u($.map(O=>O.id))},b=[{title:"",width:44,render:(C,x)=>c.jsx("span",{className:"group-task-drag-handle",draggable:!0,"aria-label":`Drag ${x.name} to reorder`,title:"Drag to reorder",onDragStart:w=>{w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",x.id),m(x.id)},onDragEnd:v,children:c.jsx(XR,{})})},{title:"Name",dataIndex:"name",render:C=>c.jsx(mv,{strong:!0,children:C})},{title:"Scripts",dataIndex:"items",width:110,render:C=>c.jsxs(mv,{type:"secondary",children:[C.length," scripts"]})},{title:"Actions",width:230,render:(C,x)=>{const w=x.items.every($=>t.has(`${$.launcherId}:${$.scriptId}`));return c.jsxs(ct,{children:[c.jsx(Re,{size:"small",className:w?"launcher-running-button":void 0,icon:w?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:()=>w?o(x):a(x),children:w?"Stop":"Start"}),c.jsx(Re,{size:"small",onClick:()=>r(x),children:"Edit"}),c.jsx(Re,{size:"small",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>s(x),children:"Delete"})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group-task-header",children:[c.jsxs("div",{className:"group-task-header-copy",children:[c.jsx(mv,{type:"secondary",children:"Start selected scripts across multiple services."}),c.jsxs(mv,{type:"secondary",className:"group-task-drag-hint",children:[c.jsx(XR,{})," Drag the handle to reorder."]})]}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:n,children:"Add quick launch"})]}),e.length?c.jsx(or,{className:"group-task-table",rowKey:"id",dataSource:e,columns:b,pagination:!1,size:"small",onRow:C=>({className:`${f===C.id?"is-dragging":""} ${h===C.id?"is-drag-over":""}`.trim(),onDragOver:x=>{x.preventDefault(),x.dataTransfer.dropEffect="move",f!==C.id&&p(C.id)},onDragLeave:()=>p(x=>x===C.id?null:x),onDrop:x=>{y(C.id,x)}})}):c.jsx(Xt,{description:"No quick launches yet.",className:"group-task-empty"})]})}function df({open:e,initialPath:t="~",onCancel:n,onSelect:r,title:a="Browse Directory",selectionType:o="directory"}){const{message:s}=Pr.useApp(),[u,f]=l.useState(t),[m,h]=l.useState(null),[p,v]=l.useState(!1),y=async b=>{v(!0);try{const C=await Zm.browse(b||"~");h(C),f(C.currentPath)}catch(C){s.error(C.message||"Failed to read directory")}finally{v(!1)}};return l.useEffect(()=>{e&&y(t||"~")},[e,t]),c.jsx(xn,{title:a,open:e,onCancel:n,footer:null,width:640,destroyOnClose:!0,children:c.jsxs(ar,{spinning:p,children:[c.jsx("div",{className:"file-browser-path-row",children:c.jsx(Ct,{value:u,onChange:b=>f(b.target.value),onPressEnter:()=>y(u),addonAfter:c.jsx(Re,{size:"small",type:"text",onClick:()=>y(u),children:"Go"})})}),m&&c.jsxs("div",{children:[c.jsx("div",{className:"file-browser-parent-row",children:c.jsxs(Re,{size:"small",onClick:()=>y(m.parentPath),disabled:m.currentPath===m.parentPath,children:[c.jsx(ec,{}),"Parent Directory"]})}),c.jsx("div",{className:"file-browser-list",children:m.subdirectories.length===0&&(o!=="file"||(m.files||[]).length===0)?c.jsx("div",{className:"file-browser-empty",children:"No items found"}):c.jsxs(c.Fragment,{children:[m.subdirectories.map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>y(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Fr,{className:"file-browser-icon"}),b.name]}),o==="directory"&&c.jsx(Re,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select Folder"})]},b.fullPath)),o==="file"&&(m.files||[]).map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>r(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Zs,{className:"file-browser-icon"}),b.name]}),c.jsx(Re,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select File"})]},b.fullPath))]})}),o==="directory"&&c.jsx("div",{className:"file-browser-confirm-row",children:c.jsxs(Re,{type:"primary",onClick:()=>r(m.currentPath),children:["Confirm Path: ",m.currentPath]})})]})]})})}const{Text:Dc}=Cn,Pm=(e,t)=>`${e}:${t}`,Oye=()=>c.jsx("div",{style:{width:"0.8em",height:"0.8em",backgroundColor:"rgba(0,0,0,0.88)"}});function Rye({form:e,editing:t,executor:n,running:r,errorCounts:a={},packageScripts:o,onRun:s,onRunInstall:u,onRunPackage:f,onStop:m,onLogs:h,onPackageLogs:p}){const v=!!(t&&[...r].some(C=>C.startsWith(`${t.id}:`))),[y,b]=l.useState(()=>v);return l.useEffect(()=>{v&&b(!0)},[t==null?void 0:t.id]),l.useEffect(()=>{v||b(!1)},[v]),c.jsx(wt.List,{name:"scripts",children:(C,{add:x,remove:w})=>{const $=["npm","pnpm","yarn"].includes(n)?{id:"install",name:"Install",command:`${n} install${n==="npm"?" --legacy-peer-deps":""}`}:null,E=[...C.map(O=>({...O,key:`custom-${O.key}`,kind:"custom"})),...$?[{key:"install",kind:"install",script:$}]:[],...(o||[]).map(O=>({key:`package-${O.id}`,kind:"package",script:O}))],R=y?E.filter(O=>{const I=O.kind==="custom"?e.getFieldValue(["scripts",O.name]):O.script;return t&&(I==null?void 0:I.id)&&r.has(Pm(t.id,I.id))}):E,N=[{title:"Source",width:100,render:(O,I)=>c.jsx($t,{color:I.kind==="package"?"purple":I.kind==="install"?"green":"default",children:I.kind==="package"?"Package":I.kind==="install"?"Executor":"Custom"})},{title:"Script name",width:200,render:(O,I)=>{var z;const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=(j==null?void 0:j.name)===e.getFieldValue("startCommand"),T=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id));return c.jsxs(ct,{direction:"vertical",size:1,style:{width:"100%"},children:[I.kind!=="custom"||T?c.jsxs(ct,{size:4,children:[c.jsx(Dc,{strong:!0,children:(j==null?void 0:j.name)||((z=I.script)==null?void 0:z.name)}),k&&c.jsx(qo,{className:"start-script-icon"})]}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"name"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"serve",allowClear:!0,suffix:k?c.jsx(qo,{className:"start-script-icon"}):null})}),T&&c.jsx(sa,{status:"success",text:c.jsx(Dc,{type:"secondary",style:{fontSize:11},children:"running"})})]})}},{title:"Command",render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id));return I.kind==="package"?c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsxs(Dc,{code:!0,children:[n," run ",I.script.name]}),c.jsx(Dc,{type:"secondary",style:{fontSize:12},children:I.script.command})]}):I.kind==="install"?c.jsx(Dc,{code:!0,children:I.script.command}):k?c.jsx(Dc,{code:!0,children:j==null?void 0:j.command}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"command"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"npm run dev",allowClear:!0})})}},{title:"Actions",width:132,render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,k=t&&(j==null?void 0:j.id)&&r.has(Pm(t.id,j.id)),T=t&&(j!=null&&j.id)&&a[Pm(t.id,j.id)]||0;return c.jsxs(ct,{size:2,children:[t&&c.jsx(yn,{title:k?"Stop":"Start",children:c.jsx(Re,{type:"text",danger:k,icon:k?c.jsx(Oye,{}):c.jsx(m0e,{}),onClick:()=>k?m(j):I.kind==="package"?f(j):I.kind==="install"?u(j):s(j),disabled:!(j!=null&&j.id)})}),c.jsx(yn,{title:"Logs",children:c.jsx(sa,{count:T,size:"small",offset:[-2,2],children:c.jsx(Re,{type:"text",icon:c.jsx(Ui,{}),onClick:()=>I.kind==="package"?p(j):h(j),disabled:!t||!(j!=null&&j.id)})})}),I.kind==="custom"&&c.jsx(yn,{title:"Remove",children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),onClick:()=>w(I.name),disabled:!!k})})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"script-header",children:[c.jsx(cp,{orientation:"left",children:"Scripts"}),c.jsxs(ct,{size:"middle",align:"center",children:[c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:y,onChange:b,disabled:!t}),c.jsx(Dc,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]}),c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:()=>{b(!1),x({name:"",command:""})},children:"Add script"})]})]}),c.jsx(or,{size:"small",rowKey:"key",pagination:!1,loading:o===null,dataSource:R,columns:N})]})}})}const Iye=e=>c.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",style:{verticalAlign:"-0.125em",...e.style},...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.75 2.5a.75.75 0 01.742-.647h21.016a.75.75 0 01.742.853l-2.622 17.5a.75.75 0 01-.742.644H4.114a.75.75 0 01-.742-.644L.75 2.5zm13.1 11.2h-3.7l-.76-3.8h5.22l-.76 3.8z"})});function kye(e){if(!e)return null;const t=e.toLowerCase();return t.includes("bitbucket")?c.jsx(Iye,{style:{color:"#2584FF"}}):t.includes("github")?c.jsx(Cve,{style:{color:"#24292e"}}):t.includes("gitlab")?c.jsx(w0,{style:{color:"#fc6d26"}}):c.jsx(Mf,{className:"repo-generic-icon"})}function F9({repoUrl:e,style:t}){if(!e)return null;const n=kye(e);return n?c.jsx(yn,{title:"Open repository in browser",children:c.jsx(Re,{className:"repo-icon-button",type:"text",size:"small",icon:n,onClick:r=>{r.preventDefault(),r.stopPropagation(),hr(e)},style:t})}):null}const Mye=()=>({alias:"",folder:"",groupName:"",executor:"npm",startCommand:void 0,scripts:[]});function Tye({open:e,editing:t,groups:n,running:r,errorCounts:a={},onCancel:o,onSave:s,onRun:u,onRunInstall:f,onRunPackage:m,onStop:h,onLogs:p,onDelete:v}){const{message:y,modal:b}=Pr.useApp(),[C]=wt.useForm(),[x,w]=l.useState(null),[$,E]=l.useState(!1),R=l.useRef(null),N=()=>{const T=document.querySelector(".service-modal.is-editing"),z=T==null?void 0:T.querySelector(".ant-modal-body"),P=T==null?void 0:T.closest(".ant-modal-wrap");R.current=[z,P].filter(Boolean).map(B=>({element:B,top:B.scrollTop}))};l.useLayoutEffect(()=>{const T=R.current;T&&(T.forEach(({element:z,top:P})=>{z.isConnected&&(z.scrollTop=P)}),R.current=null)},[x]);const O=T=>{if(T&&(C.setFieldValue("folder",T),!C.getFieldValue("alias"))){const P=T.split(/[/\\]/).filter(Boolean);P.length>0&&C.setFieldValue("alias",P[P.length-1])}E(!1)},I=async()=>{const T=String(C.getFieldValue("folder")||"").trim();if(!T){y.warning("Set a project folder first.");return}try{await Un.openFolder(T)}catch(z){y.error(z.message)}},j=()=>{b.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 v(t)}catch(T){y.error(T.message)}}})};l.useEffect(()=>{e&&(C.resetFields(),C.setFieldsValue(t?{...t,startCommand:t.startCommand||void 0,scripts:t.scripts}:Mye()),w(t?null:[]),t&&Br.packageScripts(t.id).then(T=>{N(),w(T.scripts)}).catch(()=>{N(),w([])}))},[e,t==null?void 0:t.id,C]);const k=async()=>{try{const T=(C.getFieldValue("scripts")||[]).filter(B=>{var H,A;return((H=B==null?void 0:B.name)==null?void 0:H.trim())||((A=B==null?void 0:B.command)==null?void 0:A.trim())});C.setFieldValue("scripts",T);const z=await C.validateFields(["alias","folder","groupName","startCommand"]),P={...C.getFieldsValue(!0),...z,scripts:T};await s(P)}catch(T){if(T!=null&&T.errorFields)return;y.error(T.message)}};return c.jsxs(xn,{className:`service-modal${t?" is-editing":""}`,title:t?c.jsxs(ct,{align:"center",size:6,children:[c.jsxs("span",{children:["Service details · ",t.alias]}),c.jsx(F9,{repoUrl:t.repoUrl})]}):"Add service",open:e,onCancel:o,onOk:k,okText:t?"Save":"Save service",width:860,destroyOnClose:!0,footer:c.jsxs("div",{className:"service-modal-footer",children:[t?c.jsx(Re,{type:"primary",danger:!0,onClick:j,children:"Delete service"}):c.jsx("div",{}),c.jsxs(ct,{children:[c.jsx(Re,{onClick:o,children:"Cancel"}),c.jsx(Re,{type:"primary",onClick:k,children:t?"Save":"Save service"})]})]}),children:[c.jsxs(wt,{form:C,layout:"vertical",children:[c.jsx(Q0,{className:"service-config",defaultActiveKey:t?[]:["configuration"],items:[{key:"configuration",label:"Service configuration",children:c.jsxs(Uo,{gutter:[16,0],children:[c.jsx(Wn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Name",name:"alias",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Service name",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Project folder",name:"folder",rules:[{required:!0}],children:c.jsx(Ct,{prefix:c.jsx(Re,{type:"text",htmlType:"button",icon:c.jsx(Fr,{}),onClick:I,"aria-label":"Open project folder",title:"Open project folder",style:{color:"#8c8c8c",padding:"0 4px"}}),suffix:c.jsx(Re,{type:"text",size:"small",icon:c.jsx(Fr,{}),onClick:()=>E(!0),style:{fontSize:12,padding:"0 4px"},children:"Browse"}),placeholder:"Project folder path",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Group",name:"groupName",children:c.jsx(rf,{options:n.map(T=>({value:T})),placeholder:"Group name",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Executor",name:"executor",rules:[{required:!0}],children:c.jsx(rf,{options:["npm","pnpm","yarn"].map(T=>({value:T})),placeholder:"npm",allowClear:!0})})}),c.jsx(Wn,{xs:24,sm:8,children:c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.scripts!==z.scripts,children:()=>{const T=(C.getFieldValue("scripts")||[]).map(B=>B==null?void 0:B.name).filter(Boolean),z=(x||[]).map(B=>B.name),P=[...new Set([...T,...z])].map(B=>({label:B,value:B}));return c.jsx(wt.Item,{label:"Start script name",name:"startCommand",children:c.jsx($n,{placeholder:"Select start script",allowClear:!0,options:P})})}})})]})}]}),c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.executor!==z.executor||T.startCommand!==z.startCommand||T.scripts!==z.scripts,children:()=>c.jsx(Rye,{form:C,editing:t,executor:C.getFieldValue("executor")||"npm",running:r,errorCounts:a,packageScripts:x,onRun:T=>u(t,T),onRunInstall:()=>f(t),onRunPackage:T=>m(t,T),onStop:T=>h(t,T.id),onLogs:T=>p(t,T),onPackageLogs:T=>p(t,T,!0)})})]}),c.jsx(df,{open:$,initialPath:C.getFieldValue("folder")||"~",onCancel:()=>E(!1),onSelect:O,title:"Select Project Directory"})]})}const{Text:Pye}=Cn;function Dye({open:e,editingGroupTask:t,groupCatalog:n,onCancel:r,onSave:a}){const{message:o}=Pr.useApp(),[s]=wt.useForm();l.useEffect(()=>{e&&(s.resetFields(),s.setFieldsValue({name:(t==null?void 0:t.name)||"",items:(t==null?void 0:t.items.map(m=>`${m.launcherId}|${m.scriptId}`))||[]}))},[e,t,s]);const u=l.useMemo(()=>Object.entries(n.reduce((m,h)=>{const p=h.groupName||"Ungrouped";return(m[p]||(m[p]=[])).push(h),m},{})).sort(([m],[h])=>m.localeCompare(h)).map(([m,h])=>({key:m,label:m,children:c.jsx("div",{className:"group-task-projects",children:h.map(p=>c.jsx(It,{size:"small",title:p.alias,children:c.jsx(ct,{direction:"vertical",children:p.scripts.map(v=>c.jsxs(nr,{value:`${p.id}|${v.id}`,children:[v.name," ",c.jsxs(Pye,{type:"secondary",children:["(",v.source,")"]})]},v.id))})},p.id))})})),[n]),f=async()=>{try{const m=await s.validateFields(),h={name:m.name,items:m.items.map(p=>{const[v,y]=p.split("|");return{launcherId:v,scriptId:y}})};await a(h)}catch(m){m!=null&&m.errorFields||o.error(m.message)}};return c.jsx(xn,{title:t?`Edit quick launch · ${t.name}`:"Add quick launch",open:e,onCancel:r,onOk:f,okText:t?"Save changes":"Save quick launch",width:760,destroyOnClose:!0,children:c.jsxs(wt,{form:s,layout:"vertical",children:[c.jsx(wt.Item,{label:"Name",name:"name",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Start local stack",allowClear:!0})}),c.jsx(wt.Item,{label:"Scripts",name:"items",rules:[{required:!0,message:"Select at least one script."}],children:c.jsx(nr.Group,{className:"group-task-selector",children:c.jsx(Qa,{items:u})})})]})})}const cI={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"},E0=()=>{const e=window.getSelection();return!e||e.isCollapsed||!e.toString()?!1:[e.anchorNode,e.focusNode].some(t=>{var r;const n=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement;return(r=n==null?void 0:n.closest)==null?void 0:r.call(n,".log-output")})};function Jw({value:e,editor:t,className:n="",onScroll:r}){const[a,o]=l.useState(t||"vscode"),[s,u]=l.useState(""),[f,m]=l.useState("");l.useEffect(()=>{t&&o(t),Un.status().then(C=>{C!=null&&C.defaultEditor&&!t&&o(C.defaultEditor),C!=null&&C.domain&&u(C.domain),C!=null&&C.jiraIssuePrefix&&m(C.jiraIssuePrefix)}).catch(()=>{})},[t]);const h=(f||"").split(/[\s,]+/).filter(Boolean).map(C=>C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=h.length>0&&s?new RegExp(`\\b(?:${h.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,v=(C,x)=>{let w="";const $=(O,I)=>O.split(/(\u001b\[[0-9;]*m)/g).map((k,T)=>{const z=k.match(/^\u001b\[([0-9;]*)m$/);if(z){const B=z[1].split(";").map(Number);return w=B.includes(0)?"":cI[B.find(H=>cI[H])]||w,null}if(!k)return null;const P=w||(/\b(error|failed|fatal|exception|TS\d{4,5})\b/i.test(k)?"log-error":/\b(warn|warning)\b/i.test(k)?"log-warning":/\b(success|ready|started|listening)\b/i.test(k)?"log-success":"");return c.jsx("span",{className:P,children:k},`${I}-${T}`)}),E=/(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,R=p&&p.test(C);return!C.includes("http")&&!C.includes("/")&&!R?$(C,`${x}-0`):C.split(E).map((O,I)=>{if(!O)return null;const j=`${x}-${I}`;if(/^https?:\/\//.test(O.replace(/\u001b\[[0-9;]*m/g,""))){const T=O.replace(/\u001b\[[0-9;]*m/g,""),z=T.replace(/[),.;:!?]+$/,""),P=T.slice(z.length);return c.jsxs("span",{children:[c.jsx("a",{className:"log-link",href:z,target:"_blank",rel:"noreferrer",onClick:B=>{B.preventDefault(),hr(z)},children:$(O.slice(0,O.length-P.length),`${j}-url`)}),P&&$(P,`${j}-suf`)]},j)}const k=O.replace(/\u001b\[[0-9;]*m/g,"");if(k.startsWith("/")){const[,T,z=""]=k.match(/^(.*?)(:\d+(?::\d+)?)?$/)||[];if(T){const P=H9(a,T,z);return c.jsx("a",{className:"log-link",href:P,target:"_blank",rel:"noreferrer",title:`Open in ${B9(a)}`,children:$(O,j)},j)}}if(p&&s&&(p.lastIndex=0,p.test(k))){const T=[];let z=0;p.lastIndex=0;for(const P of k.matchAll(p)){P.index>z&&T.push($(k.slice(z,P.index),`${j}-sub-${P.index}`));const B=P[0],H=By(s,B);T.push(c.jsx("a",{className:"log-link",href:H,target:"_blank",rel:"noreferrer",onClick:A=>{A.preventDefault(),hr(H)},children:B},`${j}-jira-${P.index}`)),z=P.index+B.length}return z<k.length&&T.push($(k.slice(z),`${j}-sub-end`)),c.jsx("span",{children:T},j)}return $(O,j)})},y=C=>{C.preventDefault(),C.stopPropagation()},b=C=>{C.metaKey||C.ctrlKey||C.altKey||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Shift","Tab","Escape"].includes(C.key)||C.preventDefault()};return c.jsx("div",{className:`log-output ${n}`.trim(),role:"log",contentEditable:!0,suppressContentEditableWarning:!0,onBeforeInput:y,onPaste:y,onDrop:y,onKeyDown:b,onMouseDown:C=>C.stopPropagation(),onScroll:r,children:e.split(`
497
497
  `).map((C,x)=>c.jsx("div",{className:"log-line",children:c.jsx("code",{children:v(C,x)})},x))})}function zye({open:e,logTarget:t,onCancel:n}){var v;const[r,a]=l.useState("output"),[o,s]=l.useState(""),[u,f]=l.useState(!0),m=l.useRef(0);l.useEffect(()=>{e&&(a("output"),s("Loading…"))},[e,t]),l.useEffect(()=>{if(!u)return;const y=document.querySelector(".logs-modal .ant-tabs-tabpane-active .log-output");if(y){const b=y.scrollHeight-y.clientHeight;m.current=b,y.scrollTop=b}},[o,r,u]);const h=y=>{const{scrollTop:b}=y.currentTarget;u&&b<m.current-1&&f(!1),m.current=b};l.useEffect(()=>{if(!e||!t)return;const y=async()=>{if(!E0())try{const C=t.package?r==="error"?await Br.packageScriptErrorLogs(t.launcher.id,t.script.name):await Br.packageScriptLogs(t.launcher.id,t.script.name):r==="error"?await Br.errorLogs(t.launcher.id,t.script.id):await Br.logs(t.launcher.id,t.script.id);E0()||s(C.log||(r==="error"?"No error logs yet.":"No logs yet."))}catch(C){s(C.message)}};y();const b=setInterval(y,1e3);return()=>clearInterval(b)},[e,t,r]);const p=async()=>{if(t)try{t.package?await Br.clearPackageScriptLogs(t.launcher.id,t.script.name):await Br.clearLogs(t.launcher.id,t.script.id),s(r==="error"?"No error logs yet.":"No logs yet.")}catch{}};return c.jsx(xn,{title:t?`${(v=t.launcher)!=null&&v.alias?`${t.launcher.alias} / `:""}${t.script.name} · Logs`:"Logs",open:e,onCancel:n,footer:null,width:1080,zIndex:1200,className:"logs-modal",maskClosable:!1,children:c.jsx(Qa,{activeKey:r,onChange:a,tabBarExtraContent:t&&c.jsxs(ct,{children:[c.jsx(nr,{checked:u,onChange:y=>f(y.target.checked),children:"Auto-scroll"}),c.jsx(Re,{icon:c.jsx(R9,{}),onClick:p,children:"Clear log"}),c.jsx(Re,{icon:c.jsx(Mf,{}),onClick:()=>{const y=t.package?`#/logs/${t.launcher.id}/pkg/${encodeURIComponent(t.script.name)}`:`#/logs/${t.launcher.id}/${encodeURIComponent(t.script.id)}`;window.open(y,"_blank")},children:"Open in new tab"})]}),items:[{key:"output",label:"Logs",children:c.jsx(Jw,{value:o,onScroll:h})},{key:"error",label:"Error logs",children:c.jsx(Jw,{value:o,onScroll:h})}]})})}const{Text:uI}=Cn,Aye=(e,t)=>{const n=e.scripts.find(r=>r.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t};function Lye({launchers:e,running:t,errorCounts:n={},refresh:r,loading:a,initialRunningOnly:o=!1,initialServiceId:s=null}){const{message:u}=Pr.useApp(),[f,m]=l.useState("all"),[h,p]=l.useState(o),v=ae=>{p(ae);const[pe,Ie=""]=(window.location.hash||"#/launcher").slice(2).split("?"),Ce=new URLSearchParams(Ie);ae?Ce.set("running","1"):Ce.delete("running");const me=Ce.toString();window.location.hash=`#/${pe||"launcher"}${me?`?${me}`:""}`};l.useEffect(()=>{p(o)},[o]);const[y,b]=l.useState([]),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState(!1),[N,O]=l.useState(null),[I,j]=l.useState(!1),[k,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,_]=l.useState("vscode"),F=l.useRef(null),U=l.useRef(null);l.useEffect(()=>{ji.list().then(b).catch(ae=>u.error(ae.message)),Un.status().then(ae=>{ae!=null&&ae.defaultEditor&&_(ae.defaultEditor)}).catch(()=>{})},[]);const q=l.useMemo(()=>[...new Set(e.map(ae=>ae.groupName).filter(Boolean))].sort((ae,pe)=>ae.localeCompare(pe)),[e]),L=ae=>[...t].some(pe=>pe.startsWith(`${ae.id}:`)),K=e.filter(ae=>(f==="all"||ae.groupName===f)&&(!h||L(ae)));l.useLayoutEffect(()=>{var pe;[...((pe=F.current)==null?void 0:pe.querySelectorAll("[tabindex]"))||[],...document.querySelectorAll(".launcher-table, .launcher-table [tabindex]")].forEach(Ie=>{document.activeElement===Ie&&Ie.blur(),Ie.tabIndex=-1})},[f,q,e.length]);const X=(ae=null)=>{T(ae),j(!0)};l.useEffect(()=>{if(!s){U.current=null;return}if(String(U.current)===String(s))return;const ae=e.find(pe=>String(pe.id)===String(s));ae&&(U.current=s,X(ae))},[s,e]);const V=()=>{j(!1);const[ae,pe=""]=(window.location.hash||"#/launcher").slice(2).split("?"),Ie=new URLSearchParams(pe);if(!Ie.has("service"))return;Ie.delete("service");const Ce=Ie.toString();window.location.hash=`#/${ae||"launcher"}${Ce?`?${Ce}`:""}`},W=async ae=>{if(k){const pe=await Br.update(k.id,ae);T(pe)}else await Br.create(ae),j(!1);u.success("Saved"),await r()},G=async ae=>{try{const pe=[...t].filter(Ie=>Ie.startsWith(`${ae.id}:`));if(pe.length>0){const Ie=pe.map(Ce=>Ce.slice(`${ae.id}:`.length));await Promise.all(Ie.map(Ce=>Br.stop(ae.id,Ce)))}await Br.remove(ae.id),j(!1),u.success("Deleted"),await r()}catch(pe){u.error(pe.message)}},Y=async(ae,pe)=>{try{await Br.run(ae.id,pe.id),await r()}catch(Ie){u.error(Ie.message)}},te=async ae=>{try{await Br.runInstall(ae.id),await r()}catch(pe){u.error(pe.message)}},ne=async(ae,pe)=>{try{await Br.runPackageScript(ae.id,pe.name),await r()}catch(Ie){u.error(Ie.message)}},ce=(ae,pe,Ie=!1)=>{H({launcher:ae,script:pe,package:Ie}),P(!0)},Z=async ae=>{try{await Br.start(ae.id),await r()}catch(pe){u.warning(pe.message)}},ee=async ae=>{try{await Br.openTerminal(ae.id)}catch(pe){u.error(pe.message)}},re=async(ae,pe)=>{ae.stopPropagation();try{await navigator.clipboard.writeText(pe),u.success(`Copied branch: ${pe}`)}catch(Ie){u.error(Ie.message||"Could not copy branch name.")}},oe=async(ae,pe)=>{try{await Br.stop(ae.id,pe),await r()}catch(Ie){await r(),u.error(Ie.message)}},ue=async(ae,pe)=>{try{await Promise.all(pe.map(Ie=>Br.stop(ae.id,Ie))),await r()}catch(Ie){await r(),u.error(Ie.message)}},ye=async(ae=null)=>{if(O(ae),R(!0),!C.length)try{x(await ji.catalog())}catch(pe){u.error(pe.message)}},J=async ae=>{N?await ji.update(N.id,ae):await ji.create(ae),R(!1),b(await ji.list())},ve=async ae=>{const pe=`group-task-${ae.id}`;u.loading({content:`Starting ${ae.name}…`,key:pe,duration:0});try{const Ie=await ji.start(ae.id),Ce=Ie.results.filter(me=>me.error);Ce.length?u.warning({content:`${Ie.results.length-Ce.length} started, ${Ce.length} failed.`,key:pe}):u.success({content:`${Ie.results.length} scripts started.`,key:pe}),await r()}catch(Ie){u.error({content:Ie.message,key:pe})}},xe=async ae=>{const pe=`group-task-${ae.id}`;u.loading({content:`Stopping ${ae.name}…`,key:pe,duration:0});try{const Ce=(await ji.stop(ae.id)).results.filter(me=>me.ok).length;u.success({content:`${Ce} scripts stopped.`,key:pe}),await r()}catch(Ie){u.error({content:Ie.message,key:pe})}},ze=async ae=>{try{await ji.remove(ae.id),b(await ji.list())}catch(pe){u.error(pe.message)}},fe=async(ae,pe)=>{try{b(await ji.move(ae.id,pe))}catch(Ie){u.error(Ie.message)}},se=async ae=>{try{b(await ji.reorder(ae))}catch(pe){u.error(pe.message)}},le=[{title:"Service",dataIndex:"alias",render:(ae,pe)=>c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Re,{type:"text",size:"small",className:"launcher-terminal-button",icon:c.jsx(wa,{}),"aria-label":`Open terminal in ${pe.folder}`,title:`Open Terminal in ${pe.folder}`,onClick:Ie=>{Ie.stopPropagation(),ee(pe)}}),c.jsx("a",{href:H9(A,pe.folder,"",{newWindow:!0}),title:`Open ${pe.folder} in ${B9(A)}`,onClick:Ie=>{Ie.preventDefault(),Ie.stopPropagation(),D9.openPath(pe.folder)},className:"launcher-service-link",children:ae}),c.jsx(F9,{repoUrl:pe.repoUrl}),pe.branch&&c.jsx("button",{type:"button",className:"launcher-branch-button",title:"Copy branch name","aria-label":`Copy branch name ${pe.branch}`,onClick:Ie=>re(Ie,pe.branch),children:c.jsx(uI,{code:!0,className:"launcher-branch",children:pe.branch})})]})},{title:"Scripts",width:170,align:"center",render:(ae,pe)=>{const Ie=[...t].filter(Me=>Me.startsWith(`${pe.id}:`)),Ce=Ie.map(Me=>Aye(pe,Me.slice(`${pe.id}:`.length))),me=pe.scripts.length+(pe.packageScriptCount||0),be=Object.entries(n).filter(([Me])=>Me.startsWith(`${pe.id}:`)).reduce((Me,[,De])=>Me+(De||0),0),Ee=c.jsx(sa,{status:Ie.length?"success":"default",text:`${Ie.length} / ${me} running`});return c.jsxs(ct,{size:8,children:[c.jsxs("span",{className:"launcher-running-status",children:[Ee,Ce.length>0&&c.jsx("span",{className:"launcher-running-tooltip",children:Ce.map((Me,De)=>c.jsxs("span",{children:["• ",Me]},`${Me}-${De}`))})]}),be>0&&c.jsx(sa,{count:be,overflowCount:999,style:{backgroundColor:"#ff4d4f"}})]})}},{title:"Action",width:108,align:"center",render:(ae,pe)=>{const Ie=[...t].filter(me=>me.startsWith(`${pe.id}:`)),Ce=Ie.length>0;return c.jsx(Re,{size:"small",type:Ce?"default":"primary",className:`launcher-service-action${Ce?" launcher-running-button":""}`,icon:Ce?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:me=>{me.stopPropagation(),Ce?ue(pe,Ie.map(be=>be.slice(`${pe.id}:`.length))):Z(pe)},children:Ce?"Stop":"Start"})}}];return c.jsxs(c.Fragment,{children:[c.jsx(Ur,{actions:c.jsxs(ct,{children:[c.jsx(Re,{onClick:()=>$(!0),children:"Quick Launch"}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>X(),children:"Add service"})]}),description:"Manage and run local project scripts.",title:"Launcher"}),a?c.jsx("div",{className:"launcher-loading",children:c.jsx(ar,{size:"large"})}):e.length?c.jsxs(c.Fragment,{children:[y.length>0&&c.jsxs("div",{className:"quick-launch-bar",children:[c.jsx("span",{className:"quick-launch-label",children:"Quick Launch"}),c.jsx(ct,{wrap:!0,size:"middle",children:y.map(ae=>{const pe=ae.items.every(Ie=>t.has(`${Ie.launcherId}:${Ie.scriptId}`));return c.jsx(Re,{type:pe?"default":"primary",className:`quick-launch-button${pe?" launcher-running-button":""}`,icon:pe?c.jsx("span",{className:"launcher-stop-square quick-launch-stop-icon"}):c.jsx(Kl,{className:"quick-launch-play-icon"}),onClick:()=>pe?xe(ae):ve(ae),children:ae.name},ae.id)})})]}),c.jsxs("div",{className:"launcher-tabs-row",children:[c.jsx("div",{ref:F,className:"launcher-tabs-wrap",children:c.jsx(Qa,{activeKey:f,onChange:m,className:"group-tabs",items:[{key:"all",label:`All (${e.length})`},...q.map(ae=>({key:ae,label:`${ae} (${e.filter(pe=>pe.groupName===ae).length})`}))]})}),c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:h,onChange:v}),c.jsx(uI,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]})]}),K.length?c.jsx(or,{className:"launcher-table",rowKey:"id",dataSource:K,columns:le,pagination:!1,onRow:ae=>({onClick:()=>X(ae)})},f):c.jsx(Xt,{description:"No services in this group."})]}):c.jsx(Xt,{description:"No services yet"}),c.jsx(Tye,{open:I,editing:k,groups:q,running:t,errorCounts:n,onCancel:V,onSave:W,onRun:Y,onRunInstall:te,onRunPackage:ne,onStop:oe,onLogs:ce,onDelete:G}),c.jsx(xn,{title:"Quick Launch",open:w,onCancel:()=>$(!1),footer:null,width:760,destroyOnClose:!0,children:c.jsx(Nye,{tasks:y,running:t,onCreate:()=>ye(),onEdit:ye,onStart:ve,onStop:xe,onRemove:ze,onMove:fe,onReorder:se})}),c.jsx(Dye,{open:E,editingGroupTask:N,groupCatalog:C,onCancel:()=>R(!1),onSave:J}),c.jsx(zye,{open:z,logTarget:B,onCancel:()=>P(!1)})]})}const{Text:Pl}=Cn;function _ye({refreshLaunchers:e}){const[t,n]=l.useState([]),[r,a]=l.useState(!1),[o,s]=l.useState(null),[u,f]=l.useState(!1),[m,h]=l.useState(!1),[p,v]=l.useState(null),y=async()=>{a(!0);try{n((await DC.list()).ports)}catch(w){nn.error(w.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const b=async()=>{if(o){f(!0);try{const w=(await DC.get(o)).process;v(w),h(!0)}catch(w){nn.error(w.message)}finally{f(!1)}}},C=async({port:w,pid:$})=>{try{await DC.kill(w,$),nn.success(`Process on port ${w} was killed.`),await y(),e&&await e()}catch(E){nn.error(E.message)}},x=[{title:"Port",dataIndex:"port",width:100,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:w=>c.jsx(Pl,{code:!0,children:w})},{title:"Last used",dataIndex:"launcher",render:(w,$)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(Pl,{strong:!0,children:w}),c.jsx(Pl,{type:"secondary",children:$.script})]})},{title:"Process",dataIndex:"command",render:(w,$)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(Pl,{code:!0,children:$.currentCommand||w}),c.jsxs(Pl,{type:"secondary",children:["PID ",$.currentPid||$.pid]})]})},{title:"Status",width:170,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:(w,$)=>$.ghost?c.jsx($t,{color:"error",children:"Ghost process"}):$.listening?c.jsx($t,{color:"success",children:"Script running"}):$.reused?c.jsx($t,{color:"warning",children:"Port reused"}):c.jsx($t,{children:"Port released"})},{title:"Action",width:100,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:(w,$)=>$.listening||$.reused?c.jsx(Gr,{title:`Kill process on port ${$.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>C({port:$.port,pid:$.currentPid}),children:c.jsx(Re,{type:"primary",danger:!0,icon:c.jsx(Hn,{}),children:"Kill"})}):c.jsx(Re,{type:"primary",danger:!0,disabled:!0,icon:c.jsx(Hn,{}),children:"Kill"})}];return c.jsxs("div",{className:"port-diagnostic-page",children:[c.jsx(Ur,{actions:c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:y,loading:r,children:"Refresh"}),description:"Every port observed while a recent Launcher script was running. Ghost processes still listen after their script has stopped.",title:"Port Diagnostic"}),c.jsxs(It,{className:"port-manual-query",size:"small",children:[c.jsxs(ct,{wrap:!0,children:[c.jsx(Pl,{strong:!0,children:"Query port"}),c.jsx(cf,{min:1,max:65535,controls:!1,value:o,onChange:s,onPressEnter:b,placeholder:"e.g. 3000"}),c.jsx(Re,{type:"primary",onClick:b,loading:u,disabled:!o,children:"Query"})]}),m&&c.jsx("div",{className:"port-query-result",children:p?c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"success",children:"Listening"}),c.jsxs(Pl,{code:!0,children:["PID ",p.pid]}),c.jsx(Pl,{code:!0,children:p.command}),c.jsx(Gr,{title:`Kill process on port ${p.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>C(p),children:c.jsx(Re,{type:"primary",danger:!0,icon:c.jsx(Hn,{}),children:"Kill"})})]}):c.jsxs(Pl,{type:"secondary",children:["No process is listening on port ",o,"."]})})]}),c.jsx(or,{className:"port-diagnostic-table",rowKey:w=>`${w.startedAt}-${w.port}-${w.pid}`,loading:r,dataSource:t,columns:x,pagination:!1,locale:{emptyText:c.jsx(Xt,{description:"No ports have been observed from Launcher scripts yet."})}})]})}const{Title:Ni,Paragraph:Oi,Text:_n}=Cn,Yv=[{id:"bitbucket",label:"Bitbucket"},{id:"jira",label:"Jira"},{id:"confluence",label:"Confluence"}],Dm=(e=0)=>{if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`},dI=e=>{const t=String((e==null?void 0:e.url)||"").trim().replace(/\/+$/,"");return t==="/pages/welcome"||t==="/pages/welcome/index.html"},uh=["domain","aiApiHost","jiraIssuePrefix","defaultEditor","defaultBrowser",...Yv.map(({id:e})=>e)],_C=(e={})=>Object.fromEntries(uh.map(t=>[t,String(e[t]??"")])),Bye=(e,t)=>uh.filter(n=>String(e[n]??"")!==String(t[n]??"")).length;function Hye({theme:e,onThemeChange:t,onStaticPagesChange:n}){var De,Te,Ve,_e;const[r]=wt.useForm(),[a]=wt.useForm(),[o,s]=l.useState({}),[u,f]=l.useState(!1),[m,h]=l.useState(!1),[p,v]=l.useState(0),[y,b]=l.useState(null),[C,x]=l.useState(!0),[w,$]=l.useState(!1),[E,R]=l.useState(!1),[N,O]=l.useState(!1),[I,j]=l.useState(null),[k,T]=l.useState(!1),[z,P]=l.useState(""),[B,H]=l.useState(!1),[A,_]=l.useState(!1),F=l.useRef(null),U=l.useRef({}),[q,L]=l.useState([]),[K,X]=l.useState(!1),[V,W]=l.useState(!1),[G,Y]=l.useState(null),[te,ne]=l.useState(!1),[ce,Z]=l.useState(null),ee=async()=>{try{await Un.openDataDir()}catch(Ne){nn.error(Ne.message)}},re=async()=>{if(z)try{await Un.openFolder(z)}catch(Ne){nn.error(Ne.message)}},oe=async Ne=>{const $e=String(Ne||"").trim();if($e){H(!0);try{const Ae=await So.saveConfig($e);P(Ae.workspaceDir||$e),_(!1),nn.success("Workspace directory saved.")}catch(Ae){nn.error(Ae.message)}finally{H(!1)}}},ue=async Ne=>{t==null||t(Ne);try{const $e=await Un.saveTheme(Ne);s(Ae=>({...Ae,...$e}))}catch($e){t==null||t(e),nn.error($e.message)}},ye=async()=>{x(!0);try{b(await zC.stats())}catch(Ne){nn.error(Ne.message)}finally{x(!1)}},J=async()=>{R(!0);try{const{blob:Ne,filename:$e}=await zC.export(),Ae=URL.createObjectURL(Ne),We=document.createElement("a");We.href=Ae,We.download=$e,document.body.appendChild(We),We.click(),We.remove(),setTimeout(()=>URL.revokeObjectURL(Ae),1e3),nn.success("Data backup exported.")}catch(Ne){nn.error(Ne.message)}finally{R(!1)}},ve=Ne=>{const[$e]=Ne.target.files||[];Ne.target.value="",$e&&(T(!1),j($e))},xe=async()=>{if(I){O(!0);try{const Ne=await zC.import(I);b(Ne),T(!0)}catch(Ne){nn.error(Ne.message)}finally{O(!1)}}},ze=async()=>{try{const Ne=await Kc.list();L(Ne)}catch(Ne){nn.error(Ne.message)}finally{X(!0)}},fe=()=>{v(Bye(r.getFieldsValue(uh),U.current)),h(!1)};l.useEffect(()=>{Un.status().then(Ne=>{s(Ne);const $e={domain:Ne.domain,aiApiHost:Ne.aiApiHost||"",jiraIssuePrefix:Ne.jiraIssuePrefix||"",defaultEditor:Ne.defaultEditor||"vscode",defaultBrowser:Ne.defaultBrowser||"chrome"};r.setFieldsValue($e),U.current=_C($e),v(0)}).catch(Ne=>nn.error(Ne.message)),So.config().then(Ne=>P(Ne.workspaceDir||"")).catch(()=>{}),ze(),ye()},[r]);const se=Ne=>o[`${Ne}TokenConfigured`],le=async()=>{try{await r.validateFields(["domain","aiApiHost"]),f(!0);const Ne=r.getFieldsValue();if(Ne.domain!=null){const $e=await Un.saveDomain(Ne.domain);s(Ae=>({...Ae,...$e})),r.setFieldValue("domain",$e.domain)}if(Ne.aiApiHost!=null){const $e=await Un.saveAiApiHost(Ne.aiApiHost);s(Ae=>({...Ae,...$e})),r.setFieldValue("aiApiHost",$e.aiApiHost)}if(Ne.jiraIssuePrefix!=null){const $e=await Un.saveJiraIssuePrefix(Ne.jiraIssuePrefix);s(Ae=>({...Ae,...$e})),r.setFieldValue("jiraIssuePrefix",$e.jiraIssuePrefix)}if(Ne.defaultEditor!=null){const $e=await Un.saveDefaultEditor(Ne.defaultEditor);s(Ae=>({...Ae,...$e})),r.setFieldValue("defaultEditor",$e.defaultEditor)}if(Ne.defaultBrowser!=null){const $e=await Un.saveDefaultBrowser(Ne.defaultBrowser);s(Ae=>({...Ae,...$e})),r.setFieldValue("defaultBrowser",$e.defaultBrowser)}for(const{id:$e}of Yv)if(Ne[$e]){const Ae=await Un.saveAccessToken($e,Ne[$e]);s(We=>({...We,...Ae})),r.resetFields([$e])}U.current=_C(r.getFieldsValue(uh)),v(0),f(!1),h(!0),setTimeout(()=>h(!1),1500)}catch(Ne){f(!1),Ne!=null&&Ne.errorFields||nn.error(Ne.message)}},ae=async Ne=>{try{const $e=await Un.saveAccessToken(Ne,"");s($e),r.resetFields([Ne]),U.current=_C(r.getFieldsValue(uh)),v(0),nn.success(`${Yv.find(Ae=>Ae.id===Ne).label} Access Token removed.`)}catch($e){nn.error($e.message)}},pe=()=>{Y(null),a.resetFields(),W(!0)},Ie=async()=>{const Ne="/pages/welcome";if(q.some(dI)){nn.info("The test demo page is already added.");return}try{await Kc.create({name:"Welcome Demo",url:Ne}),nn.success("Test demo page added."),await ze(),n==null||n()}catch($e){nn.error($e.message)}},Ce=Ne=>{Y(Ne),a.setFieldsValue({name:Ne.name,url:Ne.url}),W(!0)},me=async Ne=>{try{await Kc.remove(Ne),nn.success("Static page deleted."),await ze(),n==null||n()}catch($e){nn.error($e.message)}},be=async()=>{try{const Ne=await a.validateFields();ne(!0),G?(await Kc.update(G.id,Ne),nn.success("Static page updated.")):(await Kc.create(Ne),nn.success("Static page created.")),ne(!1),W(!1),await ze(),n==null||n()}catch(Ne){ne(!1),Ne!=null&&Ne.errorFields||nn.error(Ne.message)}},Ee=Ne=>{var Ae,We;const $e=Ne.target.closest('a[href^="#settings-"]');if($e){if(Ne.preventDefault(),$e.getAttribute("href")==="#settings-dev-configurations"){(Ae=document.querySelector(".page"))==null||Ae.scrollTo({top:0,behavior:"smooth"});return}(We=document.getElementById($e.getAttribute("href").slice(1)))==null||We.scrollIntoView({behavior:"smooth",block:"start"})}},Me=[{id:"settings-dev-configurations",label:"Dev Configurations"},{id:"settings-error-logs",label:"Error Logs"},{id:"settings-appearance",label:"Appearance"},{id:"settings-default-applications",label:"Default Applications"},{id:"settings-workspace-directory",label:"Workspace Directory"},{id:"settings-data-directory",label:"Data Directory"},{id:"settings-static-pages",label:"Static Pages"},{id:"settings-access-tokens",label:"Access Tokens & Domain"}];return c.jsxs("div",{className:"settings-page",children:[c.jsx(Ur,{actions:c.jsx(Re,{type:"primary",color:m?"green":"primary",variant:"solid",icon:m?c.jsx(Vl,{}):null,disabled:!m&&(u||p===0),loading:!m&&u,onClick:le,children:m?"Saved":p?`Save (${p})`:"Save"}),className:"settings-page-header",description:"Customize DevBuddy, manage integrations, and maintain your workspace data.",title:"Settings"}),c.jsxs("div",{className:"settings-layout",children:[c.jsx("nav",{className:"settings-section-nav","aria-label":"Settings sections",onClick:Ee,children:Me.map((Ne,$e)=>{const Ae=ce==null?99:Math.abs($e-ce),We=ce==null?12:Math.max(12,52-Ae*10),Le=ce===$e;return c.jsxs("a",{href:`#${Ne.id}`,"aria-label":Ne.label,className:Le?"is-active":"",style:{"--nav-width":`${We}px`},onMouseEnter:()=>Z($e),onMouseLeave:()=>Z(null),onFocus:()=>Z($e),onBlur:()=>Z(null),children:[c.jsx("span",{className:`settings-section-nav-preview ${Le?"is-visible":""}`,children:Ne.label}),Ne.label]},Ne.id)})}),c.jsxs("div",{className:"settings-content",children:[c.jsx(It,{id:"settings-dev-configurations",className:"settings-card settings-card-spaced settings-dev-config-entry",children:c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(e4,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(Ni,{level:4,children:"Dev Configurations"}),c.jsx(Oi,{type:"secondary",children:"Read and update your system-level npm and Git configuration, including Git SSH key settings."})]}),c.jsx(Re,{onClick:()=>{window.location.hash="#/dev-configurations"},children:"Open"})]})}),c.jsx(It,{id:"settings-error-logs",className:"settings-card settings-card-spaced settings-dev-config-entry",children:c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(uf,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(Ni,{level:4,children:"Error Logs"}),c.jsx(Oi,{type:"secondary",children:"Review application, launcher, and frontend errors captured by DevBuddy."})]}),c.jsx(Re,{onClick:()=>{window.location.hash="#/errors"},children:"Open"})]})}),c.jsxs(wt,{form:r,layout:"vertical",onValuesChange:fe,children:[c.jsxs(It,{id:"settings-appearance",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(tI,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(Ni,{level:4,children:"Appearance"}),c.jsx(Oi,{type:"secondary",children:"Choose how DevBuddy looks. Theme changes are applied and saved immediately."})]})]}),c.jsxs("div",{className:"settings-appearance-row",children:[c.jsxs("div",{children:[c.jsx(_n,{strong:!0,children:"Theme"}),c.jsx(_n,{type:"secondary",className:"settings-appearance-hint",children:"Use the original dark navigation or the new bright workspace."})]}),c.jsx(up,{"aria-label":"Application theme",value:e,onChange:ue,options:[{label:"Dark",value:"dark",icon:c.jsx(t0e,{})},{label:"Light",value:"light",icon:c.jsx(tI,{})}]})]})]}),c.jsxs(It,{id:"settings-default-applications",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(wa,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(Ni,{level:4,children:"Default Applications"}),c.jsx(Oi,{type:"secondary",children:"Choose your preferred editor and browser to open files, folders, and links."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Default Editor"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"VS Code, Devin, or IntelliJ IDEA"})]}),c.jsx(wt.Item,{name:"defaultEditor",children:c.jsx($n,{options:_9,className:"settings-app-select"})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Default Browser"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"Choose your default browser"})]}),c.jsx(wt.Item,{name:"defaultBrowser",className:"settings-form-item-flush",children:c.jsx($n,{options:hye(o.isMac!==!1),className:"settings-app-select"})})]})]})]}),c.jsxs(It,{id:"settings-workspace-directory",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Fr,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(Ni,{level:4,children:"Workspace Directory"}),c.jsx(Oi,{type:"secondary",children:"Local workspace used by Package Upgrade and repository workflows."})]})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Workspace Path"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"Choose the local directory that contains your repositories"})]}),c.jsx("div",{className:"settings-data-path",children:c.jsxs(ct.Compact,{className:"directory-path-control",children:[c.jsx(Ct,{value:z,readOnly:!0,placeholder:"Not configured",prefix:c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:re,disabled:!z||B,"aria-label":"Open workspace directory",title:"Open workspace directory"})}),c.jsx(Re,{onClick:()=>_(!0),loading:B,children:"Browse"})]})})]})]}),c.jsx(df,{open:A,initialPath:z||"~",onCancel:()=>_(!1),onSelect:oe,title:"Select Workspace Directory"}),c.jsxs(It,{id:"settings-data-directory",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Fr,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(Ni,{level:4,children:"Data Directory"}),c.jsx(Oi,{type:"secondary",children:"Local directory where settings, logs, and application data are stored."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Data Storage Path"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"Directory location on your file system"})]}),c.jsx("div",{className:"settings-data-path",children:c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly",children:c.jsx(Ct,{value:o.dataDir||"",readOnly:!0,prefix:c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:ee,disabled:!o.dataDir,"aria-label":"Open data directory",title:"Open data directory"})})})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Storage Usage"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"Total size and file count inside the data directory"})]}),c.jsxs("div",{className:"settings-data-usage",children:[c.jsx(zge,{}),c.jsx(_n,{strong:!0,children:C?"Calculating…":Dm(y==null?void 0:y.sizeBytes)}),!C&&c.jsxs(_n,{type:"secondary",children:["· ",(y==null?void 0:y.fileCount)||0," files"]}),c.jsx(Re,{type:"link",size:"small",onClick:()=>$(!0),children:"Details"}),c.jsx(Re,{type:"link",size:"small",onClick:ye,loading:C,children:"Refresh"})]})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Backup & Restore"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"Includes settings, access tokens, logs, clipboard files, and other local data"})]}),c.jsxs("div",{className:"settings-backup-actions",children:[c.jsx(Re,{icon:c.jsx(ql,{}),loading:E,onClick:J,children:"Export Backup"}),c.jsx(Re,{icon:c.jsx($0,{}),loading:N,onClick:()=>{var Ne;return(Ne=F.current)==null?void 0:Ne.click()},children:"Import Backup"}),c.jsx("input",{ref:F,className:"settings-backup-input",hidden:!0,type:"file",accept:".tar.gz,.tgz,application/gzip",onChange:ve})]})]})]})]}),c.jsx(xn,{title:k?"Backup restored":"Import data backup?",open:!!I,onCancel:()=>!N&&(j(null),T(!1)),onOk:()=>k?window.location.reload():xe(),okText:k?"Reload DevBuddy":"Import Backup",okButtonProps:{danger:!k,loading:N},cancelText:"Cancel",closable:!N,maskClosable:!N,children:c.jsx("div",{className:"settings-import-confirm",children:k?c.jsxs("div",{className:"settings-import-complete",children:[c.jsx(Vl,{className:"settings-import-complete-icon"}),c.jsx(Ni,{level:4,children:"Import completed successfully"}),c.jsx(Oi,{children:"Backup data has been restored. Reload DevBuddy to apply the restored settings and files."}),c.jsxs(_n,{type:"secondary",children:[(y==null?void 0:y.importedFiles)||0," files imported."]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"settings-import-file-summary",children:[c.jsx(_n,{type:"secondary",children:"Selected file"}),c.jsx(_n,{strong:!0,children:I==null?void 0:I.name}),c.jsx(_n,{type:"secondary",children:Dm((I==null?void 0:I.size)||0)})]}),c.jsx(Oi,{children:"This backup will be restored into the data directory. Matching files will be overwritten, while other existing files will be kept."}),c.jsx(_n,{type:"warning",children:"Restart DevBuddy after importing so all restored settings take effect."})]})})}),c.jsxs(It,{id:"settings-static-pages",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Mf,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(Ni,{level:4,children:"Static Pages"}),c.jsxs(Oi,{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."," ",K&&!q.some(dI)&&c.jsx("a",{href:"#add-test-demo",onClick:Ne=>{Ne.preventDefault(),Ie()},children:"Add test demo"})]})]}),c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:pe,children:"Add Static Page"})]}),c.jsx(or,{dataSource:q,rowKey:"id",pagination:!1,size:"middle",columns:[{title:"Page Name",dataIndex:"name",key:"name",width:200},{title:"URL",dataIndex:"url",key:"url",render:Ne=>c.jsx("a",{href:Ne,target:"_blank",rel:"noreferrer",children:Ne})},{title:c.jsx("div",{className:"settings-action-column-title",children:"Action"}),key:"action",width:140,align:"right",render:(Ne,$e)=>c.jsxs(ct,{children:[c.jsx(Re,{type:"link",size:"small",icon:c.jsx(Wo,{}),onClick:()=>Ce($e),children:"Edit"}),c.jsx(Gr,{title:"Delete static page?",description:"Are you sure you want to delete this page?",onConfirm:()=>me($e.id),okText:"Yes",cancelText:"No",children:c.jsx(Re,{type:"link",danger:!0,size:"small",icon:c.jsx(Hn,{}),children:"Delete"})})]})}]})]}),c.jsxs(It,{id:"settings-access-tokens",className:"settings-card",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Hve,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(Ni,{level:4,children:"Access Tokens & Domain"}),c.jsx(Oi,{type:"secondary",children:"Tokens are stored locally and are never shown again."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Domain"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"e.g. abc.com"})]}),c.jsx(wt.Item,{name:"domain",rules:[{pattern:/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:"Enter a valid domain, e.g. abc.com"}],children:c.jsx(Ct,{placeholder:"abc.com",allowClear:!0})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"AI API Host"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"e.g. https://api.openai.com/v1"})]}),c.jsx(wt.Item,{name:"aiApiHost",rules:[{validator:(Ne,$e)=>{if(!$e)return Promise.resolve();try{const Ae=new URL($e);if(!["http:","https:"].includes(Ae.protocol)||!Ae.host)throw new Error;return Promise.resolve()}catch{return Promise.reject(new Error("Enter a valid HTTP(S) API host."))}}}],children:c.jsx(Ct,{placeholder:"https://api.openai.com/v1",allowClear:!0})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:"Jira Issue Prefix"}),c.jsx(_n,{type:"secondary",className:"token-row-hint",children:"e.g. PROJ"})]}),c.jsx(wt.Item,{name:"jiraIssuePrefix",children:c.jsx(Ct,{placeholder:"PROJ",allowClear:!0})})]}),Yv.map(({id:Ne,label:$e})=>c.jsxs("div",{className:`token-row ${se(Ne)?"is-configured":""}`,children:[c.jsxs("div",{className:"token-row-info",children:[c.jsxs("div",{className:"token-row-name-line",children:[c.jsx(_n,{strong:!0,className:"token-row-name",children:$e}),se(Ne)&&c.jsx($t,{color:"success",closable:!0,onClose:Ae=>{Ae.preventDefault(),ae(Ne)},className:"token-row-tag",children:"Configured"})]}),c.jsxs(_n,{type:"secondary",className:"token-row-hint",children:[$e," API access token"]})]}),c.jsx(wt.Item,{name:Ne,children:c.jsx(Ct.Password,{placeholder:se(Ne)?"Enter new token to replace":"Paste access token",autoComplete:"off",allowClear:!0})})]},Ne))]})]})]})]})]}),c.jsxs(xn,{className:"settings-storage-modal",title:"Storage Usage Details",open:w,onCancel:()=>$(!1),width:760,footer:[c.jsx(Re,{onClick:ye,loading:C,children:"Refresh Analysis"},"refresh"),c.jsx(Re,{type:"primary",onClick:()=>$(!1),children:"Close"},"close")],children:[c.jsx(Oi,{type:"secondary",className:"settings-storage-description",children:"Size analysis for the DevBuddy data directory, grouped by top-level folder."}),c.jsxs("div",{className:"settings-storage-summary",children:[c.jsxs("div",{children:[c.jsx(_n,{type:"secondary",children:"Total size"}),c.jsx(_n,{strong:!0,children:C?"—":Dm(y==null?void 0:y.sizeBytes)})]}),c.jsxs("div",{children:[c.jsx(_n,{type:"secondary",children:"Files"}),c.jsx(_n,{strong:!0,children:C?"—":((y==null?void 0:y.fileCount)||0).toLocaleString()})]}),c.jsxs("div",{children:[c.jsx(_n,{type:"secondary",children:"Storage groups"}),c.jsx(_n,{strong:!0,children:C?"—":(((De=y==null?void 0:y.breakdown)==null?void 0:De.length)||0).toLocaleString()})]})]}),c.jsx(Ni,{level:5,className:"settings-storage-section-title",children:"Breakdown"}),!C&&!((Te=y==null?void 0:y.breakdown)!=null&&Te.length)?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"The data directory is empty"}):c.jsx(or,{className:"settings-storage-table",dataSource:(y==null?void 0:y.breakdown)||[],rowKey:"path",loading:C,pagination:!1,size:"small",scroll:((Ve=y==null?void 0:y.breakdown)==null?void 0:Ve.length)>6?{y:260}:void 0,columns:[{title:"Location",dataIndex:"name",key:"name",render:(Ne,$e)=>c.jsxs("span",{className:"settings-storage-location",children:[$e.path==="."?c.jsx(Zs,{}):c.jsx(sh,{}),c.jsx(_n,{strong:!0,children:Ne})]})},{title:"Usage",key:"usage",width:250,render:(Ne,$e)=>{const Ae=y!=null&&y.sizeBytes?$e.sizeBytes/y.sizeBytes*100:0;return c.jsxs("div",{className:"settings-storage-usage-cell",children:[c.jsx(mp,{percent:Ae,showInfo:!1,size:"small"}),c.jsxs(_n,{type:"secondary",children:[Ae<.1&&Ae>0?"<0.1":Ae.toFixed(1),"%"]})]})}},{title:"Size",dataIndex:"sizeBytes",key:"sizeBytes",width:90,align:"right",render:Dm},{title:"Files",dataIndex:"fileCount",key:"fileCount",width:75,align:"right",render:Ne=>Ne.toLocaleString()}]}),!!((_e=y==null?void 0:y.largestFiles)!=null&&_e.length)&&c.jsxs(c.Fragment,{children:[c.jsx(Ni,{level:5,className:"settings-storage-section-title",children:"Largest files"}),c.jsx("div",{className:"settings-largest-files",children:y.largestFiles.map(Ne=>c.jsxs("div",{className:"settings-largest-file",children:[c.jsxs("span",{children:[c.jsx(Zs,{}),c.jsx(_n,{ellipsis:{tooltip:Ne.path},children:Ne.path})]}),c.jsx(_n,{strong:!0,children:Dm(Ne.sizeBytes)})]},Ne.path))})]})]}),c.jsx(xn,{title:G?"Edit Static Page":"Add Static Page",open:V,onOk:be,onCancel:()=>W(!1),okText:"Save",confirmLoading:te,destroyOnClose:!0,children:c.jsxs(wt,{form:a,layout:"vertical",className:"settings-page-modal-form",children:[c.jsx(wt.Item,{name:"name",label:"Page Name",rules:[{required:!0,message:"Please enter page name"}],children:c.jsx(Ct,{placeholder:"e.g. test name"})}),c.jsx(wt.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:c.jsx(Ct,{placeholder:"e.g. /pages/welcome/index.html or https://example.com"})})]})})]})}const{Paragraph:hv,Text:Jr}=Cn,zc={npm:{prefix:"",registry:"https://registry.npmjs.org/",strictSsl:!0,cache:"",proxy:"",httpsProxy:""},git:{name:"",email:"",sshKey:""},nvm:{defaultVersion:""}};function Fye(e){const t=String(e||"").replace(/^v/,""),[n="",r=""]=t.split(".");return[n,`${n}.${r}`,e]}function Vye(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"npm-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"npm-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function Uye(){var Ye;const{message:e}=Pr.useApp(),[t]=wt.useForm(),[n,r]=l.useState(!0),[a,o]=l.useState(!1),[s,u]=l.useState(!1),[f,m]=l.useState(!1),[h,p]=l.useState({nodeVersion:"",npmVersion:""}),[v,y]=l.useState({installed:!1,currentVersion:"",defaultVersion:"",nvmDir:"",nodeJsMirror:"",installedVersions:[]}),[b,C]=l.useState(""),[x,w]=l.useState(!1),[$,E]=l.useState([]),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,k]=l.useState(""),[T,z]=l.useState(""),[P,B]=l.useState([]),[H,A]=l.useState(!1),[_,F]=l.useState(!1),[U,q]=l.useState(null),[L,K]=l.useState(""),[X,V]=l.useState([]),[W,G]=l.useState([]),[Y,te]=l.useState(!1),[ne,ce]=l.useState(""),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),[ue,ye]=l.useState("~"),[J,ve]=l.useState(!1),[xe,ze]=l.useState("npm");l.useEffect(()=>{Un.devConfigurations().then(He=>{var nt,ft,vt,qe,je;y(He.nvm||zc.nvm),E(((nt=He.npm)==null?void 0:nt.globalPackages)||[]),p({nodeVersion:((ft=He.npm)==null?void 0:ft.nodeVersion)||"",npmVersion:((vt=He.npm)==null?void 0:vt.npmVersion)||""}),t.setFieldsValue({npm:{...zc.npm,...He.npm},git:{...zc.git,...He.git},nvm:{defaultVersion:((qe=He.nvm)==null?void 0:qe.defaultVersion)||"",nodeJsMirror:((je=He.nvm)==null?void 0:je.nodeJsMirror)||""}})}).catch(He=>nn.error(He.message)).finally(()=>r(!1))},[t]);const fe=async()=>{try{await t.validateFields();const nt=t.getFieldsValue(!0)[xe]||{},ft={section:xe,[xe]:{...zc[xe],...nt}};o(!0);const vt=await Un.saveDevConfigurations(ft);t.setFieldsValue(vt),vt.nvm&&y(vt.nvm),m(!0),window.setTimeout(()=>m(!1),1500)}catch(He){He!=null&&He.errorFields||nn.error(He.message)}finally{o(!1)}},se=async()=>{if(b.trim()){w(!0);try{const He=await lye.install(b.trim());y(He),C(""),nn.success(`Installed Node.js ${He.currentVersion||b.trim()}.`)}catch(He){nn.error(He.message)}finally{w(!1)}}},le=async()=>{var He,nt,ft,vt,qe;N(!0);try{const je=await Un.devConfigurations();E(((He=je.npm)==null?void 0:He.globalPackages)||[]),p({nodeVersion:((nt=je.npm)==null?void 0:nt.nodeVersion)||"",npmVersion:((ft=je.npm)==null?void 0:ft.npmVersion)||""}),je.nvm&&y(je.nvm),t.setFieldsValue({npm:{...zc.npm,...je.npm},git:{...zc.git,...je.git},nvm:{defaultVersion:((vt=je.nvm)==null?void 0:vt.defaultVersion)||"",nodeJsMirror:((qe=je.nvm)==null?void 0:qe.nodeJsMirror)||""}})}catch(je){nn.error(je.message)}finally{N(!1)}},ae=async(He,nt)=>{k(`${He}:${nt}`);try{await qc.manage(He,nt),await le(),e.success(`${nt} ${He==="uninstall"?"uninstalled":"upgraded"}.`)}catch(ft){nn.error(ft.message)}finally{k("")}},pe=async()=>{if(T.trim()){F(!0);try{B(await qc.search(T.trim())),A(!1)}catch(He){nn.error(He.message)}finally{F(!1)}}},Ie=async()=>{if(U){ee(!0);try{const He=L.trim()?`${U.name}@${L.trim()}`:U.name;await qc.manage("install",He),await le(),q(null),B([]),z(""),e.success(`${He} installed.`)}catch(He){nn.error(He.message)}finally{ee(!1)}}},Ce=async He=>{var nt;te(!0),ce(He.name);try{const ft=await qc.versions(He.name),vt=ft.length?ft:He.version?[{version:He.version,publishedAt:""}]:[],qe=He.version||((nt=vt[0])==null?void 0:nt.version)||"";G(vt),K(qe),V(Fye(qe)),q(He)}catch(ft){nn.error(ft.message)}finally{te(!1),ce("")}},me=He=>{ye(t.getFieldValue(["npm",He])||"~"),oe(He)},be=He=>{re&&t.setFieldValue(["npm",re],He),oe(null)},Ee=He=>{t.setFieldValue(["git","sshKey"],He),m(!1),ve(!1)},Me=async He=>{const nt=String(t.getFieldValue(["npm",He])||"").trim();if(!nt){e.info(`Select a ${He} directory first.`);return}try{await Un.openFolder(nt)}catch(ft){e.error(ft.message)}},De=async()=>{u(!0);try{const He=await qc.useSuggestedPrefix();t.setFieldValue(["npm","prefix"],He.prefix),m(!1),e.success(`NPM prefix set to ${He.prefix}.`)}catch(He){e.error(He.message)}finally{u(!1)}},Te=async He=>{const nt=String(He.directory||"").trim();if(!nt){e.error("Package directory is unavailable.");return}try{await Un.revealFolder(nt)}catch(ft){e.error(ft.message)}},Ve=async He=>{try{await navigator.clipboard.writeText(He),e.success(`${He} copied.`)}catch(nt){e.error(nt.message||"Could not copy package name.")}},_e=He=>{t.setFieldValue(["npm",He],zc.npm[He]),m(!1)},Ne=(He,nt)=>c.jsxs("span",{className:"npm-field-label",children:[c.jsx("span",{children:He}),c.jsx(Re,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",onClick:()=>_e(nt),children:"Reset"})]}),$e=[{title:"Package",dataIndex:"name",key:"name",render:(He,nt)=>c.jsxs(ct,{size:4,children:[c.jsx(Re,{type:"text",className:"npm-package-name-button",title:"Copy package name","aria-label":`Copy ${He} package name`,onClick:()=>Ve(He),children:c.jsx(Jr,{code:!0,children:He})}),c.jsx(yn,{title:nt.directory?"Open package directory":"Package directory unavailable",children:c.jsx(Re,{type:"text",className:"npm-package-folder-button",icon:c.jsx(Fr,{}),disabled:!nt.directory,"aria-label":`Open ${He} package directory`,onClick:()=>Te(nt)})})]})},{title:"Version",dataIndex:"version",key:"version",render:He=>c.jsx($t,{children:He||"unknown"})},{title:"Actions",key:"actions",align:"right",render:(He,nt)=>c.jsx("div",{className:"npm-package-actions",children:c.jsx(Gr,{title:`Uninstall ${nt.name}?`,onConfirm:()=>ae("uninstall",nt.name),okText:"Uninstall",okButtonProps:{danger:!0},children:c.jsx(Re,{type:"primary",danger:!0,size:"small",loading:j===`uninstall:${nt.name}`,children:"Uninstall"})})})}],Ae=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon npm-icon",children:c.jsx(wa,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"NPM configuration"}),c.jsx(hv,{type:"secondary",children:"Set the defaults used by npm when installing and publishing packages."})]})]}),c.jsxs("div",{className:"npm-runtime-status",children:[c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current Node.js"}),c.jsx(Jr,{strong:!0,children:h.nodeVersion||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current npm"}),c.jsx(Jr,{strong:!0,children:h.npmVersion||"—"})]})]}),c.jsxs("div",{className:"dev-config-grid",children:[c.jsx(wt.Item,{label:c.jsxs("span",{className:"npm-field-label",children:[c.jsx("span",{children:"Prefix"}),c.jsx(Re,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",onClick:()=>_e("prefix"),children:"Reset"}),c.jsx(Re,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",loading:s,onClick:De,children:"Use suggestion"})]}),name:["npm","prefix"],extra:"Global package installation directory.",children:c.jsx(Ct,{className:"npm-directory-input",prefix:c.jsx(Re,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Fr,{}),onClick:()=>Me("prefix"),"aria-label":"Open Prefix Directory",title:"Open Prefix Directory"}),allowClear:!0,readOnly:!0,placeholder:"/usr/local",addonAfter:c.jsx(Re,{htmlType:"button",type:"text",onClick:()=>me("prefix"),children:"Browse"})})}),c.jsx(wt.Item,{label:Ne("Registry","registry"),name:["npm","registry"],rules:[{type:"url",warningOnly:!0}],children:c.jsx(Ct,{placeholder:"https://registry.npmjs.org/"})}),c.jsx(wt.Item,{label:Ne("Cache","cache"),name:["npm","cache"],extra:"Leave blank to use npm's default cache location.",children:c.jsx(Ct,{className:"npm-directory-input",prefix:c.jsx(Re,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Fr,{}),onClick:()=>Me("cache"),"aria-label":"Open Cache Directory",title:"Open Cache Directory"}),allowClear:!0,readOnly:!0,placeholder:"~/.npm",addonAfter:c.jsx(Re,{htmlType:"button",type:"text",onClick:()=>me("cache"),children:"Browse"})})}),c.jsx(wt.Item,{label:Ne("Proxy","proxy"),name:["npm","proxy"],children:c.jsx(Ct,{placeholder:"http://proxy.example.com:8080"})}),c.jsx(wt.Item,{label:Ne("HTTPS Proxy","httpsProxy"),name:["npm","httpsProxy"],children:c.jsx(Ct,{placeholder:"http://proxy.example.com:8080"})}),c.jsx(wt.Item,{label:"Strict SSL",name:["npm","strictSsl"],valuePropName:"checked",extra:"Verify SSL certificates when connecting to the registry.",children:c.jsx(Ja,{})})]}),c.jsx("div",{className:"npm-global-packages",children:c.jsxs("div",{className:"npm-global-packages-heading",children:[c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"Global packages"}),c.jsx(hv,{type:"secondary",children:"Manage packages installed globally by the system npm."})]}),c.jsxs(Re,{icon:c.jsx(Xa,{}),loading:R,onClick:()=>{I(!0),le()},children:["Manage (",$.length,")"]})]})})]}),We=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon git-icon",children:c.jsx(w0,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"GIT identity"}),c.jsx(hv,{type:"secondary",children:"Configure the author identity Git uses for new commits."})]})]}),c.jsxs("div",{className:"dev-config-grid git-grid",children:[c.jsx(wt.Item,{label:"Name",name:["git","name"],children:c.jsx(Ct,{placeholder:"Ada Lovelace"})}),c.jsx(wt.Item,{label:"Email",name:["git","email"],rules:[{type:"email",warningOnly:!0}],children:c.jsx(Ct,{placeholder:"ada@example.com"})}),c.jsx(wt.Item,{className:"git-ssh-key",label:"SSH Key",name:["git","sshKey"],extra:"Enter a path directly or choose a private key file.",children:c.jsx(Ct,{className:"npm-directory-input",placeholder:"~/.ssh/id_ed25519",prefix:c.jsx(Re,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Zs,{}),"aria-label":"Select SSH Key File",onClick:()=>ve(!0)})})})]})]}),Le=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon nvm-icon",children:c.jsx(wa,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"NVM configuration"}),c.jsx(hv,{type:"secondary",children:"Manage Node.js versions through the system NVM installation."})]})]}),c.jsxs("div",{className:"nvm-status-grid",children:[c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"NVM version"}),c.jsx(Jr,{strong:!0,children:v.version||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current using version"}),c.jsx(Jr,{strong:!0,children:v.currentVersion||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"NVM directory"}),c.jsx(Jr,{strong:!0,children:v.nvmDir||"—"})]})]}),c.jsxs("div",{className:"dev-config-grid nvm-grid",children:[c.jsx(wt.Item,{label:"Node.js download mirror",name:["nvm","nodeJsMirror"],extra:"Saved as NVM_NODEJS_ORG_MIRROR in your shell profile.",children:c.jsx(Ct,{placeholder:"https://nodejs.org/dist"})}),c.jsx(wt.Item,{label:"Default Node.js version",name:["nvm","defaultVersion"],extra:"Applied through nvm alias default when you save.",children:c.jsx(Ct,{placeholder:"20"})}),c.jsx(wt.Item,{label:"Install Node.js version",extra:"Examples: 20, 20.11.1, lts/*",children:c.jsx(Ct,{value:b,onChange:He=>C(He.target.value),addonAfter:c.jsx(Re,{type:"link",loading:x,onClick:se,children:"Install"}),placeholder:"22"})})]}),c.jsxs("div",{className:"nvm-installed-versions",children:[c.jsx(Jr,{type:"secondary",children:"Installed versions"}),c.jsx("div",{children:(Ye=v.installedVersions)!=null&&Ye.length?v.installedVersions.map(He=>c.jsx($t,{children:He},He)):c.jsx(Jr,{type:"secondary",children:"None found"})})]})]}),tt=c.jsxs(xn,{title:"Global packages",open:O,onCancel:()=>!j&&!Z&&I(!1),footer:null,width:760,children:[c.jsxs("div",{className:"npm-install-row",children:[c.jsx(Ct,{value:T,onChange:He=>z(He.target.value),onPressEnter:pe,placeholder:"Search npm packages"}),c.jsx(Re,{type:"primary",loading:_,disabled:!T.trim(),onClick:pe,children:"Search"}),c.jsx(Re,{icon:c.jsx(Xa,{}),loading:R,onClick:le,children:"Refresh"})]}),P.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(Jr,{strong:!0,children:"Search results"}),c.jsx(or,{className:"npm-search-results",rowKey:"name",size:"small",dataSource:H?P:P.slice(0,5),pagination:!1,columns:[{title:"Package",dataIndex:"name",render:He=>c.jsx(Jr,{code:!0,children:He})},{title:"Version",dataIndex:"version"},{title:"Description",dataIndex:"description",ellipsis:!0},{title:"",key:"install",align:"right",render:(He,nt)=>c.jsx(Re,{size:"small",type:"primary",loading:Y&&nt.name===ne,onClick:()=>Ce(nt),children:"Install"})}]}),P.length>5&&c.jsx(Re,{className:"npm-show-more",type:"link",onClick:()=>A(He=>!He),children:H?"Show fewer":`Show more (${P.length-5})`}),c.jsx(cp,{})]}),c.jsx(or,{className:"npm-global-package-table",rowKey:"name",size:"small",loading:R,dataSource:$,columns:$e,pagination:!1,locale:{emptyText:"No global packages found."}})]}),Je=c.jsx(xn,{className:"npm-install-confirm-modal",width:560,title:"Install global package?",open:!!U,onCancel:()=>!Z&&q(null),onOk:Ie,okText:Z?"Installing…":"Install",confirmLoading:Z,closable:!Z,maskClosable:!Z,children:Z?c.jsxs("div",{className:"npm-install-progress",children:[c.jsx(ar,{}),c.jsxs(Jr,{children:["Installing ",c.jsxs("strong",{children:[U==null?void 0:U.name,L?`@${L}`:""]})," globally with npm…"]}),c.jsx(Jr,{type:"secondary",children:"This may take a moment. The package list will refresh when it finishes."})]}):c.jsxs("div",{className:"npm-install-confirm",children:[c.jsx(Jr,{children:"Choose the version to install:"}),c.jsx(Jl,{className:"npm-version-select",popupClassName:"npm-version-picker",value:X,onChange:He=>{const nt=He||[];V(nt),K(nt.length?nt[nt.length-1]:"")},options:Vye(W),placeholder:"Select a version",expandTrigger:"hover",displayRender:He=>He.length?He[He.length-1]:""}),c.jsx(Jr,{type:"secondary",children:"Versions are grouped by major and minor release. Publish dates are shown on the patch version."})]})});return c.jsxs("div",{className:"dev-configurations-page",children:[c.jsx(Ur,{actions:c.jsx(Re,{type:"primary",icon:f?c.jsx(Vl,{}):null,loading:!f&&a,onClick:fe,children:f?"Saved":"Save"}),description:"Read and update the system-level npm and Git configuration used across your development workflow.",eyebrow:"DEVELOPMENT",title:"Dev Configurations"}),c.jsx(ar,{spinning:n,tip:"Loading system configuration…",children:c.jsx(wt,{form:t,layout:"vertical",children:c.jsx(Qa,{activeKey:xe,onChange:ze,items:[{key:"npm",label:"NPM",icon:c.jsx(wa,{}),children:c.jsxs(c.Fragment,{children:[Ae,tt,Je]})},{key:"git",label:"GIT",icon:c.jsx(w0,{}),children:We},{key:"nvm",label:"NVM",icon:c.jsx(wa,{}),disabled:!v.installed,children:Le}]})})}),c.jsx(df,{open:!!re,initialPath:ue,onCancel:()=>oe(null),onSelect:be,title:"Select Project Directory"}),c.jsx(df,{open:J,initialPath:"~",onCancel:()=>ve(!1),onSelect:Ee,selectionType:"file",title:"Select SSH Key File"})]})}const{Title:Wye,Text:Ho,Paragraph:qye}=Cn,{Dragger:Kye}=gp,fI=(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]}`},Gye=e=>({file:e,name:e.name||"clipboard-image.png",url:URL.createObjectURL(e),size:e.size});function Yye(){const[e,t]=l.useState(null),[n,r]=l.useState(null),[a,o]=l.useState(75),[s,u]=l.useState(!0),[f,m]=l.useState(!0),[h,p]=l.useState(!0),[v,y]=l.useState(2),[b,C]=l.useState(!1),[x,w]=l.useState(null),[$,E]=l.useState(100),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,k]=nn.useMessage(),T=l.useRef(null),z=l.useRef(null),P=L=>{var K;(K=L.current)!=null&&K.url&&URL.revokeObjectURL(L.current.url)},B=L=>{var X;if(!((X=L==null?void 0:L.type)!=null&&X.startsWith("image/")))return j.error("Please choose an image file."),!1;P(T),P(z);const K=Gye(L);return T.current=K,z.current=null,t(K),r(null),F(L),!1},H=L=>{var K;return[...((K=L.dataTransfer)==null?void 0:K.types)||[]].includes("Files")},A=L=>{var X;L.preventDefault(),I(!1);const K=[...((X=L.dataTransfer)==null?void 0:X.files)||[]].find(V=>V.type.startsWith("image/"));K?B(K):j.error("Drop an image file to compress it.")};l.useEffect(()=>()=>{P(T),P(z)},[]),l.useEffect(()=>{const L=K=>{var W;const X=[...((W=K.clipboardData)==null?void 0:W.items)||[]].find(G=>G.type.startsWith("image/"));if(!X)return;K.preventDefault();const V=X.getAsFile();V&&(B(new File([V],`clipboard-${Date.now()}.${V.type.split("/")[1]||"png"}`,{type:V.type})),j.success("Image read from clipboard."))};return window.addEventListener("paste",L),()=>window.removeEventListener("paste",L)},[j]);const _=async()=>{var L;try{if(!((L=navigator.clipboard)!=null&&L.read))throw new Error("Direct clipboard reading is unavailable. Paste an image with ⌘ / Ctrl + V instead.");const K=await navigator.clipboard.read();for(const X of K){const V=X.types.find(W=>W.startsWith("image/"));if(V){const W=await X.getType(V);B(new File([W],`clipboard-${Date.now()}.${V.split("/")[1]||"png"}`,{type:V})),j.success("Image read from clipboard.");return}}throw new Error("No image was found in the clipboard.")}catch(K){j.warning(K.message||"Unable to read an image from the clipboard.")}},F=async(L=e==null?void 0:e.file)=>{if(L){N(!0);try{const[{encode:K},{imageData:X,width:V,height:W}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),z9(L,x,$)]),G=await K(X,{quality:a,progressive:s,optimize_coding:f,auto_subsample:h,chroma_subsample:v,trellis_multipass:b});P(z);const Y=new Blob([G],{type:"image/jpeg"}),te={url:URL.createObjectURL(Y),size:Y.size,width:V,height:W};z.current=te,r(te),j.success("MozJPEG compression complete.")}catch(K){j.error(K.message||"Image compression failed.")}finally{N(!1)}}},U=()=>{if(!n)return;const L=e.name.replace(/\.[^.]+$/,"")||"image",K=document.createElement("a");K.href=n.url,K.download=`${L}-mozjpeg.jpg`,K.click()},q=n&&e?Math.round((1-n.size/e.size)*100):null;return c.jsxs(c.Fragment,{children:[k,c.jsxs("div",{className:`squoosh-page ${O?"is-file-dragging":""}`,onDragOver:L=>{H(L)&&(L.preventDefault(),I(!0))},onDragLeave:L=>{L.currentTarget===L.target&&I(!1)},onDrop:A,children:[c.jsx(Ur,{actions:c.jsxs(ct,{children:[c.jsx(Re,{icon:c.jsx(fo,{}),onClick:_,children:"Read clipboard"}),c.jsx(Re,{type:"primary",icon:c.jsx(Yw,{}),onClick:()=>F(),disabled:!e,loading:R,children:"Compress"})]}),description:"Compress JPEG images locally while balancing visual quality and file size.",title:"Image compression"}),c.jsxs("div",{className:"squoosh-studio",children:[c.jsxs("div",{className:"squoosh-preview-area",children:[c.jsx(mI,{title:"Original",detail:e?`${fI(e.size)} · ${e.name}`:"Choose an image to begin",children:e?c.jsx(hI,{label:"Original image",image:e.url}):c.jsxs(Kye,{accept:"image/*",multiple:!1,showUploadList:!1,beforeUpload:B,className:"image-dropzone",children:[c.jsx("p",{className:"ant-upload-drag-icon",children:c.jsx(Ah,{})}),c.jsx("p",{className:"ant-upload-text",children:"Drop an image or click to choose"}),c.jsx("p",{className:"ant-upload-hint",children:"Or paste an image with ⌘ / Ctrl + V."})]})}),c.jsx(mI,{title:"MozJPEG output",detail:n?`${fI(n.size)} · ${n.width} × ${n.height}`:"Waiting for compression",action:n&&c.jsx(Re,{type:"primary",size:"small",icon:c.jsx(ql,{}),onClick:U,children:"Download"}),children:R?c.jsx("div",{className:"image-loading",children:c.jsx(ar,{tip:"Compressing…"})}):n?c.jsxs(c.Fragment,{children:[c.jsx(hI,{label:"Compressed JPEG",image:n.url}),q!==null&&c.jsx("div",{className:`compression-saving ${q>0?"is-saving":""}`,children:q>0?`${q}% smaller`:"No size reduction at current settings."})]}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"Compressed preview"})})]}),c.jsxs("aside",{className:"squoosh-settings",children:[c.jsxs("div",{className:"settings-heading",children:[c.jsx(Ho,{children:"ENCODER"}),c.jsx(Wye,{level:4,children:"MozJPEG"}),c.jsx(qye,{children:"Fine-tune output size and image quality."})]}),c.jsxs("div",{className:"option-row",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Quality"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Higher values preserve more detail."})]}),c.jsx($t,{color:"purple",children:a})]}),c.jsx(ooe,{min:1,max:100,value:a,onChange:o,tooltip:{formatter:L=>`${L}`}}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Long edge"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Scale the longest edge to this value. Never crops the image."})]}),c.jsx(cf,{min:1,max:16384,value:x,onChange:w,placeholder:"Original",addonAfter:"px"})]}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Scale"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Scale the image by percentage."})]}),c.jsx(cf,{min:1,max:100,value:$,onChange:E,placeholder:"100",addonAfter:"%",allowClear:!0})]}),c.jsx(pv,{label:"Progressive JPEG",description:"Display a low-detail preview while loading.",checked:s,onChange:u}),c.jsx(pv,{label:"Optimize coding",description:"Reduce size without changing image quality.",checked:f,onChange:m}),c.jsx(Q0,{ghost:!0,className:"advanced-options",items:[{key:"advanced",label:"Advanced settings",children:c.jsxs(c.Fragment,{children:[c.jsx(pv,{label:"Automatic chroma subsampling",description:"Pick sampling based on the image content.",checked:h,onChange:p}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Chroma subsampling"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Enabled when automatic mode is off."})]}),c.jsx($n,{disabled:h,value:v,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)"}]})]}),c.jsx(pv,{label:"Trellis multi-pass",description:"Further size reduction with a longer encode time.",checked:b,onChange:C})]})}]}),c.jsx(Re,{type:"primary",size:"large",block:!0,icon:c.jsx(Yw,{}),onClick:()=>F(),disabled:!e,loading:R,children:"Compress image"})]})]})]})]})}function mI({title:e,detail:t,action:n,children:r}){return c.jsxs("div",{className:"preview-pane",children:[c.jsxs("header",{children:[c.jsxs("div",{children:[c.jsx(Ho,{children:e}),c.jsx("span",{children:t})]}),n]}),c.jsx("div",{className:"preview-canvas",children:r})]})}function pv({label:e,description:t,checked:n,onChange:r}){return c.jsxs("div",{className:"option-switch",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:e}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:t})]}),c.jsx(Ja,{checked:n,onChange:r})]})}function hI({label:e,image:t,metadata:n}){return c.jsxs("div",{className:"image-panel",children:[c.jsx("img",{src:t,alt:e}),n&&c.jsx("div",{className:"image-panel-meta",children:c.jsx(Ho,{type:"secondary",children:n})})]})}const{Paragraph:Xye,Text:wr}=Cn;function Jye({prs:e,selectedPrKeys:t,onToggleSelectPr:n,onSelectPr:r}){return e.length===0?c.jsx(Xt,{className:"pr-review-empty",description:"No open pull requests found."}):c.jsx("div",{className:"pr-review-list",children:e.map(a=>{var f,m,h,p,v,y,b,C,x;const o=a.reviewUrl||"",s=a.reviewUrl||a.id,u=t.includes(s);return c.jsx(It,{size:"small",hoverable:!0,className:`pr-review-list-item ${u?"is-selected":""}`,onClick:w=>{w.target.closest('.ant-checkbox-wrapper, .ant-checkbox, input[type="checkbox"]')||o&&r(o)},children:c.jsxs("div",{className:"pr-review-list-row",children:[c.jsxs("div",{className:"pr-review-list-primary",children:[c.jsx(nr,{checked:u,onChange:w=>{w.stopPropagation(),n(s)},onClick:w=>w.stopPropagation()}),c.jsxs("div",{className:"pr-review-list-copy",children:[c.jsxs(ct,{size:8,wrap:!0,children:[c.jsxs(wr,{strong:!0,className:"pr-review-list-title",children:["#",a.id," ",a.title]}),a.draft&&c.jsx($t,{color:"gold",children:"Draft"})]}),c.jsxs("div",{className:"pr-review-list-meta",children:[c.jsxs(wr,{type:"secondary",style:{fontWeight:500},children:[(h=(m=(f=a.fromRef)==null?void 0:f.repository)==null?void 0:m.project)==null?void 0:h.key," / ",(v=(p=a.fromRef)==null?void 0:p.repository)==null?void 0:v.slug]}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsx($t,{size:"small",className:"pr-review-branch-tag",children:(y=a.fromRef)==null?void 0:y.displayId}),c.jsx(Qc,{style:{fontSize:"10px"}}),c.jsx($t,{size:"small",className:"pr-review-branch-tag",children:(b=a.toRef)==null?void 0:b.displayId}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsxs("span",{children:["Author: ",c.jsx("strong",{children:(x=(C=a.author)==null?void 0:C.user)==null?void 0:x.displayName})]}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsxs("span",{children:["Updated: ",new Date(a.updatedDate).toLocaleDateString()]})]})]})]}),c.jsxs(ct,{size:8,children:[c.jsx(Re,{size:"small",icon:c.jsx(ul,{}),onClick:w=>{w.stopPropagation(),o&&hr(o)},children:"Open"}),c.jsx(Re,{type:"primary",size:"small",onClick:w=>{w.stopPropagation(),o&&r(o)},children:"Review"})]})]})},s)})})}function pI(){const e=window.location.hash||"";if(e.includes("#/pr-review/detail")){const t=e.indexOf("?");if(t!==-1)return new URLSearchParams(e.slice(t)).get("url")||""}return""}function Qye(e){if(!e)return"";let t=String(e||"").trim();t=t.replace(/^```(?:markdown|md|json)?\s*/i,"").replace(/\s*```$/i,"").trim();const n=/^\{?\s*\\?"?summary\\?"?\s*:\s*\\?"?/i;n.test(t)&&(t=t.replace(n,""),t=t.replace(/\\?"\s*,?\s*\\?"?findings\\?"?\s*:\s*\[[\s\S]*$/i,""),t=t.replace(/\\?"\s*\}?\s*$/i,""),t=t.replace(/\\n/g,`
498
498
  `).replace(/\\"/g,'"').replace(/\\\\/g,"\\").trim());const r=w=>String(w).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),a=w=>r(w).replace(/`([^`]+)`/g,'<code class="pr-review-md-inline-code">$1</code>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*([^*]|$)/g,"$1<em>$2</em>$3").replace(/(^|[^_])_([^_]+)_([^_]|$)/g,"$1<em>$2</em>$3").replace(/~~([^~]+)~~/g,"<del>$1</del>").replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>'),o=e.split(/\r?\n/),s=[];let u=!1,f="",m=[],h=!1,p=!1,v=!1,y=[];const b=()=>{if(y.length===0)return;const[w,...$]=y;let E='<div class="pr-review-md-table-wrapper"><table class="pr-review-md-table">';w&&(E+=`<thead><tr>${w.map(R=>`<th>${R}</th>`).join("")}</tr></thead>`),$.length>0&&(E+=`<tbody>${$.map(R=>`<tr>${R.map(N=>`<td>${N}</td>`).join("")}</tr>`).join("")}</tbody>`),E+="</table></div>",s.push(E),y=[]},C=()=>{h&&(s.push("</ul>"),h=!1),p&&(s.push("</ol>"),p=!1)},x=()=>{v&&(s.push("</blockquote>"),v=!1)};for(let w=0;w<o.length;w++){const $=o[w],E=$.trim();if(E.startsWith("```")){u?(s.push(`<pre class="pr-review-md-code-block"><code class="language-${r(f)}">${m.map(r).join(`
499
499
  `)}</code></pre>`),u=!1,f="",m=[]):(C(),x(),b(),u=!0,f=E.slice(3).trim(),m=[]);continue}if(u){m.push($);continue}if(E.startsWith("|")&&E.endsWith("|")){if(C(),x(),/^\|[\s\-:|]+\|$/.test(E))continue;const O=E.slice(1,-1).split("|").map(I=>a(I.trim()));y.push(O);continue}else b();if(/^(?:---|\*\*\*|___)\s*$/.test(E)){C(),x(),s.push('<hr class="pr-review-md-hr" />');continue}if(/^#{1,6}\s+/.test(E)){C(),x();const O=E.match(/^(#{1,6})\s+/)[1].length,I=a(E.replace(/^#{1,6}\s+/,""));s.push(`<h${O} class="pr-review-md-heading pr-review-md-h${O}">${I}</h${O}>`);continue}if(E.startsWith(">")){C(),v||(s.push('<blockquote class="pr-review-md-blockquote">'),v=!0);const O=a(E.replace(/^>\s*/,""));s.push(`<p>${O}</p>`);continue}else x();const R=E.match(/^[-*]\s+(.*)$/);if(R){p&&(s.push("</ol>"),p=!1),h||(s.push('<ul class="pr-review-md-ul">'),h=!0),s.push(`<li>${a(R[1])}</li>`);continue}const N=E.match(/^(\d+)\.\s+(.*)$/);if(N){h&&(s.push("</ul>"),h=!1),p||(s.push('<ol class="pr-review-md-ol">'),p=!0),s.push(`<li>${a(N[2])}</li>`);continue}C(),E&&s.push(`<p class="pr-review-md-p">${a(E)}</p>`)}return u&&s.push(`<pre class="pr-review-md-code-block"><code>${m.map(r).join(`
@@ -545,7 +545,7 @@ ${O.details||""}`;navigator.clipboard.writeText(I),v(O.id),setTimeout(()=>{v(j=>
545
545
  "repo": "http://bitbucket.abc.com/scm/PROJ/sub-app1.git",
546
546
  "branch": "feature/custom-sub-branch"
547
547
  }
548
- ]`})})]})}),c.jsx(xn,{title:"App List Configurations",open:m,onCancel:()=>h(!1),footer:[c.jsx(Re,{onClick:()=>h(!1),children:"Close"},"close")],width:950,children:c.jsx("div",{className:"branch-sync-modal-body",children:t.length===0?c.jsx(Xt,{description:"No apps configured."}):c.jsx(or,{dataSource:t.map(le=>({...le,key:le.id})),pagination:!1,size:"small",columns:[{title:"Name",dataIndex:"name",key:"name",render:le=>c.jsx(Ca,{strong:!0,children:le})},{title:"Branches",key:"branches",render:(le,ae)=>c.jsxs(ct,{direction:"vertical",size:4,className:"branch-sync-branches-col",children:[c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Release:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.lastReleaseBranch})]}),c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Active:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.activeBranch})]})]})},{title:"Sub-Apps",key:"subAppsCount",render:(le,ae)=>c.jsx(sa,{count:ae.subApps?ae.subApps.length:0,showZero:!0,color:"#64748b"})},{title:"Action",key:"action",render:(le,ae)=>c.jsxs(ct,{size:8,children:[c.jsx(Re,{size:"small",icon:c.jsx(Wo,{}),onClick:()=>ce(ae),children:"Edit"}),c.jsx(Gr,{title:"Delete this app config?",onConfirm:()=>ee(ae.id),okText:"Yes",cancelText:"No",children:c.jsx(Re,{size:"small",danger:!0,icon:c.jsx(Hn,{}),children:"Delete"})})]})}]})})}),c.jsx(xn,{title:`Edit App Config: ${(p==null?void 0:p.name)||""}`,open:y,onOk:Z,onCancel:()=>{b(!1),v(null)},okText:"Save Changes",width:800,destroyOnClose:!0,children:c.jsxs(wt,{className:"branch-sync-modal-form",form:O,layout:"vertical",children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter application name"}],children:c.jsx(Ct,{})}),c.jsx(wt.Item,{name:"repo",label:"Repository",rules:[{required:!0,message:"Please enter repository URL"}],children:c.jsx(Ct,{onChange:le=>W(le.target.value),onBlur:le=>G(le.target.value)})}),c.jsxs(Uo,{gutter:16,children:[c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"activeBranch",label:"Active Branch",rules:[{required:!0,message:"Please select or enter active branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter active branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})}),c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"lastReleaseBranch",label:"Last Release Branch",rules:[{required:!0,message:"Please select or enter last release branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter last release branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})})]}),c.jsx(wt.Item,{name:"subApps",label:"subApps (JSON Array)",extra:'JSON structure: [ { "name": "sub-app1", "repo": "bitbucket@abc.com/xxx.git", "branch": "custom-branch" } ]. If "branch" is omitted, inherits parent active branch.',children:c.jsx(Ct.TextArea,{rows:4})})]})}),c.jsxs(xn,{title:`Create Branch for ${(w==null?void 0:w.name)||"App"}`,open:C,onCancel:()=>{E.creating||(x(!1),$(null))},footer:[c.jsx(Re,{disabled:E.creating,onClick:()=>{x(!1),$(null)},children:E.completed?"Close":"Cancel"},"cancel"),c.jsx(Re,{type:"primary",icon:c.jsx(ou,{}),loading:E.creating,onClick:ye,children:"Create Branch"},"submit")],width:850,destroyOnClose:!0,children:[c.jsx(wt,{className:"branch-sync-modal-form",form:I,layout:"vertical",children:c.jsxs(Uo,{gutter:16,children:[c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"sourceBranch",label:"Source Branch",rules:[{required:!0,message:"Please select or enter source branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter source branch",loading:ne(w==null?void 0:w.repo),options:Array.from(new Map([...w!=null&&w.activeBranch?[{label:`Active Branch (${w.activeBranch})`,value:w.activeBranch}]:[],...w!=null&&w.lastReleaseBranch?[{label:`Last Release Branch (${w.lastReleaseBranch})`,value:w.lastReleaseBranch}]:[],...((fe=q[(ze=w==null?void 0:w.repo)==null?void 0:ze.trim()])==null?void 0:fe.options)||[],...TI].map(le=>[le.value,le])).values()),onFocus:()=>G(w==null?void 0:w.repo)})})}),c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"targetBranch",label:"Target Branch Name",rules:[{required:!0,message:"Please enter target branch name"}],children:c.jsx(Ct,{placeholder:"e.g. feature/v1.2.0"})})})]})}),c.jsxs("div",{className:"branch-sync-create-preview",children:[c.jsxs(Ca,{strong:!0,className:"branch-sync-create-preview-title",children:["Target Repositories (",1+(((se=w==null?void 0:w.subApps)==null?void 0:se.length)||0),")"]}),E.results.length===0?c.jsx(It,{className:"branch-sync-preview-card",size:"small",children:c.jsxs("div",{className:"branch-sync-preview-repos",children:[c.jsxs("div",{children:[c.jsx($t,{color:"purple",children:"Parent App"})," ",c.jsx(Ca,{strong:!0,children:w==null?void 0:w.name})," (",w==null?void 0:w.repo,")"]}),((w==null?void 0:w.subApps)||[]).map((le,ae)=>c.jsxs("div",{className:"branch-sync-preview-subitem",children:[c.jsx($t,{className:"branch-sync-branch-tag",children:"Sub-App"})," ",c.jsx(Ca,{strong:!0,children:le.name||le.directory||""})," (",le.repo,")"]},ae))]})}):c.jsx(Ra,{className:"branch-sync-result-list",size:"small",bordered:!0,dataSource:E.results,renderItem:le=>c.jsxs(Ra.Item,{className:"branch-sync-result-item",children:[c.jsxs("div",{className:"branch-sync-result-row",children:[c.jsxs(ct,{size:8,children:[c.jsx($t,{color:le.isParent?"purple":"cyan",children:le.isParent?"Parent App":"Sub-App"}),c.jsx(Ca,{strong:!0,className:"branch-sync-result-name",children:le.name}),c.jsxs(Ca,{type:"secondary",className:"branch-sync-result-repo",children:["(",le.repo,")"]})]}),c.jsx("div",{children:le.status==="creating"?c.jsx($t,{icon:c.jsx(ar,{size:"small"}),color:"purple",children:"Creating..."}):le.success?c.jsx($t,{icon:c.jsx(vi,{}),color:"success",children:"Created"}):c.jsx($t,{icon:c.jsx(YR,{}),color:"error",children:"Failed"})})]}),le.error&&c.jsx(mr,{className:"branch-sync-result-error",type:"error",message:`Creation Error: ${le.error}`,showIcon:!0})]})})]})]})]})}const{Text:In,Paragraph:_be}=Cn,Qw={safe:{color:"success",icon:c.jsx(vi,{}),label:"Safe to delete"},review:{color:"warning",icon:c.jsx(Dh,{}),label:"Review"},keep:{color:"default",icon:c.jsx(Wl,{}),label:"Keep"},blocked:{color:"error",icon:c.jsx(P9,{}),label:"Blocked"}};function Jv(e,t="Unknown"){if(!e)return t;const n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Bbe(e){if(!e)return{date:"Unknown",time:""};const t=new Date(e);return Number.isNaN(t.getTime())?{date:"Unknown",time:""}:{date:t.toLocaleDateString(),time:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}function qC(e){return e==null?"Unknown":e===0?"Today":e===1?"1 day ago":`${e} days ago`}function KC(e){const t=Qw[e==null?void 0:e.status]||Qw.keep;return c.jsx($t,{color:t.color,icon:t.icon,children:t.label})}function Lm({label:e,value:t,color:n}){return c.jsx(It,{className:"branch-health-stat-card",children:c.jsx(cl,{title:e,value:t,valueStyle:n?{color:n}:void 0})})}function Hbe(e){const t=new Map;return(e||[]).forEach(n=>{var o;const r=((o=n.repository)==null?void 0:o.name)||"Unknown repository",a=t.get(r)||{name:r,records:[]};a.records.push(n),t.set(r,a)}),[...t.values()]}function Fbe({open:e,loading:t,records:n,onClose:r}){const a=Hbe(n),[o,s]=l.useState(()=>new Set),u=f=>{s(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h})};return c.jsx(xn,{className:"branch-health-history-modal",title:"Operation history",open:e,onCancel:r,footer:null,width:700,destroyOnClose:!0,children:t?c.jsx("div",{className:"branch-health-history-loading",children:c.jsx(ar,{})}):a.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches have been deleted from this page yet."}):c.jsx("div",{className:"branch-health-history-groups",children:a.map(f=>c.jsxs("section",{className:`branch-health-history-group${o.has(f.name)?" is-collapsed":""}`,children:[c.jsxs("button",{type:"button",className:"branch-health-history-group-header","aria-expanded":!o.has(f.name),onClick:()=>u(f.name),children:[c.jsxs("div",{className:"branch-health-history-repository-name",children:[c.jsx("span",{className:"branch-health-history-repository-icon",children:c.jsx(Fr,{})}),c.jsxs("div",{className:"branch-health-history-repository-copy",children:[c.jsx(In,{className:"branch-health-history-repository-label",children:"Repository"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:f.name},children:f.name})]})]}),c.jsxs("span",{className:"branch-health-history-group-controls",children:[c.jsxs(In,{type:"secondary",className:"branch-health-history-count",children:[f.records.length," ",f.records.length===1?"operation":"operations"]}),c.jsx(Cu,{className:`branch-health-history-collapse-icon${o.has(f.name)?" is-collapsed":""}`})]})]}),!o.has(f.name)&&c.jsx(Ra,{size:"small",dataSource:f.records,renderItem:m=>c.jsx(Ra.Item,{children:c.jsxs("div",{className:"branch-health-history-record",children:[c.jsxs("div",{className:"branch-health-history-branch",children:[c.jsx(ou,{className:"branch-health-history-branch-icon"}),c.jsx(In,{code:!0,ellipsis:{tooltip:m.branch},children:m.branch})]}),c.jsxs(In,{type:"secondary",className:"branch-health-history-record-meta",children:[c.jsx("span",{className:"branch-health-history-action",children:"Deleted"}),c.jsx("span",{children:Jv(m.deletedAt)})]})]})})})]},f.name))})})}function Vbe(){var be,Ee,Me,De,Te,Ve,_e,Ne,$e,Ae,We,Le,tt,Je,Ye,He,nt,ft,vt;const{message:e}=Pr.useApp(),[t,n]=l.useState(""),[r,a]=l.useState([]),[o,s]=l.useState(""),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(!1),[y,b]=l.useState(!1),[C,x]=l.useState(""),[w,$]=l.useState(!1),[E,R]=l.useState("all"),[N,O]=l.useState("all"),[I,j]=l.useState(void 0),[k,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,_]=l.useState(null),[F,U]=l.useState(!1),[q,L]=l.useState(!1),[K,X]=l.useState(""),[V,W]=l.useState(!1),[G,Y]=l.useState(!1),[te,ne]=l.useState(!1),[ce,Z]=l.useState([]),[ee,re]=l.useState(!1),oe=async(qe,je="")=>{var Be;if(qe){h(!0);try{const Ge=await Tm.repositories(qe),Xe=Ge.repositories||[];n(Ge.workspaceDir||qe),a(Xe);const Qe=je&&Xe.some(it=>it.path===je)?je:((Be=Xe[0])==null?void 0:Be.path)||"";s(Qe),j(void 0),f(null),Qe&&await ue(Qe)}catch(Ge){a([]),s(""),f(null),e.error(Ge.message||"Unable to find Git repositories.")}finally{h(!1)}}},ue=async(qe=o)=>{if(qe){v(!0);try{f(await Tm.scan(qe)),T(null)}catch(je){e.error(je.message||"Unable to scan branches.")}finally{v(!1)}}},ye=async qe=>{var je;H(qe),_(null),X(""),U(!!qe.hasLocal),L(!1),P(!0),W(!0);try{const Be=await Tm.preflight(o,qe.name);_(Be),U(!!((je=Be.checks)!=null&&je.localDeletionAllowed)),L(!1)}catch(Be){e.error(Be.message||"Unable to check whether this branch can be deleted.")}finally{W(!1)}},J=(qe=!1)=>{G&&!qe||(P(!1),H(null),_(null))},ve=async()=>{if(!(!B||!o)){Y(!0);try{const qe=await Tm.remove(o,B.name,{deleteLocal:F,deleteRemote:q,confirmName:K});f(qe),T(null),J(!0),qe.success?e.success(`${B.name} deleted.`):e.warning("The branch was only partially deleted. Check the result details.")}catch(qe){e.error(qe.message||"Unable to delete branch."),qe!=null&&qe.checks&&_({checks:qe.checks,branch:qe.branch})}finally{Y(!1)}}},xe=async()=>{re(!0);try{const qe=await Tm.history();Z(qe.history||[])}catch(qe){e.error(qe.message||"Unable to load branch operation history.")}finally{re(!1)}},ze=()=>{ne(!0),xe()};l.useEffect(()=>{let qe=!0;return So.config().then(je=>{if(!(!qe||!je.workspaceDir))return n(je.workspaceDir),oe(je.workspaceDir)}).catch(()=>{}),()=>{qe=!1}},[]);const fe=(u==null?void 0:u.branches)||[],se=l.useMemo(()=>{const qe=new Map;return fe.forEach(je=>{var Xe,Qe;const Be=String(((Xe=je.creator)==null?void 0:Xe.name)||((Qe=je.creator)==null?void 0:Qe.email)||"Unknown").trim()||"Unknown",Ge=Be.toLocaleLowerCase();qe.has(Ge)||qe.set(Ge,{value:Ge,label:Be})}),[...qe.values()].sort((je,Be)=>je.label.localeCompare(Be.label))},[fe]),le=l.useMemo(()=>{if(!w||!C.trim())return null;try{return new RegExp(C.trim(),"i")}catch{return}},[C,w]),ae=l.useMemo(()=>{const qe=C.trim().toLowerCase();return w&&qe&&!le?[]:fe.filter(je=>{var Xe,Qe,it,ut,pt;if(E!=="all"&&((Xe=je.health)==null?void 0:Xe.status)!==E||N==="merged"&&!je.merged||N==="unmerged"&&je.merged)return!1;const Be=String(((Qe=je.creator)==null?void 0:Qe.name)||((it=je.creator)==null?void 0:it.email)||"Unknown").trim().toLocaleLowerCase()||"unknown";if(I&&Be!==I)return!1;if(!qe)return!0;const Ge=[je.name,(ut=je.creator)==null?void 0:ut.name,(pt=je.lastCommit)==null?void 0:pt.subject,je.mergedInto].filter(Boolean).join(" ");return w?le.test(Ge):Ge.toLowerCase().includes(qe)})},[fe,I,N,C,w,le,E]),pe=l.useMemo(()=>({all:fe.length,safe:fe.filter(qe=>{var je;return((je=qe.health)==null?void 0:je.status)==="safe"}).length,merged:fe.filter(qe=>qe.merged).length,stale:fe.filter(qe=>qe.ageDays>=90).length,blocked:fe.filter(qe=>{var je;return((je=qe.health)==null?void 0:je.status)==="blocked"}).length}),[fe]),Ie=[{title:"Branch",dataIndex:"name",key:"name",width:230,sorter:(qe,je)=>qe.name.localeCompare(je.name),render:(qe,je)=>c.jsxs("div",{className:"branch-health-branch-cell",children:[c.jsxs(ct,{size:6,wrap:!0,children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe},children:qe})]}),c.jsxs("div",{className:"branch-health-inline-meta",children:[c.jsx($t,{children:je.source}),je.current&&c.jsx($t,{color:"blue",children:"Current"}),je.protected&&c.jsx($t,{color:"red",children:"Protected"})]})]})},{title:"Health",key:"health",width:150,sorter:(qe,je)=>{var Be,Ge;return(((Be=je.health)==null?void 0:Be.score)||0)-(((Ge=qe.health)==null?void 0:Ge.score)||0)},defaultSortOrder:"descend",render:(qe,je)=>{var Be;return c.jsxs("div",{className:"branch-health-health-cell",children:[KC(je.health),c.jsxs(In,{type:"secondary",children:["Priority ",((Be=je.health)==null?void 0:Be.score)||0]})]})}},{title:"Created",key:"createdAt",width:190,sorter:(qe,je)=>(Date.parse(qe.createdAt||"")||0)-(Date.parse(je.createdAt||"")||0),render:(qe,je)=>{const Be=Bbe(je.createdAt);return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Be.date}),Be.time&&c.jsx(In,{children:Be.time}),c.jsx(In,{type:"secondary",children:je.createdAtSource})]})}},{title:"Creator",key:"creator",width:150,render:(qe,je)=>{var Be,Ge;return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{ellipsis:{tooltip:((Be=je.creator)==null?void 0:Be.name)||"Unknown"},children:((Ge=je.creator)==null?void 0:Ge.name)||"Unknown"}),c.jsx(In,{type:"secondary",children:"First commit author"})]})}},{title:"Last commit",key:"lastCommit",width:290,sorter:(qe,je)=>{var Be,Ge;return(Date.parse(((Be=qe.lastCommit)==null?void 0:Be.committedAt)||"")||0)-(Date.parse(((Ge=je.lastCommit)==null?void 0:Ge.committedAt)||"")||0)},render:(qe,je)=>{var Be,Ge,Xe,Qe,it;return c.jsxs("div",{className:"branch-health-commit-cell",children:[c.jsx(In,{ellipsis:{tooltip:(Be=je.lastCommit)==null?void 0:Be.subject},children:((Ge=je.lastCommit)==null?void 0:Ge.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Xe=je.lastCommit)==null?void 0:Xe.shortHash}),c.jsx(In,{type:"secondary",children:qC(je.ageDays)})]}),c.jsxs(In,{type:"secondary",children:["by ",((it=(Qe=je.lastCommit)==null?void 0:Qe.author)==null?void 0:it.name)||"Unknown"]})]})}},{title:"Last merged into",key:"mergedInto",width:190,render:(qe,je)=>je.mergedInto?c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx($t,{color:"green",children:je.mergedInto}),c.jsx(In,{type:"secondary",children:je.mergeSource})]}):c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{type:"secondary",children:"Not found"}),c.jsx(In,{type:"secondary",children:"No containing local ref"})]})},{title:"Relation",key:"relation",width:130,render:(qe,je)=>c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:je.ahead==null?"Not analyzed":`${je.ahead} ahead`}),c.jsx(In,{children:je.behind==null?"Not analyzed":`${je.behind} behind`}),c.jsx(In,{type:"secondary",children:je.commitCount==null?"Not analyzed":`${je.commitCount} commits`})]})},{title:"Details",key:"details",fixed:"right",width:88,render:(qe,je)=>c.jsx(Re,{type:"link",onClick:()=>T(je),children:"View"})}],Ce=async qe=>{b(!1),n(qe),await oe(qe)},me=async()=>{if(t)try{await Un.openFolder(t)}catch(qe){e.error(qe.message||"Unable to open the workspace directory.")}};return c.jsxs("div",{className:"branch-health-page",children:[c.jsx(Ur,{title:"Branch Health",description:"Find stale or already merged branches before deciding what to clean up.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Re,{icon:c.jsx(M9,{}),onClick:ze,children:"Operation history"}),c.jsx(Re,{icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Browse workspace"}),c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:()=>ue(),loading:p,disabled:!o,children:"Refresh"})]})}),c.jsxs(It,{className:"branch-health-repository-card",children:[c.jsxs(ct,{size:"large",className:"branch-health-summary",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:me,disabled:!t,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(In,{ellipsis:{tooltip:t||"Not configured"},children:t||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:r.length})]})]}),c.jsx("div",{className:"branch-health-repository-row",children:c.jsxs("div",{className:"branch-health-repository-picker",children:[c.jsx(In,{type:"secondary",children:"Repository"}),c.jsx($n,{className:"branch-health-repository-select",showSearch:!0,value:o||void 0,placeholder:"Select a Git repository",loading:m,options:r.map(qe=>({label:qe.name,value:qe.path})),optionFilterProp:"label",onChange:qe=>{s(qe),j(void 0),ue(qe)},notFoundContent:m?c.jsx(ar,{size:"small"}):"No Git repositories found"})]})})]}),u&&c.jsxs(c.Fragment,{children:[c.jsxs(Uo,{gutter:[12,12],className:"branch-health-stat-row",children:[c.jsx(Wn,{xs:12,sm:8,lg:4,children:c.jsx(Lm,{label:"All branches",value:pe.all})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Recommended cleanup",value:pe.safe,color:"#389e0d"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Already merged",value:pe.merged,color:"#1677ff"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Stale > 90 days",value:pe.stale,color:"#d48806"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Protected / blocked",value:pe.blocked,color:"#cf1322"})})]}),c.jsxs(It,{className:"branch-health-table-card",children:[c.jsxs("div",{className:"branch-health-toolbar",children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:w?"Regex: e.g. ^feature/.*$":"Search branch, creator, commit...",value:C,status:w&&C.trim()&&!le?"error":void 0,onChange:qe=>x(qe.target.value)}),c.jsx(nr,{checked:w,onChange:qe=>$(qe.target.checked),children:"Regex"}),w&&C.trim()&&!le&&c.jsx(In,{type:"danger",children:"Invalid regular expression"}),c.jsx($n,{value:E,onChange:R,options:[{value:"all",label:"All health states"},...Object.entries(Qw).map(([qe,je])=>({value:qe,label:je.label}))]}),c.jsx($n,{value:N,onChange:O,options:[{value:"all",label:"All merge states"},{value:"merged",label:"Merged"},{value:"unmerged",label:"Not merged"}]}),c.jsx($n,{className:"branch-health-creator-filter",allowClear:!0,showSearch:!0,value:I,onChange:j,placeholder:"Filter by creator",options:se,optionFilterProp:"label",filterOption:(qe,je)=>`${(je==null?void 0:je.label)||""} ${(je==null?void 0:je.value)||""}`.toLowerCase().includes(qe.toLowerCase())}),c.jsxs(In,{type:"secondary",className:"branch-health-result-count",children:[ae.length," shown"]})]}),c.jsx(or,{rowKey:"id",size:"small",columns:Ie,dataSource:ae,loading:p,pagination:{pageSize:20,showSizeChanger:!1,hideOnSinglePage:!0},scroll:{x:1440},locale:{emptyText:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})}}),c.jsx("div",{className:"branch-health-mobile-list",children:ae.length?ae.map(qe=>{var je,Be,Ge,Xe,Qe;return c.jsxs(It,{size:"small",className:"branch-health-mobile-card",children:[c.jsxs("div",{className:"branch-health-mobile-card-header",children:[c.jsxs("div",{className:"branch-health-mobile-branch",children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe.name},children:qe.name})]}),KC(qe.health)]}),c.jsxs("div",{className:"branch-health-mobile-source",children:[c.jsx($t,{children:qe.source}),qe.current&&c.jsx($t,{color:"blue",children:"Current"}),qe.protected&&c.jsx($t,{color:"red",children:"Protected"})]}),c.jsxs("div",{className:"branch-health-mobile-commit",children:[c.jsx(In,{ellipsis:{tooltip:(je=qe.lastCommit)==null?void 0:je.subject},children:((Be=qe.lastCommit)==null?void 0:Be.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Ge=qe.lastCommit)==null?void 0:Ge.shortHash}),c.jsx(In,{type:"secondary",children:qC(qe.ageDays)})]})]}),c.jsxs("div",{className:"branch-health-mobile-grid",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Created"}),c.jsx(In,{children:Jv(qe.createdAt)})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Creator"}),c.jsx(In,{ellipsis:{tooltip:(Xe=qe.creator)==null?void 0:Xe.name},children:((Qe=qe.creator)==null?void 0:Qe.name)||"Unknown"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Merged into"}),c.jsx(In,{children:qe.mergedInto||"Not found"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Relation"}),c.jsxs(In,{children:[qe.ahead," ahead"]}),c.jsxs(In,{children:[qe.behind," behind"]})]})]}),c.jsx(Re,{block:!0,type:"link",onClick:()=>T(qe),children:"View details"})]},qe.id)}):c.jsx(Xt,{className:"branch-health-mobile-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})})]})]}),!u&&!m&&!p&&c.jsx(It,{className:"branch-health-empty-card",children:c.jsx(Xt,{description:r.length?"Select a repository to scan its branches.":"Select a workspace folder containing Git repositories.",children:c.jsx(Re,{type:"primary",icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Choose workspace"})})}),c.jsx(I$,{title:(k==null?void 0:k.name)||"Branch details",width:540,open:!!k,onClose:()=>T(null),children:k&&c.jsxs("div",{className:"branch-health-detail",children:[c.jsxs("div",{className:"branch-health-detail-status",children:[KC(k.health),c.jsxs(In,{type:"secondary",children:["Priority ",((be=k.health)==null?void 0:be.score)||0]})]}),c.jsx(_be,{type:"secondary",children:((Ee=k.reasons)==null?void 0:Ee.join(" · "))||"No additional recommendation details."}),c.jsxs(_o,{column:1,size:"small",bordered:!0,children:[c.jsx(_o.Item,{label:"Source",children:k.source}),c.jsxs(_o.Item,{label:"Created",children:[Jv(k.createdAt)," (",k.createdAtSource,")"]}),c.jsxs(_o.Item,{label:"Creator",children:[((Me=k.creator)==null?void 0:Me.name)||"Unknown"," ",c.jsxs(In,{type:"secondary",children:["(",((De=k.creator)==null?void 0:De.email)||"no email",")"]})]}),c.jsx(_o.Item,{label:"Current branch",children:k.current?"Yes — deletion blocked":"No"}),c.jsx(_o.Item,{label:"Protected pattern",children:k.protected?"Yes — deletion blocked":"No"}),c.jsxs(_o.Item,{label:"Last commit",children:[(Te=k.lastCommit)==null?void 0:Te.shortHash," · ",(Ve=k.lastCommit)==null?void 0:Ve.subject]}),c.jsx(_o.Item,{label:"Commit author",children:((Ne=(_e=k.lastCommit)==null?void 0:_e.author)==null?void 0:Ne.name)||"Unknown"}),c.jsxs(_o.Item,{label:"Last updated",children:[Jv(($e=k.lastCommit)==null?void 0:$e.committedAt)," (",qC(k.ageDays),")"]}),c.jsx(_o.Item,{label:"Last merged into",children:k.analysisSkipped?"Not analyzed":k.mergedInto||"Not found in local refs"}),c.jsx(_o.Item,{label:"Merge evidence",children:k.mergeSource}),c.jsx(_o.Item,{label:"Relation to default",children:k.analysisSkipped?"Not analyzed (last commit older than one year)":`${k.ahead} ahead · ${k.behind} behind`})]}),c.jsx(mr,{className:"branch-health-detail-alert",type:((Ae=k.health)==null?void 0:Ae.status)==="safe"?"success":"info",showIcon:!0,icon:c.jsx(J$,{}),message:"Deletion requires a fresh safety check",description:"Branch deletion will re-check merge state and checkout state on the server before changing any refs."}),c.jsxs("div",{className:"branch-health-detail-actions",children:[c.jsx(Re,{danger:!0,disabled:((We=k.name)==null?void 0:We.toLowerCase())==="master",onClick:()=>ye(k),children:"Delete branch"}),((Le=k.name)==null?void 0:Le.toLowerCase())==="master"&&c.jsx(In,{type:"secondary",children:"The master branch cannot be deleted."})]})]})}),c.jsx(xn,{title:`Delete ${(B==null?void 0:B.name)||"branch"}?`,open:z,onCancel:J,onOk:ve,okText:"Delete branch",okButtonProps:{danger:!0,disabled:V||!(A!=null&&A.canDelete)||!F&&!q||K!==(B==null?void 0:B.name)},confirmLoading:G,destroyOnClose:!0,children:V?c.jsx("div",{className:"branch-health-delete-loading",children:c.jsx(ar,{})}):A&&B?c.jsxs("div",{className:"branch-health-delete-dialog",children:[(Je=(tt=A.checks)==null?void 0:tt.blockers)!=null&&Je.length?c.jsx(mr,{type:"error",showIcon:!0,message:"Deletion blocked",description:A.checks.blockers.join(" ")}):c.jsx(mr,{type:((Ye=B.health)==null?void 0:Ye.status)==="safe"?"success":"warning",showIcon:!0,message:((He=B.health)==null?void 0:He.status)==="safe"?"This branch passed the safety check.":"This branch passed the hard safety checks, but review the evidence first.",description:`${B.mergedInto?`Merged into ${B.mergedInto}. `:""}${B.ahead} commits ahead of the default branch.`}),c.jsxs("div",{className:"branch-health-delete-targets",children:[c.jsx(In,{strong:!0,children:"Delete targets"}),c.jsx(nr,{checked:F,disabled:!((nt=A.checks)!=null&&nt.localDeletionAllowed),onChange:qe=>U(qe.target.checked),children:"Local branch"}),c.jsx(nr,{checked:q,disabled:!((ft=A.checks)!=null&&ft.remoteDeletionAllowed),onChange:qe=>L(qe.target.checked),children:"Remote origin branch"})]}),c.jsxs("div",{className:"branch-health-delete-confirm",children:[c.jsx(In,{strong:!0,children:"Type the exact branch name to confirm"}),c.jsx(Ct,{value:K,onChange:qe=>X(qe.target.value),placeholder:B.name,autoComplete:"off"})]}),((vt=A.results)==null?void 0:vt.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Previous attempt result",description:A.results.map(qe=>`${qe.target}: ${qe.success?"deleted":qe.error}`).join(" · ")})]}):c.jsx(Xt,{description:"Safety check unavailable."})}),c.jsx(Fbe,{open:te,loading:ee,records:ce,onClose:()=>ne(!1)}),c.jsx(df,{open:y,initialPath:t||"~",onCancel:()=>b(!1),onSelect:Ce,title:"Choose workspace folder"})]})}const{Text:oo}=Cn,GC={running:["processing","Running"],queued:["default","Queued"],success:["success","Success"],failed:["error","Failed"],completed:["success","Completed"]};function Ube(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");if(!o)return;t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"package-upgrade-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"package-upgrade-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function Wbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState({workspaceDir:"",repos:[],tasks:[]}),[r,a]=l.useState(!1),[o,s]=l.useState(!1),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(null),[y]=wt.useForm(),[b]=wt.useForm(),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState([]),[N,O]=l.useState(!1),[I,j]=l.useState([]),[k,T]=l.useState([]),[z,P]=l.useState(!1),B=async()=>{try{const W=await So.config();n(W),f(G=>G?W.tasks.find(Y=>Y.id===G.id)||G:null)}catch(W){e.error(W.message)}};l.useEffect(()=>{if(r||o||m)return;B();const W=setInterval(B,2500);return()=>clearInterval(W)},[r,o,m]),l.useEffect(()=>{if(!(u!=null&&u.id)||["completed","failed","success"].includes(u.status))return;let W=!0;const G=async()=>{try{const te=await So.config();if(!W)return;n(te);const ne=te.tasks.find(ce=>ce.id===u.id);ne&&f(ne)}catch{}};G();const Y=setInterval(G,1e3);return()=>{W=!1,clearInterval(Y)}},[u==null?void 0:u.id,u==null?void 0:u.status]);const H=l.useMemo(()=>[...new Set(t.tasks.map(W=>W.packageName).filter(Boolean))],[t.tasks]),A=wt.useWatch("packageName",y),_=wt.useWatch("version",y),F=wt.useWatch("repoIds",y)||[],U=F.length?C:H;l.useEffect(()=>{A&&_&&y.setFieldValue("commitMessage",`upgrade ${A} to ${_}`)},[A,_]),l.useEffect(()=>{if(!F.length){x([]);return}let W=!0;return $(!0),So.packageNames(F).then(G=>{W&&x(G)}).catch(()=>{W&&x([])}).finally(()=>{W&&$(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{if(!F.length){T([]),y.setFieldValue("targetBranch","");return}let W=!0;return P(!0),So.branches(F).then(G=>{if(!W)return;T(G);const Y=y.getFieldValue("targetBranch");Y&&!G.some(te=>te.name===Y)&&y.setFieldValue("targetBranch","")}).catch(()=>{W&&T([])}).finally(()=>{W&&P(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{const W=String(A||"").trim();if(!W){R([]);return}let G=!0;const Y=setTimeout(async()=>{O(!0);try{const te=await qc.versions(W);G&&R(te.filter(ne=>typeof ne=="string"?ne:ne.version))}catch{G&&R([])}finally{G&&O(!1)}},350);return()=>{G=!1,clearTimeout(Y)}},[A]);const q=async()=>{if(t.workspaceDir)try{await Un.openFolder(t.workspaceDir)}catch(W){e.error(W.message)}},L=async W=>{try{await So.addRepo(W),b.resetFields(),h(!1),B()}catch(G){e.error(G.message)}},K=async W=>{v(W.id);try{await So.cloneRepo(W.id),e.success(`${W.name} cloned`),await B()}catch(G){e.error(G.message)}finally{v(null)}},X=async W=>{try{const G=await So.createTask(W);s(!1),y.resetFields(),f(G),await B(),e.success("Task started")}catch(G){e.error(G.message)}},V=[{title:"Repository",dataIndex:"name",render:(W,G)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(oo,{strong:!0,children:G.name}),c.jsx(oo,{type:"secondary",children:G.message||""})]})},{title:"Status",dataIndex:"status",render:W=>{const[G,Y]=GC[W]||["default",W];return c.jsx($t,{color:G,children:Y})}},{title:"PR",dataIndex:"prUrl",render:W=>W?c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open PR"}):"—"}];return c.jsxs("div",{className:"package-upgrade-page",children:[c.jsx(Ur,{title:"Package Upgrade",description:"Upgrade one package across multiple repositories and open Bitbucket pull requests.",actions:c.jsxs(ct,{children:[c.jsx(Re,{icon:c.jsx(Gl,{}),onClick:()=>a(!0),children:"Repository list"}),c.jsx(Re,{type:"primary",icon:c.jsx(Z$,{}),onClick:()=>s(!0),disabled:!t.repos.length,children:"Create task"})]})}),c.jsx(It,{className:"package-upgrade-summary",children:c.jsxs(ct,{size:"large",children:[c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(oo,{ellipsis:{tooltip:t.workspaceDir||"Not configured"},children:t.workspaceDir||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:t.repos.length})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Task history"}),c.jsx("div",{className:"summary-value",children:t.tasks.length})]})]})}),c.jsx(It,{title:"Operation history",className:"package-upgrade-card",children:t.tasks.length?c.jsx(Ra,{dataSource:t.tasks,renderItem:W=>{var G;return c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[W.packageName," → ",W.version]}),c.jsx($t,{color:W.status==="failed"?"error":W.status==="running"?"processing":"success",children:W.status})]}),description:c.jsxs(oo,{type:"secondary",children:[W.sourceBranch," → ",W.targetBranch," · ",((G=W.repos)==null?void 0:G.length)||W.repoIds.length," repositories · ",new Date(W.createdAt).toLocaleString()]})}),c.jsx(Re,{onClick:()=>f(W),children:"Details"})]})}}):c.jsx(oo,{type:"secondary",children:"No package upgrade tasks yet."})}),c.jsxs(xn,{title:"Repository list",open:r,onCancel:()=>a(!1),footer:null,width:760,children:[c.jsxs("div",{className:"package-upgrade-workspace-readonly",children:[c.jsxs("div",{children:[c.jsx(oo,{strong:!0,children:"Workspace directory"}),c.jsx(oo,{type:"secondary",children:"Read-only path used for local repositories"})]}),c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly package-upgrade-workspace-path-control",children:c.jsx(Ct,{value:t.workspaceDir||"",placeholder:"Not configured",readOnly:!0,prefix:c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"})})})]}),c.jsxs("div",{className:"repo-list-header",children:[c.jsx(oo,{strong:!0,children:"Repository list"}),c.jsx(Re,{size:"small",icon:c.jsx(Xn,{}),onClick:()=>h(!0),children:"Add repo"})]}),c.jsx(Ra,{className:"package-upgrade-repo-list",size:"small",dataSource:t.repos,renderItem:W=>c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{size:10,children:[c.jsx("span",{children:W.name}),c.jsx($t,{color:W.cloned?"success":"default",children:W.cloned?"Cloned":"Not cloned"})]}),description:W.url}),c.jsxs("div",{className:"package-upgrade-repo-actions",children:[c.jsx("span",{className:"package-upgrade-clone-slot",children:!W.cloned&&c.jsx(Re,{type:"link",icon:c.jsx(Cge,{}),loading:p===W.id,onClick:()=>K(W),"aria-label":"Clone repository",title:"Clone repository"})}),c.jsx(Gr,{title:"Remove repository?",onConfirm:async()=>{await So.removeRepo(W.id),B()},children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),"aria-label":"Delete repository",title:"Delete repository"})})]})]})})]}),c.jsx(xn,{title:"Add repository",open:m,onCancel:()=>h(!1),footer:null,children:c.jsxs(wt,{form:b,layout:"vertical",onFinish:L,children:[c.jsx(wt.Item,{name:"url",label:"Repository URL",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"ssh://git@bitbucket.example/scm/PROJ/repo.git"})}),c.jsx(wt.Item,{name:"name",label:"Display name",children:c.jsx(Ct,{placeholder:"Optional"})}),c.jsx(wt.Item,{name:"directory",label:"Local directory name",children:c.jsx(Ct,{placeholder:"Defaults to repository name"})}),c.jsx(Re,{type:"primary",htmlType:"submit",children:"Add repo"})]})}),c.jsx(xn,{title:"Task details",open:!!u,onCancel:()=>f(null),footer:null,width:760,children:u&&(()=>{var ne,ce;const W=u.repos||[],G=W.filter(Z=>["success","failed"].includes(Z.status)).length,Y=W.length?Math.round(G/W.length*100):0,te=W.some(Z=>Z.status==="failed")||u.status==="failed";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"package-upgrade-task-progress",children:c.jsxs(ct,{direction:"vertical",size:4,style:{width:"100%"},children:[c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[u.packageName," → ",u.version]}),c.jsx($t,{color:((ne=GC[u.status])==null?void 0:ne[0])||"default",children:((ce=GC[u.status])==null?void 0:ce[1])||u.status})]}),c.jsxs(oo,{type:"secondary",children:[G," / ",W.length," repositories completed"]}),c.jsx(mp,{percent:Y,status:te?"exception":u.status==="completed"?"success":"active"})]})}),c.jsx(or,{size:"small",rowKey:"repoId",pagination:!1,columns:V,dataSource:W})]})})()}),c.jsx(xn,{title:"Create package upgrade task",open:o,onCancel:()=>s(!1),onOk:()=>y.submit(),okText:"Confirm",cancelText:"Cancel",width:620,children:c.jsxs(wt,{form:y,layout:"vertical",onFinish:X,children:[c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"sourceBranch",label:"Work branch",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade/package-name"})}),c.jsx(wt.Item,{name:"targetBranch",label:"Target branch",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:k.map(W=>({label:W.name,value:W.name})),filterOption:(W,G)=>{var Y;return(Y=G==null?void 0:G.value)==null?void 0:Y.toLowerCase().includes(W.toLowerCase())},loading:z,placeholder:F.length?"Select or enter a branch":"Select repositories first",notFoundContent:z?"Loading branches…":"No common branches found",disabled:!F.length})})]}),c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"packageName",label:"Package name",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:U.map(W=>({label:W,value:W})),loading:w,placeholder:"@scope/package"})}),c.jsx(wt.Item,{name:"version",label:"Target version",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"1.2.3",onChange:()=>j([]),addonAfter:c.jsx(Jl,{className:"package-upgrade-version-cascader",popupClassName:"package-upgrade-version-picker",placement:"bottomRight",value:I,options:Ube(E),loading:N,placeholder:"Select",expandTrigger:"hover",displayRender:()=>"Select",onChange:W=>{const G=W||[];j(G),y.setFieldValue("version",G.length?G[G.length-1]:"")}})})})]}),c.jsx(wt.Item,{name:"commitMessage",label:"Commit message",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade xxx to xxx"})}),c.jsx(wt.Item,{name:"repoIds",label:"Repositories",rules:[{required:!0,message:"Select at least one repository"}],children:c.jsx(nr.Group,{style:{width:"100%"},children:c.jsx(ct,{direction:"vertical",children:t.repos.map(W=>c.jsxs(nr,{value:W.id,children:[W.name," ",c.jsxs(oo,{type:"secondary",children:["(",W.cloned?"cloned":"clone on task start",")"]})]},W.id))})})})]})})]})}const{Text:xo}=Cn,DI=["#7c5cff","#16a085","#e67e22","#d94f70","#1982c4","#7a9e2a","#c44536","#8e5ea2"];function qbe(e,t){return DI[Math.max(0,t.indexOf(e))%DI.length]}function Kbe(){var j;const{message:e}=Pr.useApp(),[t,n]=l.useState(null),[r,a]=l.useState(!1),[o,s]=l.useState(""),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState([]),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState(!1),E=async()=>{a(!0);try{const[k]=await Promise.all([So.dependencyScan(),new Promise(T=>setTimeout(T,500))]);n(k),e.success("Scan complete")}catch(k){n(null),e.error(k.message)}finally{a(!1)}},R=l.useMemo(()=>((t==null?void 0:t.packages)||[]).filter(k=>k.name.toLowerCase().includes(o.trim().toLowerCase())&&(!u||k.repositoryCount>1)),[t,o,u]),N=async()=>{if(t!=null&&t.workspaceDir)try{await Un.openFolder(t.workspaceDir)}catch(k){e.error(k.message)}},O=async()=>{h(!0),x(!0);try{const k=await So.dependencyRepositories();v(k.repositories||[]),b((k.repositories||[]).filter(T=>T.selected).map(T=>T.directory))}catch(k){e.error(k.message)}finally{x(!1)}},I=async()=>{$(!0);try{await So.saveDependencyRepositories(y),h(!1),n(null),e.success("Repository settings saved")}catch(k){e.error(k.message)}finally{$(!1)}};return c.jsxs("div",{className:"package-versions-page",children:[c.jsx(Ur,{title:"Package Versions",description:"Scan every repository in the configured workspace and compare dependency versions at a glance. Matching versions share a color within each package.",actions:c.jsxs(ct,{children:[c.jsx(Re,{icon:c.jsx(Gl,{}),onClick:O,children:"Repositories"}),c.jsx(Re,{icon:c.jsx(Xa,{}),loading:r,onClick:E,children:t?"Scan again":"Scan"})]})}),r&&!t?c.jsxs("div",{className:"package-versions-loading",children:[c.jsx(ar,{size:"large"}),c.jsx(xo,{type:"secondary",children:"Scanning package.json files…"})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs(It,{className:"package-versions-summary",children:[c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"package-versions-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:N,"aria-label":"Open workspace directory"}),c.jsx(yn,{title:t.workspaceDir,children:c.jsx(xo,{ellipsis:!0,children:t.workspaceDir})})]})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"package-versions-stat",children:t.repositories.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Shared packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.filter(k=>k.repositoryCount>1).length})]})]}),((j=t.errors)==null?void 0:j.length)>0&&c.jsx(mr,{className:"package-versions-alert",type:"warning",showIcon:!0,message:`${t.errors.length} repository could not be read`,description:t.errors.map(k=>`${k.repository}: ${k.message}`).join(" · ")}),c.jsx(It,{className:"package-versions-card",title:c.jsxs("span",{children:["Dependency matrix ",c.jsxs(xo,{type:"secondary",children:["· ",R.length," shown"]})]}),extra:c.jsxs(ct,{children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Filter packages",value:o,onChange:k=>s(k.target.value)}),c.jsx(Ja,{checked:u,onChange:f,checkedChildren:"Shared",unCheckedChildren:"All"})]}),children:R.length?c.jsx(Q0,{className:"package-versions-list",items:R.map(k=>{const T=k.versions.map(z=>z.version);return{key:k.name,label:c.jsxs("div",{className:"package-version-name",children:[c.jsx(xo,{strong:!0,children:k.name}),c.jsxs(xo,{type:"secondary",children:[k.repositoryCount," repos · ",k.versions.length," versions"]})]}),children:c.jsx("div",{className:"package-version-groups",children:k.versions.map(z=>c.jsxs("div",{className:"package-version-group",children:[c.jsx($t,{className:"package-version-tag",style:{"--version-color":qbe(z.version,T)},children:z.version}),c.jsx("div",{className:"package-version-repos",children:z.repositories.map(P=>c.jsx(yn,{title:`${P.repository} · ${P.sections.join(", ")}`,children:c.jsx("span",{className:"package-version-repo",children:P.repository})},P.directory))})]},z.version))})}})}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:o?"No matching packages":u?"No package is shared by more than one repository":"No dependencies found"})}),c.jsxs(xo,{className:"package-versions-updated",type:"secondary",children:["Last scanned ",new Date(t.scannedAt).toLocaleString()]})]}):c.jsx(It,{children:c.jsx(Xt,{description:"Click Scan to inspect package versions in the configured workspace."})}),c.jsxs(xn,{title:"Repositories to scan",open:m,onCancel:()=>h(!1),onOk:I,okButtonProps:{disabled:!y.length},okText:"Save",confirmLoading:w,width:620,children:[c.jsx(xo,{type:"secondary",children:"Select which repositories in the workspace should be included in the next scan."}),c.jsxs("div",{className:"package-versions-repository-toolbar",children:[c.jsx(nr,{checked:p.length>0&&y.length===p.length,indeterminate:y.length>0&&y.length<p.length,onChange:k=>b(k.target.checked?p.map(T=>T.directory):[]),children:"Select all"}),c.jsxs(xo,{type:"secondary",children:[y.length," / ",p.length," selected"]})]}),C?c.jsx("div",{className:"package-versions-settings-loading",children:c.jsx(ar,{})}):c.jsx(nr.Group,{value:y,onChange:b,className:"package-versions-repository-options",children:c.jsx(Ra,{size:"small",dataSource:p,locale:{emptyText:"No repositories found in this workspace."},renderItem:k=>c.jsx(Ra.Item,{children:c.jsx(nr,{value:k.directory,children:c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(xo,{children:k.name}),c.jsx(xo,{type:"secondary",children:k.directory})]})})})})})]})]})}const{Paragraph:q9,Text:Zn,Title:Bd}=Cn,Gbe=[{key:"launcher",label:"Service Launcher",description:"Start, stop, and inspect local project scripts.",icon:c.jsx(qo,{})},{key:"pr-review",label:"PR Review",description:"Turn pull request changes into a focused review.",icon:c.jsx(Ly,{})},{key:"todo-list",label:"To-Do",description:"Keep development tasks visible and moving.",icon:c.jsx(mu,{})},{key:"postman",label:"API Workspace",description:"Build, organize, and send HTTP requests.",icon:c.jsx(hu,{})},{key:"ports",label:"Port Diagnostic",description:"Find listeners and resolve local port conflicts.",icon:c.jsx(e4,{})},{key:"errors",label:"Error Logs",description:"Review recent launcher and application errors.",icon:c.jsx(uf,{})}],Id=e=>Array.isArray(e)?e:[],Ybe=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[]),Xbe=e=>e instanceof Map?[...e.entries()]:!e||typeof e!="object"?[]:Object.entries(e),Jbe=e=>e.reduce((t,[,n])=>t+Math.max(0,Number(n)||0),0),Qbe=(e,t)=>e.alias||e.name||e.folder||`Service ${t+1}`,Zbe=e=>e.groupName||e.branch||e.folder||"Local service",Is=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,zI=e=>typeof e=="string"?e:(e==null?void 0:e.message)||"DevBuddy could not load service and runtime data.",e1e=[{key:"activity",title:"Recent activity",description:"Jira & Confluence mentions.",icon:c.jsx(uf,{}),route:"jira-filters"},{key:"jiraDueToday",title:"Jira due today",description:"Unresolved issues due today.",icon:c.jsx(mu,{}),route:"jira-filters"},{key:"assignedTodos",title:"Assigned to-dos",description:"Your open local tasks.",icon:c.jsx(mu,{}),route:"todo-list"},{key:"authoredPrs",title:"Your open PRs",description:"Created by you and not merged.",icon:c.jsx(hu,{}),route:"pr-review"}];let YC=null;const K9=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},t1e=e=>n1e(e).filter(t=>!t.read).length,n1e=e=>{const t=(e==null?void 0:e.notifications)||{};return[...Array.isArray(t.jira)?t.jira:[],...Array.isArray(t.confluence)?t.confluence:[]]};function r1e({config:e,items:t,open:n,onClose:r,onNavigate:a}){const[o,s]=l.useState(""),[u,f]=l.useState("all"),m=l.useMemo(()=>{let C=t||[];if(u!=="all"&&(C=C.filter(x=>(x.sourceType||x.source||"").toLowerCase()===u.toLowerCase())),o.trim()){const x=o.trim().toLowerCase();C=C.filter(w=>{const $=String(w.title||w.summary||w.name||"").toLowerCase(),E=String(w.key||w.repository||"").toLowerCase(),R=String(w.author||"").toLowerCase(),N=String(w.activityType||w.status||"").toLowerCase();return $.includes(x)||E.includes(x)||R.includes(x)||N.includes(x)})}return C},[t,o,u]),h=(t||[]).some(C=>C.source==="Jira"||C.sourceType==="jira")&&(t||[]).some(C=>C.source==="Confluence"||C.sourceType==="confluence"),p=(t||[]).filter(C=>(C.sourceType||C.source)==="Jira"||(C.sourceType||C.source)==="jira").length,v=(t||[]).filter(C=>(C.sourceType||C.source)==="Confluence"||(C.sourceType||C.source)==="confluence").length,y=C=>{if(C!=null&&C.url&&/^https?:\/\//i.test(C.url)){window.open(C.url,"_blank","noopener,noreferrer");return}if(C!=null&&C.url&&C.url.startsWith("#/")){window.location.hash=C.url;return}e!=null&&e.route&&typeof a=="function"&&a(e.route)},b=C=>{const x=C.source||C.sourceType;return x==="Jira"||x==="jira"?c.jsx($t,{color:"blue",children:"Jira"}):x==="Confluence"||x==="confluence"?c.jsx($t,{color:"cyan",children:"Confluence"}):C.repository?c.jsx($t,{color:"purple",children:"PR"}):C.completed!==void 0?c.jsx($t,{color:"green",children:"To-Do"}):null};return c.jsxs(xn,{title:c.jsxs(ct,{size:8,children:[c.jsx("span",{className:"overview-insight-modal-icon",children:e==null?void 0:e.icon}),c.jsx("span",{children:e==null?void 0:e.title}),c.jsx(sa,{count:t.length,style:{backgroundColor:"var(--db-primary)"}})]}),open:n,onCancel:r,footer:null,width:880,className:"overview-insights-modal",children:[c.jsxs("div",{className:"overview-insights-modal-header",children:[c.jsx(Zn,{type:"secondary",children:e==null?void 0:e.description}),c.jsxs(ct,{size:12,className:"overview-insights-modal-filters",wrap:!0,children:[c.jsx(Ct,{placeholder:"Search items...",prefix:c.jsx(jo,{}),allowClear:!0,value:o,onChange:C=>s(C.target.value),style:{width:220}}),h&&c.jsxs(er.Group,{value:u,onChange:C=>f(C.target.value),size:"small",optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",t.length,")"]}),c.jsxs(er.Button,{value:"jira",children:["Jira (",p,")"]}),c.jsxs(er.Button,{value:"confluence",children:["Confluence (",v,")"]})]})]})]}),c.jsx("div",{className:"overview-insights-modal-list",children:m.length===0?c.jsx(Xt,{description:o?"No matching items found.":"No items.",image:Xt.PRESENTED_IMAGE_SIMPLE}):m.map((C,x)=>c.jsxs("div",{className:"overview-insights-modal-item",onClick:()=>y(C),children:[c.jsxs("div",{className:"overview-insights-modal-item-body",children:[c.jsxs("div",{className:"overview-insights-modal-item-top",children:[b(C),C.key&&c.jsx(Zn,{strong:!0,className:"overview-insights-modal-item-key",children:C.key}),c.jsx(Zn,{className:"overview-insights-modal-item-title",title:C.title||C.summary||C.name||C.branch,children:C.title||C.summary||C.name||C.branch})]}),c.jsxs("div",{className:"overview-insights-modal-item-meta",children:[C.author&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-author",title:`By ${C.author}`,children:["By ",C.author]}),C.activityType&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.activityType,children:["· ",C.activityType]}),C.status&&c.jsx($t,{size:"small",children:C.status}),C.priority&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",children:["· Priority: ",C.priority]}),C.repository&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.repository,children:["· Repo: ",C.repository]})]})]}),c.jsx("div",{className:"overview-insights-modal-item-extra",children:c.jsx("span",{className:"overview-insights-modal-item-date",children:C.activityAt||C.updated||C.dueDate||C.date?new Date(C.activityAt||C.updated||C.dueDate||C.date).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})})]},C.id||C.key||`item-${x}`))})]})}function a1e({data:e,open:t,onClose:n,onRefresh:r}){var y;const[a,o]=l.useState(!1),[s,u]=l.useState(""),f=async()=>{o(!0);try{await r(),u("")}catch(b){u(b.message||"Unable to load notifications.")}finally{o(!1)}};l.useEffect(()=>{t&&f()},[t]);const m=(b,C)=>c.jsx("div",{className:"overview-notifications-list",children:b.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:`No ${C} notifications.`}):b.map((x,w)=>{const $=()=>{x.url&&/^https?:\/\//i.test(x.url)&&window.open(x.url,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:`overview-notification-item${x.read?"":" is-unread"}${x.url?" is-link":""}`,role:x.url?"button":void 0,tabIndex:x.url?0:void 0,onClick:x.url?$:void 0,onKeyDown:x.url?E=>{(E.key==="Enter"||E.key===" ")&&$()}:void 0,children:[c.jsxs("div",{className:"overview-notification-item-main",children:[c.jsxs("div",{className:"overview-notification-item-title-row",children:[!x.read&&c.jsx(sa,{status:"processing"}),c.jsx(Zn,{strong:!0,children:x.title})]}),x.summary&&c.jsx(Zn,{type:"secondary",className:"overview-notification-item-summary",children:x.summary})]}),c.jsx(Zn,{type:"secondary",className:"overview-notification-item-date",children:K9(x.activityAt||x.updated)})]},x.id||`${C}-${w}`)})}),h=e.notifications||{},p=Array.isArray(h.jira)?h.jira:[],v=Array.isArray(h.confluence)?h.confluence:[];return c.jsxs(xn,{title:c.jsxs(ct,{children:[c.jsx(Kd,{}),c.jsx("span",{children:"Jira & Confluence Notifications"})]}),open:t,onCancel:n,footer:null,width:760,className:"overview-notifications-modal",children:[c.jsxs("div",{className:"overview-notifications-toolbar",children:[c.jsx(Zn,{type:"secondary",children:"View the latest notifications from your connected work systems."}),c.jsx(Re,{icon:c.jsx(Xa,{}),loading:a,onClick:f,children:"Refresh"})]}),s&&c.jsx(mr,{type:"warning",showIcon:!0,message:s,className:"overview-notifications-alert"}),((y=e.errors)==null?void 0:y.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Some notifications could not be loaded",description:e.errors.join(" · "),className:"overview-notifications-alert"}),c.jsx(Qa,{items:[{key:"jira",label:`Jira (${p.length})`,children:m(p,"Jira")},{key:"confluence",label:`Confluence (${v.length})`,children:m(v,"Confluence")}]})]})}function o1e({onNavigate:e}){var I;const[t,n]=l.useState(()=>YC),[r,a]=l.useState(()=>!YC),[o,s]=l.useState(null),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState({notifications:{jira:[],confluence:[]},errors:[]}),[y,b]=l.useState({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1}),C=async()=>{const j=await Xw.notifications();return v(j),j},x=async()=>{try{const j=await Un.status();b(j)}catch{b({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1})}},w=async()=>{a(!0);try{const j=await Xw.get();YC=j,n(j),s(null)}catch(j){s(j.message||"Unable to load work insights.")}finally{a(!1)}};l.useEffect(()=>{w(),x()},[]);const $=(j,k)=>{if(j!=null&&j.url&&/^https?:\/\//i.test(j.url)){window.open(j.url,"_blank","noopener,noreferrer");return}if(j!=null&&j.url&&j.url.startsWith("#/")){window.location.hash=j.url;return}typeof e=="function"&&e(k)};if(r&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(_a,{active:!0,title:{width:"30%"},paragraph:{rows:3}})});if(o&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(mr,{type:"warning",showIcon:!0,message:"Work insights unavailable",description:o,action:c.jsx(Re,{size:"small",onClick:w,children:"Retry"})})});const E=t1e(p),R=j=>c.jsx(sa,{count:E,overflowCount:99,offset:[2,-2],children:c.jsx(Re,{type:j,icon:c.jsx(Kd,{}),onClick:()=>h(!0),children:"Notifications"})}),N=!!(y.jiraTokenConfigured&&y.confluenceTokenConfigured);if(!(t!=null&&t.configured))return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"}),c.jsx(Bd,{level:3,className:"overview-section-title",children:"Connect your work systems"}),c.jsx(Zn,{type:"secondary",children:"Configure Jira and Bitbucket access tokens to see your daily work here."})]}),c.jsxs(ct,{children:[N&&R(),c.jsx(Re,{type:"primary",onClick:()=>e==null?void 0:e("settings"),children:"Open Settings"})]})]})});const O=t.categories||{};return c.jsxs(It,{className:"overview-panel overview-insights-card",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsx("div",{children:c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"})}),c.jsxs("div",{className:"overview-insights-actions",children:[r&&c.jsx(ar,{size:"small","aria-label":"Refreshing work insights"}),N&&R("text"),c.jsx(Re,{type:"text",onClick:w,children:"Refresh"})]})]}),o&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Refresh failed; showing the last result",description:o}),((I=t.errors)==null?void 0:I.length)>0&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Some work data could not be loaded",description:t.errors.join(" · ")}),c.jsx("div",{className:"overview-insights-grid",children:e1e.map(j=>{const k=Array.isArray(O[j.key])?O[j.key]:[];return c.jsxs("section",{className:`overview-insight-tile${k.length?" has-items":""}`,"aria-labelledby":`overview-insight-${j.key}`,children:[c.jsxs("div",{className:"overview-insight-heading",children:[c.jsx("span",{className:"overview-insight-icon","aria-hidden":"true",children:j.icon}),c.jsxs("div",{children:[c.jsx(Zn,{strong:!0,id:`overview-insight-${j.key}`,children:j.title}),c.jsx(Zn,{type:"secondary",children:j.description})]}),c.jsx(sa,{count:k.length,showZero:!0,overflowCount:99})]}),k.length===0?c.jsx(Zn,{type:"secondary",className:"overview-insight-empty",children:"Nothing needs attention."}):c.jsxs("div",{className:"overview-insight-items",children:[k.slice(0,3).map((T,z)=>c.jsxs("button",{type:"button",className:"overview-insight-item",onClick:()=>$(T,j.route),children:[c.jsxs("span",{className:"overview-insight-item-main",children:[c.jsx("span",{className:"overview-insight-item-title",title:T.title||T.summary||T.name||T.branch,children:T.title||T.summary||T.name||T.branch}),c.jsx("span",{className:"overview-insight-item-meta",title:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||"",children:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||""})]}),c.jsx("span",{className:"overview-insight-item-date",children:K9(T.dueDate||T.updated||T.activityAt||T.date)})]},T.id||T.key||`${j.key}-${z}`)),k.length>3&&c.jsxs(Re,{type:"link",className:"overview-insight-more",onClick:()=>f({config:j,items:k}),children:["View all ",k.length]})]})]},j.key)})}),c.jsx(r1e,{config:u==null?void 0:u.config,items:(u==null?void 0:u.items)||[],open:!!u,onClose:()=>f(null),onNavigate:e}),c.jsx(a1e,{data:p,open:m,onClose:()=>h(!1),onRefresh:C})]})}function i1e(){const[e,t]=l.useState("");return l.useEffect(()=>{let n=!0;return Xw.version().then(({version:r})=>{n&&r&&r!=="0.2.12"&&t(r)}).catch(()=>{}),()=>{n=!1}},[]),e?c.jsx(mr,{showIcon:!0,type:"warning",message:"A newer UI version is available. Reload to update.",action:c.jsx(Re,{size:"small",type:"primary",onClick:()=>window.location.reload(),children:"Reload"}),style:{marginBottom:16}}):null}function l1e(){return c.jsxs("div",{className:"overview-page",role:"status","aria-live":"polite","aria-busy":"true","aria-label":"Loading workspace overview",children:[c.jsxs("section",{className:"overview-hero",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"LOADING WORKSPACE"}),c.jsx(Bd,{level:1,className:"overview-hero-title",children:"Getting your development workspace ready…"}),c.jsx(q9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Checking services, runtime status, and recent errors."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(_a.Button,{active:!0,style:{width:176,height:42,borderRadius:10}}),c.jsx(_a.Button,{active:!0,style:{width:196,height:42,borderRadius:10}})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsx("section",{className:"overview-metrics","aria-hidden":"true",children:["services","running","errors","extensions"].map(e=>c.jsx(It,{className:"overview-metric-card",children:c.jsx(_a,{active:!0,title:{width:"48%"},paragraph:{rows:1,width:"72%"}})},e))}),c.jsxs("div",{className:"overview-content-grid overview-grid","aria-hidden":"true",children:[c.jsx("section",{className:"overview-shortcuts-section",children:c.jsx(_a,{active:!0,title:{width:"34%"},paragraph:{rows:4}})}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsx(_a,{active:!0,title:{width:"46%"},paragraph:{rows:4}})})]}),c.jsx(It,{className:"overview-panel overview-health-card","aria-hidden":"true",children:c.jsx(_a,{active:!0,title:{width:"24%"},paragraph:{rows:3}})})]})}function s1e({launchers:e=[],running:t=new Set,errorCounts:n={},errorLogs:r=[],plugins:a=[],staticPages:o=[],loading:s=!1,error:u=null,hasLoaded:f=!1,onRetry:m,onNavigate:h}){const p=Id(e),v=Id(a),y=Id(o),b=Ybe(t),C=Id(r),x=f||p.length>0;if(s&&!x)return c.jsx(l1e,{});if(u&&!x)return c.jsx("div",{className:"overview-page",role:"alert",children:c.jsx(It,{className:"overview-panel",children:c.jsx(My,{status:"error",title:"Unable to load your workspace",subTitle:zI(u),extra:typeof m=="function"?c.jsx(Re,{type:"primary",icon:c.jsx(qo,{}),onClick:m,children:"Retry"}):null})})});const w=Xbe(n),$=v.length+y.length,E=C.length,R=p.reduce((P,B)=>P+Id(B.scripts).length+Math.max(0,Number(B.packageScriptCount)||0),0),N=p.map((P,B)=>{const H=`${P.id}:`,A=[...b].filter(L=>String(L).startsWith(H)).length,_=Jbe(w.filter(([L])=>String(L).startsWith(H))),F=C.filter(L=>String(L.source||"").startsWith(`Launcher: ${P.alias||P.name||""}`)).length,U=Id(P.scripts).length+Math.max(0,Number(P.packageScriptCount)||0),q=_>0?{badge:"error",label:"Needs attention",priority:2}:A>0?{badge:"success",label:"Running",priority:1}:{badge:"default",label:"Idle",priority:0};return{service:P,name:Qbe(P,B),meta:Zbe(P),activeCount:A,serviceErrors:Math.max(_,F),scriptCount:U,health:q,order:B}}).sort((P,B)=>B.health.priority-P.health.priority||P.order-B.order),O=N.filter(P=>P.activeCount>0).length,I=N.filter(P=>P.serviceErrors>0).length,j=[{key:"service",title:"Add your first service",description:"Connect a local project and choose the scripts you use most.",complete:p.length>0,action:"Add service",route:"launcher"},{key:"run",title:"Start a development script",description:"Launch a configured script and keep its status within reach.",complete:b.size>0,action:"Open Launcher",route:"launcher"},{key:"extend",title:"Personalize your workspace",description:"Add a plugin or static page for the tools your team already uses.",complete:$>0,action:"Open Settings",route:"settings"}],k=j.filter(P=>P.complete).length,T=N.slice(0,5),z=P=>{typeof h=="function"&&h(P)};return c.jsxs("div",{className:"overview-page",children:[u&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Live service status may be out of date",description:zI(u),action:typeof m=="function"?c.jsx(Re,{size:"small",loading:s,onClick:m,children:"Retry"}):null,className:"overview-data-warning"}),c.jsxs("section",{className:"overview-hero","aria-labelledby":"overview-title",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"DEVBUDDY OVERVIEW"}),c.jsx(Bd,{id:"overview-title",level:1,className:"overview-hero-title",children:"Your development day, in one calm workspace."}),c.jsx(q9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Start local services, spot issues, and jump into everyday tools without losing your flow."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(Re,{type:"primary",size:"large",icon:p.length>0?c.jsx(qo,{}):c.jsx(Xn,{}),onClick:()=>z("launcher"),children:p.length>0?"Open Launcher":"Add your first service"}),c.jsx(Re,{size:"large",icon:c.jsx(Ly,{}),onClick:()=>z("pr-review"),children:"Review a pull request"})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsxs("section",{className:"overview-metrics","aria-label":"Workspace status",children:[c.jsxs(It,{className:"overview-metric-card overview-metric-card-clickable",role:"button",tabIndex:0,"aria-label":`Open Launcher, ${p.length} services`,onClick:()=>h==null?void 0:h("launcher"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Bpe,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Services"}),c.jsx("strong",{className:"overview-metric-value",children:p.length}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(R,"configured script")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${b.size>0?" is-success":""}`,role:"button",tabIndex:0,"aria-label":`Open Launcher, ${b.size} running scripts`,onClick:()=>h==null?void 0:h("launcher?running=1"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher?running=1"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Kl,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Running"}),c.jsx("strong",{className:"overview-metric-value",children:b.size}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(O,"active service")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${E>0?" is-danger":" is-neutral"}`,role:"button",tabIndex:0,"aria-label":`Open Error Logs, ${E} errors`,onClick:()=>h==null?void 0:h("errors"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("errors"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(uf,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Errors"}),c.jsx("strong",{className:"overview-metric-value",children:E}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:I>0?`Across ${Is(I,"service")}`:"No services need attention"})]})]}),c.jsxs(It,{className:"overview-metric-card",children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(j9,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Extensions"}),c.jsx("strong",{className:"overview-metric-value",children:$}),c.jsxs(Zn,{type:"secondary",className:"overview-metric-note",children:[Is(v.length,"plugin")," · ",Is(y.length,"page")]})]})]})]}),c.jsx(i1e,{}),c.jsx(o1e,{onNavigate:z}),c.jsxs("div",{className:"overview-content-grid overview-grid",children:[c.jsxs("section",{className:"overview-shortcuts-section","aria-labelledby":"overview-shortcuts-title",children:[c.jsx("div",{className:"overview-section-header",children:c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-shortcuts-title",className:"overview-section-title",children:"Jump back into your flow"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Your most-used developer tools, one click away."})]})}),c.jsx("div",{className:"overview-shortcuts overview-quick-grid",children:Gbe.map(P=>c.jsxs("button",{type:"button",className:"overview-shortcut overview-quick-card","aria-label":`${P.label}: ${P.description}`,onClick:()=>z(P.key),children:[c.jsx("span",{className:"overview-shortcut-icon overview-quick-card-icon","aria-hidden":"true",children:P.icon}),c.jsxs("span",{className:"overview-shortcut-copy overview-quick-card-copy",children:[c.jsx("span",{className:"overview-shortcut-title overview-quick-card-title",children:P.label}),c.jsx("span",{className:"overview-shortcut-description overview-quick-card-description",children:P.description})]}),c.jsx(Qc,{className:"overview-shortcut-arrow","aria-hidden":"true"})]},P.key))})]}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsxs("section",{className:"overview-setup","aria-labelledby":"overview-setup-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"GET STARTED"}),c.jsx(Bd,{level:3,id:"overview-setup-title",className:"overview-section-title",children:"Set up your workspace"})]}),c.jsxs(Zn,{type:"secondary",className:"overview-setup-progress",children:[k," of ",j.length]})]}),c.jsx("ol",{className:"overview-setup-list overview-checklist",children:j.map((P,B)=>c.jsxs("li",{className:`overview-setup-step overview-checklist-item${P.complete?" is-complete":""}`,children:[c.jsx("span",{className:"overview-setup-step-marker overview-checklist-marker","aria-hidden":"true",children:P.complete?c.jsx(Hi,{}):B+1}),c.jsxs("div",{className:"overview-setup-step-copy overview-checklist-copy",children:[c.jsx(Zn,{strong:!0,className:"overview-setup-step-title overview-checklist-title",children:P.title}),c.jsx(Zn,{type:"secondary",className:"overview-setup-step-description overview-checklist-description",children:P.description}),!P.complete&&c.jsx(Re,{type:"link",className:"overview-setup-step-action",onClick:()=>z(P.route),children:P.action})]})]},P.key))})]})})]}),c.jsx(It,{className:"overview-panel overview-health-card",children:c.jsxs("section",{className:"overview-health","aria-labelledby":"overview-health-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-health-title",className:"overview-section-title",children:"Service health"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Running scripts and recent errors across your local projects."})]}),p.length>0&&c.jsxs(Re,{type:"text",className:"overview-section-link",onClick:()=>z("launcher"),children:["View all services ",c.jsx(Qc,{})]})]}),T.length===0?c.jsx(Xt,{className:"overview-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No services configured yet",children:c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>z("launcher"),children:"Add your first service"})}):c.jsx("div",{className:"overview-service-list",children:T.map(P=>c.jsxs("button",{type:"button",className:`overview-service-row ${P.health.badge==="error"?"is-error":P.health.badge==="success"?"is-running":"is-idle"}`,"aria-label":`${P.name}: ${P.health.label}, ${Is(P.activeCount,"script")} running, ${Is(P.serviceErrors,"error")}`,onClick:()=>z(`launcher?service=${encodeURIComponent(P.service.id)}`),children:[c.jsxs("span",{className:"overview-service-primary",children:[c.jsxs("span",{className:"overview-service-name-line",children:[c.jsx("span",{className:"overview-service-name",children:P.name}),c.jsx(sa,{status:P.health.badge,text:P.health.label})]}),c.jsx("span",{className:"overview-service-meta overview-service-detail",children:P.meta})]}),c.jsxs("span",{className:"overview-service-stats",children:[c.jsxs("span",{className:"overview-service-stat",children:[c.jsx(Kl,{"aria-hidden":"true"}),P.activeCount," / ",P.scriptCount," running"]}),c.jsxs("span",{className:`overview-service-stat${P.serviceErrors>0?" has-errors":""}`,children:[c.jsx(uf,{"aria-hidden":"true"}),Is(P.serviceErrors,"error")]}),c.jsx(Qc,{className:"overview-service-arrow","aria-hidden":"true"})]})]},P.service.id))}),N.length>T.length&&c.jsxs(Re,{type:"text",className:"overview-more-services",onClick:()=>z("launcher"),children:["View ",N.length-T.length," more services",c.jsx(Qc,{})]})]})}),c.jsxs("footer",{className:"overview-footer",children:[c.jsx(Mf,{"aria-hidden":"true"}),c.jsx(Zn,{type:"secondary",children:"DevBuddy keeps your workspace local and your daily tools close."}),c.jsx(Re,{type:"link",icon:c.jsx(Gl,{}),onClick:()=>z("settings"),children:"Workspace settings"})]})]})}const{Paragraph:Zw,Text:Vs,Title:G9}=Cn,{TextArea:O0}=Ct,c1e="devbuddy.presentation-plan.v1",u1e="devbuddy.presentation-plans.v1",Y9="devbuddy-presentation-plan",Bh=()=>{var e,t;return((t=(e=globalThis.crypto)==null?void 0:e.randomUUID)==null?void 0:t.call(e))||`section-${Date.now()}-${Math.random().toString(16).slice(2)}`},X9=e=>{if(!e)return"";const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?"":`Planned ${t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}`},d1e=e=>{const t=[`# ${e.title.trim()||"Untitled presentation"}`];e.subtitle.trim()&&t.push("",`> ${e.subtitle.trim()}`);const n=[];return e.presenter.trim()&&n.push(`**Presenter:** ${e.presenter.trim()}`),e.plannedDate&&n.push(`**Planned date:** ${e.plannedDate}`),n.length>0&&t.push("",...n),e.sections.forEach((r,a)=>{const o=String(a+1).padStart(2,"0"),s=e.showTimeBoxes?` · ${r.duration} min`:"";t.push("","---","",`## ${o}. ${r.title.trim()||`Section ${a+1}`}${s}`),r.summary.trim()&&t.push("",r.summary.trim())}),e.quickNotes.length>0&&(t.push("","---","","## Quick capture",""),[...e.quickNotes].sort((r,a)=>(r.createdAt||0)-(a.createdAt||0)).forEach(r=>{const a=r.sectionIndex===null?"Step not recorded":`Step ${String(r.sectionIndex+1).padStart(2,"0")} — ${r.sectionTitle||"Untitled section"}`,o=String(r.text||"").trim().replace(/\r?\n/g,`
548
+ ]`})})]})}),c.jsx(xn,{title:"App List Configurations",open:m,onCancel:()=>h(!1),footer:[c.jsx(Re,{onClick:()=>h(!1),children:"Close"},"close")],width:950,children:c.jsx("div",{className:"branch-sync-modal-body",children:t.length===0?c.jsx(Xt,{description:"No apps configured."}):c.jsx(or,{dataSource:t.map(le=>({...le,key:le.id})),pagination:!1,size:"small",columns:[{title:"Name",dataIndex:"name",key:"name",render:le=>c.jsx(Ca,{strong:!0,children:le})},{title:"Branches",key:"branches",render:(le,ae)=>c.jsxs(ct,{direction:"vertical",size:4,className:"branch-sync-branches-col",children:[c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Release:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.lastReleaseBranch})]}),c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Active:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.activeBranch})]})]})},{title:"Sub-Apps",key:"subAppsCount",render:(le,ae)=>c.jsx(sa,{count:ae.subApps?ae.subApps.length:0,showZero:!0,color:"#64748b"})},{title:"Action",key:"action",render:(le,ae)=>c.jsxs(ct,{size:8,children:[c.jsx(Re,{size:"small",icon:c.jsx(Wo,{}),onClick:()=>ce(ae),children:"Edit"}),c.jsx(Gr,{title:"Delete this app config?",onConfirm:()=>ee(ae.id),okText:"Yes",cancelText:"No",children:c.jsx(Re,{size:"small",danger:!0,icon:c.jsx(Hn,{}),children:"Delete"})})]})}]})})}),c.jsx(xn,{title:`Edit App Config: ${(p==null?void 0:p.name)||""}`,open:y,onOk:Z,onCancel:()=>{b(!1),v(null)},okText:"Save Changes",width:800,destroyOnClose:!0,children:c.jsxs(wt,{className:"branch-sync-modal-form",form:O,layout:"vertical",children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter application name"}],children:c.jsx(Ct,{})}),c.jsx(wt.Item,{name:"repo",label:"Repository",rules:[{required:!0,message:"Please enter repository URL"}],children:c.jsx(Ct,{onChange:le=>W(le.target.value),onBlur:le=>G(le.target.value)})}),c.jsxs(Uo,{gutter:16,children:[c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"activeBranch",label:"Active Branch",rules:[{required:!0,message:"Please select or enter active branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter active branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})}),c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"lastReleaseBranch",label:"Last Release Branch",rules:[{required:!0,message:"Please select or enter last release branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter last release branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})})]}),c.jsx(wt.Item,{name:"subApps",label:"subApps (JSON Array)",extra:'JSON structure: [ { "name": "sub-app1", "repo": "bitbucket@abc.com/xxx.git", "branch": "custom-branch" } ]. If "branch" is omitted, inherits parent active branch.',children:c.jsx(Ct.TextArea,{rows:4})})]})}),c.jsxs(xn,{title:`Create Branch for ${(w==null?void 0:w.name)||"App"}`,open:C,onCancel:()=>{E.creating||(x(!1),$(null))},footer:[c.jsx(Re,{disabled:E.creating,onClick:()=>{x(!1),$(null)},children:E.completed?"Close":"Cancel"},"cancel"),c.jsx(Re,{type:"primary",icon:c.jsx(ou,{}),loading:E.creating,onClick:ye,children:"Create Branch"},"submit")],width:850,destroyOnClose:!0,children:[c.jsx(wt,{className:"branch-sync-modal-form",form:I,layout:"vertical",children:c.jsxs(Uo,{gutter:16,children:[c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"sourceBranch",label:"Source Branch",rules:[{required:!0,message:"Please select or enter source branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter source branch",loading:ne(w==null?void 0:w.repo),options:Array.from(new Map([...w!=null&&w.activeBranch?[{label:`Active Branch (${w.activeBranch})`,value:w.activeBranch}]:[],...w!=null&&w.lastReleaseBranch?[{label:`Last Release Branch (${w.lastReleaseBranch})`,value:w.lastReleaseBranch}]:[],...((fe=q[(ze=w==null?void 0:w.repo)==null?void 0:ze.trim()])==null?void 0:fe.options)||[],...TI].map(le=>[le.value,le])).values()),onFocus:()=>G(w==null?void 0:w.repo)})})}),c.jsx(Wn,{span:12,children:c.jsx(wt.Item,{name:"targetBranch",label:"Target Branch Name",rules:[{required:!0,message:"Please enter target branch name"}],children:c.jsx(Ct,{placeholder:"e.g. feature/v1.2.0"})})})]})}),c.jsxs("div",{className:"branch-sync-create-preview",children:[c.jsxs(Ca,{strong:!0,className:"branch-sync-create-preview-title",children:["Target Repositories (",1+(((se=w==null?void 0:w.subApps)==null?void 0:se.length)||0),")"]}),E.results.length===0?c.jsx(It,{className:"branch-sync-preview-card",size:"small",children:c.jsxs("div",{className:"branch-sync-preview-repos",children:[c.jsxs("div",{children:[c.jsx($t,{color:"purple",children:"Parent App"})," ",c.jsx(Ca,{strong:!0,children:w==null?void 0:w.name})," (",w==null?void 0:w.repo,")"]}),((w==null?void 0:w.subApps)||[]).map((le,ae)=>c.jsxs("div",{className:"branch-sync-preview-subitem",children:[c.jsx($t,{className:"branch-sync-branch-tag",children:"Sub-App"})," ",c.jsx(Ca,{strong:!0,children:le.name||le.directory||""})," (",le.repo,")"]},ae))]})}):c.jsx(Ra,{className:"branch-sync-result-list",size:"small",bordered:!0,dataSource:E.results,renderItem:le=>c.jsxs(Ra.Item,{className:"branch-sync-result-item",children:[c.jsxs("div",{className:"branch-sync-result-row",children:[c.jsxs(ct,{size:8,children:[c.jsx($t,{color:le.isParent?"purple":"cyan",children:le.isParent?"Parent App":"Sub-App"}),c.jsx(Ca,{strong:!0,className:"branch-sync-result-name",children:le.name}),c.jsxs(Ca,{type:"secondary",className:"branch-sync-result-repo",children:["(",le.repo,")"]})]}),c.jsx("div",{children:le.status==="creating"?c.jsx($t,{icon:c.jsx(ar,{size:"small"}),color:"purple",children:"Creating..."}):le.success?c.jsx($t,{icon:c.jsx(vi,{}),color:"success",children:"Created"}):c.jsx($t,{icon:c.jsx(YR,{}),color:"error",children:"Failed"})})]}),le.error&&c.jsx(mr,{className:"branch-sync-result-error",type:"error",message:`Creation Error: ${le.error}`,showIcon:!0})]})})]})]})]})}const{Text:In,Paragraph:_be}=Cn,Qw={safe:{color:"success",icon:c.jsx(vi,{}),label:"Safe to delete"},review:{color:"warning",icon:c.jsx(Dh,{}),label:"Review"},keep:{color:"default",icon:c.jsx(Wl,{}),label:"Keep"},blocked:{color:"error",icon:c.jsx(P9,{}),label:"Blocked"}};function Jv(e,t="Unknown"){if(!e)return t;const n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Bbe(e){if(!e)return{date:"Unknown",time:""};const t=new Date(e);return Number.isNaN(t.getTime())?{date:"Unknown",time:""}:{date:t.toLocaleDateString(),time:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}function qC(e){return e==null?"Unknown":e===0?"Today":e===1?"1 day ago":`${e} days ago`}function KC(e){const t=Qw[e==null?void 0:e.status]||Qw.keep;return c.jsx($t,{color:t.color,icon:t.icon,children:t.label})}function Lm({label:e,value:t,color:n}){return c.jsx(It,{className:"branch-health-stat-card",children:c.jsx(cl,{title:e,value:t,valueStyle:n?{color:n}:void 0})})}function Hbe(e){const t=new Map;return(e||[]).forEach(n=>{var o;const r=((o=n.repository)==null?void 0:o.name)||"Unknown repository",a=t.get(r)||{name:r,records:[]};a.records.push(n),t.set(r,a)}),[...t.values()]}function Fbe({open:e,loading:t,records:n,onClose:r}){const a=Hbe(n),[o,s]=l.useState(()=>new Set),u=f=>{s(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h})};return c.jsx(xn,{className:"branch-health-history-modal",title:"Operation history",open:e,onCancel:r,footer:null,width:700,destroyOnClose:!0,children:t?c.jsx("div",{className:"branch-health-history-loading",children:c.jsx(ar,{})}):a.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches have been deleted from this page yet."}):c.jsx("div",{className:"branch-health-history-groups",children:a.map(f=>c.jsxs("section",{className:`branch-health-history-group${o.has(f.name)?" is-collapsed":""}`,children:[c.jsxs("button",{type:"button",className:"branch-health-history-group-header","aria-expanded":!o.has(f.name),onClick:()=>u(f.name),children:[c.jsxs("div",{className:"branch-health-history-repository-name",children:[c.jsx("span",{className:"branch-health-history-repository-icon",children:c.jsx(Fr,{})}),c.jsxs("div",{className:"branch-health-history-repository-copy",children:[c.jsx(In,{className:"branch-health-history-repository-label",children:"Repository"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:f.name},children:f.name})]})]}),c.jsxs("span",{className:"branch-health-history-group-controls",children:[c.jsxs(In,{type:"secondary",className:"branch-health-history-count",children:[f.records.length," ",f.records.length===1?"operation":"operations"]}),c.jsx(Cu,{className:`branch-health-history-collapse-icon${o.has(f.name)?" is-collapsed":""}`})]})]}),!o.has(f.name)&&c.jsx(Ra,{size:"small",dataSource:f.records,renderItem:m=>c.jsx(Ra.Item,{children:c.jsxs("div",{className:"branch-health-history-record",children:[c.jsxs("div",{className:"branch-health-history-branch",children:[c.jsx(ou,{className:"branch-health-history-branch-icon"}),c.jsx(In,{code:!0,ellipsis:{tooltip:m.branch},children:m.branch})]}),c.jsxs(In,{type:"secondary",className:"branch-health-history-record-meta",children:[c.jsx("span",{className:"branch-health-history-action",children:"Deleted"}),c.jsx("span",{children:Jv(m.deletedAt)})]})]})})})]},f.name))})})}function Vbe(){var be,Ee,Me,De,Te,Ve,_e,Ne,$e,Ae,We,Le,tt,Je,Ye,He,nt,ft,vt;const{message:e}=Pr.useApp(),[t,n]=l.useState(""),[r,a]=l.useState([]),[o,s]=l.useState(""),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(!1),[y,b]=l.useState(!1),[C,x]=l.useState(""),[w,$]=l.useState(!1),[E,R]=l.useState("all"),[N,O]=l.useState("all"),[I,j]=l.useState(void 0),[k,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,_]=l.useState(null),[F,U]=l.useState(!1),[q,L]=l.useState(!1),[K,X]=l.useState(""),[V,W]=l.useState(!1),[G,Y]=l.useState(!1),[te,ne]=l.useState(!1),[ce,Z]=l.useState([]),[ee,re]=l.useState(!1),oe=async(qe,je="")=>{var Be;if(qe){h(!0);try{const Ge=await Tm.repositories(qe),Xe=Ge.repositories||[];n(Ge.workspaceDir||qe),a(Xe);const Qe=je&&Xe.some(it=>it.path===je)?je:((Be=Xe[0])==null?void 0:Be.path)||"";s(Qe),j(void 0),f(null),Qe&&await ue(Qe)}catch(Ge){a([]),s(""),f(null),e.error(Ge.message||"Unable to find Git repositories.")}finally{h(!1)}}},ue=async(qe=o)=>{if(qe){v(!0);try{f(await Tm.scan(qe)),T(null)}catch(je){e.error(je.message||"Unable to scan branches.")}finally{v(!1)}}},ye=async qe=>{var je;H(qe),_(null),X(""),U(!!qe.hasLocal),L(!1),P(!0),W(!0);try{const Be=await Tm.preflight(o,qe.name);_(Be),U(!!((je=Be.checks)!=null&&je.localDeletionAllowed)),L(!1)}catch(Be){e.error(Be.message||"Unable to check whether this branch can be deleted.")}finally{W(!1)}},J=(qe=!1)=>{G&&!qe||(P(!1),H(null),_(null))},ve=async()=>{if(!(!B||!o)){Y(!0);try{const qe=await Tm.remove(o,B.name,{deleteLocal:F,deleteRemote:q,confirmName:K});f(qe),T(null),J(!0),qe.success?e.success(`${B.name} deleted.`):e.warning("The branch was only partially deleted. Check the result details.")}catch(qe){e.error(qe.message||"Unable to delete branch."),qe!=null&&qe.checks&&_({checks:qe.checks,branch:qe.branch})}finally{Y(!1)}}},xe=async()=>{re(!0);try{const qe=await Tm.history();Z(qe.history||[])}catch(qe){e.error(qe.message||"Unable to load branch operation history.")}finally{re(!1)}},ze=()=>{ne(!0),xe()};l.useEffect(()=>{let qe=!0;return So.config().then(je=>{if(!(!qe||!je.workspaceDir))return n(je.workspaceDir),oe(je.workspaceDir)}).catch(()=>{}),()=>{qe=!1}},[]);const fe=(u==null?void 0:u.branches)||[],se=l.useMemo(()=>{const qe=new Map;return fe.forEach(je=>{var Xe,Qe;const Be=String(((Xe=je.creator)==null?void 0:Xe.name)||((Qe=je.creator)==null?void 0:Qe.email)||"Unknown").trim()||"Unknown",Ge=Be.toLocaleLowerCase();qe.has(Ge)||qe.set(Ge,{value:Ge,label:Be})}),[...qe.values()].sort((je,Be)=>je.label.localeCompare(Be.label))},[fe]),le=l.useMemo(()=>{if(!w||!C.trim())return null;try{return new RegExp(C.trim(),"i")}catch{return}},[C,w]),ae=l.useMemo(()=>{const qe=C.trim().toLowerCase();return w&&qe&&!le?[]:fe.filter(je=>{var Xe,Qe,it,ut,pt;if(E!=="all"&&((Xe=je.health)==null?void 0:Xe.status)!==E||N==="merged"&&!je.merged||N==="unmerged"&&je.merged)return!1;const Be=String(((Qe=je.creator)==null?void 0:Qe.name)||((it=je.creator)==null?void 0:it.email)||"Unknown").trim().toLocaleLowerCase()||"unknown";if(I&&Be!==I)return!1;if(!qe)return!0;const Ge=[je.name,(ut=je.creator)==null?void 0:ut.name,(pt=je.lastCommit)==null?void 0:pt.subject,je.mergedInto].filter(Boolean).join(" ");return w?le.test(Ge):Ge.toLowerCase().includes(qe)})},[fe,I,N,C,w,le,E]),pe=l.useMemo(()=>({all:fe.length,safe:fe.filter(qe=>{var je;return((je=qe.health)==null?void 0:je.status)==="safe"}).length,merged:fe.filter(qe=>qe.merged).length,stale:fe.filter(qe=>qe.ageDays>=90).length,blocked:fe.filter(qe=>{var je;return((je=qe.health)==null?void 0:je.status)==="blocked"}).length}),[fe]),Ie=[{title:"Branch",dataIndex:"name",key:"name",width:230,sorter:(qe,je)=>qe.name.localeCompare(je.name),render:(qe,je)=>c.jsxs("div",{className:"branch-health-branch-cell",children:[c.jsxs(ct,{size:6,wrap:!0,children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe},children:qe})]}),c.jsxs("div",{className:"branch-health-inline-meta",children:[c.jsx($t,{children:je.source}),je.current&&c.jsx($t,{color:"blue",children:"Current"}),je.protected&&c.jsx($t,{color:"red",children:"Protected"})]})]})},{title:"Health",key:"health",width:150,sorter:(qe,je)=>{var Be,Ge;return(((Be=je.health)==null?void 0:Be.score)||0)-(((Ge=qe.health)==null?void 0:Ge.score)||0)},defaultSortOrder:"descend",render:(qe,je)=>{var Be;return c.jsxs("div",{className:"branch-health-health-cell",children:[KC(je.health),c.jsxs(In,{type:"secondary",children:["Priority ",((Be=je.health)==null?void 0:Be.score)||0]})]})}},{title:"Created",key:"createdAt",width:190,sorter:(qe,je)=>(Date.parse(qe.createdAt||"")||0)-(Date.parse(je.createdAt||"")||0),render:(qe,je)=>{const Be=Bbe(je.createdAt);return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Be.date}),Be.time&&c.jsx(In,{children:Be.time}),c.jsx(In,{type:"secondary",children:je.createdAtSource})]})}},{title:"Creator",key:"creator",width:150,render:(qe,je)=>{var Be,Ge;return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{ellipsis:{tooltip:((Be=je.creator)==null?void 0:Be.name)||"Unknown"},children:((Ge=je.creator)==null?void 0:Ge.name)||"Unknown"}),c.jsx(In,{type:"secondary",children:"First commit author"})]})}},{title:"Last commit",key:"lastCommit",width:290,sorter:(qe,je)=>{var Be,Ge;return(Date.parse(((Be=qe.lastCommit)==null?void 0:Be.committedAt)||"")||0)-(Date.parse(((Ge=je.lastCommit)==null?void 0:Ge.committedAt)||"")||0)},render:(qe,je)=>{var Be,Ge,Xe,Qe,it;return c.jsxs("div",{className:"branch-health-commit-cell",children:[c.jsx(In,{ellipsis:{tooltip:(Be=je.lastCommit)==null?void 0:Be.subject},children:((Ge=je.lastCommit)==null?void 0:Ge.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Xe=je.lastCommit)==null?void 0:Xe.shortHash}),c.jsx(In,{type:"secondary",children:qC(je.ageDays)})]}),c.jsxs(In,{type:"secondary",children:["by ",((it=(Qe=je.lastCommit)==null?void 0:Qe.author)==null?void 0:it.name)||"Unknown"]})]})}},{title:"Last merged into",key:"mergedInto",width:190,render:(qe,je)=>je.mergedInto?c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx($t,{color:"green",children:je.mergedInto}),c.jsx(In,{type:"secondary",children:je.mergeSource})]}):c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{type:"secondary",children:"Not found"}),c.jsx(In,{type:"secondary",children:"No containing local ref"})]})},{title:"Relation",key:"relation",width:130,render:(qe,je)=>c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:je.ahead==null?"Not analyzed":`${je.ahead} ahead`}),c.jsx(In,{children:je.behind==null?"Not analyzed":`${je.behind} behind`}),c.jsx(In,{type:"secondary",children:je.commitCount==null?"Not analyzed":`${je.commitCount} commits`})]})},{title:"Details",key:"details",fixed:"right",width:88,render:(qe,je)=>c.jsx(Re,{type:"link",onClick:()=>T(je),children:"View"})}],Ce=async qe=>{b(!1),n(qe),await oe(qe)},me=async()=>{if(t)try{await Un.openFolder(t)}catch(qe){e.error(qe.message||"Unable to open the workspace directory.")}};return c.jsxs("div",{className:"branch-health-page",children:[c.jsx(Ur,{title:"Branch Health",description:"Find stale or already merged branches before deciding what to clean up.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Re,{icon:c.jsx(M9,{}),onClick:ze,children:"Operation history"}),c.jsx(Re,{icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Browse workspace"}),c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:()=>ue(),loading:p,disabled:!o,children:"Refresh"})]})}),c.jsxs(It,{className:"branch-health-repository-card",children:[c.jsxs(ct,{size:"large",className:"branch-health-summary",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:me,disabled:!t,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(In,{ellipsis:{tooltip:t||"Not configured"},children:t||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:r.length})]})]}),c.jsx("div",{className:"branch-health-repository-row",children:c.jsxs("div",{className:"branch-health-repository-picker",children:[c.jsx(In,{type:"secondary",children:"Repository"}),c.jsx($n,{className:"branch-health-repository-select",showSearch:!0,value:o||void 0,placeholder:"Select a Git repository",loading:m,options:r.map(qe=>({label:qe.name,value:qe.path})),optionFilterProp:"label",onChange:qe=>{s(qe),j(void 0),ue(qe)},notFoundContent:m?c.jsx(ar,{size:"small"}):"No Git repositories found"})]})})]}),u&&c.jsxs(c.Fragment,{children:[c.jsxs(Uo,{gutter:[12,12],className:"branch-health-stat-row",children:[c.jsx(Wn,{xs:12,sm:8,lg:4,children:c.jsx(Lm,{label:"All branches",value:pe.all})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Recommended cleanup",value:pe.safe,color:"#389e0d"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Already merged",value:pe.merged,color:"#1677ff"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Stale > 90 days",value:pe.stale,color:"#d48806"})}),c.jsx(Wn,{xs:12,sm:8,lg:5,children:c.jsx(Lm,{label:"Protected / blocked",value:pe.blocked,color:"#cf1322"})})]}),c.jsxs(It,{className:"branch-health-table-card",children:[c.jsxs("div",{className:"branch-health-toolbar",children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:w?"Regex: e.g. ^feature/.*$":"Search branch, creator, commit...",value:C,status:w&&C.trim()&&!le?"error":void 0,onChange:qe=>x(qe.target.value)}),c.jsx(nr,{checked:w,onChange:qe=>$(qe.target.checked),children:"Regex"}),w&&C.trim()&&!le&&c.jsx(In,{type:"danger",children:"Invalid regular expression"}),c.jsx($n,{value:E,onChange:R,options:[{value:"all",label:"All health states"},...Object.entries(Qw).map(([qe,je])=>({value:qe,label:je.label}))]}),c.jsx($n,{value:N,onChange:O,options:[{value:"all",label:"All merge states"},{value:"merged",label:"Merged"},{value:"unmerged",label:"Not merged"}]}),c.jsx($n,{className:"branch-health-creator-filter",allowClear:!0,showSearch:!0,value:I,onChange:j,placeholder:"Filter by creator",options:se,optionFilterProp:"label",filterOption:(qe,je)=>`${(je==null?void 0:je.label)||""} ${(je==null?void 0:je.value)||""}`.toLowerCase().includes(qe.toLowerCase())}),c.jsxs(In,{type:"secondary",className:"branch-health-result-count",children:[ae.length," shown"]})]}),c.jsx(or,{rowKey:"id",size:"small",columns:Ie,dataSource:ae,loading:p,pagination:{pageSize:20,showSizeChanger:!1,hideOnSinglePage:!0},scroll:{x:1440},locale:{emptyText:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})}}),c.jsx("div",{className:"branch-health-mobile-list",children:ae.length?ae.map(qe=>{var je,Be,Ge,Xe,Qe;return c.jsxs(It,{size:"small",className:"branch-health-mobile-card",children:[c.jsxs("div",{className:"branch-health-mobile-card-header",children:[c.jsxs("div",{className:"branch-health-mobile-branch",children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe.name},children:qe.name})]}),KC(qe.health)]}),c.jsxs("div",{className:"branch-health-mobile-source",children:[c.jsx($t,{children:qe.source}),qe.current&&c.jsx($t,{color:"blue",children:"Current"}),qe.protected&&c.jsx($t,{color:"red",children:"Protected"})]}),c.jsxs("div",{className:"branch-health-mobile-commit",children:[c.jsx(In,{ellipsis:{tooltip:(je=qe.lastCommit)==null?void 0:je.subject},children:((Be=qe.lastCommit)==null?void 0:Be.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Ge=qe.lastCommit)==null?void 0:Ge.shortHash}),c.jsx(In,{type:"secondary",children:qC(qe.ageDays)})]})]}),c.jsxs("div",{className:"branch-health-mobile-grid",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Created"}),c.jsx(In,{children:Jv(qe.createdAt)})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Creator"}),c.jsx(In,{ellipsis:{tooltip:(Xe=qe.creator)==null?void 0:Xe.name},children:((Qe=qe.creator)==null?void 0:Qe.name)||"Unknown"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Merged into"}),c.jsx(In,{children:qe.mergedInto||"Not found"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Relation"}),c.jsxs(In,{children:[qe.ahead," ahead"]}),c.jsxs(In,{children:[qe.behind," behind"]})]})]}),c.jsx(Re,{block:!0,type:"link",onClick:()=>T(qe),children:"View details"})]},qe.id)}):c.jsx(Xt,{className:"branch-health-mobile-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})})]})]}),!u&&!m&&!p&&c.jsx(It,{className:"branch-health-empty-card",children:c.jsx(Xt,{description:r.length?"Select a repository to scan its branches.":"Select a workspace folder containing Git repositories.",children:c.jsx(Re,{type:"primary",icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Choose workspace"})})}),c.jsx(I$,{title:(k==null?void 0:k.name)||"Branch details",width:540,open:!!k,onClose:()=>T(null),children:k&&c.jsxs("div",{className:"branch-health-detail",children:[c.jsxs("div",{className:"branch-health-detail-status",children:[KC(k.health),c.jsxs(In,{type:"secondary",children:["Priority ",((be=k.health)==null?void 0:be.score)||0]})]}),c.jsx(_be,{type:"secondary",children:((Ee=k.reasons)==null?void 0:Ee.join(" · "))||"No additional recommendation details."}),c.jsxs(_o,{column:1,size:"small",bordered:!0,children:[c.jsx(_o.Item,{label:"Source",children:k.source}),c.jsxs(_o.Item,{label:"Created",children:[Jv(k.createdAt)," (",k.createdAtSource,")"]}),c.jsxs(_o.Item,{label:"Creator",children:[((Me=k.creator)==null?void 0:Me.name)||"Unknown"," ",c.jsxs(In,{type:"secondary",children:["(",((De=k.creator)==null?void 0:De.email)||"no email",")"]})]}),c.jsx(_o.Item,{label:"Current branch",children:k.current?"Yes — deletion blocked":"No"}),c.jsx(_o.Item,{label:"Protected pattern",children:k.protected?"Yes — deletion blocked":"No"}),c.jsxs(_o.Item,{label:"Last commit",children:[(Te=k.lastCommit)==null?void 0:Te.shortHash," · ",(Ve=k.lastCommit)==null?void 0:Ve.subject]}),c.jsx(_o.Item,{label:"Commit author",children:((Ne=(_e=k.lastCommit)==null?void 0:_e.author)==null?void 0:Ne.name)||"Unknown"}),c.jsxs(_o.Item,{label:"Last updated",children:[Jv(($e=k.lastCommit)==null?void 0:$e.committedAt)," (",qC(k.ageDays),")"]}),c.jsx(_o.Item,{label:"Last merged into",children:k.analysisSkipped?"Not analyzed":k.mergedInto||"Not found in local refs"}),c.jsx(_o.Item,{label:"Merge evidence",children:k.mergeSource}),c.jsx(_o.Item,{label:"Relation to default",children:k.analysisSkipped?"Not analyzed (last commit older than one year)":`${k.ahead} ahead · ${k.behind} behind`})]}),c.jsx(mr,{className:"branch-health-detail-alert",type:((Ae=k.health)==null?void 0:Ae.status)==="safe"?"success":"info",showIcon:!0,icon:c.jsx(J$,{}),message:"Deletion requires a fresh safety check",description:"Branch deletion will re-check merge state and checkout state on the server before changing any refs."}),c.jsxs("div",{className:"branch-health-detail-actions",children:[c.jsx(Re,{danger:!0,disabled:((We=k.name)==null?void 0:We.toLowerCase())==="master",onClick:()=>ye(k),children:"Delete branch"}),((Le=k.name)==null?void 0:Le.toLowerCase())==="master"&&c.jsx(In,{type:"secondary",children:"The master branch cannot be deleted."})]})]})}),c.jsx(xn,{title:`Delete ${(B==null?void 0:B.name)||"branch"}?`,open:z,onCancel:J,onOk:ve,okText:"Delete branch",okButtonProps:{danger:!0,disabled:V||!(A!=null&&A.canDelete)||!F&&!q||K!==(B==null?void 0:B.name)},confirmLoading:G,destroyOnClose:!0,children:V?c.jsx("div",{className:"branch-health-delete-loading",children:c.jsx(ar,{})}):A&&B?c.jsxs("div",{className:"branch-health-delete-dialog",children:[(Je=(tt=A.checks)==null?void 0:tt.blockers)!=null&&Je.length?c.jsx(mr,{type:"error",showIcon:!0,message:"Deletion blocked",description:A.checks.blockers.join(" ")}):c.jsx(mr,{type:((Ye=B.health)==null?void 0:Ye.status)==="safe"?"success":"warning",showIcon:!0,message:((He=B.health)==null?void 0:He.status)==="safe"?"This branch passed the safety check.":"This branch passed the hard safety checks, but review the evidence first.",description:`${B.mergedInto?`Merged into ${B.mergedInto}. `:""}${B.ahead} commits ahead of the default branch.`}),c.jsxs("div",{className:"branch-health-delete-targets",children:[c.jsx(In,{strong:!0,children:"Delete targets"}),c.jsx(nr,{checked:F,disabled:!((nt=A.checks)!=null&&nt.localDeletionAllowed),onChange:qe=>U(qe.target.checked),children:"Local branch"}),c.jsx(nr,{checked:q,disabled:!((ft=A.checks)!=null&&ft.remoteDeletionAllowed),onChange:qe=>L(qe.target.checked),children:"Remote origin branch"})]}),c.jsxs("div",{className:"branch-health-delete-confirm",children:[c.jsx(In,{strong:!0,children:"Type the exact branch name to confirm"}),c.jsx(Ct,{value:K,onChange:qe=>X(qe.target.value),placeholder:B.name,autoComplete:"off"})]}),((vt=A.results)==null?void 0:vt.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Previous attempt result",description:A.results.map(qe=>`${qe.target}: ${qe.success?"deleted":qe.error}`).join(" · ")})]}):c.jsx(Xt,{description:"Safety check unavailable."})}),c.jsx(Fbe,{open:te,loading:ee,records:ce,onClose:()=>ne(!1)}),c.jsx(df,{open:y,initialPath:t||"~",onCancel:()=>b(!1),onSelect:Ce,title:"Choose workspace folder"})]})}const{Text:oo}=Cn,GC={running:["processing","Running"],queued:["default","Queued"],success:["success","Success"],failed:["error","Failed"],completed:["success","Completed"]};function Ube(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");if(!o)return;t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"package-upgrade-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"package-upgrade-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function Wbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState({workspaceDir:"",repos:[],tasks:[]}),[r,a]=l.useState(!1),[o,s]=l.useState(!1),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(null),[y]=wt.useForm(),[b]=wt.useForm(),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState([]),[N,O]=l.useState(!1),[I,j]=l.useState([]),[k,T]=l.useState([]),[z,P]=l.useState(!1),B=async()=>{try{const W=await So.config();n(W),f(G=>G?W.tasks.find(Y=>Y.id===G.id)||G:null)}catch(W){e.error(W.message)}};l.useEffect(()=>{if(r||o||m)return;B();const W=setInterval(B,2500);return()=>clearInterval(W)},[r,o,m]),l.useEffect(()=>{if(!(u!=null&&u.id)||["completed","failed","success"].includes(u.status))return;let W=!0;const G=async()=>{try{const te=await So.config();if(!W)return;n(te);const ne=te.tasks.find(ce=>ce.id===u.id);ne&&f(ne)}catch{}};G();const Y=setInterval(G,1e3);return()=>{W=!1,clearInterval(Y)}},[u==null?void 0:u.id,u==null?void 0:u.status]);const H=l.useMemo(()=>[...new Set(t.tasks.map(W=>W.packageName).filter(Boolean))],[t.tasks]),A=wt.useWatch("packageName",y),_=wt.useWatch("version",y),F=wt.useWatch("repoIds",y)||[],U=F.length?C:H;l.useEffect(()=>{A&&_&&y.setFieldValue("commitMessage",`upgrade ${A} to ${_}`)},[A,_]),l.useEffect(()=>{if(!F.length){x([]);return}let W=!0;return $(!0),So.packageNames(F).then(G=>{W&&x(G)}).catch(()=>{W&&x([])}).finally(()=>{W&&$(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{if(!F.length){T([]),y.setFieldValue("targetBranch","");return}let W=!0;return P(!0),So.branches(F).then(G=>{if(!W)return;T(G);const Y=y.getFieldValue("targetBranch");Y&&!G.some(te=>te.name===Y)&&y.setFieldValue("targetBranch","")}).catch(()=>{W&&T([])}).finally(()=>{W&&P(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{const W=String(A||"").trim();if(!W){R([]);return}let G=!0;const Y=setTimeout(async()=>{O(!0);try{const te=await qc.versions(W);G&&R(te.filter(ne=>typeof ne=="string"?ne:ne.version))}catch{G&&R([])}finally{G&&O(!1)}},350);return()=>{G=!1,clearTimeout(Y)}},[A]);const q=async()=>{if(t.workspaceDir)try{await Un.openFolder(t.workspaceDir)}catch(W){e.error(W.message)}},L=async W=>{try{await So.addRepo(W),b.resetFields(),h(!1),B()}catch(G){e.error(G.message)}},K=async W=>{v(W.id);try{await So.cloneRepo(W.id),e.success(`${W.name} cloned`),await B()}catch(G){e.error(G.message)}finally{v(null)}},X=async W=>{try{const G=await So.createTask(W);s(!1),y.resetFields(),f(G),await B(),e.success("Task started")}catch(G){e.error(G.message)}},V=[{title:"Repository",dataIndex:"name",render:(W,G)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(oo,{strong:!0,children:G.name}),c.jsx(oo,{type:"secondary",children:G.message||""})]})},{title:"Status",dataIndex:"status",render:W=>{const[G,Y]=GC[W]||["default",W];return c.jsx($t,{color:G,children:Y})}},{title:"PR",dataIndex:"prUrl",render:W=>W?c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open PR"}):"—"}];return c.jsxs("div",{className:"package-upgrade-page",children:[c.jsx(Ur,{title:"Package Upgrade",description:"Upgrade one package across multiple repositories and open Bitbucket pull requests.",actions:c.jsxs(ct,{children:[c.jsx(Re,{icon:c.jsx(Gl,{}),onClick:()=>a(!0),children:"Repository list"}),c.jsx(Re,{type:"primary",icon:c.jsx(Z$,{}),onClick:()=>s(!0),disabled:!t.repos.length,children:"Create task"})]})}),c.jsx(It,{className:"package-upgrade-summary",children:c.jsxs(ct,{size:"large",children:[c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(oo,{ellipsis:{tooltip:t.workspaceDir||"Not configured"},children:t.workspaceDir||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:t.repos.length})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Task history"}),c.jsx("div",{className:"summary-value",children:t.tasks.length})]})]})}),c.jsx(It,{title:"Operation history",className:"package-upgrade-card",children:t.tasks.length?c.jsx(Ra,{dataSource:t.tasks,renderItem:W=>{var G;return c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[W.packageName," → ",W.version]}),c.jsx($t,{color:W.status==="failed"?"error":W.status==="running"?"processing":"success",children:W.status})]}),description:c.jsxs(oo,{type:"secondary",children:[W.sourceBranch," → ",W.targetBranch," · ",((G=W.repos)==null?void 0:G.length)||W.repoIds.length," repositories · ",new Date(W.createdAt).toLocaleString()]})}),c.jsx(Re,{onClick:()=>f(W),children:"Details"})]})}}):c.jsx(oo,{type:"secondary",children:"No package upgrade tasks yet."})}),c.jsxs(xn,{title:"Repository list",open:r,onCancel:()=>a(!1),footer:null,width:760,children:[c.jsxs("div",{className:"package-upgrade-workspace-readonly",children:[c.jsxs("div",{children:[c.jsx(oo,{strong:!0,children:"Workspace directory"}),c.jsx(oo,{type:"secondary",children:"Read-only path used for local repositories"})]}),c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly package-upgrade-workspace-path-control",children:c.jsx(Ct,{value:t.workspaceDir||"",placeholder:"Not configured",readOnly:!0,prefix:c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"})})})]}),c.jsxs("div",{className:"repo-list-header",children:[c.jsx(oo,{strong:!0,children:"Repository list"}),c.jsx(Re,{size:"small",icon:c.jsx(Xn,{}),onClick:()=>h(!0),children:"Add repo"})]}),c.jsx(Ra,{className:"package-upgrade-repo-list",size:"small",dataSource:t.repos,renderItem:W=>c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{size:10,children:[c.jsx("span",{children:W.name}),c.jsx($t,{color:W.cloned?"success":"default",children:W.cloned?"Cloned":"Not cloned"})]}),description:W.url}),c.jsxs("div",{className:"package-upgrade-repo-actions",children:[c.jsx("span",{className:"package-upgrade-clone-slot",children:!W.cloned&&c.jsx(Re,{type:"link",icon:c.jsx(Cge,{}),loading:p===W.id,onClick:()=>K(W),"aria-label":"Clone repository",title:"Clone repository"})}),c.jsx(Gr,{title:"Remove repository?",onConfirm:async()=>{await So.removeRepo(W.id),B()},children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),"aria-label":"Delete repository",title:"Delete repository"})})]})]})})]}),c.jsx(xn,{title:"Add repository",open:m,onCancel:()=>h(!1),footer:null,children:c.jsxs(wt,{form:b,layout:"vertical",onFinish:L,children:[c.jsx(wt.Item,{name:"url",label:"Repository URL",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"ssh://git@bitbucket.example/scm/PROJ/repo.git"})}),c.jsx(wt.Item,{name:"name",label:"Display name",children:c.jsx(Ct,{placeholder:"Optional"})}),c.jsx(wt.Item,{name:"directory",label:"Local directory name",children:c.jsx(Ct,{placeholder:"Defaults to repository name"})}),c.jsx(Re,{type:"primary",htmlType:"submit",children:"Add repo"})]})}),c.jsx(xn,{title:"Task details",open:!!u,onCancel:()=>f(null),footer:null,width:760,children:u&&(()=>{var ne,ce;const W=u.repos||[],G=W.filter(Z=>["success","failed"].includes(Z.status)).length,Y=W.length?Math.round(G/W.length*100):0,te=W.some(Z=>Z.status==="failed")||u.status==="failed";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"package-upgrade-task-progress",children:c.jsxs(ct,{direction:"vertical",size:4,style:{width:"100%"},children:[c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[u.packageName," → ",u.version]}),c.jsx($t,{color:((ne=GC[u.status])==null?void 0:ne[0])||"default",children:((ce=GC[u.status])==null?void 0:ce[1])||u.status})]}),c.jsxs(oo,{type:"secondary",children:[G," / ",W.length," repositories completed"]}),c.jsx(mp,{percent:Y,status:te?"exception":u.status==="completed"?"success":"active"})]})}),c.jsx(or,{size:"small",rowKey:"repoId",pagination:!1,columns:V,dataSource:W})]})})()}),c.jsx(xn,{title:"Create package upgrade task",open:o,onCancel:()=>s(!1),onOk:()=>y.submit(),okText:"Confirm",cancelText:"Cancel",width:620,children:c.jsxs(wt,{form:y,layout:"vertical",onFinish:X,children:[c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"sourceBranch",label:"Work branch",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade/package-name"})}),c.jsx(wt.Item,{name:"targetBranch",label:"Target branch",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:k.map(W=>({label:W.name,value:W.name})),filterOption:(W,G)=>{var Y;return(Y=G==null?void 0:G.value)==null?void 0:Y.toLowerCase().includes(W.toLowerCase())},loading:z,placeholder:F.length?"Select or enter a branch":"Select repositories first",notFoundContent:z?"Loading branches…":"No common branches found",disabled:!F.length})})]}),c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"packageName",label:"Package name",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:U.map(W=>({label:W,value:W})),loading:w,placeholder:"@scope/package"})}),c.jsx(wt.Item,{name:"version",label:"Target version",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"1.2.3",onChange:()=>j([]),addonAfter:c.jsx(Jl,{className:"package-upgrade-version-cascader",popupClassName:"package-upgrade-version-picker",placement:"bottomRight",value:I,options:Ube(E),loading:N,placeholder:"Select",expandTrigger:"hover",displayRender:()=>"Select",onChange:W=>{const G=W||[];j(G),y.setFieldValue("version",G.length?G[G.length-1]:"")}})})})]}),c.jsx(wt.Item,{name:"commitMessage",label:"Commit message",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade xxx to xxx"})}),c.jsx(wt.Item,{name:"repoIds",label:"Repositories",rules:[{required:!0,message:"Select at least one repository"}],children:c.jsx(nr.Group,{style:{width:"100%"},children:c.jsx(ct,{direction:"vertical",children:t.repos.map(W=>c.jsxs(nr,{value:W.id,children:[W.name," ",c.jsxs(oo,{type:"secondary",children:["(",W.cloned?"cloned":"clone on task start",")"]})]},W.id))})})})]})})]})}const{Text:xo}=Cn,DI=["#7c5cff","#16a085","#e67e22","#d94f70","#1982c4","#7a9e2a","#c44536","#8e5ea2"];function qbe(e,t){return DI[Math.max(0,t.indexOf(e))%DI.length]}function Kbe(){var j;const{message:e}=Pr.useApp(),[t,n]=l.useState(null),[r,a]=l.useState(!1),[o,s]=l.useState(""),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState([]),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState(!1),E=async()=>{a(!0);try{const[k]=await Promise.all([So.dependencyScan(),new Promise(T=>setTimeout(T,500))]);n(k),e.success("Scan complete")}catch(k){n(null),e.error(k.message)}finally{a(!1)}},R=l.useMemo(()=>((t==null?void 0:t.packages)||[]).filter(k=>k.name.toLowerCase().includes(o.trim().toLowerCase())&&(!u||k.repositoryCount>1)),[t,o,u]),N=async()=>{if(t!=null&&t.workspaceDir)try{await Un.openFolder(t.workspaceDir)}catch(k){e.error(k.message)}},O=async()=>{h(!0),x(!0);try{const k=await So.dependencyRepositories();v(k.repositories||[]),b((k.repositories||[]).filter(T=>T.selected).map(T=>T.directory))}catch(k){e.error(k.message)}finally{x(!1)}},I=async()=>{$(!0);try{await So.saveDependencyRepositories(y),h(!1),n(null),e.success("Repository settings saved")}catch(k){e.error(k.message)}finally{$(!1)}};return c.jsxs("div",{className:"package-versions-page",children:[c.jsx(Ur,{title:"Package Versions",description:"Scan every repository in the configured workspace and compare dependency versions at a glance. Matching versions share a color within each package.",actions:c.jsxs(ct,{children:[c.jsx(Re,{icon:c.jsx(Gl,{}),onClick:O,children:"Repositories"}),c.jsx(Re,{icon:c.jsx(Xa,{}),loading:r,onClick:E,children:t?"Scan again":"Scan"})]})}),r&&!t?c.jsxs("div",{className:"package-versions-loading",children:[c.jsx(ar,{size:"large"}),c.jsx(xo,{type:"secondary",children:"Scanning package.json files…"})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs(It,{className:"package-versions-summary",children:[c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"package-versions-path",children:[c.jsx(Re,{type:"text",icon:c.jsx(Fr,{}),onClick:N,"aria-label":"Open workspace directory"}),c.jsx(yn,{title:t.workspaceDir,children:c.jsx(xo,{ellipsis:!0,children:t.workspaceDir})})]})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"package-versions-stat",children:t.repositories.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Shared packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.filter(k=>k.repositoryCount>1).length})]})]}),((j=t.errors)==null?void 0:j.length)>0&&c.jsx(mr,{className:"package-versions-alert",type:"warning",showIcon:!0,message:`${t.errors.length} repository could not be read`,description:t.errors.map(k=>`${k.repository}: ${k.message}`).join(" · ")}),c.jsx(It,{className:"package-versions-card",title:c.jsxs("span",{children:["Dependency matrix ",c.jsxs(xo,{type:"secondary",children:["· ",R.length," shown"]})]}),extra:c.jsxs(ct,{children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Filter packages",value:o,onChange:k=>s(k.target.value)}),c.jsx(Ja,{checked:u,onChange:f,checkedChildren:"Shared",unCheckedChildren:"All"})]}),children:R.length?c.jsx(Q0,{className:"package-versions-list",items:R.map(k=>{const T=k.versions.map(z=>z.version);return{key:k.name,label:c.jsxs("div",{className:"package-version-name",children:[c.jsx(xo,{strong:!0,children:k.name}),c.jsxs(xo,{type:"secondary",children:[k.repositoryCount," repos · ",k.versions.length," versions"]})]}),children:c.jsx("div",{className:"package-version-groups",children:k.versions.map(z=>c.jsxs("div",{className:"package-version-group",children:[c.jsx($t,{className:"package-version-tag",style:{"--version-color":qbe(z.version,T)},children:z.version}),c.jsx("div",{className:"package-version-repos",children:z.repositories.map(P=>c.jsx(yn,{title:`${P.repository} · ${P.sections.join(", ")}`,children:c.jsx("span",{className:"package-version-repo",children:P.repository})},P.directory))})]},z.version))})}})}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:o?"No matching packages":u?"No package is shared by more than one repository":"No dependencies found"})}),c.jsxs(xo,{className:"package-versions-updated",type:"secondary",children:["Last scanned ",new Date(t.scannedAt).toLocaleString()]})]}):c.jsx(It,{children:c.jsx(Xt,{description:"Click Scan to inspect package versions in the configured workspace."})}),c.jsxs(xn,{title:"Repositories to scan",open:m,onCancel:()=>h(!1),onOk:I,okButtonProps:{disabled:!y.length},okText:"Save",confirmLoading:w,width:620,children:[c.jsx(xo,{type:"secondary",children:"Select which repositories in the workspace should be included in the next scan."}),c.jsxs("div",{className:"package-versions-repository-toolbar",children:[c.jsx(nr,{checked:p.length>0&&y.length===p.length,indeterminate:y.length>0&&y.length<p.length,onChange:k=>b(k.target.checked?p.map(T=>T.directory):[]),children:"Select all"}),c.jsxs(xo,{type:"secondary",children:[y.length," / ",p.length," selected"]})]}),C?c.jsx("div",{className:"package-versions-settings-loading",children:c.jsx(ar,{})}):c.jsx(nr.Group,{value:y,onChange:b,className:"package-versions-repository-options",children:c.jsx(Ra,{size:"small",dataSource:p,locale:{emptyText:"No repositories found in this workspace."},renderItem:k=>c.jsx(Ra.Item,{children:c.jsx(nr,{value:k.directory,children:c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(xo,{children:k.name}),c.jsx(xo,{type:"secondary",children:k.directory})]})})})})})]})]})}const{Paragraph:q9,Text:Zn,Title:Bd}=Cn,Gbe=[{key:"launcher",label:"Service Launcher",description:"Start, stop, and inspect local project scripts.",icon:c.jsx(qo,{})},{key:"pr-review",label:"PR Review",description:"Turn pull request changes into a focused review.",icon:c.jsx(Ly,{})},{key:"todo-list",label:"To-Do",description:"Keep development tasks visible and moving.",icon:c.jsx(mu,{})},{key:"postman",label:"API Workspace",description:"Build, organize, and send HTTP requests.",icon:c.jsx(hu,{})},{key:"ports",label:"Port Diagnostic",description:"Find listeners and resolve local port conflicts.",icon:c.jsx(e4,{})},{key:"errors",label:"Error Logs",description:"Review recent launcher and application errors.",icon:c.jsx(uf,{})}],Id=e=>Array.isArray(e)?e:[],Ybe=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[]),Xbe=e=>e instanceof Map?[...e.entries()]:!e||typeof e!="object"?[]:Object.entries(e),Jbe=e=>e.reduce((t,[,n])=>t+Math.max(0,Number(n)||0),0),Qbe=(e,t)=>e.alias||e.name||e.folder||`Service ${t+1}`,Zbe=e=>e.groupName||e.branch||e.folder||"Local service",Is=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,zI=e=>typeof e=="string"?e:(e==null?void 0:e.message)||"DevBuddy could not load service and runtime data.",e1e=[{key:"activity",title:"Recent activity",description:"Jira & Confluence mentions.",icon:c.jsx(uf,{}),route:"jira-filters"},{key:"jiraDueToday",title:"Jira due today",description:"Unresolved issues due today.",icon:c.jsx(mu,{}),route:"jira-filters"},{key:"assignedTodos",title:"Assigned to-dos",description:"Your open local tasks.",icon:c.jsx(mu,{}),route:"todo-list"},{key:"authoredPrs",title:"Your open PRs",description:"Created by you and not merged.",icon:c.jsx(hu,{}),route:"pr-review"}];let YC=null;const K9=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},t1e=e=>n1e(e).filter(t=>!t.read).length,n1e=e=>{const t=(e==null?void 0:e.notifications)||{};return[...Array.isArray(t.jira)?t.jira:[],...Array.isArray(t.confluence)?t.confluence:[]]};function r1e({config:e,items:t,open:n,onClose:r,onNavigate:a}){const[o,s]=l.useState(""),[u,f]=l.useState("all"),m=l.useMemo(()=>{let C=t||[];if(u!=="all"&&(C=C.filter(x=>(x.sourceType||x.source||"").toLowerCase()===u.toLowerCase())),o.trim()){const x=o.trim().toLowerCase();C=C.filter(w=>{const $=String(w.title||w.summary||w.name||"").toLowerCase(),E=String(w.key||w.repository||"").toLowerCase(),R=String(w.author||"").toLowerCase(),N=String(w.activityType||w.status||"").toLowerCase();return $.includes(x)||E.includes(x)||R.includes(x)||N.includes(x)})}return C},[t,o,u]),h=(t||[]).some(C=>C.source==="Jira"||C.sourceType==="jira")&&(t||[]).some(C=>C.source==="Confluence"||C.sourceType==="confluence"),p=(t||[]).filter(C=>(C.sourceType||C.source)==="Jira"||(C.sourceType||C.source)==="jira").length,v=(t||[]).filter(C=>(C.sourceType||C.source)==="Confluence"||(C.sourceType||C.source)==="confluence").length,y=C=>{if(C!=null&&C.url&&/^https?:\/\//i.test(C.url)){window.open(C.url,"_blank","noopener,noreferrer");return}if(C!=null&&C.url&&C.url.startsWith("#/")){window.location.hash=C.url;return}e!=null&&e.route&&typeof a=="function"&&a(e.route)},b=C=>{const x=C.source||C.sourceType;return x==="Jira"||x==="jira"?c.jsx($t,{color:"blue",children:"Jira"}):x==="Confluence"||x==="confluence"?c.jsx($t,{color:"cyan",children:"Confluence"}):C.repository?c.jsx($t,{color:"purple",children:"PR"}):C.completed!==void 0?c.jsx($t,{color:"green",children:"To-Do"}):null};return c.jsxs(xn,{title:c.jsxs(ct,{size:8,children:[c.jsx("span",{className:"overview-insight-modal-icon",children:e==null?void 0:e.icon}),c.jsx("span",{children:e==null?void 0:e.title}),c.jsx(sa,{count:t.length,style:{backgroundColor:"var(--db-primary)"}})]}),open:n,onCancel:r,footer:null,width:880,className:"overview-insights-modal",children:[c.jsxs("div",{className:"overview-insights-modal-header",children:[c.jsx(Zn,{type:"secondary",children:e==null?void 0:e.description}),c.jsxs(ct,{size:12,className:"overview-insights-modal-filters",wrap:!0,children:[c.jsx(Ct,{placeholder:"Search items...",prefix:c.jsx(jo,{}),allowClear:!0,value:o,onChange:C=>s(C.target.value),style:{width:220}}),h&&c.jsxs(er.Group,{value:u,onChange:C=>f(C.target.value),size:"small",optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",t.length,")"]}),c.jsxs(er.Button,{value:"jira",children:["Jira (",p,")"]}),c.jsxs(er.Button,{value:"confluence",children:["Confluence (",v,")"]})]})]})]}),c.jsx("div",{className:"overview-insights-modal-list",children:m.length===0?c.jsx(Xt,{description:o?"No matching items found.":"No items.",image:Xt.PRESENTED_IMAGE_SIMPLE}):m.map((C,x)=>c.jsxs("div",{className:"overview-insights-modal-item",onClick:()=>y(C),children:[c.jsxs("div",{className:"overview-insights-modal-item-body",children:[c.jsxs("div",{className:"overview-insights-modal-item-top",children:[b(C),C.key&&c.jsx(Zn,{strong:!0,className:"overview-insights-modal-item-key",children:C.key}),c.jsx(Zn,{className:"overview-insights-modal-item-title",title:C.title||C.summary||C.name||C.branch,children:C.title||C.summary||C.name||C.branch})]}),c.jsxs("div",{className:"overview-insights-modal-item-meta",children:[C.author&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-author",title:`By ${C.author}`,children:["By ",C.author]}),C.activityType&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.activityType,children:["· ",C.activityType]}),C.status&&c.jsx($t,{size:"small",children:C.status}),C.priority&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",children:["· Priority: ",C.priority]}),C.repository&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.repository,children:["· Repo: ",C.repository]})]})]}),c.jsx("div",{className:"overview-insights-modal-item-extra",children:c.jsx("span",{className:"overview-insights-modal-item-date",children:C.activityAt||C.updated||C.dueDate||C.date?new Date(C.activityAt||C.updated||C.dueDate||C.date).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})})]},C.id||C.key||`item-${x}`))})]})}function a1e({data:e,open:t,onClose:n,onRefresh:r}){var y;const[a,o]=l.useState(!1),[s,u]=l.useState(""),f=async()=>{o(!0);try{await r(),u("")}catch(b){u(b.message||"Unable to load notifications.")}finally{o(!1)}};l.useEffect(()=>{t&&f()},[t]);const m=(b,C)=>c.jsx("div",{className:"overview-notifications-list",children:b.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:`No ${C} notifications.`}):b.map((x,w)=>{const $=()=>{x.url&&/^https?:\/\//i.test(x.url)&&window.open(x.url,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:`overview-notification-item${x.read?"":" is-unread"}${x.url?" is-link":""}`,role:x.url?"button":void 0,tabIndex:x.url?0:void 0,onClick:x.url?$:void 0,onKeyDown:x.url?E=>{(E.key==="Enter"||E.key===" ")&&$()}:void 0,children:[c.jsxs("div",{className:"overview-notification-item-main",children:[c.jsxs("div",{className:"overview-notification-item-title-row",children:[!x.read&&c.jsx(sa,{status:"processing"}),c.jsx(Zn,{strong:!0,children:x.title})]}),x.summary&&c.jsx(Zn,{type:"secondary",className:"overview-notification-item-summary",children:x.summary})]}),c.jsx(Zn,{type:"secondary",className:"overview-notification-item-date",children:K9(x.activityAt||x.updated)})]},x.id||`${C}-${w}`)})}),h=e.notifications||{},p=Array.isArray(h.jira)?h.jira:[],v=Array.isArray(h.confluence)?h.confluence:[];return c.jsxs(xn,{title:c.jsxs(ct,{children:[c.jsx(Kd,{}),c.jsx("span",{children:"Jira & Confluence Notifications"})]}),open:t,onCancel:n,footer:null,width:760,className:"overview-notifications-modal",children:[c.jsxs("div",{className:"overview-notifications-toolbar",children:[c.jsx(Zn,{type:"secondary",children:"View the latest notifications from your connected work systems."}),c.jsx(Re,{icon:c.jsx(Xa,{}),loading:a,onClick:f,children:"Refresh"})]}),s&&c.jsx(mr,{type:"warning",showIcon:!0,message:s,className:"overview-notifications-alert"}),((y=e.errors)==null?void 0:y.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Some notifications could not be loaded",description:e.errors.join(" · "),className:"overview-notifications-alert"}),c.jsx(Qa,{items:[{key:"jira",label:`Jira (${p.length})`,children:m(p,"Jira")},{key:"confluence",label:`Confluence (${v.length})`,children:m(v,"Confluence")}]})]})}function o1e({onNavigate:e}){var I;const[t,n]=l.useState(()=>YC),[r,a]=l.useState(()=>!YC),[o,s]=l.useState(null),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState({notifications:{jira:[],confluence:[]},errors:[]}),[y,b]=l.useState({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1}),C=async()=>{const j=await Xw.notifications();return v(j),j},x=async()=>{try{const j=await Un.status();b(j)}catch{b({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1})}},w=async()=>{a(!0);try{const j=await Xw.get();YC=j,n(j),s(null)}catch(j){s(j.message||"Unable to load work insights.")}finally{a(!1)}};l.useEffect(()=>{w(),x()},[]);const $=(j,k)=>{if(j!=null&&j.url&&/^https?:\/\//i.test(j.url)){window.open(j.url,"_blank","noopener,noreferrer");return}if(j!=null&&j.url&&j.url.startsWith("#/")){window.location.hash=j.url;return}typeof e=="function"&&e(k)};if(r&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(_a,{active:!0,title:{width:"30%"},paragraph:{rows:3}})});if(o&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(mr,{type:"warning",showIcon:!0,message:"Work insights unavailable",description:o,action:c.jsx(Re,{size:"small",onClick:w,children:"Retry"})})});const E=t1e(p),R=j=>c.jsx(sa,{count:E,overflowCount:99,offset:[2,-2],children:c.jsx(Re,{type:j,icon:c.jsx(Kd,{}),onClick:()=>h(!0),children:"Notifications"})}),N=!!(y.jiraTokenConfigured&&y.confluenceTokenConfigured);if(!(t!=null&&t.configured))return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"}),c.jsx(Bd,{level:3,className:"overview-section-title",children:"Connect your work systems"}),c.jsx(Zn,{type:"secondary",children:"Configure Jira and Bitbucket access tokens to see your daily work here."})]}),c.jsxs(ct,{children:[N&&R(),c.jsx(Re,{type:"primary",onClick:()=>e==null?void 0:e("settings"),children:"Open Settings"})]})]})});const O=t.categories||{};return c.jsxs(It,{className:"overview-panel overview-insights-card",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsx("div",{children:c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"})}),c.jsxs("div",{className:"overview-insights-actions",children:[r&&c.jsx(ar,{size:"small","aria-label":"Refreshing work insights"}),N&&R("text"),c.jsx(Re,{type:"text",onClick:w,children:"Refresh"})]})]}),o&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Refresh failed; showing the last result",description:o}),((I=t.errors)==null?void 0:I.length)>0&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Some work data could not be loaded",description:t.errors.join(" · ")}),c.jsx("div",{className:"overview-insights-grid",children:e1e.map(j=>{const k=Array.isArray(O[j.key])?O[j.key]:[];return c.jsxs("section",{className:`overview-insight-tile${k.length?" has-items":""}`,"aria-labelledby":`overview-insight-${j.key}`,children:[c.jsxs("div",{className:"overview-insight-heading",children:[c.jsx("span",{className:"overview-insight-icon","aria-hidden":"true",children:j.icon}),c.jsxs("div",{children:[c.jsx(Zn,{strong:!0,id:`overview-insight-${j.key}`,children:j.title}),c.jsx(Zn,{type:"secondary",children:j.description})]}),c.jsx(sa,{count:k.length,showZero:!0,overflowCount:99})]}),k.length===0?c.jsx(Zn,{type:"secondary",className:"overview-insight-empty",children:"Nothing needs attention."}):c.jsxs("div",{className:"overview-insight-items",children:[k.slice(0,3).map((T,z)=>c.jsxs("button",{type:"button",className:"overview-insight-item",onClick:()=>$(T,j.route),children:[c.jsxs("span",{className:"overview-insight-item-main",children:[c.jsx("span",{className:"overview-insight-item-title",title:T.title||T.summary||T.name||T.branch,children:T.title||T.summary||T.name||T.branch}),c.jsx("span",{className:"overview-insight-item-meta",title:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||"",children:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||""})]}),c.jsx("span",{className:"overview-insight-item-date",children:K9(T.dueDate||T.updated||T.activityAt||T.date)})]},T.id||T.key||`${j.key}-${z}`)),k.length>3&&c.jsxs(Re,{type:"link",className:"overview-insight-more",onClick:()=>f({config:j,items:k}),children:["View all ",k.length]})]})]},j.key)})}),c.jsx(r1e,{config:u==null?void 0:u.config,items:(u==null?void 0:u.items)||[],open:!!u,onClose:()=>f(null),onNavigate:e}),c.jsx(a1e,{data:p,open:m,onClose:()=>h(!1),onRefresh:C})]})}function i1e(){const[e,t]=l.useState("");return l.useEffect(()=>{let n=!0;return Xw.version().then(({version:r})=>{n&&r&&r!=="0.2.13"&&t(r)}).catch(()=>{}),()=>{n=!1}},[]),e?c.jsx(mr,{showIcon:!0,type:"warning",message:"A newer UI version is available. Reload to update.",action:c.jsx(Re,{size:"small",type:"primary",onClick:()=>window.location.reload(),children:"Reload"}),style:{marginBottom:16}}):null}function l1e(){return c.jsxs("div",{className:"overview-page",role:"status","aria-live":"polite","aria-busy":"true","aria-label":"Loading workspace overview",children:[c.jsxs("section",{className:"overview-hero",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"LOADING WORKSPACE"}),c.jsx(Bd,{level:1,className:"overview-hero-title",children:"Getting your development workspace ready…"}),c.jsx(q9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Checking services, runtime status, and recent errors."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(_a.Button,{active:!0,style:{width:176,height:42,borderRadius:10}}),c.jsx(_a.Button,{active:!0,style:{width:196,height:42,borderRadius:10}})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsx("section",{className:"overview-metrics","aria-hidden":"true",children:["services","running","errors","extensions"].map(e=>c.jsx(It,{className:"overview-metric-card",children:c.jsx(_a,{active:!0,title:{width:"48%"},paragraph:{rows:1,width:"72%"}})},e))}),c.jsxs("div",{className:"overview-content-grid overview-grid","aria-hidden":"true",children:[c.jsx("section",{className:"overview-shortcuts-section",children:c.jsx(_a,{active:!0,title:{width:"34%"},paragraph:{rows:4}})}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsx(_a,{active:!0,title:{width:"46%"},paragraph:{rows:4}})})]}),c.jsx(It,{className:"overview-panel overview-health-card","aria-hidden":"true",children:c.jsx(_a,{active:!0,title:{width:"24%"},paragraph:{rows:3}})})]})}function s1e({launchers:e=[],running:t=new Set,errorCounts:n={},errorLogs:r=[],plugins:a=[],staticPages:o=[],loading:s=!1,error:u=null,hasLoaded:f=!1,onRetry:m,onNavigate:h}){const p=Id(e),v=Id(a),y=Id(o),b=Ybe(t),C=Id(r),x=f||p.length>0;if(s&&!x)return c.jsx(l1e,{});if(u&&!x)return c.jsx("div",{className:"overview-page",role:"alert",children:c.jsx(It,{className:"overview-panel",children:c.jsx(My,{status:"error",title:"Unable to load your workspace",subTitle:zI(u),extra:typeof m=="function"?c.jsx(Re,{type:"primary",icon:c.jsx(qo,{}),onClick:m,children:"Retry"}):null})})});const w=Xbe(n),$=v.length+y.length,E=C.length,R=p.reduce((P,B)=>P+Id(B.scripts).length+Math.max(0,Number(B.packageScriptCount)||0),0),N=p.map((P,B)=>{const H=`${P.id}:`,A=[...b].filter(L=>String(L).startsWith(H)).length,_=Jbe(w.filter(([L])=>String(L).startsWith(H))),F=C.filter(L=>String(L.source||"").startsWith(`Launcher: ${P.alias||P.name||""}`)).length,U=Id(P.scripts).length+Math.max(0,Number(P.packageScriptCount)||0),q=_>0?{badge:"error",label:"Needs attention",priority:2}:A>0?{badge:"success",label:"Running",priority:1}:{badge:"default",label:"Idle",priority:0};return{service:P,name:Qbe(P,B),meta:Zbe(P),activeCount:A,serviceErrors:Math.max(_,F),scriptCount:U,health:q,order:B}}).sort((P,B)=>B.health.priority-P.health.priority||P.order-B.order),O=N.filter(P=>P.activeCount>0).length,I=N.filter(P=>P.serviceErrors>0).length,j=[{key:"service",title:"Add your first service",description:"Connect a local project and choose the scripts you use most.",complete:p.length>0,action:"Add service",route:"launcher"},{key:"run",title:"Start a development script",description:"Launch a configured script and keep its status within reach.",complete:b.size>0,action:"Open Launcher",route:"launcher"},{key:"extend",title:"Personalize your workspace",description:"Add a plugin or static page for the tools your team already uses.",complete:$>0,action:"Open Settings",route:"settings"}],k=j.filter(P=>P.complete).length,T=N.slice(0,5),z=P=>{typeof h=="function"&&h(P)};return c.jsxs("div",{className:"overview-page",children:[u&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Live service status may be out of date",description:zI(u),action:typeof m=="function"?c.jsx(Re,{size:"small",loading:s,onClick:m,children:"Retry"}):null,className:"overview-data-warning"}),c.jsxs("section",{className:"overview-hero","aria-labelledby":"overview-title",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"DEVBUDDY OVERVIEW"}),c.jsx(Bd,{id:"overview-title",level:1,className:"overview-hero-title",children:"Your development day, in one calm workspace."}),c.jsx(q9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Start local services, spot issues, and jump into everyday tools without losing your flow."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(Re,{type:"primary",size:"large",icon:p.length>0?c.jsx(qo,{}):c.jsx(Xn,{}),onClick:()=>z("launcher"),children:p.length>0?"Open Launcher":"Add your first service"}),c.jsx(Re,{size:"large",icon:c.jsx(Ly,{}),onClick:()=>z("pr-review"),children:"Review a pull request"})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsxs("section",{className:"overview-metrics","aria-label":"Workspace status",children:[c.jsxs(It,{className:"overview-metric-card overview-metric-card-clickable",role:"button",tabIndex:0,"aria-label":`Open Launcher, ${p.length} services`,onClick:()=>h==null?void 0:h("launcher"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Bpe,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Services"}),c.jsx("strong",{className:"overview-metric-value",children:p.length}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(R,"configured script")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${b.size>0?" is-success":""}`,role:"button",tabIndex:0,"aria-label":`Open Launcher, ${b.size} running scripts`,onClick:()=>h==null?void 0:h("launcher?running=1"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher?running=1"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Kl,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Running"}),c.jsx("strong",{className:"overview-metric-value",children:b.size}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(O,"active service")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${E>0?" is-danger":" is-neutral"}`,role:"button",tabIndex:0,"aria-label":`Open Error Logs, ${E} errors`,onClick:()=>h==null?void 0:h("errors"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("errors"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(uf,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Errors"}),c.jsx("strong",{className:"overview-metric-value",children:E}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:I>0?`Across ${Is(I,"service")}`:"No services need attention"})]})]}),c.jsxs(It,{className:"overview-metric-card",children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(j9,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Extensions"}),c.jsx("strong",{className:"overview-metric-value",children:$}),c.jsxs(Zn,{type:"secondary",className:"overview-metric-note",children:[Is(v.length,"plugin")," · ",Is(y.length,"page")]})]})]})]}),c.jsx(i1e,{}),c.jsx(o1e,{onNavigate:z}),c.jsxs("div",{className:"overview-content-grid overview-grid",children:[c.jsxs("section",{className:"overview-shortcuts-section","aria-labelledby":"overview-shortcuts-title",children:[c.jsx("div",{className:"overview-section-header",children:c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-shortcuts-title",className:"overview-section-title",children:"Jump back into your flow"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Your most-used developer tools, one click away."})]})}),c.jsx("div",{className:"overview-shortcuts overview-quick-grid",children:Gbe.map(P=>c.jsxs("button",{type:"button",className:"overview-shortcut overview-quick-card","aria-label":`${P.label}: ${P.description}`,onClick:()=>z(P.key),children:[c.jsx("span",{className:"overview-shortcut-icon overview-quick-card-icon","aria-hidden":"true",children:P.icon}),c.jsxs("span",{className:"overview-shortcut-copy overview-quick-card-copy",children:[c.jsx("span",{className:"overview-shortcut-title overview-quick-card-title",children:P.label}),c.jsx("span",{className:"overview-shortcut-description overview-quick-card-description",children:P.description})]}),c.jsx(Qc,{className:"overview-shortcut-arrow","aria-hidden":"true"})]},P.key))})]}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsxs("section",{className:"overview-setup","aria-labelledby":"overview-setup-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"GET STARTED"}),c.jsx(Bd,{level:3,id:"overview-setup-title",className:"overview-section-title",children:"Set up your workspace"})]}),c.jsxs(Zn,{type:"secondary",className:"overview-setup-progress",children:[k," of ",j.length]})]}),c.jsx("ol",{className:"overview-setup-list overview-checklist",children:j.map((P,B)=>c.jsxs("li",{className:`overview-setup-step overview-checklist-item${P.complete?" is-complete":""}`,children:[c.jsx("span",{className:"overview-setup-step-marker overview-checklist-marker","aria-hidden":"true",children:P.complete?c.jsx(Hi,{}):B+1}),c.jsxs("div",{className:"overview-setup-step-copy overview-checklist-copy",children:[c.jsx(Zn,{strong:!0,className:"overview-setup-step-title overview-checklist-title",children:P.title}),c.jsx(Zn,{type:"secondary",className:"overview-setup-step-description overview-checklist-description",children:P.description}),!P.complete&&c.jsx(Re,{type:"link",className:"overview-setup-step-action",onClick:()=>z(P.route),children:P.action})]})]},P.key))})]})})]}),c.jsx(It,{className:"overview-panel overview-health-card",children:c.jsxs("section",{className:"overview-health","aria-labelledby":"overview-health-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-health-title",className:"overview-section-title",children:"Service health"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Running scripts and recent errors across your local projects."})]}),p.length>0&&c.jsxs(Re,{type:"text",className:"overview-section-link",onClick:()=>z("launcher"),children:["View all services ",c.jsx(Qc,{})]})]}),T.length===0?c.jsx(Xt,{className:"overview-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No services configured yet",children:c.jsx(Re,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>z("launcher"),children:"Add your first service"})}):c.jsx("div",{className:"overview-service-list",children:T.map(P=>c.jsxs("button",{type:"button",className:`overview-service-row ${P.health.badge==="error"?"is-error":P.health.badge==="success"?"is-running":"is-idle"}`,"aria-label":`${P.name}: ${P.health.label}, ${Is(P.activeCount,"script")} running, ${Is(P.serviceErrors,"error")}`,onClick:()=>z(`launcher?service=${encodeURIComponent(P.service.id)}`),children:[c.jsxs("span",{className:"overview-service-primary",children:[c.jsxs("span",{className:"overview-service-name-line",children:[c.jsx("span",{className:"overview-service-name",children:P.name}),c.jsx(sa,{status:P.health.badge,text:P.health.label})]}),c.jsx("span",{className:"overview-service-meta overview-service-detail",children:P.meta})]}),c.jsxs("span",{className:"overview-service-stats",children:[c.jsxs("span",{className:"overview-service-stat",children:[c.jsx(Kl,{"aria-hidden":"true"}),P.activeCount," / ",P.scriptCount," running"]}),c.jsxs("span",{className:`overview-service-stat${P.serviceErrors>0?" has-errors":""}`,children:[c.jsx(uf,{"aria-hidden":"true"}),Is(P.serviceErrors,"error")]}),c.jsx(Qc,{className:"overview-service-arrow","aria-hidden":"true"})]})]},P.service.id))}),N.length>T.length&&c.jsxs(Re,{type:"text",className:"overview-more-services",onClick:()=>z("launcher"),children:["View ",N.length-T.length," more services",c.jsx(Qc,{})]})]})}),c.jsxs("footer",{className:"overview-footer",children:[c.jsx(Mf,{"aria-hidden":"true"}),c.jsx(Zn,{type:"secondary",children:"DevBuddy keeps your workspace local and your daily tools close."}),c.jsx(Re,{type:"link",icon:c.jsx(Gl,{}),onClick:()=>z("settings"),children:"Workspace settings"})]})]})}const{Paragraph:Zw,Text:Vs,Title:G9}=Cn,{TextArea:O0}=Ct,c1e="devbuddy.presentation-plan.v1",u1e="devbuddy.presentation-plans.v1",Y9="devbuddy-presentation-plan",Bh=()=>{var e,t;return((t=(e=globalThis.crypto)==null?void 0:e.randomUUID)==null?void 0:t.call(e))||`section-${Date.now()}-${Math.random().toString(16).slice(2)}`},X9=e=>{if(!e)return"";const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?"":`Planned ${t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}`},d1e=e=>{const t=[`# ${e.title.trim()||"Untitled presentation"}`];e.subtitle.trim()&&t.push("",`> ${e.subtitle.trim()}`);const n=[];return e.presenter.trim()&&n.push(`**Presenter:** ${e.presenter.trim()}`),e.plannedDate&&n.push(`**Planned date:** ${e.plannedDate}`),n.length>0&&t.push("",...n),e.sections.forEach((r,a)=>{const o=String(a+1).padStart(2,"0"),s=e.showTimeBoxes?` · ${r.duration} min`:"";t.push("","---","",`## ${o}. ${r.title.trim()||`Section ${a+1}`}${s}`),r.summary.trim()&&t.push("",r.summary.trim())}),e.quickNotes.length>0&&(t.push("","---","","## Quick capture",""),[...e.quickNotes].sort((r,a)=>(r.createdAt||0)-(a.createdAt||0)).forEach(r=>{const a=r.sectionIndex===null?"Step not recorded":`Step ${String(r.sectionIndex+1).padStart(2,"0")} — ${r.sectionTitle||"Untitled section"}`,o=String(r.text||"").trim().replace(/\r?\n/g,`
549
549
  `);t.push(`- **${a}:** ${o}`)})),`${t.join(`
550
550
  `).trim()}
551
551
  `},f1e=(e,t)=>{var b;const n=String(e||"").replace(/^\uFEFF/,"").replace(/\r\n?/g,`
@@ -618,6 +618,6 @@ ${m.join(`
618
618
 
619
619
  `:"",Me=`${be}${fe}${Ee}`,De=`${Ce}${Me}${me}`;s(Ne=>({...Ne,content:De}));const Te=pe+Me.length;F.current={start:Te,end:Te},requestAnimationFrame(()=>{var $e,Ae;const Ne=(Ae=($e=A.current)==null?void 0:$e.resizableTextArea)==null?void 0:Ae.textArea;Ne==null||Ne.focus(),Ne==null||Ne.setSelectionRange(Te,Te)})},oe=async fe=>{var le;if(!((le=fe==null?void 0:fe.type)!=null&&le.startsWith("image/")))return;if(fe.size>10*1024*1024){e.error("Images must be 10 MB or smaller.");return}const se="memo-image-upload";e.loading({content:"Uploading image…",key:se,duration:0});try{const ae=await createImageBitmap(fe),pe=await Al.uploadImage(fe),Ie=(fe.name||"Image").replace(/\.[^.]+$/,"").replace(/[\[\]\r\n]/g," ").trim()||"Image";re(Rk(Ie,pe.url,{width:ae.width,height:ae.height})),ae.close(),w&&L(),e.success({content:"Image inserted",key:se})}catch(ae){e.error({content:ae.message,key:se})}},ue=async fe=>{var se;if((se=fe==null?void 0:fe.type)!=null&&se.startsWith("image/")){if(fe.size>10*1024*1024){e.error("Images must be 10 MB or smaller.");return}j(!0);try{await Al.uploadImage(fe),await L(!1),e.success("Image uploaded")}catch(le){e.error(le.message)}finally{j(!1)}}},ye=fe=>{const[se]=fe.target.files||[];fe.target.value="",oe(se)},J=fe=>{var le;const se=[...((le=fe.clipboardData)==null?void 0:le.files)||[]].find(ae=>{var pe;return(pe=ae.type)==null?void 0:pe.startsWith("image/")});se&&(fe.preventDefault(),oe(se))},ve=async fe=>{try{await navigator.clipboard.writeText(Rk(fe.filename,fe.url,k[fe.filename])),e.success("Image Markdown copied")}catch(se){e.error(se.message||"Could not copy image Markdown.")}},xe=async fe=>{P(fe.filename);try{await Al.removeImage(fe.filename),R(se=>se.filter(le=>le.filename!==fe.filename)),T(se=>{const le={...se};return delete le[fe.filename],le}),e.success("Deleted successfully")}catch(se){e.error(se.message)}finally{P("")}};l.useEffect(()=>{if(p!=="edit")return;const fe=setInterval(()=>{Vm(o)!==U.current&&te(!0)},3e3);return()=>clearInterval(fe)},[p,o,r]);async function ze(){if(r){if(r===Ms){n(fe=>fe.filter(se=>se.id!==Ms)),Y();return}try{await Al.remove(r);const fe=t.filter(se=>se.id!==r);n(fe),fe[0]?G(fe[0]):Y(),e.success("Memo deleted")}catch(fe){e.error(fe.message)}}}return y?c.jsx("div",{className:"memos-loading",children:c.jsx(ar,{})}):c.jsxs("div",{className:"memos-page",children:[c.jsx(Ur,{actions:c.jsx(Re,{icon:c.jsx(qv,{}),onClick:K,children:"Image library"}),description:"Capture ideas and keep your thinking light.",eyebrow:"PERSONAL KNOWLEDGE",title:"Memos"}),c.jsxs("div",{className:"memos-shell",children:[c.jsxs("aside",{className:"memos-list-panel",children:[c.jsxs("div",{className:"memos-list-title",children:[c.jsxs("span",{children:["All notes ",c.jsx("b",{children:t.length})]}),c.jsx(Re,{type:"text",icon:c.jsx(Xn,{}),onClick:Y})]}),c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Search memos...",value:u,onChange:fe=>f(fe.target.value)}),c.jsxs("div",{className:"memo-tags",children:[c.jsx("button",{className:m==="all"?"active":"",onClick:()=>h("all"),children:"All notes"}),V.map(fe=>c.jsxs("button",{className:m===fe?"active":"",onClick:()=>h(fe),children:["#",fe]},fe))]}),c.jsx("div",{className:"memo-items",children:W.length?W.map(fe=>c.jsxs("button",{className:`memo-item ${fe.id===r?"selected":""}`,onClick:()=>G(fe),children:[c.jsx("strong",{children:fe.title||"Untitled memo"}),c.jsx("span",{children:n4e(fe.content)||"No content yet"}),c.jsx("small",{children:m2(fe.updatedAt)})]},fe.id)):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No memos found"})})]}),c.jsxs("main",{className:"memo-editor-panel",children:[c.jsxs("div",{className:"memo-toolbar",children:[c.jsx(up,{className:"memo-mode","aria-label":"Memo view mode",value:p,onChange:v,options:[{value:"edit",label:c.jsx(Wo,{"aria-label":"Edit"})},{value:"preview",label:c.jsx(jf,{"aria-label":"Preview"})},{value:"split",label:c.jsx("span",{"aria-label":"Split",children:"↔"})}]}),c.jsxs("div",{className:"memo-toolbar-actions",children:[c.jsx("input",{ref:_,className:"memo-image-input",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",onChange:ye}),p!=="preview"&&c.jsx(yn,{title:"Insert image",children:c.jsx(Re,{"aria-label":"Insert image",type:"text",icon:c.jsx(qv,{}),onClick:()=>{var fe;return(fe=_.current)==null?void 0:fe.click()}})}),c.jsx(yn,{title:"Open reading view in a new window",children:c.jsx(Re,{"aria-label":"Open reading view in a new window",type:"text",icon:c.jsx(x0e,{}),disabled:!r,onClick:ne})}),c.jsx(Gr,{title:"Delete this memo?",onConfirm:ze,disabled:!r,children:c.jsx(Re,{danger:!0,type:"text",icon:c.jsx(Hn,{}),disabled:!r})}),c.jsxs(Re,{type:"primary",icon:c.jsx(Q$,{}),loading:C,onClick:te,children:["Save ",c.jsx("span",{className:"save-hint",children:"⌘S"})]})]})]}),c.jsxs("div",{className:`memo-workspace view-${p}`,children:[c.jsxs("section",{className:"memo-edit",children:[c.jsx(Ct,{ref:H,className:"memo-title-input",bordered:!1,placeholder:"Memo title",value:o.title,onChange:fe=>s({...o,title:fe.target.value})}),c.jsx(Ct.TextArea,{ref:A,className:"memo-content-input",bordered:!1,placeholder:"Start writing in Markdown...",value:o.content,onChange:fe=>s({...o,content:fe.target.value}),onKeyDown:ee,onSelect:ce,onClick:ce,onKeyUp:ce,onPaste:J,autoSize:{minRows:18}})]}),c.jsx("section",{className:"memo-preview",children:c.jsx(rA,{title:o.title,content:o.content,onCopyCode:Z})})]}),c.jsxs("div",{className:"memo-footer",children:[c.jsx("span",{children:"Markdown supported · Paste or insert images"}),c.jsxs("span",{children:[o.content.length," characters"]}),c.jsx($n,{className:"memo-footer-tags",mode:"tags",bordered:!1,open:!1,suffixIcon:null,prefix:"#",placeholder:"Add tags",tokenSeparators:[","],value:o.tags||[],onChange:fe=>s({...o,tags:fe.map(se=>se.trim().toLowerCase()).filter(Boolean)})})]})]}),c.jsx(xn,{className:"memo-image-library-modal",title:c.jsxs(ct,{size:8,children:[c.jsx(qv,{}),c.jsx("span",{children:"Uploaded images"}),c.jsx($t,{children:E.length}),c.jsx(gp,{accept:"image/png,image/jpeg,image/gif,image/webp",beforeUpload:fe=>(ue(fe),!1),showUploadList:!1,children:c.jsx(Re,{size:"small",icon:c.jsx($0,{}),loading:I,children:"Upload image"})})]}),open:w,onCancel:()=>$(!1),footer:null,width:780,children:N?c.jsx("div",{className:"memo-image-library-loading",children:c.jsx(ar,{})}):E.length?c.jsx("div",{className:"memo-image-grid",children:E.map(fe=>{const se=k[fe.filename];return c.jsxs("div",{className:"memo-image-card",children:[c.jsx(P$,{src:fe.url,alt:fe.filename,preview:{mask:c.jsx("span",{children:"Preview"})}}),c.jsxs("div",{className:"memo-image-card-copy",children:[c.jsx(Cn.Text,{ellipsis:{tooltip:fe.filename},title:fe.filename,children:fe.filename}),c.jsxs(Cn.Text,{type:"secondary",children:[a4e(fe.size)," · ",m2(fe.updatedAt)]}),c.jsxs("div",{className:"memo-image-card-usage",children:[se&&c.jsxs(Cn.Text,{type:"secondary",children:[se.width," × ",se.height," px"]}),c.jsx(Cn.Text,{type:"secondary",children:fe.usedBy.length?`Used in ${fe.usedBy.length} memo${fe.usedBy.length>1?"s":""}`:"Not used"})]}),c.jsxs(ct,{size:4,children:[c.jsx(Re,{size:"small",type:"text",icon:c.jsx(fo,{}),onClick:()=>ve(fe),children:"Copy Markdown"}),c.jsx(Gr,{title:"Delete this image?",description:fe.usedBy.length?"This image is still used by a memo.":void 0,disabled:!!fe.usedBy.length||z===fe.filename,onConfirm:()=>xe(fe),children:c.jsx(Re,{size:"small",type:"text",danger:!0,icon:c.jsx(Hn,{}),disabled:!!fe.usedBy.length,loading:z===fe.filename,children:"Delete"})})]})]})]},fe.filename)})}):c.jsx(Xt,{description:"No uploaded images yet"})})]})]})}const{Text:Md,Title:d4e}=Cn,aA=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],oA=[1,2,3,4,5,6,0],f4e=[{value:"once",label:"One-time reminder"},{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"}],Ik=()=>({title:"",content:"",scheduleType:"once",scheduledAt:dr().add(1,"hour").startOf("hour"),time:dr().hour(9).minute(0),weekday:1,enabled:!0});function iA(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function m4e(e){return e.scheduleType==="once"?`One-time · ${iA(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:`Every ${aA[oA.indexOf(e.weekday)]||"week"} · ${e.time}`}function h4e(e){return{title:e.title,content:e.content,scheduleType:e.scheduleType,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"hour").startOf("hour"),time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,enabled:e.enabled}}function p4e(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(Ik),[o,s]=l.useState(null),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState(()=>"Notification"in window?Notification.permission:"unsupported"),y=l.useCallback(async(N=!0)=>{N&&f(!0);try{n(await Td.list())}catch(O){e.error(O.message)}finally{N&&f(!1)}},[e]);l.useEffect(()=>{y()},[y]);const b=async()=>{if(!("Notification"in window)){e.warning("This browser does not support desktop notifications.");return}const N=await Notification.requestPermission();v(N),N==="granted"?e.success("Desktop notifications enabled"):N==="denied"&&e.warning("Notification permission was denied. Re-enable it in your browser settings.")},C=l.useMemo(()=>({total:t.length,active:t.filter(N=>N.enabled).length,repeating:t.filter(N=>N.scheduleType!=="once").length}),[t]),x=()=>{s(null),a(Ik())},w=async()=>{if(!r.title.trim()){e.warning("Enter a reminder title");return}if(!r.content.trim()){e.warning("Enter notification content");return}if(r.scheduleType==="once"&&(!r.scheduledAt||!r.scheduledAt.isValid())){e.warning("Choose a reminder date and time");return}if(r.scheduleType!=="once"&&(!r.time||!r.time.isValid())){e.warning("Choose a reminder time");return}p==="default"&&await b(),h(!0);try{const N={title:r.title,content:r.content,scheduleType:r.scheduleType,scheduledAt:r.scheduleType==="once"?r.scheduledAt.toISOString():void 0,time:r.scheduleType==="once"?void 0:r.time.format("HH:mm"),weekday:r.scheduleType==="weekly"?r.weekday:void 0,enabled:r.enabled},O=o?await Td.update(o,N):await Td.create(N);n(I=>o?I.map(j=>j.id===O.id?O:j):[O,...I]),x(),e.success(o?"Reminder updated":"Reminder created")}catch(N){e.error(N.message)}finally{h(!1)}},$=async(N,O)=>{try{const I=await Td.toggle(N.id,O);n(j=>j.map(k=>k.id===I.id?I:k))}catch(I){e.error(I.message)}},E=async N=>{try{await Td.remove(N),n(O=>O.filter(I=>I.id!==N)),o===N&&x(),e.success("Reminder deleted")}catch(O){e.error(O.message)}},R=(N,O)=>a(I=>({...I,[N]:O}));return c.jsxs("div",{className:"reminders-page",children:[c.jsx(Ur,{eyebrow:"PLAN & REVIEW",title:"Reminders",description:"Schedule one-time or recurring reminders and receive custom notifications at the right time.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Re,{icon:c.jsx(Xa,{}),onClick:()=>y(!1),children:"Refresh"}),p!=="granted"&&p!=="unsupported"&&c.jsx(Re,{type:"primary",icon:c.jsx(Kd,{}),onClick:b,children:"Enable desktop notifications"})]})}),p==="denied"&&c.jsx(mr,{className:"reminders-alert",type:"warning",showIcon:!0,message:"Desktop notifications are disabled",description:"Reminders will still be saved, but system notifications cannot appear until browser permission is enabled."}),p==="unsupported"&&c.jsx(mr,{className:"reminders-alert",type:"info",showIcon:!0,message:"Desktop notifications are not supported",description:"You can still use the reminder list, but system alerts require a browser with Notification API support."}),c.jsxs("div",{className:"reminder-stats",children:[c.jsxs(It,{children:[c.jsx(Md,{type:"secondary",children:"All reminders"}),c.jsx("strong",{children:C.total}),c.jsx("span",{children:"Saved reminders"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Md,{type:"secondary",children:"Active"}),c.jsx("strong",{children:C.active}),c.jsx("span",{children:"Running on schedule"})]}),c.jsxs(It,{className:"is-repeat",children:[c.jsx(Md,{type:"secondary",children:"Recurring"}),c.jsx("strong",{children:C.repeating}),c.jsx("span",{children:"Daily, weekday, or weekly"})]})]}),c.jsxs("div",{className:"reminders-layout",children:[c.jsx(It,{className:"reminder-editor",title:c.jsxs("span",{children:[c.jsx(Ny,{})," ",o?"Edit reminder":"New reminder"]}),extra:o&&c.jsx(Re,{type:"link",onClick:x,children:"New"}),children:c.jsxs("div",{className:"reminder-form",children:[c.jsxs("label",{children:["Reminder title",c.jsx(Ct,{value:r.title,maxLength:50,showCount:!0,placeholder:"For example: Take a stretch break",onChange:N=>R("title",N.target.value)})]}),c.jsxs("label",{children:["Notification content",c.jsx(Ct.TextArea,{value:r.content,maxLength:100,showCount:!0,autoSize:{minRows:4,maxRows:7},placeholder:"The message shown when the reminder fires",onChange:N=>R("content",N.target.value)})]}),c.jsxs("label",{children:["Repeat",c.jsx($n,{value:r.scheduleType,options:f4e,onChange:N=>R("scheduleType",N)})]}),r.scheduleType==="once"?c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"reminder-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:r.scheduledAt,onChange:N=>R("scheduledAt",N&&N.second(0).millisecond(0))})]}):c.jsxs("div",{className:"reminder-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(kf,{className:"reminder-wide-control",format:"HH:mm",minuteStep:5,value:r.time,onChange:N=>R("time",N)})]}),r.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:r.weekday,options:aA.map((N,O)=>({label:N,value:oA[O]})),onChange:N=>R("weekday",N)})]})]}),c.jsxs("div",{className:"reminder-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Md,{strong:!0,children:"Enable reminder"}),c.jsx(Md,{type:"secondary",children:"Run on schedule as soon as it is saved"})]}),c.jsx(Ja,{checked:r.enabled,onChange:N=>R("enabled",N)})]}),c.jsxs("div",{className:"reminder-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Notification preview"}),c.jsx(Kd,{})]}),c.jsx("strong",{children:r.title.trim()||"Reminder title"}),c.jsx("p",{children:r.content.trim()||"Your custom notification content will appear here."})]}),c.jsxs(ct,{className:"reminder-form-actions",children:[c.jsx(Re,{onClick:x,children:o?"Cancel":"Clear"}),c.jsx(Re,{type:"primary",icon:c.jsx(vi,{}),loading:m,onClick:w,children:o?"Save changes":"Create reminder"})]})]})}),c.jsx(It,{className:"reminder-list-card",title:c.jsxs("span",{children:[c.jsx(Wl,{})," My reminders"]}),children:u?c.jsx("div",{className:"reminder-list-state",children:"Loading reminders…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No reminders yet. Create your first one."}):c.jsx("div",{className:"reminder-list",children:t.map(N=>c.jsxs("article",{className:`reminder-item ${N.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"reminder-item-icon",children:c.jsx(Kd,{})}),c.jsxs("div",{className:"reminder-item-main",children:[c.jsxs("div",{className:"reminder-item-heading",children:[c.jsx(d4e,{level:4,children:N.title}),c.jsx($t,{color:N.enabled?"green":"default",children:N.enabled?"Active":"Paused"})]}),c.jsx(Md,{className:"reminder-item-content",children:N.content}),c.jsxs("div",{className:"reminder-item-meta",children:[c.jsx("span",{children:m4e(N)}),N.enabled&&N.nextRunAt&&c.jsxs("span",{children:["Next: ",iA(N.nextRunAt)]})]})]}),c.jsxs("div",{className:"reminder-item-actions",children:[c.jsx(Ja,{size:"small",checked:N.enabled,onChange:O=>$(N,O)}),c.jsx(Re,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit reminder",onClick:()=>{s(N.id),a(h4e(N))}}),c.jsx(Gr,{title:"Delete this reminder?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>E(N.id),children:c.jsx(Re,{type:"text",danger:!0,icon:c.jsx(Hn,{}),"aria-label":"Delete reminder"})})]})]},N.id))})})]}),c.jsxs("div",{className:"reminder-footnote",children:[c.jsx(Xn,{})," Reminders are saved locally. Keep DevBuddy open to check schedules and show notifications, even while using another workspace."]})]})}const Us=(e="node")=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,lA=(e,t="Untitled idea")=>{const n=String((e==null?void 0:e.edgeLabel)||"").trim();return{id:String((e==null?void 0:e.id)||Us()),text:String((e==null?void 0:e.text)??(e==null?void 0:e.label)??t),edgeLabel:n||void 0,color:(e==null?void 0:e.color)||void 0,autoWidth:(e==null?void 0:e.autoWidth)!==!1,collapsed:!!(e!=null&&e.collapsed),tested:!!(e!=null&&e.tested),notes:e!=null&&e.notes?String(e.notes):void 0,jiraKeys:Array.isArray(e==null?void 0:e.jiraKeys)?[...new Set(e.jiraKeys.map(r=>String(r).trim().toUpperCase()).filter(Boolean))]:void 0,position:e!=null&&e.position&&Number.isFinite(Number(e.position.x))&&Number.isFinite(Number(e.position.y))?{x:Number(e.position.x),y:Number(e.position.y)}:void 0,children:Array.isArray(e==null?void 0:e.children)?e.children.map(r=>lA(r)):[]}},C4=(e,t="Untitled mind map")=>{var s;const n=(e==null?void 0:e.root)||((s=e==null?void 0:e.data)==null?void 0:s.root)||e,r=String((e==null?void 0:e.title)||(n==null?void 0:n.text)||t).trim()||t,a=lA(n,r),o=new Date().toISOString();return{id:String((e==null?void 0:e.id)||Us("map")),title:r,layout:"left-to-right",createdAt:(e==null?void 0:e.createdAt)||new Date().toISOString(),updatedAt:(e==null?void 0:e.updatedAt)||o,jiraIssues:Array.isArray(e==null?void 0:e.jiraIssues)?e.jiraIssues.map(u=>({id:String((u==null?void 0:u.id)||(u==null?void 0:u.key)||"").trim(),key:String((u==null?void 0:u.key)||"").trim().toUpperCase(),summary:String((u==null?void 0:u.summary)||"").trim(),url:typeof(u==null?void 0:u.url)=="string"?u.url.trim():""})).filter(u=>u.id&&u.key):[],root:{...a,text:a.text||r}}},g4e=e=>{const t=String(e||"").trim();if(!t)return null;const n=t.match(/(?:\/browse\/|\b)([A-Z][A-Z0-9_]*-\d+)\b/i);if(!n)return null;const r=n[1].toUpperCase(),a=/^https?:\/\//i.test(t);return{key:r,url:a?t:""}},v4e=(e="Untitled mind map")=>{const t=new Date().toISOString();return{id:Us("map"),title:e,layout:"left-to-right",createdAt:t,updatedAt:t,root:{id:Us(),text:e,color:"#6555e8",children:[{id:Us(),text:"First idea",color:"#4f8edb",children:[]},{id:Us(),text:"Second idea",color:"#36a269",children:[]}]}}},S4=e=>1+(e.children||[]).reduce((t,n)=>t+S4(n),0),Gd=(e,t)=>{if(!e)return null;if(e.id===t)return e;for(const n of e.children||[]){const r=Gd(n,t);if(r)return r}return null},Vh=(e,t)=>{var n;if(!((n=e==null?void 0:e.children)!=null&&n.length))return null;if(e.children.some(r=>r.id===t))return e;for(const r of e.children){const a=Vh(r,t);if(a)return a}return null},eu=(e,t,n)=>e.id===t?n(e):{...e,children:(e.children||[]).map(r=>eu(r,t,n))},qy=(e,t)=>({...e,children:(e.children||[]).filter(n=>n.id!==t).map(n=>qy(n,t))}),y4e=(e,t,n)=>{let r=!1;const a=o=>{if(r)return o;const s=o.children||[],u=s.findIndex(f=>f.id===t);return u>=0?(r=!0,{...o,children:[...s.slice(0,u+1),n,...s.slice(u+1)]}):{...o,children:s.map(a)}};return a(e)},b4e=(e,t)=>{var s;const n=Vh(e,t),r=n?Vh(e,n.id):null,a=(s=n==null?void 0:n.children)==null?void 0:s.find(u=>u.id===t);if(!n||!r||!a)return e;const o=qy(e,t);return eu(o,r.id,u=>{const f=(u.children||[]).findIndex(m=>m.id===n.id);return f<0?u:{...u,children:[...u.children.slice(0,f+1),a,...u.children.slice(f+1)]}})},kk=(e,t,n)=>{const r=Gd(e,t);if(!r||!Gd(e,n)||t===n||Gd(r,n))return e;const a=qy(e,t);return eu(a,n,o=>({...o,children:[...o.children||[],r]}))},sA=e=>{const t=[`# ${e.title}`],n=(r,a)=>{r.id!==e.root.id&&t.push(`${"#".repeat(Math.min(a+1,6))} ${r.text}`),(r.children||[]).forEach(o=>n(o,a+1))};return n(e.root,0),`${t.join(`
620
620
  `)}
621
- `},cA=(e,t="Imported mind map")=>{var u,f,m;const r=e.split(/\r?\n/).filter(h=>h.trim()).map(h=>({line:h,match:h.match(/^(#{1,6})\s+(.+?)\s*$/)})).filter(({match:h})=>h),a=((m=(f=(u=r[0])==null?void 0:u.match)==null?void 0:f[2])==null?void 0:m.trim())||t,o={id:Us(),text:a,children:[]},s=[{depth:0,node:o}];return r.slice(1).forEach(({match:h})=>{var b;const p=h[1].length,v={id:Us(),text:h[2].trim(),children:[]};for(;s.length&&s[s.length-1].depth>=p;)s.pop();(((b=s[s.length-1])==null?void 0:b.node)||o).children.push(v),s.push({depth:p,node:v})}),C4({title:a,root:o})},tu=(e,t,n="application/json")=>{const r=typeof Blob<"u"&&t instanceof Blob?t:new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)},x4e=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"Recently updated":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)},{Title:uA,Text:dA}=Cn,wv=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map";function C4e({map:e}){const t=["#6555e8","#4f8edb","#36a269","#d98a34"];return c.jsxs("div",{className:"mind-map-mini-preview","aria-hidden":"true",children:[c.jsx("div",{className:"mind-map-mini-root",style:{background:e.root.color||t[0]},children:c.jsx("span",{className:"mind-map-mini-root-text",children:e.root.text})}),c.jsx("div",{className:"mind-map-mini-branches",children:(e.root.children||[]).slice(0,4).map((n,r)=>c.jsxs("div",{className:"mind-map-mini-branch",children:[c.jsx("span",{className:"mind-map-mini-line"}),c.jsx("span",{className:"mind-map-mini-node",style:{borderColor:n.color||t[r%t.length]},children:n.text})]},n.id))})]})}function S4e({map:e,index:t,onOpen:n,onDelete:r,onExport:a}){const o=[{key:"xmind",icon:c.jsx(ql,{}),label:"Export XMind"},{key:"json",icon:c.jsx(ql,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"},{type:"divider"},{key:"delete",danger:!0,icon:c.jsx(Hn,{}),label:"Delete map"}],s=({key:u,domEvent:f})=>{f==null||f.stopPropagation(),u==="delete"&&r(e),(u==="xmind"||u==="json"||u==="markdown")&&a(e,u)};return c.jsxs(It,{className:`mind-map-card ${t===0?"is-featured":""}`,hoverable:!0,onClick:()=>n(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(e.id))},role:"button",tabIndex:0,children:[c.jsxs("div",{className:"mind-map-card-topline",children:[c.jsx($t,{className:"mind-map-card-type",children:"MIND MAP"}),c.jsx(Bl,{menu:{items:o,onClick:s},trigger:["click"],children:c.jsx(Re,{"aria-label":`Actions for ${e.title}`,className:"mind-map-card-menu",icon:c.jsx(Kv,{}),onClick:u=>u.stopPropagation(),type:"text"})})]}),c.jsx(C4e,{map:e}),c.jsxs("div",{className:"mind-map-card-content",children:[c.jsx("div",{className:"mind-map-card-title-row",children:c.jsx(uA,{ellipsis:{rows:1,tooltip:e.title},level:3,children:e.title})}),c.jsxs("div",{className:"mind-map-card-meta-row",children:[c.jsxs(dA,{className:"mind-map-card-meta",children:[S4(e.root)," nodes ",c.jsx("span",{children:"·"})," Updated ",x4e(e.updatedAt)]}),c.jsxs("span",{className:"mind-map-card-open",children:["Open map ",c.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]})]})}function w4e({onNavigate:e}){const{message:t,modal:n}=Pr.useApp(),[r,a]=l.useState([]),[o,s]=l.useState(!0),[u,f]=l.useState(""),m=l.useRef(null),h=async()=>{try{a(await sl.list())}catch($){t.error(`Could not load mind maps: ${$.message||"unknown error"}`)}finally{s(!1)}};l.useEffect(()=>{h()},[]);const p=l.useMemo(()=>{const $=u.trim().toLowerCase();return $?r.filter(E=>`${E.title} ${E.root.text}`.toLowerCase().includes($)):r},[r,u]),v=()=>h(),y=$=>e(`mind-maps/${encodeURIComponent($)}`),b=async()=>{try{const $=await sl.create(v4e());a(E=>[$,...E]),y($.id)}catch($){t.error(`Could not create mind map: ${$.message||"unknown error"}`)}},C=async($,E)=>{try{if(E==="xmind"){const{mindMapToXmindBlob:R}=await pu(async()=>{const{mindMapToXmindBlob:O}=await import("./xmindAdapter-BxzU4Y3W.js");return{mindMapToXmindBlob:O}},[]),N=await R($);tu(`${$.title||"mind-map"}.xmind`,N,"application/octet-stream"),t.success("XMind exported");return}if(E==="markdown"){tu(`${$.title||"mind-map"}.md`,sA($),"text/markdown;charset=utf-8"),t.success("Markdown exported");return}tu(`${$.title||"mind-map"}.json`,`${JSON.stringify($,null,2)}
622
- `,"application/json;charset=utf-8"),t.success("JSON exported")}catch(R){t.error(`Could not export this map: ${R.message||"unknown error"}`)}},x=$=>{n.confirm({title:"Delete this mind map?",content:`“${$.title}” will be removed from workspace data.`,okText:"Delete",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{await sl.remove($.id),await v(),t.success("Mind map deleted")}})},w=async $=>{var R;const E=(R=$.target.files)==null?void 0:R[0];if($.target.value="",!!E)try{const N=E.name.toLowerCase().endsWith(".xmind"),O=N?null:await E.text(),I=E.name.toLowerCase().endsWith(".json"),j=N?await(async()=>{const{xmindBlobToMindMap:T}=await pu(async()=>{const{xmindBlobToMindMap:z}=await import("./xmindAdapter-BxzU4Y3W.js");return{xmindBlobToMindMap:z}},[]);return T(await E.arrayBuffer(),wv(E.name))})():I?C4(JSON.parse(O),wv(E.name)):cA(O,wv(E.name)),k=await sl.create({...j,title:j.title||wv(E.name)});a(T=>[k,...T]),t.success(`${N?"XMind":I?"JSON":"Markdown"} imported`),y(k.id)}catch(N){t.error(`Could not import this file: ${N.message||"invalid format"}`)}};return c.jsxs("div",{className:"mind-map-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"mind-map-page-actions",size:10,children:[c.jsx("input",{ref:m,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:w,type:"file"}),c.jsx(Re,{icon:c.jsx($0,{}),onClick:()=>{var $;return($=m.current)==null?void 0:$.click()},children:"Import"}),c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"New mind map"})]}),description:"Turn scattered thoughts into a clear visual plan.",eyebrow:"PLAN & REVIEW",title:"Mind maps"}),c.jsxs("div",{className:"mind-map-list-summary",children:[c.jsxs("div",{children:[c.jsx(uA,{level:2,children:"Your workspace"}),c.jsxs(dA,{type:"secondary",children:[r.length," ",r.length===1?"map":"maps"," saved locally"]})]}),c.jsx(Ct,{allowClear:!0,className:"mind-map-search",onChange:$=>f($.target.value),placeholder:"Search maps...",prefix:c.jsx(jo,{}),value:u})]}),o?c.jsx("div",{className:"mind-map-loading",children:c.jsx("span",{children:"Loading mind maps..."})}):p.length?c.jsx("div",{className:"mind-map-card-grid",children:p.map(($,E)=>c.jsx(S4e,{index:E,map:$,onDelete:x,onExport:C,onOpen:y},$.id))}):c.jsx(It,{className:"mind-map-empty-card",children:c.jsx(Xt,{description:u?"No maps match your search.":"No mind maps yet.",children:!u&&c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"Create your first map"})})}),c.jsxs("div",{className:"mind-map-import-hint",children:[c.jsx($0,{})," ",c.jsx("span",{children:"Import XMind, JSON, or Markdown. Export XMind to continue editing in XMind."})]})]})}const $v=40,$4e=8192,Mk=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Gc=(e,t)=>{const n=e.getBoundingClientRect();return{left:n.left-t.left,top:n.top-t.top,right:n.right-t.left,bottom:n.bottom-t.top,width:n.width,height:n.height}},ph=(e,t=0)=>{const n=Number.parseFloat(e);return Number.isFinite(n)?n:t},E4e=(e,t)=>{const n=e.nodeValue||"",r=new Map;let a=0;for(const o of n){const s=o.length;t.setStart(e,a),t.setEnd(e,a+s),a+=s;const u=t.getBoundingClientRect();if(!u.height)continue;const f=Math.round(u.top*2)/2,m=r.get(f)||{top:f,x:u.left,text:""};m.x=Math.min(m.x,u.left),m.text+=o,r.set(f,m)}return[...r.values()].sort((o,s)=>o.top-s.top)},j4e=(e,t)=>{var u;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),a=document.createElement("canvas").getContext("2d"),o=[];let s=n.nextNode();for(;s;){const f=s.parentElement;if(!(f!=null&&f.closest(".mind-map-collapse"))&&((u=s.nodeValue)!=null&&u.trim())){const m=getComputedStyle(f),h=E4e(s,r),p=ph(m.fontSize,12),v=m.lineHeight==="normal"?p*1.2:ph(m.lineHeight,p*1.2),y=`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`;a.font=y;const b=a.measureText("Mg"),C=b.fontBoundingBoxAscent||b.actualBoundingBoxAscent||p*.8,x=b.fontBoundingBoxDescent||b.actualBoundingBoxDescent||p*.2,w=Math.max(0,(v-C-x)/2)+C,$=Gc(f,t),E=getComputedStyle(f),R=["hidden","clip"].includes(E.overflowX)||["hidden","clip"].includes(E.overflowY)||E.textOverflow==="ellipsis";h.forEach(N=>{N.text&&o.push({text:N.text,x:N.x-t.left,y:N.top-t.top+w,font:`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`,color:m.color,letterSpacing:m.letterSpacing,opacity:ph(m.opacity,1),clip:R?$:null})})}s=n.nextNode()}return o},N4e=(e,t)=>{const n=Gc(e,t),r=getComputedStyle(e),a=r.backgroundColor==="rgba(0, 0, 0, 0)"?"none":r.backgroundColor,o=ph(r.borderTopWidth),s=r.borderTopStyle==="none"||o===0?"none":r.borderTopColor,u=Math.min(ph(r.borderTopLeftRadius),n.width/2,n.height/2);return`<rect x="${n.left}" y="${n.top}" width="${n.width}" height="${n.height}" rx="${u}" fill="${Mk(a)}" stroke="${Mk(s)}" stroke-width="${o}"/>`},O4e=e=>{const t=e.getBoundingClientRect(),n=[],r=(o,s,u,f,m)=>{n.push(`<line x1="${o}" y1="${s}" x2="${u}" y2="${f}" stroke="${m}" stroke-width="1.5" stroke-linecap="round"/>`)};return[...e.querySelectorAll(".mind-map-ltr-children")].forEach(o=>{const s=Gc(o,t),f=[...o.children].filter(y=>y.classList.contains("mind-map-ltr-branch")).map(y=>({branch:y,row:y.querySelector(":scope > .mind-map-ltr-node-row"),node:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]")})).filter(({row:y,node:b})=>y&&b);if(!f.length)return;const m=s.left,p=f.map(({row:y})=>Gc(y,t)).map(y=>y.top+y.height/2),v=o.classList.contains("is-comment-children")?"#9da9b6":"#c6cada";if(p.length>1&&r(m,p[0],m,p[p.length-1],v),f.forEach(({branch:y,node:b},C)=>{const x=Gc(b,t),w=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(m,p[C],x.left,p[C],w)}),o.classList.contains("mind-map-ltr-root-children")){const y=e.querySelector(".mind-map-ltr-root-column > [data-mind-map-node]");if(y){const b=Gc(y,t);r(b.right,b.top+b.height/2,m,b.top+b.height/2,v)}}else{const y=o.parentElement,b=y==null?void 0:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]");if(b){const C=Gc(b,t),x=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(C.right,C.top+C.height/2,m,C.top+C.height/2,x)}}}),n.join("")},R4e=(e,t)=>{const n=e.getBoundingClientRect(),r=Math.floor(t.left-n.left-$v),a=Math.floor(t.top-n.top-$v),o=Math.ceil(t.right-t.left+$v*2),s=Math.ceil(t.bottom-t.top+$v*2),u=[...e.querySelectorAll(".mind-map-root-node, .mind-map-node, .mind-map-node-jira-tag")].map(h=>N4e(h,n)).join(""),f=j4e(e,n);return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="${r} ${a} ${o} ${s}"><rect x="${r}" y="${a}" width="${o}" height="${s}" fill="#ffffff"/>${O4e(e)}${u}</svg>`,width:o,height:s,left:r,top:a,text:f}},I4e=async e=>{var p;if(!e)throw new Error("Mind map canvas is not ready.");const t=[...e.querySelectorAll("[data-mind-map-node], .mind-map-canvas-empty")];if(!t.length)throw new Error("Mind map canvas is empty.");(p=document.fonts)!=null&&p.ready&&await document.fonts.ready;const n=t.reduce((v,y)=>{const b=y.getBoundingClientRect();return{left:Math.min(v.left,b.left),top:Math.min(v.top,b.top),right:Math.max(v.right,b.right),bottom:Math.max(v.bottom,b.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),{svg:r,width:a,height:o,left:s,top:u,text:f}=R4e(e,n),m=new Image,h=URL.createObjectURL(new Blob([r],{type:"image/svg+xml;charset=utf-8"}));try{await new Promise((w,$)=>{m.onload=w,m.onerror=()=>$(new Error("Could not render the mind map image.")),m.src=h});const v=Math.min(2,$4e/Math.max(a,o)),y=document.createElement("canvas");y.width=Math.max(1,Math.round(a*v)),y.height=Math.max(1,Math.round(o*v));const b=y.getContext("2d");if(!b)throw new Error("Canvas is unavailable.");b.fillStyle="#ffffff",b.fillRect(0,0,y.width,y.height),b.drawImage(m,0,0,y.width,y.height),b.save(),b.scale(v,v),f.forEach(w=>{b.save(),b.font=w.font,b.fillStyle=w.color,b.globalAlpha=w.opacity,"letterSpacing"in b&&w.letterSpacing&&w.letterSpacing!=="normal"&&(b.letterSpacing=w.letterSpacing),w.clip&&(b.beginPath(),b.rect(w.clip.left-s,w.clip.top-u,w.clip.width,w.clip.height),b.clip()),b.textBaseline="alphabetic",b.fillText(w.text,w.x-s,w.y-u),b.restore()}),b.restore();const{encode:C}=await pu(async()=>{const{encode:w}=await import("./index-_vMuByUV.js");return{encode:w}},[]),x=await C(b.getImageData(0,0,y.width,y.height),{quality:75,progressive:!0,optimize_coding:!0,auto_subsample:!0});return new Blob([x],{type:"image/jpeg"})}finally{URL.revokeObjectURL(h)}},{Text:io,Title:Tk}=Cn,P0=["#4f8edb","#36a269","#d98a34","#c05a83","#8a70c5"],k4e=3200,M4e=2200,Ts=1600,T4e=380,Ky=e=>String((e==null?void 0:e.text)||"").trimStart().startsWith("#"),P4e=e=>{var n;const t=e instanceof HTMLElement?e:null;return!!(t!=null&&t.isContentEditable||(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable="true"]'))},fA=e=>e.reduce((t,n)=>{const r=String(n.edgeLabel||"").trim();return r?Math.max(t,Math.min(160,Math.max(72,r.length*7+16))):t},16),h2=(e,t,n=!1)=>({...e,collapsed:n?!1:t,children:(e.children||[]).map(r=>h2(r,t))}),mA=(e,t,n=!1)=>{const r=n||Ky(e);return{...e,tested:r?!1:t,children:(e.children||[]).map(a=>mA(a,t,r))}},hA=(e,t)=>({...e,jiraKeys:(e.jiraKeys||[]).filter(n=>n!==t),children:(e.children||[]).map(n=>hA(n,t))}),pA=(e,t)=>{t.add(e.id),(e.children||[]).forEach(n=>pA(n,t))},gA=(e,t)=>t.has(e.id)?null:{label:e.text||"Untitled idea",value:e.id,children:(e.children||[]).map(n=>gA(n,t)).filter(Boolean)},vA=(e,t,n=[])=>{const r=[...n,e.id];if(e.id===t)return r;for(const a of e.children||[]){const o=vA(a,t,r);if(o)return o}return null},pS=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map",yA=(e,t,n=!1)=>{if(!e)return!1;const r=n||Ky(e);return e.id===t?r:(e.children||[]).some(a=>yA(a,t,r))};function bA({node:e,jiraIssues:t}){const n=(e.jiraKeys||[]).map(r=>t.find(a=>a.key===r)||{key:r});return n.length?c.jsx("span",{className:"mind-map-node-jira-tags","aria-label":"Jira tags",children:n.map(r=>c.jsx("span",{className:"mind-map-node-jira-tag",title:r.summary||r.key,children:r.key},r.key))}):null}function xA({node:e,depth:t=0,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,commented:s=!1}){const u=e.color||P0[t%P0.length],f=e.children||[],m=Ky(e),h=s||m,p=fA(f);return c.jsxs("div",{className:`mind-map-ltr-branch depth-${Math.min(t,4)}${h?" is-comment-branch":""}${m?" is-comment-marker":""}`,children:[c.jsxs("div",{className:"mind-map-ltr-node-row",children:[e.edgeLabel&&c.jsx("span",{className:"mind-map-ltr-edge-label",title:e.edgeLabel,children:e.edgeLabel}),c.jsxs("button",{className:`mind-map-node ${n===e.id?"is-selected":""} ${e.tested&&!h?"is-tested":""}${e.autoWidth===!1?" is-auto-width-disabled":""}${h?" is-comment":""}${m?" is-comment-marker":""}`,onClick:()=>r(e.id),"data-mind-map-node":e.id,style:{"--node-color":u},type:"button",children:[c.jsxs("span",{className:"mind-map-node-main",children:[c.jsx("span",{className:"mind-map-node-text",children:e.text||"Untitled idea"}),f.length>0&&c.jsx("span",{className:"mind-map-node-count",children:f.length})]}),c.jsx(bA,{jiraIssues:o,node:e})]}),f.length>0&&c.jsxs("button",{"aria-label":e.collapsed?"Expand branch":"Collapse branch",className:"mind-map-collapse",onClick:()=>a(e.id),type:"button",children:[c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"is-visible":""}`,children:"+"}),c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"":"is-visible"}`,children:"−"})]})]}),!e.collapsed&&f.length>0&&c.jsx("div",{className:`mind-map-ltr-children${h?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${p}px`},children:f.map(v=>c.jsx(xA,{depth:t+1,node:v,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:h},v.id))})]})}const CA=l.forwardRef(function({map:t,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,nodeMaxWidth:s,fitContent:u=!1},f){const m=t.root,h=m.children||[],p=m.color||"#6555e8",v=Ky(m);return c.jsxs("div",{className:"mind-map-ltr-diagram",ref:f,style:{...u?{minWidth:0,minHeight:0,margin:0}:{},...Number.isInteger(s)?{"--mind-map-node-max-width":`${s}px`}:{}},children:[c.jsx("div",{className:"mind-map-ltr-root-column",children:c.jsxs("button",{className:`mind-map-root-node ${n===m.id?"is-selected":""} ${m.tested&&!v?"is-tested":""}${m.autoWidth===!1?" is-auto-width-disabled":""}${v?" is-comment is-comment-marker":""}`,"data-mind-map-node":m.id,onClick:()=>r(m.id),style:{"--node-color":p},type:"button",children:[c.jsx("span",{className:"mind-map-root-text",children:m.text||"Untitled idea"}),c.jsxs("span",{className:"mind-map-root-count",children:[S4(m)-1," connected ideas"]}),c.jsx(bA,{jiraIssues:o,node:m})]})}),!m.collapsed&&h.length>0&&c.jsx("div",{className:`mind-map-ltr-children mind-map-ltr-root-children${v?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${fA(h)}px`},children:h.map(y=>c.jsx(xA,{node:y,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:v},y.id))}),!h.length&&c.jsx("div",{className:"mind-map-canvas-empty",children:c.jsx(io,{type:"secondary",children:"Add a branch from the inspector to start mapping this idea."})})]})}),D4e=l.forwardRef(function({map:t,nodeMaxWidth:n},r){const a=l.useRef(null);return l.useLayoutEffect(()=>{const o=a.current;if(!o)return;const s=1;o.querySelectorAll(".mind-map-ltr-children").forEach(u=>{const f=[...u.children].map(b=>b.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!f.length)return;const m=u.getBoundingClientRect(),h=f[0].getBoundingClientRect(),p=f[f.length-1].getBoundingClientRect(),v=(h.top+h.bottom)/2,y=(p.top+p.bottom)/2;u.style.setProperty("--mind-map-connector-top",`${Math.max(0,(v-m.top)/s)}px`),u.style.setProperty("--mind-map-connector-height",`${Math.max(0,(y-v)/s)}px`)})},[t]),c.jsx("div",{"aria-hidden":"true",className:"mind-map-export-offscreen",inert:"",children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right mind-map-export-render",ref:r,style:{width:"max-content",height:"auto",padding:0,margin:0,zoom:1},children:c.jsx(CA,{fitContent:!0,jiraIssues:t.jiraIssues||[],map:t,nodeMaxWidth:n,onSelect:()=>{},onToggle:()=>{},ref:a,selectedId:null})})})}),z4e=l.forwardRef(function({map:t,selectedId:n,zoom:r,resetViewToken:a,recenterLayoutToken:o,isPanning:s,onCanvasPointerDown:u,onCanvasPointerMove:f,onCanvasPointerUp:m,onSelect:h,onToggle:p,onZoomChange:v,jiraIssues:y,nodeMaxWidth:b},C){const x=l.useRef(null),w=l.useRef(null),$=l.useRef(r),E=l.useRef({meta:!1,ctrl:!1}),R=l.useRef(new Map),N=l.useRef(0),O=l.useRef(0),I=l.useRef(!1),j=l.useRef(o);$.current=r;const k=(A,_,F,U)=>{const q=A.querySelector(".mind-map-canvas-stage"),L=A.getBoundingClientRect(),K=q==null?void 0:q.getBoundingClientRect();return{fromZoom:_,toZoom:null,x:F,y:U,stageX:K?(L.left+F-K.left)/_:null,stageY:K?(L.top+U-K.top)/_:null}};l.useImperativeHandle(C,()=>({zoomAt(A){const _=x.current,F=$.current;!_||A===F||(w.current=k(_,F,_.clientWidth/2,_.clientHeight/2),w.current.toZoom=A,$.current=A,v(A))}}),[v]);const T=A=>{const _=A.target instanceof Element?A.target:null,F=_==null?void 0:_.closest("button[data-mind-map-node]");_!=null&&_.closest("button")&&!F||u(A,(F==null?void 0:F.dataset.mindMapNode)||null)},z=(A=null)=>{const _=x.current;if(!_)return;const F=[..._.querySelectorAll("[data-mind-map-node]")],U=_.querySelector(".mind-map-root-node");if(!F.length||!U)return;const q=_.getBoundingClientRect(),L=F.reduce((J,ve)=>{const xe=(A==null?void 0:A.get(ve.dataset.mindMapNode))||ve.getBoundingClientRect();return{left:Math.min(J.left,xe.left),top:Math.min(J.top,xe.top),right:Math.max(J.right,xe.right),bottom:Math.max(J.bottom,xe.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),K=(L.left+L.right)/2,X=(L.top+L.bottom)/2,V=(A==null?void 0:A.get(U.dataset.mindMapNode))||U.getBoundingClientRect();let W=_.scrollLeft+K-q.left-_.clientWidth/2,G=_.scrollTop+X-q.top-_.clientHeight/2;const Y=W-_.scrollLeft,te=G-_.scrollTop,ne=V.left-Y,ce=V.right-Y,Z=V.top-te,ee=V.bottom-te,re=q.left+24,oe=q.right-24,ue=q.top+24,ye=q.bottom-24;ce<re&&(W+=ce-re),ne>oe&&(W+=ne-oe),ee<ue&&(G+=ee-ue),Z>ye&&(G+=Z-ye),_.scrollLeft=Math.max(0,Math.min(W,_.scrollWidth-_.clientWidth)),_.scrollTop=Math.max(0,Math.min(G,_.scrollHeight-_.clientHeight))},P=()=>{const A=x.current;if(!A)return;const _=$.current||1;A.querySelectorAll(".mind-map-ltr-children").forEach(F=>{const U=[...F.children].map(W=>W.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!U.length)return;const q=F.getBoundingClientRect(),L=U[0].getBoundingClientRect(),K=U[U.length-1].getBoundingClientRect(),X=(L.top+L.bottom)/2,V=(K.top+K.bottom)/2;F.style.setProperty("--mind-map-connector-top",`${Math.max(0,(X-q.top)/_)}px`),F.style.setProperty("--mind-map-connector-height",`${Math.max(0,(V-X)/_)}px`)})},B=()=>{const A=x.current;!A||I.current||(R.current=new Map([...A.querySelectorAll("[data-mind-map-node]")].map(_=>[_.dataset.mindMapNode,_.getBoundingClientRect()])))};l.useLayoutEffect(()=>{P()},[t,r,b]),l.useLayoutEffect(()=>{z()},[t.id]),l.useLayoutEffect(()=>{const A=x.current;if(!A)return;const _=o!==j.current;j.current=o;const F=[...A.querySelectorAll("[data-mind-map-node]")],U=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()])),q=R.current,L=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode;return[te,Y.style.transform?U.get(te):q.get(te)||U.get(te)]}));cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1,F.forEach(Y=>{Y.style.transition="none",Y.style.transform="",Y.style.opacity=""}),A.offsetHeight;const K=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]));let X=K;if(_&&(I.current=!0,z(K),X=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]))),!q.size){I.current=!1,R.current=X;return}const V=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode,ne=L.get(te),ce=K.get(te);return[te,ne&&ce?{x:(ne.left-ce.left)/($.current||1),y:(ne.top-ce.top)/($.current||1)}:null]})),W=[...V.values()].filter(Y=>Y&&(Math.abs(Y.x)>=1||Math.abs(Y.y)>=1));if(!(W.length<=40&&W.every(Y=>Math.max(Math.abs(Y.x),Math.abs(Y.y))<=900))){I.current=!1,R.current=X;return}return I.current=W.length>0,F.forEach(Y=>{const te=L.get(Y.dataset.mindMapNode),ne=K.get(Y.dataset.mindMapNode);if(!te||!ne){Y.style.opacity="1";return}const ce=V.get(Y.dataset.mindMapNode),Z=ce.x,ee=ce.y;Math.abs(Z)<1&&Math.abs(ee)<1||(Y.style.transition="none",Y.style.transform=`translate(${Z}px, ${ee}px)`)}),F.forEach(Y=>void Y.offsetWidth),N.current=requestAnimationFrame(()=>{F.forEach(Y=>{const te=L.get(Y.dataset.mindMapNode);Y.style.transition="transform 380ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease",Y.style.transform="",te||(Y.style.opacity="1")}),N.current=0,O.current=window.setTimeout(()=>{I.current=!1,B(),O.current=0},T4e+16)}),R.current=X,()=>{cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1}},[t,b,o]),l.useLayoutEffect(()=>{const A=x.current,_=w.current;if(!A||!_||_.toZoom!==r)return;const F=A.getBoundingClientRect(),U=A.querySelector(".mind-map-canvas-stage"),q=U==null?void 0:U.getBoundingClientRect(),L=_.stageX===null||!q?Ts+(_.x+A.scrollLeft-Ts)*(r/_.fromZoom)-_.x:A.scrollLeft+q.left+_.stageX*r-(F.left+_.x),K=_.stageY===null||!q?Ts+(_.y+A.scrollTop-Ts)*(r/_.fromZoom)-_.y:A.scrollTop+q.top+_.stageY*r-(F.top+_.y);A.scrollLeft=Math.max(0,Math.min(L,A.scrollWidth-A.clientWidth)),A.scrollTop=Math.max(0,Math.min(K,A.scrollHeight-A.clientHeight)),w.current=null},[r]),l.useLayoutEffect(()=>{if(a===0)return;const A=requestAnimationFrame(()=>z());return()=>cancelAnimationFrame(A)},[a]),l.useEffect(()=>{const A=U=>{U.key==="Meta"&&(E.current.meta=!0),U.key==="Control"&&(E.current.ctrl=!0)},_=U=>{U.key==="Meta"&&(E.current.meta=!1),U.key==="Control"&&(E.current.ctrl=!1)},F=()=>{E.current={meta:!1,ctrl:!1}};return window.addEventListener("keydown",A),window.addEventListener("keyup",_),window.addEventListener("blur",F),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",_),window.removeEventListener("blur",F)}},[]);const H=l.useCallback(A=>{var W,G;const _=x.current;if(!_||!_.contains(A.target))return;const F=A.metaKey||((W=A.getModifierState)==null?void 0:W.call(A,"Meta"))||E.current.meta,U=A.ctrlKey||((G=A.getModifierState)==null?void 0:G.call(A,"Control"))||E.current.ctrl;if(!F&&!U||!A.deltaY)return;A.preventDefault(),A.returnValue=!1,A.stopPropagation();const q=_.getBoundingClientRect(),L=$.current,K=A.deltaMode===1?A.deltaY*16:A.deltaY,X=Math.min(Math.abs(K),48)*Math.sign(K),V=Math.max(.5,Math.min(2,Number((L*Math.pow(1.1,-X/24)).toFixed(3))));V!==L&&(w.current=k(_,L,A.clientX-q.left,A.clientY-q.top),w.current.toZoom=V,$.current=V,v(V))},[v]);return l.useEffect(()=>(window.addEventListener("wheel",H,{capture:!0,passive:!1}),()=>window.removeEventListener("wheel",H,{capture:!0})),[H]),c.jsx("div",{className:`mind-map-canvas-scroll ${s?"is-panning":""}`,ref:x,onPointerCancel:m,onPointerDown:T,onPointerMove:f,onPointerUp:m,onScroll:B,children:c.jsx("div",{className:"mind-map-canvas-world",style:{height:`${M4e*r+Ts*2}px`,width:`${k4e*r+Ts*2}px`},children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right",style:{marginLeft:`${Ts}px`,marginTop:`${Ts}px`,zoom:r},children:c.jsx(CA,{jiraIssues:y,map:t,nodeMaxWidth:b,onSelect:h,onToggle:p,selectedId:n})})})})});function A4e({mindMapId:e,onNavigate:t}){var Qt,kt;const{message:n}=Pr.useApp(),r=l.useRef(null),[a,o]=l.useState(null),[s,u]=l.useState(null),[f,m]=l.useState(null),[h,p]=l.useState(""),[v,y]=l.useState(!0),[b,C]=l.useState(1),[x,w]=l.useState(0),[$,E]=l.useState(0),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,k]=l.useState(null),[T,z]=l.useState(null),[P,B]=l.useState(!1),[H,A]=l.useState(!1),[_,F]=l.useState(""),[U,q]=l.useState(!1),[L,K]=l.useState(""),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState([]),[ne,ce]=l.useState(!1),[Z,ee]=l.useState(!1),[re,oe]=l.useState(!1),ue=l.useRef(null),ye=l.useRef(null),J=l.useRef(null),ve=l.useRef(null),xe=l.useRef(!1),ze=l.useRef(null),fe=l.useRef(Promise.resolve());l.useEffect(()=>{let ke=!0;return Un.status().then(Ue=>{if(!ke)return;const mt=Number.isInteger(Ue.mindMapNodeMaxWidth)?Ue.mindMapNodeMaxWidth:null;k(mt),z(mt),B(!0)}).catch(Ue=>{ke&&(B(!0),n.error(`Could not load mind map settings: ${Ue.message||"unknown error"}`))}),()=>{ke=!1}},[]),l.useEffect(()=>{P&&E(ke=>ke+1)},[j,P]),l.useEffect(()=>{let ke=!0;return y(!0),o(null),m(null),ce(!1),sl.get(e).then(Ue=>{ke&&(o(Ue),p(Ue.title||""),C(1),w(0),N(!1),ue.current=null)}).catch(Ue=>{ke&&n.error(`Could not load mind map: ${Ue.message||"unknown error"}`)}).finally(()=>{ke&&y(!1)}),()=>{ke=!1}},[e]),l.useEffect(()=>{a&&f&&!Gd(a.root,f)&&m(null)},[a,f]),l.useEffect(()=>{var ke,Ue;xe.current&&(xe.current=!1,(Ue=(ke=ve.current)==null?void 0:ke.focus)==null||Ue.call(ke))},[f]),l.useEffect(()=>{var ke;oe(!!((ke=se==null?void 0:se.notes)!=null&&ke.trim()))},[f]),l.useEffect(()=>{if(!Z)return;const ke=Ue=>{Ue.key==="Escape"&&ee(!1)};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[Z]);const se=l.useMemo(()=>f?Gd(a==null?void 0:a.root,f):null,[a,f]),le=l.useMemo(()=>yA(a==null?void 0:a.root,f),[a,f]),ae=l.useMemo(()=>Vh(a==null?void 0:a.root,f),[a,f]),pe=((Qt=ae==null?void 0:ae.children)==null?void 0:Qt.findIndex(ke=>ke.id===f))??-1,Ie=(a==null?void 0:a.jiraIssues)||[],Ce=l.useMemo(()=>{const ke=new Set,Ue=mt=>{((mt==null?void 0:mt.jiraKeys)||[]).forEach(qt=>ke.add(qt)),((mt==null?void 0:mt.children)||[]).forEach(Ue)};return Ue(a==null?void 0:a.root),ke},[a]),me=l.useMemo(()=>((se==null?void 0:se.jiraKeys)||[]).map(ke=>Ie.find(Ue=>Ue.key===ke)||{key:ke,summary:"Summary unavailable",url:""}),[Ie,se]),be=l.useMemo(()=>{if(!a||!se||!ae)return[];const ke=new Set;pA(se,ke);const Ue=gA(a.root,ke);return Ue?[Ue]:[]},[a,se,ae]),Ee=ke=>{if(!a)return;const Ue={...ke(a),updatedAt:new Date().toISOString()};o(Ue),fe.current=fe.current.catch(()=>{}).then(()=>sl.update(Ue.id,Ue)).catch(()=>new Promise((mt,qt)=>{window.setTimeout(()=>{sl.update(Ue.id,Ue).then(mt).catch(qt)},120)})).catch(mt=>n.error(`Could not save mind map: ${mt.message||"unknown error"}`))},Me=()=>{const ke=h.trim()||"Untitled mind map";p(ke),Ee(Ue=>({...Ue,title:ke,root:Ue.root.text===Ue.title?{...Ue.root,text:ke}:Ue.root}))},De=ke=>{se&&Ee(Ue=>({...Ue,root:eu(Ue.root,se.id,mt=>({...mt,...ke}))}))},Te=()=>{if(!se||le)return;const ke=!se.tested;Ee(Ue=>({...Ue,root:eu(Ue.root,se.id,mt=>mA(mt,ke))}))},Ve=(ke=0)=>({id:`node-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,text:"New idea",color:P0[ke%P0.length],tested:!1,children:[]}),_e=()=>{if(!se)return;const ke=Ve((se.children||[]).length);De({children:[...se.children||[],ke],collapsed:!1}),xe.current=!0,m(ke.id)},Ne=()=>{if(!se||!ae){_e();return}const ke=Ve(ae.children.findIndex(Ue=>Ue.id===se.id)+1);Ee(Ue=>({...Ue,root:y4e(Ue.root,se.id,ke)})),xe.current=!0,m(ke.id)},$e=ke=>{if(!ae||pe<0)return;const Ue=ae.id,mt=pe+ke;mt<0||mt>=ae.children.length||Ee(qt=>({...qt,root:eu(qt.root,Ue,Yt=>{const cn=[...Yt.children||[]],rn=cn.findIndex(Mt=>Mt.id===f),gn=rn+ke;if(rn<0||gn<0||gn>=cn.length)return Yt;const[St]=cn.splice(rn,1);return cn.splice(gn,0,St),{...Yt,children:cn}})}))},Ae=()=>{!se||!ae||!Vh(a==null?void 0:a.root,ae.id)||Ee(ke=>({...ke,root:b4e(ke.root,se.id)}))};l.useEffect(()=>{const ke=Ue=>{if(!(!a||!se||Ue.defaultPrevented||Ue.isComposing||Ue.repeat)&&!(Ue.altKey||Ue.ctrlKey||Ue.metaKey)&&!(Ue.key!=="Enter"&&Ue.key!=="Tab")&&!(Ue.key==="Enter"&&P4e(Ue.target))){if(Ue.key==="Tab"){const mt=document.querySelector(".mind-map-inspector-card"),qt=(mt==null?void 0:mt.matches(":hover"))||!1,Yt=Ue.target instanceof Element&&!!Ue.target.closest(".mind-map-inspector-card");if(qt&&!Yt)return}if(Ue.preventDefault(),Ue.key==="Tab"){Ue.shiftKey?Ae():_e();return}Ne()}};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[a,se,ae]);const We=()=>{if(!se||!ae)return;const ke=ae.id;Ee(Ue=>({...Ue,root:qy(Ue.root,se.id)})),m(ke),n.success("Idea removed")},Le=()=>{ae&&(te(vA(a.root,ae.id)||[]),G(!0))},tt=()=>{const ke=Y[Y.length-1];if(!se||!ae||!ke)return;if(kk(a.root,se.id,ke)===a.root){n.error("Please choose another valid parent node.");return}Ee(mt=>({...mt,root:kk(mt.root,se.id,ke)})),G(!1),n.success(`Moved “${se.text||"idea"}” successfully.`)},Je=()=>{I(!0)},Ye=async()=>{A(!0);try{const ke=await Un.saveMindMapNodeMaxWidth(T),Ue=Number.isInteger(ke.mindMapNodeMaxWidth)?ke.mindMapNodeMaxWidth:null;k(Ue),z(Ue),n.success(Ue?"Mind map node width saved":"Using default mind map node widths")}catch(ke){n.error(`Could not save node width: ${ke.message||"unknown error"}`)}finally{A(!1)}},He=async()=>{const ke=g4e(_);if(!ke){n.error("Enter a Jira No such as PROJ-123 or a Jira issue link.");return}q(!0);try{const Ue=await sl.resolveJiraIssue(_);if(Ie.some(mt=>mt.key===Ue.key)){n.info(`${Ue.key} is already in this map.`);return}Ee(mt=>({...mt,jiraIssues:[...mt.jiraIssues||[],Ue]})),F(""),n.success(`${Ue.key} added to this map.`)}catch(Ue){n.error(Ue.message||`Could not load ${ke.key} from Jira.`)}finally{q(!1)}},nt=ke=>{Ee(Ue=>({...Ue,jiraIssues:(Ue.jiraIssues||[]).filter(mt=>mt.key!==ke),root:hA(Ue.root,ke)}))},ft=async ke=>{K(ke.key);try{const Ue=await sl.resolveJiraIssue(ke.key);Ee(mt=>({...mt,jiraIssues:(mt.jiraIssues||[]).map(qt=>qt.key===ke.key?{...qt,summary:Ue.summary,url:Ue.url||qt.url}:qt)})),n.success(`${ke.key} summary refreshed`)}catch(Ue){n.error(Ue.message||`Could not refresh ${ke.key}.`)}finally{K("")}},vt=ke=>{De({jiraKeys:((se==null?void 0:se.jiraKeys)||[]).filter(Ue=>Ue!==ke)})},qe=ke=>{ke&&(m(ke),ce(!0))},je=(ke,Ue)=>{var qt;if(ke.button!==0)return;const mt=ke.currentTarget;mt&&(ke.preventDefault(),(qt=mt.setPointerCapture)==null||qt.call(mt,ke.pointerId),ue.current={canvas:mt,pointerId:ke.pointerId,startX:ke.clientX,startY:ke.clientY,startScrollLeft:mt.scrollLeft,startScrollTop:mt.scrollTop,nodeId:Ue,moved:!1},Ue&&qe(Ue),N(!0))},Be=ke=>{const Ue=ue.current;if(!Ue||Ue.pointerId!==ke.pointerId)return;const mt=Ue.canvas||ke.currentTarget;!Ue.moved&&Math.hypot(ke.clientX-Ue.startX,ke.clientY-Ue.startY)<3||(Ue.moved=!0,mt.scrollLeft=Ue.startScrollLeft-(ke.clientX-Ue.startX),mt.scrollTop=Ue.startScrollTop-(ke.clientY-Ue.startY))},Ge=ke=>{var mt,qt,Yt,cn;const Ue=ue.current;!Ue||ke.pointerId!==void 0&&Ue.pointerId!==ke.pointerId||(!Ue.moved&&!Ue.nodeId&&ce(!1),(qt=(mt=Ue.canvas)==null?void 0:mt.releasePointerCapture)==null||qt.call(mt,Ue.pointerId),(cn=(Yt=ke.currentTarget)==null?void 0:Yt.releasePointerCapture)==null||cn.call(Yt,Ue.pointerId),ue.current=null,N(!1))};l.useEffect(()=>{const ke=Ue=>Ge(Ue);return window.addEventListener("pointerup",ke),window.addEventListener("pointercancel",ke),window.addEventListener("blur",ke),()=>{window.removeEventListener("pointerup",ke),window.removeEventListener("pointercancel",ke),window.removeEventListener("blur",ke)}},[]);const Xe=ke=>{Ee(Ue=>({...Ue,root:eu(Ue.root,ke,mt=>({...mt,collapsed:!mt.collapsed}))}))},Qe=(ke,Ue=!1)=>{Ee(mt=>({...mt,root:h2(mt.root,ke,!0)})),Ue&&E(mt=>mt+1)},it=async ke=>{var Ue;if(a)try{if(ke==="xmind"){const{mindMapToXmindBlob:mt}=await pu(async()=>{const{mindMapToXmindBlob:Yt}=await import("./xmindAdapter-BxzU4Y3W.js");return{mindMapToXmindBlob:Yt}},[]),qt=await mt(a);tu(`${a.title||"mind-map"}.xmind`,qt,"application/octet-stream"),n.success("XMind exported");return}if(ke==="markdown"){tu(`${a.title||"mind-map"}.md`,sA(a),"text/markdown;charset=utf-8"),n.success("Markdown exported");return}if(ke==="jpg"){(Ue=document.fonts)!=null&&Ue.ready&&await document.fonts.ready,u({...a,root:h2(a.root,!1,!0)}),await new Promise(mt=>requestAnimationFrame(()=>requestAnimationFrame(mt)));try{const mt=await I4e(J.current);tu(`${a.title||"mind-map"}.jpg`,mt,"image/jpeg"),n.success("JPG exported")}finally{u(null)}return}tu(`${a.title||"mind-map"}.json`,`${JSON.stringify(a,null,2)}
623
- `,"application/json;charset=utf-8"),n.success("JSON exported")}catch(mt){n.error(`Could not export this map: ${mt.message||"unknown error"}`)}},ut=async ke=>{var mt;const Ue=(mt=ke.target.files)==null?void 0:mt[0];if(ke.target.value="",!(!Ue||!a))try{const qt=Ue.name.toLowerCase().endsWith(".xmind"),Yt=qt?null:await Ue.text(),cn=Ue.name.toLowerCase().endsWith(".json"),rn=qt?await(async()=>{const{xmindBlobToMindMap:Mt}=await pu(async()=>{const{xmindBlobToMindMap:Rt}=await import("./xmindAdapter-BxzU4Y3W.js");return{xmindBlobToMindMap:Rt}},[]);return Mt(await Ue.arrayBuffer(),pS(Ue.name))})():cn?C4(JSON.parse(Yt),pS(Ue.name)):cA(Yt,pS(Ue.name)),gn={...rn,id:a.id,title:rn.title||a.title,createdAt:a.createdAt,updatedAt:new Date().toISOString()};await fe.current.catch(()=>{});const St=await sl.update(a.id,gn);o(St),qe(gn.root.id),p(St.title),n.success(`${qt?"XMind":cn?"JSON":"Markdown"} imported into this map`)}catch(qt){n.error(`Could not import this file: ${qt.message||"invalid format"}`)}},pt=async()=>{if(a!=null&&a.filePath)try{await Un.openFolder(a.filePath)}catch(ke){n.error(`Could not open map folder: ${ke.message||"unknown error"}`)}},_t=async()=>{if(a!=null&&a.filePath)try{await navigator.clipboard.writeText(a.filePath),n.success("Mind map file path copied")}catch(ke){n.error(`Could not copy file path: ${ke.message||"clipboard unavailable"}`)}};if(v)return c.jsx("div",{className:"mind-map-missing",children:c.jsx(ar,{tip:"Loading mind map..."})});if(!a)return c.jsxs("div",{className:"mind-map-missing",children:[c.jsx(Xt,{description:"This mind map could not be found."}),c.jsx(Re,{onClick:()=>t("mind-maps"),children:"Back to mind maps"})]});const Pt=ne&&!!f;return c.jsxs("div",{className:`mind-map-detail-page${Z?" is-canvas-fullscreen":""}`,children:[c.jsxs("div",{className:"mind-map-detail-toolbar",children:[c.jsxs("div",{className:"mind-map-detail-heading",children:[c.jsx(Re,{"aria-label":"Back to mind maps",className:"mind-map-back-button",icon:c.jsx(ec,{}),onClick:()=>t("mind-maps"),type:"text"}),c.jsx("div",{className:"mind-map-breadcrumbs",children:c.jsx("button",{onClick:()=>t("mind-maps"),type:"button",children:"Mind maps"})}),c.jsx(Ct,{"aria-label":"Mind map title",className:"mind-map-title-input",onBlur:Me,onChange:ke=>p(ke.target.value),onPressEnter:ke=>ke.currentTarget.blur(),value:h})]}),c.jsxs(ct,{className:"mind-map-detail-actions",size:8,children:[c.jsx("input",{ref:r,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:ut,type:"file"}),c.jsx(Re,{icon:c.jsx(X$,{}),onClick:()=>{var ke;return(ke=r.current)==null?void 0:ke.click()},children:"Import"}),c.jsx(Bl,{menu:{items:[{key:"xmind",icon:c.jsx(QR,{}),label:"Export XMind"},{key:"jpg",icon:c.jsx(qv,{}),label:"Export JPG"},{key:"json",icon:c.jsx(wa,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"}],onClick:({key:ke})=>it(ke)},trigger:["click"],children:c.jsx(Re,{icon:c.jsx(ql,{}),children:"Export"})}),c.jsx(Re,{"aria-label":"Mind map settings",icon:c.jsx(Gl,{}),onClick:Je,children:"Settings"}),c.jsx(Re,{icon:c.jsx(Q$,{}),onClick:()=>n.success("All changes saved to the data file"),children:"Save"})]})]}),c.jsxs("div",{className:`mind-map-detail-layout${Pt?"":" is-inspector-collapsed"}`,children:[c.jsxs(It,{className:"mind-map-canvas-card",styles:{body:{padding:0}},children:[c.jsxs("div",{className:"mind-map-canvas-header",children:[c.jsxs("div",{className:"mind-map-canvas-heading",children:[c.jsx(io,{className:"mind-map-eyebrow",children:"CANVAS"}),c.jsxs("div",{className:"mind-map-canvas-title-row",children:[c.jsx(Tk,{level:3,children:"Map canvas"}),c.jsx(io,{className:"mind-map-canvas-tip",type:"secondary",children:"Tip: keep each branch short and concrete."})]})]}),c.jsxs(ct,{className:"mind-map-canvas-controls",size:12,children:[c.jsx(Re,{"aria-label":Z?"Exit canvas full screen":"Enter canvas full screen",icon:Z?c.jsx(I9,{}):c.jsx(k9,{}),onClick:()=>{ee(ke=>!ke),w(ke=>ke+1)},type:"text"}),c.jsx(Re,{"aria-label":Pt?"Collapse inspector":"Show inspector",className:"mind-map-inspector-control",icon:Pt?c.jsx(Yve,{}):c.jsx(Qve,{}),onClick:()=>ce(ke=>!ke),type:"text"}),c.jsxs(ct,{className:"mind-map-tree-actions",size:4,children:[c.jsx(Re,{icon:c.jsx(d9,{}),onClick:()=>Qe(!1),children:"Expand all"}),c.jsx(Re,{icon:c.jsx(u9,{}),onClick:()=>Qe(!0,!0),children:"Collapse all"})]}),c.jsxs(ct,{className:"mind-map-zoom-control",size:4,children:[c.jsx(Re,{"aria-label":"Zoom out",disabled:b<=.5,icon:c.jsx(jD,{}),onClick:()=>{var ke;return(ke=ye.current)==null?void 0:ke.zoomAt(Math.max(.5,Number((b-.1).toFixed(2))))},type:"text"}),c.jsxs("button",{"aria-label":"Reset canvas view",className:"mind-map-zoom-label",onClick:()=>{C(1),w(ke=>ke+1)},type:"button",children:[Math.round(b*100),"%"]}),c.jsx(Re,{"aria-label":"Zoom in",disabled:b>=2,icon:c.jsx(ED,{}),onClick:()=>{var ke;return(ke=ye.current)==null?void 0:ke.zoomAt(Math.min(2,Number((b+.1).toFixed(2))))},type:"text"})]})]})]}),c.jsx(z4e,{ref:ye,isPanning:R,map:a,onCanvasPointerDown:je,onCanvasPointerMove:Be,onCanvasPointerUp:Ge,onSelect:qe,onToggle:Xe,onZoomChange:C,recenterLayoutToken:$,resetViewToken:x,selectedId:f,zoom:b,jiraIssues:Ie,nodeMaxWidth:j}),c.jsx("div",{className:"mind-map-canvas-footer",children:c.jsxs(io,{type:"secondary",children:[c.jsx("span",{className:"mind-map-key",children:"⌘"})," Click to select ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Enter"})," sibling ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Tab"})," child ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Drag canvas to pan ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ⌘ + Scroll to zoom ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Changes save automatically"]})})]}),c.jsx(It,{className:"mind-map-inspector-card",children:c.jsxs("div",{className:"mind-map-inspector-shell",children:[c.jsxs("div",{className:"mind-map-inspector-header",children:[c.jsxs("div",{children:[c.jsx(io,{className:"mind-map-eyebrow",children:"INSPECTOR"}),c.jsxs("div",{className:"mind-map-inspector-title-row",children:[c.jsx(Tk,{level:3,children:"Selected idea"}),(se==null?void 0:se.id)===a.root.id?c.jsx($t,{color:"purple",children:"Root"}):null,le?c.jsx($t,{className:"mind-map-comment-tag",children:"Comment"}):null]})]}),(se==null?void 0:se.id)!==a.root.id&&c.jsxs("div",{className:"mind-map-inspector-header-actions",children:[ae&&c.jsxs("div",{className:"mind-map-sibling-order-actions",children:[c.jsx(yn,{title:"Move idea up",children:c.jsx(Re,{"aria-label":"Move idea up",disabled:pe<=0,icon:c.jsx(O9,{}),onClick:()=>$e(-1)})}),c.jsx(yn,{title:"Move idea down",children:c.jsx(Re,{"aria-label":"Move idea down",disabled:pe<0||pe>=ae.children.length-1,icon:c.jsx(N9,{}),onClick:()=>$e(1)})})]}),c.jsx(Gr,{cancelText:"Cancel",description:"This will also remove all child ideas.",okButtonProps:{danger:!0},okText:"Delete",onConfirm:We,placement:"topRight",title:"Delete this idea?",children:c.jsx(Re,{"aria-label":"Delete selected idea",className:"mind-map-inline-delete",danger:!0,icon:c.jsx(Hn,{}),type:"text"})})]})]}),c.jsx("div",{className:"mind-map-inspector-content",children:se&&c.jsxs("div",{className:"mind-map-inspector-fields",children:[c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Content"}),c.jsxs("div",{className:"mind-map-idea-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-text",children:"Idea"}),c.jsxs("div",{className:"mind-map-auto-width-field",children:[c.jsx(yn,{title:"When off, text wraps only at manual line breaks.",placement:"top",children:c.jsx("span",{className:"mind-map-auto-width-label",children:"Auto width"})}),c.jsx(Ja,{"aria-label":"Auto width",checked:se.autoWidth!==!1,onChange:ke=>De({autoWidth:ke}),size:"small"})]})]}),c.jsx(Ct.TextArea,{autoSize:{minRows:2,maxRows:8},className:"mind-map-idea-input",id:"mind-map-node-text",onChange:ke=>De({text:ke.target.value}),placeholder:"Name this idea",ref:ve,value:se.text}),ae&&c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-edge-label",children:"Line label"}),c.jsx(Ct,{id:"mind-map-node-edge-label",onChange:ke=>De({edgeLabel:ke.target.value||void 0}),placeholder:"Label this connection",value:se.edgeLabel||""})]}),c.jsxs("div",{className:"mind-map-notes-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-notes",children:"Notes"}),c.jsx(Re,{className:"mind-map-notes-toggle",onClick:()=>oe(ke=>!ke),size:"small",type:"text",children:re?"Hide notes":(kt=se.notes)!=null&&kt.trim()?"Edit notes":"Add note"})]}),re&&c.jsx(Ct.TextArea,{autoSize:{minRows:4,maxRows:8},id:"mind-map-node-notes",onChange:ke=>De({notes:ke.target.value}),placeholder:"Add a note or a prompt...",value:se.notes||""})]}),!le&&c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Test status"}),c.jsxs("div",{className:"mind-map-tested-field",children:[c.jsxs("div",{children:[c.jsx("span",{className:"mind-map-field-label",children:"Tested"}),c.jsx(io,{type:"secondary",children:"Updates this node and all child nodes."})]}),c.jsxs("div",{className:"mind-map-tested-control",children:[c.jsx("span",{className:"mind-map-tested-state",children:se.tested?"Tested":"Pending"}),c.jsx(Ja,{checked:!!se.tested,onChange:Te,size:"small"})]})]})]}),c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Jira"}),me.length>0&&c.jsx("div",{"aria-label":"Selected Jira issues",className:"mind-map-selected-jira-list",children:me.map(ke=>c.jsxs("div",{className:"mind-map-selected-jira-item",children:[c.jsxs("button",{className:"mind-map-selected-jira-open",disabled:!ke.url,onClick:()=>hr(ke.url),title:ke.url?"Open in Jira":"Jira link unavailable",type:"button",children:[c.jsx($t,{color:"blue",children:ke.key}),c.jsx("span",{className:"mind-map-selected-jira-summary",children:ke.summary||"Summary unavailable"}),ke.url&&c.jsx(ul,{})]}),c.jsx("button",{"aria-label":`Untag ${ke.key}`,className:"mind-map-selected-jira-untag",onClick:()=>vt(ke.key),title:`Untag ${ke.key}`,type:"button",children:c.jsx(Jo,{})})]},ke.key))}),c.jsx($n,{allowClear:!0,"aria-label":"Jira tags",className:"mind-map-node-jira-select",filterOption:(ke,Ue)=>`${(Ue==null?void 0:Ue.value)||""} ${(Ue==null?void 0:Ue.summary)||""}`.toLowerCase().includes(ke.toLowerCase()),id:"mind-map-node-jira",mode:"multiple",onChange:ke=>{De({jiraKeys:ke}),V(!1),requestAnimationFrame(()=>{var Ue,mt;return(mt=(Ue=ze.current)==null?void 0:Ue.blur)==null?void 0:mt.call(Ue)})},options:Ie.map(ke=>({label:c.jsxs("div",{className:"mind-map-jira-select-option",children:[c.jsx("span",{className:"mind-map-jira-select-option-key",children:ke.key}),c.jsx("span",{className:"mind-map-jira-select-option-summary",children:ke.summary||"Summary unavailable"})]}),summary:ke.summary||"",value:ke.key})),maxTagCount:0,maxTagPlaceholder:"Select Jira issues",onOpenChange:V,placeholder:Ie.length?"Select Jira issues":"Add Jira issues in Settings",showSearch:!0,open:X,ref:ze,value:se.jiraKeys||[]})]})]})}),c.jsxs("div",{className:"mind-map-inspector-actions",children:[c.jsx(yn,{title:"Add a child idea (Tab)",children:c.jsx(Re,{block:!0,className:"mind-map-add-child",icon:c.jsx(Xn,{}),onClick:_e,type:"primary",children:"Add child idea"})}),ae&&c.jsx(Re,{block:!0,className:"mind-map-move-button",icon:c.jsx(QR,{}),onClick:Le,children:"Move idea"})]})]})})]}),c.jsxs(I$,{className:"mind-map-settings-drawer",onClose:()=>I(!1),open:O,title:"Mind map settings",width:520,children:[c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Node width"}),c.jsx(io,{className:"mind-map-settings-description",children:"Set a maximum width for regular nodes. Leave empty to keep the current default (255px)."}),c.jsxs("div",{className:"mind-map-node-width-control",children:[c.jsx(cf,{"aria-label":"Maximum node width",className:"mind-map-node-width-input",max:800,min:120,onChange:ke=>z(ke??null),placeholder:"Default",step:10,value:T??void 0}),c.jsx(Re,{disabled:!P||T===j,loading:H,onClick:Ye,type:"primary",children:"Save"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"File location"}),c.jsx(io,{className:"mind-map-settings-description",children:"This mind map is stored locally in the following file."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-file-location-row",children:[c.jsxs("div",{className:`mind-map-file-location-display${a.filePath?"":" is-unavailable"}`,title:a.filePath||"File location unavailable",children:[c.jsx(Re,{"aria-label":"Open mind map folder",className:"mind-map-file-location-folder",disabled:!a.filePath,icon:c.jsx(Fr,{}),onClick:pt,type:"text"}),c.jsx(io,{className:"mind-map-file-location-path",children:a.filePath||"File location unavailable"})]}),c.jsx(Re,{disabled:!a.filePath,icon:c.jsx(fo,{}),onClick:_t,children:"Copy"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Jira issues"}),c.jsx(io,{className:"mind-map-settings-description",children:"Add issues to this map by Jira No or a Jira issue link, then tag them from the selected node inspector."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-jira-add-row",children:[c.jsx(Ct,{onChange:ke=>F(ke.target.value),onPressEnter:He,placeholder:"PROJ-123 or https://.../browse/PROJ-123",value:_}),c.jsx(Re,{loading:U,onClick:He,type:"primary",children:"Add"})]}),c.jsx("div",{className:"mind-map-jira-list",children:Ie.length?Ie.map(ke=>c.jsxs("div",{className:`mind-map-jira-list-item ${ke.url?"is-clickable":""} ${Ce.has(ke.key)?"is-tagged":""}`,onClick:()=>ke.url&&hr(ke.url),onKeyDown:Ue=>{Ue.target!==Ue.currentTarget||!ke.url||(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),hr(ke.url))},role:ke.url?"link":void 0,tabIndex:ke.url?0:void 0,children:[c.jsx("div",{className:"mind-map-jira-list-item-main",children:c.jsxs("div",{className:"mind-map-jira-list-item-title",children:[c.jsx($t,{color:"blue",children:ke.key}),c.jsx(io,{ellipsis:{tooltip:!0},children:ke.summary||"Summary unavailable"})]})}),c.jsxs("div",{className:"mind-map-jira-list-item-delete",onClick:Ue=>Ue.stopPropagation(),children:[c.jsx(Re,{"aria-label":`Refresh summary for ${ke.key}`,className:"mind-map-jira-refresh",disabled:!!L,icon:c.jsx(Xa,{spin:L===ke.key}),onClick:()=>void ft(ke),title:`Refresh summary for ${ke.key}`,type:"text"}),c.jsx(Gr,{cancelText:"Cancel",description:"Existing node tags for this issue will also be removed.",okButtonProps:{danger:!0},okText:"Remove",onConfirm:()=>nt(ke.key),placement:"left",title:`Remove ${ke.key}?`,children:c.jsx(Re,{"aria-label":`Remove ${ke.key}`,danger:!0,icon:c.jsx(Hn,{}),type:"text"})})]})]},ke.id||ke.key)):c.jsx(Xt,{className:"mind-map-jira-empty",description:"No Jira issues added yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})]}),c.jsxs(xn,{cancelText:"Cancel",okText:"Move",onCancel:()=>G(!1),onOk:tt,open:W,title:`Move “${(se==null?void 0:se.text)||"idea"}”`,children:[c.jsx(io,{type:"secondary",children:"Choose the node that should become the new parent. The entire subtree will move with it."}),c.jsx(Jl,{changeOnSelect:!0,className:"mind-map-move-select",onChange:te,options:be,placeholder:"Select a parent node",showSearch:!0,value:Y})]}),s&&c.jsx(D4e,{map:s,nodeMaxWidth:j,ref:J})]})}async function Pk(e,t={}){if(typeof window>"u"||!("Notification"in window)||Notification.permission!=="granted")return!1;const n={body:"",icon:"/devbuddy-192.png",tag:`devbuddy-notification-${Date.now()}`,...t};try{if("serviceWorker"in navigator){const r=await navigator.serviceWorker.ready;if(r.active)return r.active.postMessage({type:"SHOW_NOTIFICATION",title:e,...n}),!0}return new Notification(e,n),!0}catch{return!1}}const{Content:L4e,Sider:_4e}=Js,{Title:Dk,Text:Bc}=Cn,zk={dark:"#171c2b",light:"#dbeafe"},B4e="var(--db-font-sans)",H4e=(e,t)=>{var r;const n=(r=e==null?void 0:e.scripts)==null?void 0:r.find(a=>a.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t},F4e=(e,t)=>{const[n,...r]=String(t).split(":"),a=r.join(":"),o=e.find(s=>String(s.id)===n);return`${(o==null?void 0:o.alias)||(o==null?void 0:o.folder)||"Launcher"} · ${H4e(o,a)}`},SA=["overview","launcher","cron-jobs","clipboard","ports","image-compress","json-to-typescript","jira-filters","todo-list","reminders","memos","mind-maps","postman","bookmark-sync","file-organizer","branch-sync","branch-health","package-upgrade","package-versions","presentation-plan","presentation-view","settings","dev-configurations","errors"],V4e={overview:"Overview",launcher:"Launcher","cron-jobs":"Cron Jobs",clipboard:"Clipboard",ports:"Port Diagnostic","todo-list":"To-Do","todo-archived":"Archived Tasks",reminders:"Reminders",memos:"Memos","mind-maps":"Mind Maps","pr-review":"PR Review","pr-conflicts":"Resolve Conflicts","pr-conflict":"Resolve Conflicts","jira-filters":"Jira Workspace","presentation-plan":"Presentations","presentation-view":"Presentation","memo-reader":"Reading","branch-sync":"Branch Sync","branch-health":"Branch Health","package-upgrade":"Package Upgrade","package-versions":"Package Versions",postman:"Postman","image-compress":"Image compression","json-to-typescript":"JSON to TypeScript","bookmark-sync":"Bookmark Sync","file-organizer":"Folder Organizer",settings:"Settings","dev-configurations":"Dev Configurations",errors:"Error Logs"},wA=e=>{if(e==="mind-maps"||e==="mind-maps/")return{page:"mind-maps",mindMapId:null};if(e.startsWith("mind-maps/")){const t=e.slice(10).split("?")[0];return t?{page:"mind-maps",mindMapId:decodeURIComponent(t)}:null}return null},U4e=()=>{const t=(window.location.hash||"#/overview").slice(2),n=wA(t);if(n)return n;if(t==="memo-reader"||t.startsWith("memo-reader?"))return{page:"memo-reader",memoId:new URLSearchParams(t.split("?")[1]||"").get("id")||null};if(t.startsWith("plugin:"))return{page:"plugin",pluginId:t.slice(7)};if(t.startsWith("static:"))return{page:"static-page",staticId:t.slice(7)};if(t.startsWith("logs/"))return{page:"logs",pluginId:null};if(["todo-list/archived","todo-archived"].includes(t))return{page:"todo-archived",pluginId:null};if(t.startsWith("pr-review"))return{page:"pr-review",pluginId:null};if(t==="pr-conflicts"||t.startsWith("pr-conflicts?"))return{page:"pr-conflicts",pluginId:null};if(t.startsWith("pr-conflict"))return{page:"pr-conflict",pluginId:null};if(t.startsWith("branch-sync"))return{page:"branch-sync",pluginId:null};if(t.startsWith("branch-health"))return{page:"branch-health",pluginId:null};if(t==="launcher"||t.startsWith("launcher?")){const r=new URLSearchParams(t.split("?")[1]||"");return{page:"launcher",pluginId:null,launcherRunningOnly:r.get("running")==="1",launcherServiceId:r.get("service")||null}}return t==="home"?{page:"overview",pluginId:null}:SA.includes(t)?{page:t,pluginId:null}:{page:"overview",pluginId:null}};function W4e({theme:e,onThemeChange:t}){var We;const{message:n}=Pr.useApp(),r=U4e(),[a,o]=l.useState([]),[s,u]=l.useState(new Set),[f,m]=l.useState({}),[h,p]=l.useState([]),[v,y]=l.useState(!0),[b,C]=l.useState(null),[x,w]=l.useState(!1),[$,E]=l.useState(!1),[R,N]=l.useState([]),[O,I]=l.useState([]),[j,k]=l.useState(r.page),[T,z]=l.useState(r.launcherRunningOnly||!1),[P,B]=l.useState(r.launcherServiceId||null),[H,A]=l.useState(r.mindMapId||null),[_,F]=l.useState(r.memoId||null),[U,q]=l.useState(()=>{var Le;return((Le=window.matchMedia)==null?void 0:Le.call(window,"(max-width: 991.98px)").matches)??!1}),[L,K]=l.useState(null),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState(""),[ne,ce]=l.useState(null),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),ue=l.useRef(null),ye=l.useRef(new Map),J=l.useRef(null),ve=l.useCallback((Le,tt)=>{Le.preventDefault(),Le.stopPropagation(),oe({key:tt,left:Math.min(Le.clientX,Math.max(8,window.innerWidth-220)),top:Math.min(Le.clientY,Math.max(8,window.innerHeight-58))})},[]),xe=l.useCallback(Le=>{var Ye,He,nt;const tt=(He=(Ye=Le.target).closest)==null?void 0:He.call(Ye,".ant-menu-item"),Je=(nt=tt==null?void 0:tt.querySelector("[data-sidebar-key]"))==null?void 0:nt.dataset.sidebarKey;Je&&ve(Le,Je)},[ve]),ze=l.useCallback(()=>{if(!(re!=null&&re.key))return;const Le=new URL(window.location.href);Le.hash=`#/${re.key}`,window.open(Le.toString(),"_blank","noopener,noreferrer"),oe(null)},[re]),[fe,se]=l.useState(r.pluginId?{id:r.pluginId,name:"Plugin"}:null),[le,ae]=l.useState(null),[pe,Ie]=l.useState(""),Ce=async({showLoading:Le=!1}={})=>{Le&&y(!0);try{const[tt,Je,Ye]=await Promise.all([Br.list(),Br.running(),Zc.list().catch(()=>[])]);o(tt),p(Array.isArray(Ye)?Ye:[]),Array.isArray(Je)?(u(new Set(Je)),m({})):(u(new Set((Je==null?void 0:Je.running)||[])),m((Je==null?void 0:Je.errorCounts)||{})),w(!0),C(null),E(!0)}catch(tt){C((tt==null?void 0:tt.message)||"Unable to load service and runtime data."),E(!1)}finally{Le&&y(!1)}};l.useEffect(()=>{const Le=async()=>{try{const[Je,Ye]=await Promise.all([Br.running(),Zc.list().catch(()=>[])]);Array.isArray(Je)?(u(new Set(Je)),m({})):(u(new Set((Je==null?void 0:Je.running)||[])),m((Je==null?void 0:Je.errorCounts)||{})),Array.isArray(Ye)&&p(Ye)}catch{}},tt=setInterval(()=>{Le()},5e3);return()=>clearInterval(tt)},[]),l.useEffect(()=>{if(!x)return;const Le=Object.fromEntries(Object.entries(f).map(([Ge,Xe])=>[Ge,Number(Xe)||0])),tt=(Array.isArray(h)?h:[]).filter(Ge=>{var Xe;return(Xe=Ge==null?void 0:Ge.source)==null?void 0:Xe.startsWith("Launcher")}),Je=new Set(tt.map(Ge=>Ge.id).filter(Boolean)),Ye=ue.current;if(!Ye){ue.current={counts:Le,ids:Je};return}const He=Object.entries(Le).filter(([Ge,Xe])=>Xe>(Ye.counts[Ge]||0)).map(([Ge,Xe])=>({key:Ge,delta:Xe-(Ye.counts[Ge]||0),count:Xe})),nt=tt.filter(Ge=>Ge.id&&!Ye.ids.has(Ge.id));ue.current={counts:Le,ids:Je};const ft=[...He.map(Ge=>({dedupeKey:Ge.key,label:F4e(a,Ge.key),count:Ge.delta})),...nt.map(Ge=>({dedupeKey:Ge.source,label:`${Ge.source.replace(/^Launcher:\s*/,"")} · ${Ge.message||"Script error"}`,count:1}))],vt=Date.now(),qe=ft.filter(Ge=>{const Xe=ye.current.get(Ge.dedupeKey)||0;return vt-Xe<1e4?!1:(ye.current.set(Ge.dedupeKey,vt),!0)});if(qe.length===0)return;const je=qe.reduce((Ge,Xe)=>Ge+Xe.count,0),Be=qe.slice(0,3).map(Ge=>Ge.label).join(";");Pk(je===1?"Launcher script error":`Launcher: ${je} new script errors`,{body:Be||"A Launcher script reported a new error."})},[f,h,x,a]),l.useEffect(()=>{let Le=!1;const tt=async()=>{var Ye;try{const He=await Td.claimDue();if(Le||!((Ye=He==null?void 0:He.due)!=null&&Ye.length))return;await Promise.all(He.due.map(async nt=>{await Pk(nt.title,{body:nt.content,tag:`devbuddy-reminder-${nt.id}`})||n.info({content:`${nt.title}:${nt.content}`,duration:8})}))}catch{}};tt();const Je=window.setInterval(()=>{tt()},1e4);return()=>{Le=!0,window.clearInterval(Je)}},[n]);const me=async(Le=!1)=>{V(!0);try{K(await nI.status(Le))}catch{K(tt=>tt||{currentVersion:jd.version,latestVersion:jd.version,updateAvailable:!1,releases:[],sourceUnavailable:!0})}finally{V(!1)}},be=()=>Ce({showLoading:!0}),Ee=()=>{ce(null),ee(!0)},Me=()=>{const Le=ne==null?void 0:ne.success;ee(!1),Le&&window.location.reload()},De=async(Le="latest")=>{G(!0),te(Le),ce(null);try{const tt=await nI.selfUpdate(Le);ce({success:!0,message:tt.message}),K(Je=>Je&&{...Je,currentVersion:Le==="latest"?Je.latestVersion:Le,updateAvailable:Le==="latest"?!1:Le!==Je.latestVersion})}catch(tt){ce({success:!1,message:tt.message||"DevBuddy could not be updated."})}finally{G(!1)}},Te=async Le=>{if(Le){Ie("Loading plugin…");try{Ie(Le.view?await(await fetch(Le.view)).text():"This plugin does not provide a view yet.")}catch{Ie("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([Ce({showLoading:!0}),iye.list().then(N),Kc.list().then(I)]).catch(Le=>n.error(Le.message)),me()},[]),l.useEffect(()=>{const Le=()=>{const Je=(window.location.hash||"#/overview").slice(2),Ye=wA(Je);if(Ye){se(null),ae(null),k("mind-maps"),A(Ye.mindMapId);return}if(Je==="memo-reader"||Je.startsWith("memo-reader?")){const He=new URLSearchParams(Je.split("?")[1]||"");se(null),ae(null),k("memo-reader"),A(null),F(He.get("id")||null);return}if(Je.startsWith("plugin:")){const He=Je.slice(7),nt=R.find(ft=>ft.id===He);nt?(ae(null),k("plugin"),A(null),se(nt),Te(nt)):R.length>0&&(window.location.hash="#/overview")}else if(Je.startsWith("static:")){const He=Je.slice(7),nt=O.find(ft=>String(ft.id)===String(He));nt?(se(null),k("static-page"),A(null),ae(nt)):O.length>0&&(window.location.hash="#/overview")}else if(Je.startsWith("logs/"))se(null),ae(null),k("logs"),A(null);else if(["todo-list/archived","todo-archived"].includes(Je))se(null),ae(null),k("todo-archived"),A(null);else if(Je.startsWith("pr-review"))se(null),ae(null),k("pr-review"),A(null);else if(Je==="pr-conflicts"||Je.startsWith("pr-conflicts?"))se(null),ae(null),k("pr-conflicts"),A(null);else if(Je.startsWith("pr-conflict"))se(null),ae(null),k("pr-conflict"),A(null);else if(Je.startsWith("branch-sync"))se(null),ae(null),k("branch-sync"),A(null);else if(Je.startsWith("branch-health"))se(null),ae(null),k("branch-health"),A(null);else if(Je==="launcher"||Je.startsWith("launcher?")){const He=new URLSearchParams(Je.split("?")[1]||"");se(null),ae(null),k("launcher"),A(null),z(He.get("running")==="1"),B(He.get("service")||null)}else Je==="home"||SA.includes(Je)?(se(null),ae(null),k(Je==="home"?"overview":Je),A(null),Je==="launcher"&&z(!1)):window.location.hash="#/overview"};return window.addEventListener("hashchange",Le),window.location.hash?Le():window.location.hash="#/overview",()=>window.removeEventListener("hashchange",Le)},[R,O]),l.useEffect(()=>{if(!re)return;const Le=()=>oe(null),tt=Ye=>{var He,nt;Ye.button!==0||(nt=(He=Ye.target).closest)!=null&&nt.call(He,".sidebar-context-menu")||Le()},Je=Ye=>{Ye.key==="Escape"&&Le()};return document.addEventListener("pointerdown",tt),document.addEventListener("contextmenu",Le),window.addEventListener("blur",Le),window.addEventListener("keydown",Je),()=>{document.removeEventListener("pointerdown",tt),document.removeEventListener("contextmenu",Le),window.removeEventListener("blur",Le),window.removeEventListener("keydown",Je)}},[re]),l.useEffect(()=>{const Le=Je=>{var Ye;(Je.error||Je.message)&&Zc.log({source:"Frontend",message:Je.message||"Uncaught JavaScript Error",details:((Ye=Je.error)==null?void 0:Ye.stack)||`${Je.filename}:${Je.lineno}:${Je.colno}`}).catch(()=>{})},tt=Je=>{var Ye,He;Zc.log({source:"Frontend (Promise)",message:((Ye=Je.reason)==null?void 0:Ye.message)||String(Je.reason||"Unhandled Promise Rejection"),details:((He=Je.reason)==null?void 0:He.stack)||String(Je.reason)}).catch(()=>{})};return window.addEventListener("error",Le),window.addEventListener("unhandledrejection",tt),()=>{window.removeEventListener("error",Le),window.removeEventListener("unhandledrejection",tt)}},[]),l.useLayoutEffect(()=>{var Le;(Le=document.querySelector(".page"))==null||Le.scrollTo({top:0,left:0,behavior:"auto"}),j==="overview"&&J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)},[j,H,fe==null?void 0:fe.id,le==null?void 0:le.id]),l.useEffect(()=>{if(j==="logs")return;const Le=j==="plugin"?(fe==null?void 0:fe.name)||(fe==null?void 0:fe.id):j==="static-page"?le==null?void 0:le.name:V4e[j];document.title=Le?`${Le} · DevBuddy`:"DevBuddy · Workbench"},[j,fe==null?void 0:fe.name,fe==null?void 0:fe.id,le==null?void 0:le.name]);const Ve=()=>{J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)};l.useEffect(()=>{const Le=tt=>{(tt.metaKey||tt.ctrlKey)&&tt.shiftKey&&(tt.key==="r"||tt.key==="R"||tt.code==="KeyR")&&(tt.preventDefault(),tt.stopPropagation())};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[]),l.useEffect(()=>{if(v||!["overview","launcher","ports"].includes(j))return;const Le=setInterval(()=>{Ce()},2e3);return()=>clearInterval(Le)},[j,v]);const _e=l.useMemo(()=>{const Le=Je=>Je.map(Ye=>Ye.children?{...Ye,children:Le(Ye.children)}:Ye.key?{...Ye,icon:Ye.icon?c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":Ye.key,children:Ye.icon}):Ye.icon,label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":Ye.key,children:Ye.label})}:Ye),tt=[...R.map(Je=>({key:`plugin:${Je.id}`,icon:c.jsx("span",{"aria-hidden":"true",children:Je.icon||"✦"}),label:Je.name||Je.id})),...O.map(Je=>({key:`static:${Je.id}`,icon:c.jsx(Mf,{}),label:Je.name}))];return Le([{type:"group",label:"Run & Observe",children:[{key:"launcher",icon:c.jsx(qo,{}),label:"Launcher"},{key:"cron-jobs",icon:c.jsx(Qm,{}),label:"Cron Jobs"},{key:"clipboard",icon:c.jsx(fo,{}),label:"Clipboard"},{key:"ports",icon:c.jsx(e4,{}),label:"Port Diagnostic"}]},{type:"group",label:"Plan & Review",children:[{key:"todo-list",icon:c.jsx(mu,{}),label:"To-Do"},{key:"reminders",icon:c.jsx(Kd,{}),label:"Reminders"},{key:"memos",icon:c.jsx(Ui,{}),label:"Memos"},{key:"mind-maps",icon:c.jsx(TC,{}),label:"Mind Maps"},{key:"pr-review",icon:c.jsx(Ly,{}),label:"PR Review"},{key:"pr-conflicts",icon:c.jsx(w0,{}),label:"Resolve Conflicts"},{key:"jira-filters",icon:c.jsx(ove,{}),label:"Jira Workspace"},{key:"presentation-plan",icon:c.jsx(yve,{}),label:"Presentations"},{key:"branch-sync",icon:c.jsx(ou,{}),label:"Branch Sync"},{key:"branch-health",icon:c.jsx(J$,{}),label:"Branch Health"},{key:"package-upgrade",icon:c.jsx(Z$,{}),label:"Package Upgrade"},{key:"package-versions",icon:c.jsx(Ape,{}),label:"Package Versions"}]},{type:"group",label:"Utilities",children:[{key:"postman",icon:c.jsx(hu,{}),label:"Postman"},{key:"image-compress",icon:c.jsx(Yw,{}),label:"Image compression"},{key:"json-to-typescript",icon:c.jsx(wa,{}),label:"JSON to TypeScript"},{key:"bookmark-sync",icon:c.jsx(_h,{}),label:"Bookmark Sync"},{key:"file-organizer",icon:c.jsx(Fr,{}),label:"Folder Organizer"}]},...tt.length>0?[{type:"group",label:"Extensions",children:tt}]:[]])},[ve,R,O]),Ne=({key:Le})=>{window.location.hash=`#/${Le}`},$e=fe?`plugin:${fe.id}`:le?`static:${le.id}`:j==="todo-archived"?"todo-list":["pr-conflicts","pr-conflict"].includes(j)?"pr-conflicts":j,Ae=b&&!(v&&!x)?c.jsx(mr,{type:x?"warning":"error",showIcon:!0,message:x?"Service status may be out of date":"Unable to load services",description:b,action:c.jsx(Re,{size:"small",loading:v,onClick:be,children:"Retry"}),className:"launcher-data-notice"}):null;return j==="memo-reader"?c.jsx(c4e,{memoId:_}):j==="logs"?c.jsx(Cbe,{}):j==="presentation-view"?c.jsx(S1e,{}):c.jsxs(Js,{className:"workbench",children:[c.jsxs(_4e,{"aria-label":"DevBuddy navigation",breakpoint:"lg",className:"sidebar",collapsed:U,collapsedWidth:64,collapsible:!0,onBreakpoint:q,onCollapse:q,width:240,children:[c.jsxs("div",{className:"brand-row",children:[c.jsxs("a",{className:"brand",href:"#/overview","aria-current":j==="overview"?"page":void 0,"aria-label":`Go to Overview — DevBuddy version ${jd.version}`,onClick:Ve,children:[c.jsx("span",{className:`brand-mark ${$?"":"is-offline"}`,"aria-hidden":"true",children:"✦"}),c.jsx("span",{className:"brand-name",children:"DevBuddy"}),c.jsxs("span",{className:"brand-version",children:["v",jd.version]})]}),!U&&c.jsx(yn,{title:L!=null&&L.updateAvailable?`Update available: v${L.latestVersion}`:"View Change Log",children:c.jsx(sa,{dot:!!(L!=null&&L.updateAvailable),color:"#f5b942",offset:[-2,3],children:c.jsx(Re,{"aria-label":L!=null&&L.updateAvailable?`Update available: version ${L.latestVersion}`:"View Change Log",className:`sidebar-update-button ${L!=null&&L.updateAvailable?"has-update":""}`,icon:c.jsx(TC,{}),loading:X&&!L,onClick:Ee,type:"text"})})})]}),c.jsx("nav",{ref:J,className:"sidebar-nav","aria-label":"Main navigation",onContextMenu:xe,children:c.jsx(Xs,{theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:[$e],items:_e,onClick:Ne})}),c.jsx("div",{className:"sidebar-bottom",children:c.jsx("div",{className:"sidebar-bottom-inner",children:c.jsx("nav",{"aria-label":"Settings navigation",onContextMenu:xe,children:c.jsx(Xs,{className:"sidebar-settings-menu",theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:["settings","errors"].includes(j)?[j]:[],items:[{key:"settings",icon:c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":"settings",children:c.jsx(Gl,{})}),label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":"settings",children:"Settings"})}],onClick:Ne})})})})]}),c.jsx(Js,{children:c.jsx(L4e,{className:`page ${j==="overview"?"is-overview-page":""} ${["static-page","postman"].includes(j)?"is-static-page":""} ${["overview","postman","static-page"].includes(j)?"":"is-workspace-content"} ${j==="mind-maps"&&H?"is-mind-map-detail":""} ${j==="presentation-plan"?"is-presentation-plan":""} ${j==="json-to-typescript"?"is-json-to-typescript":""} ${j==="memos"?"is-memos":""}`,children:fe?c.jsxs(c.Fragment,{children:[c.jsx(Bc,{type:"secondary",children:"PLUGIN"}),c.jsx(Dk,{level:2,children:fe.name}),c.jsx(It,{children:c.jsx("div",{dangerouslySetInnerHTML:{__html:pe}})})]}):j==="static-page"&&le?c.jsx("div",{className:"static-page-container",children:c.jsx("iframe",{src:le.url,title:le.name,className:"static-page-iframe"})}):j==="image-compress"?c.jsx(Yye,{}):j==="json-to-typescript"?c.jsx(O1e,{}):j==="mind-maps"?H?c.jsx(A4e,{mindMapId:H,onNavigate:Le=>{window.location.hash=`#/${Le}`}}):c.jsx(w4e,{onNavigate:Le=>{window.location.hash=`#/${Le}`}}):j==="overview"?c.jsx(s1e,{launchers:a,running:s,errorCounts:f,errorLogs:h,plugins:R,staticPages:O,loading:v,error:b,hasLoaded:x,onRetry:be,onNavigate:Le=>{window.location.hash=`#/${Le}`}}):j==="clipboard"?c.jsx(Cye,{}):j==="cron-jobs"?c.jsx(jye,{}):j==="ports"?c.jsx(_ye,{refreshLaunchers:Ce}):j==="pr-review"?c.jsx(Zye,{}):j==="pr-conflicts"?c.jsx(vI,{listOnly:!0},"pr-conflicts"):j==="pr-conflict"?c.jsx(vI,{},"pr-conflict"):j==="jira-filters"?c.jsx(cbe,{}):j==="todo-list"?c.jsx(pbe,{}):j==="reminders"?c.jsx(p4e,{}):j==="memos"?c.jsx(u4e,{}):j==="todo-archived"?c.jsx(ybe,{}):j==="presentation-plan"?c.jsx(C1e,{}):j==="postman"?c.jsx(Pbe,{}):j==="bookmark-sync"?c.jsx(Dbe,{}):j==="file-organizer"?c.jsx(Abe,{}):j==="branch-sync"?c.jsx(Lbe,{}):j==="branch-health"?c.jsx(Vbe,{}):j==="package-upgrade"?c.jsx(Wbe,{}):j==="package-versions"?c.jsx(Kbe,{}):j==="errors"?c.jsx(Sbe,{}):j==="settings"?c.jsx(Hye,{theme:e,onThemeChange:t,onStaticPagesChange:()=>Kc.list().then(I)}):j==="dev-configurations"?c.jsx(Uye,{}):c.jsxs(c.Fragment,{children:[Ae,(v||x||!b)&&c.jsx(Lye,{launchers:a,running:s,errorCounts:f,refresh:Ce,loading:v&&!x,initialRunningOnly:T,initialServiceId:P})]})})}),re&&c.jsx("div",{className:"sidebar-context-menu",role:"menu",style:{left:re.left,top:re.top},onClick:Le=>Le.stopPropagation(),onContextMenu:Le=>Le.preventDefault(),children:c.jsx("button",{type:"button",role:"menuitem",onClick:ze,children:"Open in new window"})}),c.jsx(xn,{className:"changelog-modal",footer:[(L==null?void 0:L.updateAvailable)&&!(ne!=null&&ne.success)&&c.jsx(Re,{type:"primary",loading:W&&Y===(L==null?void 0:L.latestVersion),onClick:()=>De(L==null?void 0:L.latestVersion),children:"Update now"},"update"),c.jsx(Re,{disabled:W,loading:X,onClick:()=>me(!0),children:"Check again"},"refresh"),c.jsx(Re,{type:"primary",disabled:W,onClick:Me,children:ne!=null&&ne.success?"Close & reload":"Close"},"close")],onCancel:Me,closable:!W,maskClosable:!W,open:Z,title:c.jsxs("div",{className:"changelog-title",children:[c.jsx("span",{className:`changelog-bulb ${L!=null&&L.updateAvailable?"has-update":""}`,children:c.jsx(TC,{})}),c.jsx("span",{children:"Updates"})]}),width:680,children:X&&!L?c.jsx("div",{className:"changelog-loading",children:c.jsx(ar,{})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changelog-version-row",children:[c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Installed"}),c.jsxs(Bc,{strong:!0,children:["v",(L==null?void 0:L.currentVersion)||jd.version]})]}),c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Latest"}),c.jsxs(Bc,{strong:!0,children:["v",(L==null?void 0:L.latestVersion)||jd.version]})]}),c.jsx($t,{color:L!=null&&L.updateAvailable?"gold":"green",children:L!=null&&L.updateAvailable?"Update available":"Up to date"})]}),(L==null?void 0:L.sourceUnavailable)&&c.jsx(mr,{className:"changelog-source-alert",message:"Could not reach the configured npm registry. Showing locally available release notes.",showIcon:!0,type:"info"}),ne&&c.jsx(mr,{className:"changelog-source-alert",description:ne.message,message:ne.success?"DevBuddy updated successfully":"DevBuddy update failed",showIcon:!0,type:ne.success?"success":"error"}),c.jsx("div",{className:"changelog-release-list",children:(We=L==null?void 0:L.releases)!=null&&We.length?L.releases.slice(0,5).map(Le=>c.jsxs("section",{className:"changelog-release",children:[c.jsxs("div",{className:"changelog-release-heading",children:[c.jsxs("div",{className:"changelog-release-title",children:[c.jsxs($t,{className:"changelog-release-version",children:["v",Le.version]}),c.jsx(Dk,{level:4,children:Le.name})]}),c.jsxs("div",{className:"changelog-release-actions",children:[Le.publishedAt&&c.jsx(Bc,{type:"secondary",children:new Date(Le.publishedAt).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}),c.jsx(Re,{size:"small",type:Le.version===(L==null?void 0:L.latestVersion)?"primary":"default",disabled:W||Le.version===(L==null?void 0:L.currentVersion),loading:W&&Y===Le.version,onClick:()=>De(Le.version),children:Le.version===(L==null?void 0:L.currentVersion)?"Installed":"Install"})]})]}),c.jsx(Bc,{className:"changelog-release-notes",children:Le.notes||"Published to the configured npm registry."})]},`${Le.version}-${Le.publishedAt||""}`)):c.jsx(Xt,{description:"No published release notes yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})})]})}function q4e(){const[e,t]=l.useState(()=>document.documentElement.dataset.theme||localStorage.getItem("devbuddy-theme")||"dark");return l.useEffect(()=>{let n=!1;try{n=["dark","light"].includes(localStorage.getItem("devbuddy-theme"))}catch{}n||Un.status().then(r=>{const a=r.theme==="light"?"light":"dark";t(a),localStorage.setItem("devbuddy-theme",a)}).catch(()=>{})},[]),l.useLayoutEffect(()=>{var n;document.documentElement.dataset.theme=e,localStorage.setItem("devbuddy-theme",e),(n=document.querySelector('meta[name="theme-color"]'))==null||n.setAttribute("content",zk[e]||zk.dark)},[e]),l.useLayoutEffect(()=>{const n=()=>{document.querySelectorAll('[role="tab"], [role="tabpanel"]').forEach(o=>{document.activeElement===o&&o.blur(),o.tabIndex!==-1&&(o.tabIndex=-1)})};n();const r=new MutationObserver(n),a=o=>{var s,u;(u=(s=o.target).matches)!=null&&u.call(s,'[role="tab"], [role="tabpanel"]')&&o.target.blur()};return document.addEventListener("focusin",a,!0),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),()=>{r.disconnect(),document.removeEventListener("focusin",a,!0)}},[]),c.jsx(bi,{theme:{token:{fontFamily:B4e,borderRadius:10,colorBgLayout:e==="light"?"#f7f8fc":"#f4f5fa",colorInfo:e==="light"?"#2e83d2":"#6555e8",colorLink:e==="light"?"#2e83d2":"#5b4cc4",colorLinkActive:e==="light"?"#2474bd":"#5143c2",colorLinkHover:e==="light"?"#4593d8":"#7669ee",colorPrimary:e==="light"?"#2e83d2":"#5d63a8",colorPrimaryActive:e==="light"?"#2474bd":"#505690",colorPrimaryHover:e==="light"?"#4593d8":"#6c72b8",controlOutline:e==="light"?"rgba(46, 131, 210, .2)":"rgba(93, 99, 168, .24)",colorTextSecondary:"#667085"},components:{Layout:{bodyBg:e==="light"?"#f7f8fc":"#f4f5fa",siderBg:e==="light"?"#ffffff":"#171c2b",triggerBg:e==="light"?"#f8f9fc":"#101522",triggerColor:e==="light"?"#667085":"#c9ced8"},Menu:{darkItemBg:"#171c2b",darkItemSelectedBg:"#3f476e",darkItemSelectedColor:"#f0f1ff",darkSubMenuItemBg:"#171c2b",itemSelectedBg:"#eeecff",itemSelectedColor:"#5143c2"}}},children:c.jsx(Pr,{children:c.jsx(W4e,{theme:e,onThemeChange:t})})})}const K4e=/Macintosh|Mac OS X|iPhone|iPad/i.test(navigator.userAgent);document.documentElement.dataset.platform=K4e?"mac":"other";const Ak='input, textarea, [contenteditable="true"]',$A=e=>{var t,n;(t=e.matches)!=null&&t.call(e,Ak)&&(e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","none")),(n=e.querySelectorAll)==null||n.call(e,Ak).forEach(r=>{r.setAttribute("spellcheck","false"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","none")})};$A(document);const G4e=new MutationObserver(e=>{e.forEach(({addedNodes:t})=>{t.forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&$A(n)})})});G4e.observe(document.body,{childList:!0,subtree:!0});const Y4e=cB.createRoot(document.getElementById("app"));Y4e.render(c.jsx(q4e,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{updateViaCache:"none"}).catch(e=>{console.warn("DevBuddy service worker registration failed:",e)})});requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.setTimeout(()=>{const e=document.getElementById("app-splash");e&&(e.classList.add("is-hidden"),window.setTimeout(()=>e.remove(),700))},700)})});export{Yo as g,C4 as n};
621
+ `},cA=(e,t="Imported mind map")=>{var u,f,m;const r=e.split(/\r?\n/).filter(h=>h.trim()).map(h=>({line:h,match:h.match(/^(#{1,6})\s+(.+?)\s*$/)})).filter(({match:h})=>h),a=((m=(f=(u=r[0])==null?void 0:u.match)==null?void 0:f[2])==null?void 0:m.trim())||t,o={id:Us(),text:a,children:[]},s=[{depth:0,node:o}];return r.slice(1).forEach(({match:h})=>{var b;const p=h[1].length,v={id:Us(),text:h[2].trim(),children:[]};for(;s.length&&s[s.length-1].depth>=p;)s.pop();(((b=s[s.length-1])==null?void 0:b.node)||o).children.push(v),s.push({depth:p,node:v})}),C4({title:a,root:o})},tu=(e,t,n="application/json")=>{const r=typeof Blob<"u"&&t instanceof Blob?t:new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)},x4e=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"Recently updated":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)},{Title:uA,Text:dA}=Cn,wv=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map";function C4e({map:e}){const t=["#6555e8","#4f8edb","#36a269","#d98a34"];return c.jsxs("div",{className:"mind-map-mini-preview","aria-hidden":"true",children:[c.jsx("div",{className:"mind-map-mini-root",style:{background:e.root.color||t[0]},children:c.jsx("span",{className:"mind-map-mini-root-text",children:e.root.text})}),c.jsx("div",{className:"mind-map-mini-branches",children:(e.root.children||[]).slice(0,4).map((n,r)=>c.jsxs("div",{className:"mind-map-mini-branch",children:[c.jsx("span",{className:"mind-map-mini-line"}),c.jsx("span",{className:"mind-map-mini-node",style:{borderColor:n.color||t[r%t.length]},children:n.text})]},n.id))})]})}function S4e({map:e,index:t,onOpen:n,onDelete:r,onExport:a}){const o=[{key:"xmind",icon:c.jsx(ql,{}),label:"Export XMind"},{key:"json",icon:c.jsx(ql,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"},{type:"divider"},{key:"delete",danger:!0,icon:c.jsx(Hn,{}),label:"Delete map"}],s=({key:u,domEvent:f})=>{f==null||f.stopPropagation(),u==="delete"&&r(e),(u==="xmind"||u==="json"||u==="markdown")&&a(e,u)};return c.jsxs(It,{className:`mind-map-card ${t===0?"is-featured":""}`,hoverable:!0,onClick:()=>n(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(e.id))},role:"button",tabIndex:0,children:[c.jsxs("div",{className:"mind-map-card-topline",children:[c.jsx($t,{className:"mind-map-card-type",children:"MIND MAP"}),c.jsx(Bl,{menu:{items:o,onClick:s},trigger:["click"],children:c.jsx(Re,{"aria-label":`Actions for ${e.title}`,className:"mind-map-card-menu",icon:c.jsx(Kv,{}),onClick:u=>u.stopPropagation(),type:"text"})})]}),c.jsx(C4e,{map:e}),c.jsxs("div",{className:"mind-map-card-content",children:[c.jsx("div",{className:"mind-map-card-title-row",children:c.jsx(uA,{ellipsis:{rows:1,tooltip:e.title},level:3,children:e.title})}),c.jsxs("div",{className:"mind-map-card-meta-row",children:[c.jsxs(dA,{className:"mind-map-card-meta",children:[S4(e.root)," nodes ",c.jsx("span",{children:"·"})," Updated ",x4e(e.updatedAt)]}),c.jsxs("span",{className:"mind-map-card-open",children:["Open map ",c.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]})]})}function w4e({onNavigate:e}){const{message:t,modal:n}=Pr.useApp(),[r,a]=l.useState([]),[o,s]=l.useState(!0),[u,f]=l.useState(""),m=l.useRef(null),h=async()=>{try{a(await sl.list())}catch($){t.error(`Could not load mind maps: ${$.message||"unknown error"}`)}finally{s(!1)}};l.useEffect(()=>{h()},[]);const p=l.useMemo(()=>{const $=u.trim().toLowerCase();return $?r.filter(E=>`${E.title} ${E.root.text}`.toLowerCase().includes($)):r},[r,u]),v=()=>h(),y=$=>e(`mind-maps/${encodeURIComponent($)}`),b=async()=>{try{const $=await sl.create(v4e());a(E=>[$,...E]),y($.id)}catch($){t.error(`Could not create mind map: ${$.message||"unknown error"}`)}},C=async($,E)=>{try{if(E==="xmind"){const{mindMapToXmindBlob:R}=await pu(async()=>{const{mindMapToXmindBlob:O}=await import("./xmindAdapter-BoqP-2G8.js");return{mindMapToXmindBlob:O}},[]),N=await R($);tu(`${$.title||"mind-map"}.xmind`,N,"application/octet-stream"),t.success("XMind exported");return}if(E==="markdown"){tu(`${$.title||"mind-map"}.md`,sA($),"text/markdown;charset=utf-8"),t.success("Markdown exported");return}tu(`${$.title||"mind-map"}.json`,`${JSON.stringify($,null,2)}
622
+ `,"application/json;charset=utf-8"),t.success("JSON exported")}catch(R){t.error(`Could not export this map: ${R.message||"unknown error"}`)}},x=$=>{n.confirm({title:"Delete this mind map?",content:`“${$.title}” will be removed from workspace data.`,okText:"Delete",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{await sl.remove($.id),await v(),t.success("Mind map deleted")}})},w=async $=>{var R;const E=(R=$.target.files)==null?void 0:R[0];if($.target.value="",!!E)try{const N=E.name.toLowerCase().endsWith(".xmind"),O=N?null:await E.text(),I=E.name.toLowerCase().endsWith(".json"),j=N?await(async()=>{const{xmindBlobToMindMap:T}=await pu(async()=>{const{xmindBlobToMindMap:z}=await import("./xmindAdapter-BoqP-2G8.js");return{xmindBlobToMindMap:z}},[]);return T(await E.arrayBuffer(),wv(E.name))})():I?C4(JSON.parse(O),wv(E.name)):cA(O,wv(E.name)),k=await sl.create({...j,title:j.title||wv(E.name)});a(T=>[k,...T]),t.success(`${N?"XMind":I?"JSON":"Markdown"} imported`),y(k.id)}catch(N){t.error(`Could not import this file: ${N.message||"invalid format"}`)}};return c.jsxs("div",{className:"mind-map-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"mind-map-page-actions",size:10,children:[c.jsx("input",{ref:m,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:w,type:"file"}),c.jsx(Re,{icon:c.jsx($0,{}),onClick:()=>{var $;return($=m.current)==null?void 0:$.click()},children:"Import"}),c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"New mind map"})]}),description:"Turn scattered thoughts into a clear visual plan.",eyebrow:"PLAN & REVIEW",title:"Mind maps"}),c.jsxs("div",{className:"mind-map-list-summary",children:[c.jsxs("div",{children:[c.jsx(uA,{level:2,children:"Your workspace"}),c.jsxs(dA,{type:"secondary",children:[r.length," ",r.length===1?"map":"maps"," saved locally"]})]}),c.jsx(Ct,{allowClear:!0,className:"mind-map-search",onChange:$=>f($.target.value),placeholder:"Search maps...",prefix:c.jsx(jo,{}),value:u})]}),o?c.jsx("div",{className:"mind-map-loading",children:c.jsx("span",{children:"Loading mind maps..."})}):p.length?c.jsx("div",{className:"mind-map-card-grid",children:p.map(($,E)=>c.jsx(S4e,{index:E,map:$,onDelete:x,onExport:C,onOpen:y},$.id))}):c.jsx(It,{className:"mind-map-empty-card",children:c.jsx(Xt,{description:u?"No maps match your search.":"No mind maps yet.",children:!u&&c.jsx(Re,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"Create your first map"})})}),c.jsxs("div",{className:"mind-map-import-hint",children:[c.jsx($0,{})," ",c.jsx("span",{children:"Import XMind, JSON, or Markdown. Export XMind to continue editing in XMind."})]})]})}const $v=40,$4e=8192,Mk=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Gc=(e,t)=>{const n=e.getBoundingClientRect();return{left:n.left-t.left,top:n.top-t.top,right:n.right-t.left,bottom:n.bottom-t.top,width:n.width,height:n.height}},ph=(e,t=0)=>{const n=Number.parseFloat(e);return Number.isFinite(n)?n:t},E4e=(e,t)=>{const n=e.nodeValue||"",r=new Map;let a=0;for(const o of n){const s=o.length;t.setStart(e,a),t.setEnd(e,a+s),a+=s;const u=t.getBoundingClientRect();if(!u.height)continue;const f=Math.round(u.top*2)/2,m=r.get(f)||{top:f,x:u.left,text:""};m.x=Math.min(m.x,u.left),m.text+=o,r.set(f,m)}return[...r.values()].sort((o,s)=>o.top-s.top)},j4e=(e,t)=>{var u;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),a=document.createElement("canvas").getContext("2d"),o=[];let s=n.nextNode();for(;s;){const f=s.parentElement;if(!(f!=null&&f.closest(".mind-map-collapse"))&&((u=s.nodeValue)!=null&&u.trim())){const m=getComputedStyle(f),h=E4e(s,r),p=ph(m.fontSize,12),v=m.lineHeight==="normal"?p*1.2:ph(m.lineHeight,p*1.2),y=`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`;a.font=y;const b=a.measureText("Mg"),C=b.fontBoundingBoxAscent||b.actualBoundingBoxAscent||p*.8,x=b.fontBoundingBoxDescent||b.actualBoundingBoxDescent||p*.2,w=Math.max(0,(v-C-x)/2)+C,$=Gc(f,t),E=getComputedStyle(f),R=["hidden","clip"].includes(E.overflowX)||["hidden","clip"].includes(E.overflowY)||E.textOverflow==="ellipsis";h.forEach(N=>{N.text&&o.push({text:N.text,x:N.x-t.left,y:N.top-t.top+w,font:`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`,color:m.color,letterSpacing:m.letterSpacing,opacity:ph(m.opacity,1),clip:R?$:null})})}s=n.nextNode()}return o},N4e=(e,t)=>{const n=Gc(e,t),r=getComputedStyle(e),a=r.backgroundColor==="rgba(0, 0, 0, 0)"?"none":r.backgroundColor,o=ph(r.borderTopWidth),s=r.borderTopStyle==="none"||o===0?"none":r.borderTopColor,u=Math.min(ph(r.borderTopLeftRadius),n.width/2,n.height/2);return`<rect x="${n.left}" y="${n.top}" width="${n.width}" height="${n.height}" rx="${u}" fill="${Mk(a)}" stroke="${Mk(s)}" stroke-width="${o}"/>`},O4e=e=>{const t=e.getBoundingClientRect(),n=[],r=(o,s,u,f,m)=>{n.push(`<line x1="${o}" y1="${s}" x2="${u}" y2="${f}" stroke="${m}" stroke-width="1.5" stroke-linecap="round"/>`)};return[...e.querySelectorAll(".mind-map-ltr-children")].forEach(o=>{const s=Gc(o,t),f=[...o.children].filter(y=>y.classList.contains("mind-map-ltr-branch")).map(y=>({branch:y,row:y.querySelector(":scope > .mind-map-ltr-node-row"),node:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]")})).filter(({row:y,node:b})=>y&&b);if(!f.length)return;const m=s.left,p=f.map(({row:y})=>Gc(y,t)).map(y=>y.top+y.height/2),v=o.classList.contains("is-comment-children")?"#9da9b6":"#c6cada";if(p.length>1&&r(m,p[0],m,p[p.length-1],v),f.forEach(({branch:y,node:b},C)=>{const x=Gc(b,t),w=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(m,p[C],x.left,p[C],w)}),o.classList.contains("mind-map-ltr-root-children")){const y=e.querySelector(".mind-map-ltr-root-column > [data-mind-map-node]");if(y){const b=Gc(y,t);r(b.right,b.top+b.height/2,m,b.top+b.height/2,v)}}else{const y=o.parentElement,b=y==null?void 0:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]");if(b){const C=Gc(b,t),x=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(C.right,C.top+C.height/2,m,C.top+C.height/2,x)}}}),n.join("")},R4e=(e,t)=>{const n=e.getBoundingClientRect(),r=Math.floor(t.left-n.left-$v),a=Math.floor(t.top-n.top-$v),o=Math.ceil(t.right-t.left+$v*2),s=Math.ceil(t.bottom-t.top+$v*2),u=[...e.querySelectorAll(".mind-map-root-node, .mind-map-node, .mind-map-node-jira-tag")].map(h=>N4e(h,n)).join(""),f=j4e(e,n);return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="${r} ${a} ${o} ${s}"><rect x="${r}" y="${a}" width="${o}" height="${s}" fill="#ffffff"/>${O4e(e)}${u}</svg>`,width:o,height:s,left:r,top:a,text:f}},I4e=async e=>{var p;if(!e)throw new Error("Mind map canvas is not ready.");const t=[...e.querySelectorAll("[data-mind-map-node], .mind-map-canvas-empty")];if(!t.length)throw new Error("Mind map canvas is empty.");(p=document.fonts)!=null&&p.ready&&await document.fonts.ready;const n=t.reduce((v,y)=>{const b=y.getBoundingClientRect();return{left:Math.min(v.left,b.left),top:Math.min(v.top,b.top),right:Math.max(v.right,b.right),bottom:Math.max(v.bottom,b.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),{svg:r,width:a,height:o,left:s,top:u,text:f}=R4e(e,n),m=new Image,h=URL.createObjectURL(new Blob([r],{type:"image/svg+xml;charset=utf-8"}));try{await new Promise((w,$)=>{m.onload=w,m.onerror=()=>$(new Error("Could not render the mind map image.")),m.src=h});const v=Math.min(2,$4e/Math.max(a,o)),y=document.createElement("canvas");y.width=Math.max(1,Math.round(a*v)),y.height=Math.max(1,Math.round(o*v));const b=y.getContext("2d");if(!b)throw new Error("Canvas is unavailable.");b.fillStyle="#ffffff",b.fillRect(0,0,y.width,y.height),b.drawImage(m,0,0,y.width,y.height),b.save(),b.scale(v,v),f.forEach(w=>{b.save(),b.font=w.font,b.fillStyle=w.color,b.globalAlpha=w.opacity,"letterSpacing"in b&&w.letterSpacing&&w.letterSpacing!=="normal"&&(b.letterSpacing=w.letterSpacing),w.clip&&(b.beginPath(),b.rect(w.clip.left-s,w.clip.top-u,w.clip.width,w.clip.height),b.clip()),b.textBaseline="alphabetic",b.fillText(w.text,w.x-s,w.y-u),b.restore()}),b.restore();const{encode:C}=await pu(async()=>{const{encode:w}=await import("./index-_vMuByUV.js");return{encode:w}},[]),x=await C(b.getImageData(0,0,y.width,y.height),{quality:75,progressive:!0,optimize_coding:!0,auto_subsample:!0});return new Blob([x],{type:"image/jpeg"})}finally{URL.revokeObjectURL(h)}},{Text:io,Title:Tk}=Cn,P0=["#4f8edb","#36a269","#d98a34","#c05a83","#8a70c5"],k4e=3200,M4e=2200,Ts=1600,T4e=380,Ky=e=>String((e==null?void 0:e.text)||"").trimStart().startsWith("#"),P4e=e=>{var n;const t=e instanceof HTMLElement?e:null;return!!(t!=null&&t.isContentEditable||(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable="true"]'))},fA=e=>e.reduce((t,n)=>{const r=String(n.edgeLabel||"").trim();return r?Math.max(t,Math.min(160,Math.max(72,r.length*7+16))):t},16),h2=(e,t,n=!1)=>({...e,collapsed:n?!1:t,children:(e.children||[]).map(r=>h2(r,t))}),mA=(e,t,n=!1)=>{const r=n||Ky(e);return{...e,tested:r?!1:t,children:(e.children||[]).map(a=>mA(a,t,r))}},hA=(e,t)=>({...e,jiraKeys:(e.jiraKeys||[]).filter(n=>n!==t),children:(e.children||[]).map(n=>hA(n,t))}),pA=(e,t)=>{t.add(e.id),(e.children||[]).forEach(n=>pA(n,t))},gA=(e,t)=>t.has(e.id)?null:{label:e.text||"Untitled idea",value:e.id,children:(e.children||[]).map(n=>gA(n,t)).filter(Boolean)},vA=(e,t,n=[])=>{const r=[...n,e.id];if(e.id===t)return r;for(const a of e.children||[]){const o=vA(a,t,r);if(o)return o}return null},pS=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map",yA=(e,t,n=!1)=>{if(!e)return!1;const r=n||Ky(e);return e.id===t?r:(e.children||[]).some(a=>yA(a,t,r))};function bA({node:e,jiraIssues:t}){const n=(e.jiraKeys||[]).map(r=>t.find(a=>a.key===r)||{key:r});return n.length?c.jsx("span",{className:"mind-map-node-jira-tags","aria-label":"Jira tags",children:n.map(r=>c.jsx("span",{className:"mind-map-node-jira-tag",title:r.summary||r.key,children:r.key},r.key))}):null}function xA({node:e,depth:t=0,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,commented:s=!1}){const u=e.color||P0[t%P0.length],f=e.children||[],m=Ky(e),h=s||m,p=fA(f);return c.jsxs("div",{className:`mind-map-ltr-branch depth-${Math.min(t,4)}${h?" is-comment-branch":""}${m?" is-comment-marker":""}`,children:[c.jsxs("div",{className:"mind-map-ltr-node-row",children:[e.edgeLabel&&c.jsx("span",{className:"mind-map-ltr-edge-label",title:e.edgeLabel,children:e.edgeLabel}),c.jsxs("button",{className:`mind-map-node ${n===e.id?"is-selected":""} ${e.tested&&!h?"is-tested":""}${e.autoWidth===!1?" is-auto-width-disabled":""}${h?" is-comment":""}${m?" is-comment-marker":""}`,onClick:()=>r(e.id),"data-mind-map-node":e.id,style:{"--node-color":u},type:"button",children:[c.jsxs("span",{className:"mind-map-node-main",children:[c.jsx("span",{className:"mind-map-node-text",children:e.text||"Untitled idea"}),f.length>0&&c.jsx("span",{className:"mind-map-node-count",children:f.length})]}),c.jsx(bA,{jiraIssues:o,node:e})]}),f.length>0&&c.jsxs("button",{"aria-label":e.collapsed?"Expand branch":"Collapse branch",className:"mind-map-collapse",onClick:()=>a(e.id),type:"button",children:[c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"is-visible":""}`,children:"+"}),c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"":"is-visible"}`,children:"−"})]})]}),!e.collapsed&&f.length>0&&c.jsx("div",{className:`mind-map-ltr-children${h?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${p}px`},children:f.map(v=>c.jsx(xA,{depth:t+1,node:v,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:h},v.id))})]})}const CA=l.forwardRef(function({map:t,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,nodeMaxWidth:s,fitContent:u=!1},f){const m=t.root,h=m.children||[],p=m.color||"#6555e8",v=Ky(m);return c.jsxs("div",{className:"mind-map-ltr-diagram",ref:f,style:{...u?{minWidth:0,minHeight:0,margin:0}:{},...Number.isInteger(s)?{"--mind-map-node-max-width":`${s}px`}:{}},children:[c.jsx("div",{className:"mind-map-ltr-root-column",children:c.jsxs("button",{className:`mind-map-root-node ${n===m.id?"is-selected":""} ${m.tested&&!v?"is-tested":""}${m.autoWidth===!1?" is-auto-width-disabled":""}${v?" is-comment is-comment-marker":""}`,"data-mind-map-node":m.id,onClick:()=>r(m.id),style:{"--node-color":p},type:"button",children:[c.jsx("span",{className:"mind-map-root-text",children:m.text||"Untitled idea"}),c.jsxs("span",{className:"mind-map-root-count",children:[S4(m)-1," connected ideas"]}),c.jsx(bA,{jiraIssues:o,node:m})]})}),!m.collapsed&&h.length>0&&c.jsx("div",{className:`mind-map-ltr-children mind-map-ltr-root-children${v?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${fA(h)}px`},children:h.map(y=>c.jsx(xA,{node:y,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:v},y.id))}),!h.length&&c.jsx("div",{className:"mind-map-canvas-empty",children:c.jsx(io,{type:"secondary",children:"Add a branch from the inspector to start mapping this idea."})})]})}),D4e=l.forwardRef(function({map:t,nodeMaxWidth:n},r){const a=l.useRef(null);return l.useLayoutEffect(()=>{const o=a.current;if(!o)return;const s=1;o.querySelectorAll(".mind-map-ltr-children").forEach(u=>{const f=[...u.children].map(b=>b.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!f.length)return;const m=u.getBoundingClientRect(),h=f[0].getBoundingClientRect(),p=f[f.length-1].getBoundingClientRect(),v=(h.top+h.bottom)/2,y=(p.top+p.bottom)/2;u.style.setProperty("--mind-map-connector-top",`${Math.max(0,(v-m.top)/s)}px`),u.style.setProperty("--mind-map-connector-height",`${Math.max(0,(y-v)/s)}px`)})},[t]),c.jsx("div",{"aria-hidden":"true",className:"mind-map-export-offscreen",inert:"",children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right mind-map-export-render",ref:r,style:{width:"max-content",height:"auto",padding:0,margin:0,zoom:1},children:c.jsx(CA,{fitContent:!0,jiraIssues:t.jiraIssues||[],map:t,nodeMaxWidth:n,onSelect:()=>{},onToggle:()=>{},ref:a,selectedId:null})})})}),z4e=l.forwardRef(function({map:t,selectedId:n,zoom:r,resetViewToken:a,recenterLayoutToken:o,isPanning:s,onCanvasPointerDown:u,onCanvasPointerMove:f,onCanvasPointerUp:m,onSelect:h,onToggle:p,onZoomChange:v,jiraIssues:y,nodeMaxWidth:b},C){const x=l.useRef(null),w=l.useRef(null),$=l.useRef(r),E=l.useRef({meta:!1,ctrl:!1}),R=l.useRef(new Map),N=l.useRef(0),O=l.useRef(0),I=l.useRef(!1),j=l.useRef(o);$.current=r;const k=(A,_,F,U)=>{const q=A.querySelector(".mind-map-canvas-stage"),L=A.getBoundingClientRect(),K=q==null?void 0:q.getBoundingClientRect();return{fromZoom:_,toZoom:null,x:F,y:U,stageX:K?(L.left+F-K.left)/_:null,stageY:K?(L.top+U-K.top)/_:null}};l.useImperativeHandle(C,()=>({zoomAt(A){const _=x.current,F=$.current;!_||A===F||(w.current=k(_,F,_.clientWidth/2,_.clientHeight/2),w.current.toZoom=A,$.current=A,v(A))}}),[v]);const T=A=>{const _=A.target instanceof Element?A.target:null,F=_==null?void 0:_.closest("button[data-mind-map-node]");_!=null&&_.closest("button")&&!F||u(A,(F==null?void 0:F.dataset.mindMapNode)||null)},z=(A=null)=>{const _=x.current;if(!_)return;const F=[..._.querySelectorAll("[data-mind-map-node]")],U=_.querySelector(".mind-map-root-node");if(!F.length||!U)return;const q=_.getBoundingClientRect(),L=F.reduce((J,ve)=>{const xe=(A==null?void 0:A.get(ve.dataset.mindMapNode))||ve.getBoundingClientRect();return{left:Math.min(J.left,xe.left),top:Math.min(J.top,xe.top),right:Math.max(J.right,xe.right),bottom:Math.max(J.bottom,xe.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),K=(L.left+L.right)/2,X=(L.top+L.bottom)/2,V=(A==null?void 0:A.get(U.dataset.mindMapNode))||U.getBoundingClientRect();let W=_.scrollLeft+K-q.left-_.clientWidth/2,G=_.scrollTop+X-q.top-_.clientHeight/2;const Y=W-_.scrollLeft,te=G-_.scrollTop,ne=V.left-Y,ce=V.right-Y,Z=V.top-te,ee=V.bottom-te,re=q.left+24,oe=q.right-24,ue=q.top+24,ye=q.bottom-24;ce<re&&(W+=ce-re),ne>oe&&(W+=ne-oe),ee<ue&&(G+=ee-ue),Z>ye&&(G+=Z-ye),_.scrollLeft=Math.max(0,Math.min(W,_.scrollWidth-_.clientWidth)),_.scrollTop=Math.max(0,Math.min(G,_.scrollHeight-_.clientHeight))},P=()=>{const A=x.current;if(!A)return;const _=$.current||1;A.querySelectorAll(".mind-map-ltr-children").forEach(F=>{const U=[...F.children].map(W=>W.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!U.length)return;const q=F.getBoundingClientRect(),L=U[0].getBoundingClientRect(),K=U[U.length-1].getBoundingClientRect(),X=(L.top+L.bottom)/2,V=(K.top+K.bottom)/2;F.style.setProperty("--mind-map-connector-top",`${Math.max(0,(X-q.top)/_)}px`),F.style.setProperty("--mind-map-connector-height",`${Math.max(0,(V-X)/_)}px`)})},B=()=>{const A=x.current;!A||I.current||(R.current=new Map([...A.querySelectorAll("[data-mind-map-node]")].map(_=>[_.dataset.mindMapNode,_.getBoundingClientRect()])))};l.useLayoutEffect(()=>{P()},[t,r,b]),l.useLayoutEffect(()=>{z()},[t.id]),l.useLayoutEffect(()=>{const A=x.current;if(!A)return;const _=o!==j.current;j.current=o;const F=[...A.querySelectorAll("[data-mind-map-node]")],U=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()])),q=R.current,L=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode;return[te,Y.style.transform?U.get(te):q.get(te)||U.get(te)]}));cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1,F.forEach(Y=>{Y.style.transition="none",Y.style.transform="",Y.style.opacity=""}),A.offsetHeight;const K=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]));let X=K;if(_&&(I.current=!0,z(K),X=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]))),!q.size){I.current=!1,R.current=X;return}const V=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode,ne=L.get(te),ce=K.get(te);return[te,ne&&ce?{x:(ne.left-ce.left)/($.current||1),y:(ne.top-ce.top)/($.current||1)}:null]})),W=[...V.values()].filter(Y=>Y&&(Math.abs(Y.x)>=1||Math.abs(Y.y)>=1));if(!(W.length<=40&&W.every(Y=>Math.max(Math.abs(Y.x),Math.abs(Y.y))<=900))){I.current=!1,R.current=X;return}return I.current=W.length>0,F.forEach(Y=>{const te=L.get(Y.dataset.mindMapNode),ne=K.get(Y.dataset.mindMapNode);if(!te||!ne){Y.style.opacity="1";return}const ce=V.get(Y.dataset.mindMapNode),Z=ce.x,ee=ce.y;Math.abs(Z)<1&&Math.abs(ee)<1||(Y.style.transition="none",Y.style.transform=`translate(${Z}px, ${ee}px)`)}),F.forEach(Y=>void Y.offsetWidth),N.current=requestAnimationFrame(()=>{F.forEach(Y=>{const te=L.get(Y.dataset.mindMapNode);Y.style.transition="transform 380ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease",Y.style.transform="",te||(Y.style.opacity="1")}),N.current=0,O.current=window.setTimeout(()=>{I.current=!1,B(),O.current=0},T4e+16)}),R.current=X,()=>{cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1}},[t,b,o]),l.useLayoutEffect(()=>{const A=x.current,_=w.current;if(!A||!_||_.toZoom!==r)return;const F=A.getBoundingClientRect(),U=A.querySelector(".mind-map-canvas-stage"),q=U==null?void 0:U.getBoundingClientRect(),L=_.stageX===null||!q?Ts+(_.x+A.scrollLeft-Ts)*(r/_.fromZoom)-_.x:A.scrollLeft+q.left+_.stageX*r-(F.left+_.x),K=_.stageY===null||!q?Ts+(_.y+A.scrollTop-Ts)*(r/_.fromZoom)-_.y:A.scrollTop+q.top+_.stageY*r-(F.top+_.y);A.scrollLeft=Math.max(0,Math.min(L,A.scrollWidth-A.clientWidth)),A.scrollTop=Math.max(0,Math.min(K,A.scrollHeight-A.clientHeight)),w.current=null},[r]),l.useLayoutEffect(()=>{if(a===0)return;const A=requestAnimationFrame(()=>z());return()=>cancelAnimationFrame(A)},[a]),l.useEffect(()=>{const A=U=>{U.key==="Meta"&&(E.current.meta=!0),U.key==="Control"&&(E.current.ctrl=!0)},_=U=>{U.key==="Meta"&&(E.current.meta=!1),U.key==="Control"&&(E.current.ctrl=!1)},F=()=>{E.current={meta:!1,ctrl:!1}};return window.addEventListener("keydown",A),window.addEventListener("keyup",_),window.addEventListener("blur",F),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",_),window.removeEventListener("blur",F)}},[]);const H=l.useCallback(A=>{var W,G;const _=x.current;if(!_||!_.contains(A.target))return;const F=A.metaKey||((W=A.getModifierState)==null?void 0:W.call(A,"Meta"))||E.current.meta,U=A.ctrlKey||((G=A.getModifierState)==null?void 0:G.call(A,"Control"))||E.current.ctrl;if(!F&&!U||!A.deltaY)return;A.preventDefault(),A.returnValue=!1,A.stopPropagation();const q=_.getBoundingClientRect(),L=$.current,K=A.deltaMode===1?A.deltaY*16:A.deltaY,X=Math.min(Math.abs(K),48)*Math.sign(K),V=Math.max(.5,Math.min(2,Number((L*Math.pow(1.1,-X/24)).toFixed(3))));V!==L&&(w.current=k(_,L,A.clientX-q.left,A.clientY-q.top),w.current.toZoom=V,$.current=V,v(V))},[v]);return l.useEffect(()=>(window.addEventListener("wheel",H,{capture:!0,passive:!1}),()=>window.removeEventListener("wheel",H,{capture:!0})),[H]),c.jsx("div",{className:`mind-map-canvas-scroll ${s?"is-panning":""}`,ref:x,onPointerCancel:m,onPointerDown:T,onPointerMove:f,onPointerUp:m,onScroll:B,children:c.jsx("div",{className:"mind-map-canvas-world",style:{height:`${M4e*r+Ts*2}px`,width:`${k4e*r+Ts*2}px`},children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right",style:{marginLeft:`${Ts}px`,marginTop:`${Ts}px`,zoom:r},children:c.jsx(CA,{jiraIssues:y,map:t,nodeMaxWidth:b,onSelect:h,onToggle:p,selectedId:n})})})})});function A4e({mindMapId:e,onNavigate:t}){var Qt,kt;const{message:n}=Pr.useApp(),r=l.useRef(null),[a,o]=l.useState(null),[s,u]=l.useState(null),[f,m]=l.useState(null),[h,p]=l.useState(""),[v,y]=l.useState(!0),[b,C]=l.useState(1),[x,w]=l.useState(0),[$,E]=l.useState(0),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,k]=l.useState(null),[T,z]=l.useState(null),[P,B]=l.useState(!1),[H,A]=l.useState(!1),[_,F]=l.useState(""),[U,q]=l.useState(!1),[L,K]=l.useState(""),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState([]),[ne,ce]=l.useState(!1),[Z,ee]=l.useState(!1),[re,oe]=l.useState(!1),ue=l.useRef(null),ye=l.useRef(null),J=l.useRef(null),ve=l.useRef(null),xe=l.useRef(!1),ze=l.useRef(null),fe=l.useRef(Promise.resolve());l.useEffect(()=>{let ke=!0;return Un.status().then(Ue=>{if(!ke)return;const mt=Number.isInteger(Ue.mindMapNodeMaxWidth)?Ue.mindMapNodeMaxWidth:null;k(mt),z(mt),B(!0)}).catch(Ue=>{ke&&(B(!0),n.error(`Could not load mind map settings: ${Ue.message||"unknown error"}`))}),()=>{ke=!1}},[]),l.useEffect(()=>{P&&E(ke=>ke+1)},[j,P]),l.useEffect(()=>{let ke=!0;return y(!0),o(null),m(null),ce(!1),sl.get(e).then(Ue=>{ke&&(o(Ue),p(Ue.title||""),C(1),w(0),N(!1),ue.current=null)}).catch(Ue=>{ke&&n.error(`Could not load mind map: ${Ue.message||"unknown error"}`)}).finally(()=>{ke&&y(!1)}),()=>{ke=!1}},[e]),l.useEffect(()=>{a&&f&&!Gd(a.root,f)&&m(null)},[a,f]),l.useEffect(()=>{var ke,Ue;xe.current&&(xe.current=!1,(Ue=(ke=ve.current)==null?void 0:ke.focus)==null||Ue.call(ke))},[f]),l.useEffect(()=>{var ke;oe(!!((ke=se==null?void 0:se.notes)!=null&&ke.trim()))},[f]),l.useEffect(()=>{if(!Z)return;const ke=Ue=>{Ue.key==="Escape"&&ee(!1)};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[Z]);const se=l.useMemo(()=>f?Gd(a==null?void 0:a.root,f):null,[a,f]),le=l.useMemo(()=>yA(a==null?void 0:a.root,f),[a,f]),ae=l.useMemo(()=>Vh(a==null?void 0:a.root,f),[a,f]),pe=((Qt=ae==null?void 0:ae.children)==null?void 0:Qt.findIndex(ke=>ke.id===f))??-1,Ie=(a==null?void 0:a.jiraIssues)||[],Ce=l.useMemo(()=>{const ke=new Set,Ue=mt=>{((mt==null?void 0:mt.jiraKeys)||[]).forEach(qt=>ke.add(qt)),((mt==null?void 0:mt.children)||[]).forEach(Ue)};return Ue(a==null?void 0:a.root),ke},[a]),me=l.useMemo(()=>((se==null?void 0:se.jiraKeys)||[]).map(ke=>Ie.find(Ue=>Ue.key===ke)||{key:ke,summary:"Summary unavailable",url:""}),[Ie,se]),be=l.useMemo(()=>{if(!a||!se||!ae)return[];const ke=new Set;pA(se,ke);const Ue=gA(a.root,ke);return Ue?[Ue]:[]},[a,se,ae]),Ee=ke=>{if(!a)return;const Ue={...ke(a),updatedAt:new Date().toISOString()};o(Ue),fe.current=fe.current.catch(()=>{}).then(()=>sl.update(Ue.id,Ue)).catch(()=>new Promise((mt,qt)=>{window.setTimeout(()=>{sl.update(Ue.id,Ue).then(mt).catch(qt)},120)})).catch(mt=>n.error(`Could not save mind map: ${mt.message||"unknown error"}`))},Me=()=>{const ke=h.trim()||"Untitled mind map";p(ke),Ee(Ue=>({...Ue,title:ke,root:Ue.root.text===Ue.title?{...Ue.root,text:ke}:Ue.root}))},De=ke=>{se&&Ee(Ue=>({...Ue,root:eu(Ue.root,se.id,mt=>({...mt,...ke}))}))},Te=()=>{if(!se||le)return;const ke=!se.tested;Ee(Ue=>({...Ue,root:eu(Ue.root,se.id,mt=>mA(mt,ke))}))},Ve=(ke=0)=>({id:`node-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,text:"New idea",color:P0[ke%P0.length],tested:!1,children:[]}),_e=()=>{if(!se)return;const ke=Ve((se.children||[]).length);De({children:[...se.children||[],ke],collapsed:!1}),xe.current=!0,m(ke.id)},Ne=()=>{if(!se||!ae){_e();return}const ke=Ve(ae.children.findIndex(Ue=>Ue.id===se.id)+1);Ee(Ue=>({...Ue,root:y4e(Ue.root,se.id,ke)})),xe.current=!0,m(ke.id)},$e=ke=>{if(!ae||pe<0)return;const Ue=ae.id,mt=pe+ke;mt<0||mt>=ae.children.length||Ee(qt=>({...qt,root:eu(qt.root,Ue,Yt=>{const cn=[...Yt.children||[]],rn=cn.findIndex(Mt=>Mt.id===f),gn=rn+ke;if(rn<0||gn<0||gn>=cn.length)return Yt;const[St]=cn.splice(rn,1);return cn.splice(gn,0,St),{...Yt,children:cn}})}))},Ae=()=>{!se||!ae||!Vh(a==null?void 0:a.root,ae.id)||Ee(ke=>({...ke,root:b4e(ke.root,se.id)}))};l.useEffect(()=>{const ke=Ue=>{if(!(!a||!se||Ue.defaultPrevented||Ue.isComposing||Ue.repeat)&&!(Ue.altKey||Ue.ctrlKey||Ue.metaKey)&&!(Ue.key!=="Enter"&&Ue.key!=="Tab")&&!(Ue.key==="Enter"&&P4e(Ue.target))){if(Ue.key==="Tab"){const mt=document.querySelector(".mind-map-inspector-card"),qt=(mt==null?void 0:mt.matches(":hover"))||!1,Yt=Ue.target instanceof Element&&!!Ue.target.closest(".mind-map-inspector-card");if(qt&&!Yt)return}if(Ue.preventDefault(),Ue.key==="Tab"){Ue.shiftKey?Ae():_e();return}Ne()}};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[a,se,ae]);const We=()=>{if(!se||!ae)return;const ke=ae.id;Ee(Ue=>({...Ue,root:qy(Ue.root,se.id)})),m(ke),n.success("Idea removed")},Le=()=>{ae&&(te(vA(a.root,ae.id)||[]),G(!0))},tt=()=>{const ke=Y[Y.length-1];if(!se||!ae||!ke)return;if(kk(a.root,se.id,ke)===a.root){n.error("Please choose another valid parent node.");return}Ee(mt=>({...mt,root:kk(mt.root,se.id,ke)})),G(!1),n.success(`Moved “${se.text||"idea"}” successfully.`)},Je=()=>{I(!0)},Ye=async()=>{A(!0);try{const ke=await Un.saveMindMapNodeMaxWidth(T),Ue=Number.isInteger(ke.mindMapNodeMaxWidth)?ke.mindMapNodeMaxWidth:null;k(Ue),z(Ue),n.success(Ue?"Mind map node width saved":"Using default mind map node widths")}catch(ke){n.error(`Could not save node width: ${ke.message||"unknown error"}`)}finally{A(!1)}},He=async()=>{const ke=g4e(_);if(!ke){n.error("Enter a Jira No such as PROJ-123 or a Jira issue link.");return}q(!0);try{const Ue=await sl.resolveJiraIssue(_);if(Ie.some(mt=>mt.key===Ue.key)){n.info(`${Ue.key} is already in this map.`);return}Ee(mt=>({...mt,jiraIssues:[...mt.jiraIssues||[],Ue]})),F(""),n.success(`${Ue.key} added to this map.`)}catch(Ue){n.error(Ue.message||`Could not load ${ke.key} from Jira.`)}finally{q(!1)}},nt=ke=>{Ee(Ue=>({...Ue,jiraIssues:(Ue.jiraIssues||[]).filter(mt=>mt.key!==ke),root:hA(Ue.root,ke)}))},ft=async ke=>{K(ke.key);try{const Ue=await sl.resolveJiraIssue(ke.key);Ee(mt=>({...mt,jiraIssues:(mt.jiraIssues||[]).map(qt=>qt.key===ke.key?{...qt,summary:Ue.summary,url:Ue.url||qt.url}:qt)})),n.success(`${ke.key} summary refreshed`)}catch(Ue){n.error(Ue.message||`Could not refresh ${ke.key}.`)}finally{K("")}},vt=ke=>{De({jiraKeys:((se==null?void 0:se.jiraKeys)||[]).filter(Ue=>Ue!==ke)})},qe=ke=>{ke&&(m(ke),ce(!0))},je=(ke,Ue)=>{var qt;if(ke.button!==0)return;const mt=ke.currentTarget;mt&&(ke.preventDefault(),(qt=mt.setPointerCapture)==null||qt.call(mt,ke.pointerId),ue.current={canvas:mt,pointerId:ke.pointerId,startX:ke.clientX,startY:ke.clientY,startScrollLeft:mt.scrollLeft,startScrollTop:mt.scrollTop,nodeId:Ue,moved:!1},Ue&&qe(Ue),N(!0))},Be=ke=>{const Ue=ue.current;if(!Ue||Ue.pointerId!==ke.pointerId)return;const mt=Ue.canvas||ke.currentTarget;!Ue.moved&&Math.hypot(ke.clientX-Ue.startX,ke.clientY-Ue.startY)<3||(Ue.moved=!0,mt.scrollLeft=Ue.startScrollLeft-(ke.clientX-Ue.startX),mt.scrollTop=Ue.startScrollTop-(ke.clientY-Ue.startY))},Ge=ke=>{var mt,qt,Yt,cn;const Ue=ue.current;!Ue||ke.pointerId!==void 0&&Ue.pointerId!==ke.pointerId||(!Ue.moved&&!Ue.nodeId&&ce(!1),(qt=(mt=Ue.canvas)==null?void 0:mt.releasePointerCapture)==null||qt.call(mt,Ue.pointerId),(cn=(Yt=ke.currentTarget)==null?void 0:Yt.releasePointerCapture)==null||cn.call(Yt,Ue.pointerId),ue.current=null,N(!1))};l.useEffect(()=>{const ke=Ue=>Ge(Ue);return window.addEventListener("pointerup",ke),window.addEventListener("pointercancel",ke),window.addEventListener("blur",ke),()=>{window.removeEventListener("pointerup",ke),window.removeEventListener("pointercancel",ke),window.removeEventListener("blur",ke)}},[]);const Xe=ke=>{Ee(Ue=>({...Ue,root:eu(Ue.root,ke,mt=>({...mt,collapsed:!mt.collapsed}))}))},Qe=(ke,Ue=!1)=>{Ee(mt=>({...mt,root:h2(mt.root,ke,!0)})),Ue&&E(mt=>mt+1)},it=async ke=>{var Ue;if(a)try{if(ke==="xmind"){const{mindMapToXmindBlob:mt}=await pu(async()=>{const{mindMapToXmindBlob:Yt}=await import("./xmindAdapter-BoqP-2G8.js");return{mindMapToXmindBlob:Yt}},[]),qt=await mt(a);tu(`${a.title||"mind-map"}.xmind`,qt,"application/octet-stream"),n.success("XMind exported");return}if(ke==="markdown"){tu(`${a.title||"mind-map"}.md`,sA(a),"text/markdown;charset=utf-8"),n.success("Markdown exported");return}if(ke==="jpg"){(Ue=document.fonts)!=null&&Ue.ready&&await document.fonts.ready,u({...a,root:h2(a.root,!1,!0)}),await new Promise(mt=>requestAnimationFrame(()=>requestAnimationFrame(mt)));try{const mt=await I4e(J.current);tu(`${a.title||"mind-map"}.jpg`,mt,"image/jpeg"),n.success("JPG exported")}finally{u(null)}return}tu(`${a.title||"mind-map"}.json`,`${JSON.stringify(a,null,2)}
623
+ `,"application/json;charset=utf-8"),n.success("JSON exported")}catch(mt){n.error(`Could not export this map: ${mt.message||"unknown error"}`)}},ut=async ke=>{var mt;const Ue=(mt=ke.target.files)==null?void 0:mt[0];if(ke.target.value="",!(!Ue||!a))try{const qt=Ue.name.toLowerCase().endsWith(".xmind"),Yt=qt?null:await Ue.text(),cn=Ue.name.toLowerCase().endsWith(".json"),rn=qt?await(async()=>{const{xmindBlobToMindMap:Mt}=await pu(async()=>{const{xmindBlobToMindMap:Rt}=await import("./xmindAdapter-BoqP-2G8.js");return{xmindBlobToMindMap:Rt}},[]);return Mt(await Ue.arrayBuffer(),pS(Ue.name))})():cn?C4(JSON.parse(Yt),pS(Ue.name)):cA(Yt,pS(Ue.name)),gn={...rn,id:a.id,title:rn.title||a.title,createdAt:a.createdAt,updatedAt:new Date().toISOString()};await fe.current.catch(()=>{});const St=await sl.update(a.id,gn);o(St),qe(gn.root.id),p(St.title),n.success(`${qt?"XMind":cn?"JSON":"Markdown"} imported into this map`)}catch(qt){n.error(`Could not import this file: ${qt.message||"invalid format"}`)}},pt=async()=>{if(a!=null&&a.filePath)try{await Un.openFolder(a.filePath)}catch(ke){n.error(`Could not open map folder: ${ke.message||"unknown error"}`)}},_t=async()=>{if(a!=null&&a.filePath)try{await navigator.clipboard.writeText(a.filePath),n.success("Mind map file path copied")}catch(ke){n.error(`Could not copy file path: ${ke.message||"clipboard unavailable"}`)}};if(v)return c.jsx("div",{className:"mind-map-missing",children:c.jsx(ar,{tip:"Loading mind map..."})});if(!a)return c.jsxs("div",{className:"mind-map-missing",children:[c.jsx(Xt,{description:"This mind map could not be found."}),c.jsx(Re,{onClick:()=>t("mind-maps"),children:"Back to mind maps"})]});const Pt=ne&&!!f;return c.jsxs("div",{className:`mind-map-detail-page${Z?" is-canvas-fullscreen":""}`,children:[c.jsxs("div",{className:"mind-map-detail-toolbar",children:[c.jsxs("div",{className:"mind-map-detail-heading",children:[c.jsx(Re,{"aria-label":"Back to mind maps",className:"mind-map-back-button",icon:c.jsx(ec,{}),onClick:()=>t("mind-maps"),type:"text"}),c.jsx("div",{className:"mind-map-breadcrumbs",children:c.jsx("button",{onClick:()=>t("mind-maps"),type:"button",children:"Mind maps"})}),c.jsx(Ct,{"aria-label":"Mind map title",className:"mind-map-title-input",onBlur:Me,onChange:ke=>p(ke.target.value),onPressEnter:ke=>ke.currentTarget.blur(),value:h})]}),c.jsxs(ct,{className:"mind-map-detail-actions",size:8,children:[c.jsx("input",{ref:r,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:ut,type:"file"}),c.jsx(Re,{icon:c.jsx(X$,{}),onClick:()=>{var ke;return(ke=r.current)==null?void 0:ke.click()},children:"Import"}),c.jsx(Bl,{menu:{items:[{key:"xmind",icon:c.jsx(QR,{}),label:"Export XMind"},{key:"jpg",icon:c.jsx(qv,{}),label:"Export JPG"},{key:"json",icon:c.jsx(wa,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"}],onClick:({key:ke})=>it(ke)},trigger:["click"],children:c.jsx(Re,{icon:c.jsx(ql,{}),children:"Export"})}),c.jsx(Re,{"aria-label":"Mind map settings",icon:c.jsx(Gl,{}),onClick:Je,children:"Settings"}),c.jsx(Re,{icon:c.jsx(Q$,{}),onClick:()=>n.success("All changes saved to the data file"),children:"Save"})]})]}),c.jsxs("div",{className:`mind-map-detail-layout${Pt?"":" is-inspector-collapsed"}`,children:[c.jsxs(It,{className:"mind-map-canvas-card",styles:{body:{padding:0}},children:[c.jsxs("div",{className:"mind-map-canvas-header",children:[c.jsxs("div",{className:"mind-map-canvas-heading",children:[c.jsx(io,{className:"mind-map-eyebrow",children:"CANVAS"}),c.jsxs("div",{className:"mind-map-canvas-title-row",children:[c.jsx(Tk,{level:3,children:"Map canvas"}),c.jsx(io,{className:"mind-map-canvas-tip",type:"secondary",children:"Tip: keep each branch short and concrete."})]})]}),c.jsxs(ct,{className:"mind-map-canvas-controls",size:12,children:[c.jsx(Re,{"aria-label":Z?"Exit canvas full screen":"Enter canvas full screen",icon:Z?c.jsx(I9,{}):c.jsx(k9,{}),onClick:()=>{ee(ke=>!ke),w(ke=>ke+1)},type:"text"}),c.jsx(Re,{"aria-label":Pt?"Collapse inspector":"Show inspector",className:"mind-map-inspector-control",icon:Pt?c.jsx(Yve,{}):c.jsx(Qve,{}),onClick:()=>ce(ke=>!ke),type:"text"}),c.jsxs(ct,{className:"mind-map-tree-actions",size:4,children:[c.jsx(Re,{icon:c.jsx(d9,{}),onClick:()=>Qe(!1),children:"Expand all"}),c.jsx(Re,{icon:c.jsx(u9,{}),onClick:()=>Qe(!0,!0),children:"Collapse all"})]}),c.jsxs(ct,{className:"mind-map-zoom-control",size:4,children:[c.jsx(Re,{"aria-label":"Zoom out",disabled:b<=.5,icon:c.jsx(jD,{}),onClick:()=>{var ke;return(ke=ye.current)==null?void 0:ke.zoomAt(Math.max(.5,Number((b-.1).toFixed(2))))},type:"text"}),c.jsxs("button",{"aria-label":"Reset canvas view",className:"mind-map-zoom-label",onClick:()=>{C(1),w(ke=>ke+1)},type:"button",children:[Math.round(b*100),"%"]}),c.jsx(Re,{"aria-label":"Zoom in",disabled:b>=2,icon:c.jsx(ED,{}),onClick:()=>{var ke;return(ke=ye.current)==null?void 0:ke.zoomAt(Math.min(2,Number((b+.1).toFixed(2))))},type:"text"})]})]})]}),c.jsx(z4e,{ref:ye,isPanning:R,map:a,onCanvasPointerDown:je,onCanvasPointerMove:Be,onCanvasPointerUp:Ge,onSelect:qe,onToggle:Xe,onZoomChange:C,recenterLayoutToken:$,resetViewToken:x,selectedId:f,zoom:b,jiraIssues:Ie,nodeMaxWidth:j}),c.jsx("div",{className:"mind-map-canvas-footer",children:c.jsxs(io,{type:"secondary",children:[c.jsx("span",{className:"mind-map-key",children:"⌘"})," Click to select ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Enter"})," sibling ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Tab"})," child ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Drag canvas to pan ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ⌘ + Scroll to zoom ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Changes save automatically"]})})]}),c.jsx(It,{className:"mind-map-inspector-card",children:c.jsxs("div",{className:"mind-map-inspector-shell",children:[c.jsxs("div",{className:"mind-map-inspector-header",children:[c.jsxs("div",{children:[c.jsx(io,{className:"mind-map-eyebrow",children:"INSPECTOR"}),c.jsxs("div",{className:"mind-map-inspector-title-row",children:[c.jsx(Tk,{level:3,children:"Selected idea"}),(se==null?void 0:se.id)===a.root.id?c.jsx($t,{color:"purple",children:"Root"}):null,le?c.jsx($t,{className:"mind-map-comment-tag",children:"Comment"}):null]})]}),(se==null?void 0:se.id)!==a.root.id&&c.jsxs("div",{className:"mind-map-inspector-header-actions",children:[ae&&c.jsxs("div",{className:"mind-map-sibling-order-actions",children:[c.jsx(yn,{title:"Move idea up",children:c.jsx(Re,{"aria-label":"Move idea up",disabled:pe<=0,icon:c.jsx(O9,{}),onClick:()=>$e(-1)})}),c.jsx(yn,{title:"Move idea down",children:c.jsx(Re,{"aria-label":"Move idea down",disabled:pe<0||pe>=ae.children.length-1,icon:c.jsx(N9,{}),onClick:()=>$e(1)})})]}),c.jsx(Gr,{cancelText:"Cancel",description:"This will also remove all child ideas.",okButtonProps:{danger:!0},okText:"Delete",onConfirm:We,placement:"topRight",title:"Delete this idea?",children:c.jsx(Re,{"aria-label":"Delete selected idea",className:"mind-map-inline-delete",danger:!0,icon:c.jsx(Hn,{}),type:"text"})})]})]}),c.jsx("div",{className:"mind-map-inspector-content",children:se&&c.jsxs("div",{className:"mind-map-inspector-fields",children:[c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Content"}),c.jsxs("div",{className:"mind-map-idea-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-text",children:"Idea"}),c.jsxs("div",{className:"mind-map-auto-width-field",children:[c.jsx(yn,{title:"When off, text wraps only at manual line breaks.",placement:"top",children:c.jsx("span",{className:"mind-map-auto-width-label",children:"Auto width"})}),c.jsx(Ja,{"aria-label":"Auto width",checked:se.autoWidth!==!1,onChange:ke=>De({autoWidth:ke}),size:"small"})]})]}),c.jsx(Ct.TextArea,{autoSize:{minRows:2,maxRows:8},className:"mind-map-idea-input",id:"mind-map-node-text",onChange:ke=>De({text:ke.target.value}),placeholder:"Name this idea",ref:ve,value:se.text}),ae&&c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-edge-label",children:"Line label"}),c.jsx(Ct,{id:"mind-map-node-edge-label",onChange:ke=>De({edgeLabel:ke.target.value||void 0}),placeholder:"Label this connection",value:se.edgeLabel||""})]}),c.jsxs("div",{className:"mind-map-notes-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-notes",children:"Notes"}),c.jsx(Re,{className:"mind-map-notes-toggle",onClick:()=>oe(ke=>!ke),size:"small",type:"text",children:re?"Hide notes":(kt=se.notes)!=null&&kt.trim()?"Edit notes":"Add note"})]}),re&&c.jsx(Ct.TextArea,{autoSize:{minRows:4,maxRows:8},id:"mind-map-node-notes",onChange:ke=>De({notes:ke.target.value}),placeholder:"Add a note or a prompt...",value:se.notes||""})]}),!le&&c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Test status"}),c.jsxs("div",{className:"mind-map-tested-field",children:[c.jsxs("div",{children:[c.jsx("span",{className:"mind-map-field-label",children:"Tested"}),c.jsx(io,{type:"secondary",children:"Updates this node and all child nodes."})]}),c.jsxs("div",{className:"mind-map-tested-control",children:[c.jsx("span",{className:"mind-map-tested-state",children:se.tested?"Tested":"Pending"}),c.jsx(Ja,{checked:!!se.tested,onChange:Te,size:"small"})]})]})]}),c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Jira"}),me.length>0&&c.jsx("div",{"aria-label":"Selected Jira issues",className:"mind-map-selected-jira-list",children:me.map(ke=>c.jsxs("div",{className:"mind-map-selected-jira-item",children:[c.jsxs("button",{className:"mind-map-selected-jira-open",disabled:!ke.url,onClick:()=>hr(ke.url),title:ke.url?"Open in Jira":"Jira link unavailable",type:"button",children:[c.jsx($t,{color:"blue",children:ke.key}),c.jsx("span",{className:"mind-map-selected-jira-summary",children:ke.summary||"Summary unavailable"}),ke.url&&c.jsx(ul,{})]}),c.jsx("button",{"aria-label":`Untag ${ke.key}`,className:"mind-map-selected-jira-untag",onClick:()=>vt(ke.key),title:`Untag ${ke.key}`,type:"button",children:c.jsx(Jo,{})})]},ke.key))}),c.jsx($n,{allowClear:!0,"aria-label":"Jira tags",className:"mind-map-node-jira-select",filterOption:(ke,Ue)=>`${(Ue==null?void 0:Ue.value)||""} ${(Ue==null?void 0:Ue.summary)||""}`.toLowerCase().includes(ke.toLowerCase()),id:"mind-map-node-jira",mode:"multiple",onChange:ke=>{De({jiraKeys:ke}),V(!1),requestAnimationFrame(()=>{var Ue,mt;return(mt=(Ue=ze.current)==null?void 0:Ue.blur)==null?void 0:mt.call(Ue)})},options:Ie.map(ke=>({label:c.jsxs("div",{className:"mind-map-jira-select-option",children:[c.jsx("span",{className:"mind-map-jira-select-option-key",children:ke.key}),c.jsx("span",{className:"mind-map-jira-select-option-summary",children:ke.summary||"Summary unavailable"})]}),summary:ke.summary||"",value:ke.key})),maxTagCount:0,maxTagPlaceholder:"Select Jira issues",onOpenChange:V,placeholder:Ie.length?"Select Jira issues":"Add Jira issues in Settings",showSearch:!0,open:X,ref:ze,value:se.jiraKeys||[]})]})]})}),c.jsxs("div",{className:"mind-map-inspector-actions",children:[c.jsx(yn,{title:"Add a child idea (Tab)",children:c.jsx(Re,{block:!0,className:"mind-map-add-child",icon:c.jsx(Xn,{}),onClick:_e,type:"primary",children:"Add child idea"})}),ae&&c.jsx(Re,{block:!0,className:"mind-map-move-button",icon:c.jsx(QR,{}),onClick:Le,children:"Move idea"})]})]})})]}),c.jsxs(I$,{className:"mind-map-settings-drawer",onClose:()=>I(!1),open:O,title:"Mind map settings",width:520,children:[c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Node width"}),c.jsx(io,{className:"mind-map-settings-description",children:"Set a maximum width for regular nodes. Leave empty to keep the current default (255px)."}),c.jsxs("div",{className:"mind-map-node-width-control",children:[c.jsx(cf,{"aria-label":"Maximum node width",className:"mind-map-node-width-input",max:800,min:120,onChange:ke=>z(ke??null),placeholder:"Default",step:10,value:T??void 0}),c.jsx(Re,{disabled:!P||T===j,loading:H,onClick:Ye,type:"primary",children:"Save"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"File location"}),c.jsx(io,{className:"mind-map-settings-description",children:"This mind map is stored locally in the following file."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-file-location-row",children:[c.jsxs("div",{className:`mind-map-file-location-display${a.filePath?"":" is-unavailable"}`,title:a.filePath||"File location unavailable",children:[c.jsx(Re,{"aria-label":"Open mind map folder",className:"mind-map-file-location-folder",disabled:!a.filePath,icon:c.jsx(Fr,{}),onClick:pt,type:"text"}),c.jsx(io,{className:"mind-map-file-location-path",children:a.filePath||"File location unavailable"})]}),c.jsx(Re,{disabled:!a.filePath,icon:c.jsx(fo,{}),onClick:_t,children:"Copy"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Jira issues"}),c.jsx(io,{className:"mind-map-settings-description",children:"Add issues to this map by Jira No or a Jira issue link, then tag them from the selected node inspector."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-jira-add-row",children:[c.jsx(Ct,{onChange:ke=>F(ke.target.value),onPressEnter:He,placeholder:"PROJ-123 or https://.../browse/PROJ-123",value:_}),c.jsx(Re,{loading:U,onClick:He,type:"primary",children:"Add"})]}),c.jsx("div",{className:"mind-map-jira-list",children:Ie.length?Ie.map(ke=>c.jsxs("div",{className:`mind-map-jira-list-item ${ke.url?"is-clickable":""} ${Ce.has(ke.key)?"is-tagged":""}`,onClick:()=>ke.url&&hr(ke.url),onKeyDown:Ue=>{Ue.target!==Ue.currentTarget||!ke.url||(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),hr(ke.url))},role:ke.url?"link":void 0,tabIndex:ke.url?0:void 0,children:[c.jsx("div",{className:"mind-map-jira-list-item-main",children:c.jsxs("div",{className:"mind-map-jira-list-item-title",children:[c.jsx($t,{color:"blue",children:ke.key}),c.jsx(io,{ellipsis:{tooltip:!0},children:ke.summary||"Summary unavailable"})]})}),c.jsxs("div",{className:"mind-map-jira-list-item-delete",onClick:Ue=>Ue.stopPropagation(),children:[c.jsx(Re,{"aria-label":`Refresh summary for ${ke.key}`,className:"mind-map-jira-refresh",disabled:!!L,icon:c.jsx(Xa,{spin:L===ke.key}),onClick:()=>void ft(ke),title:`Refresh summary for ${ke.key}`,type:"text"}),c.jsx(Gr,{cancelText:"Cancel",description:"Existing node tags for this issue will also be removed.",okButtonProps:{danger:!0},okText:"Remove",onConfirm:()=>nt(ke.key),placement:"left",title:`Remove ${ke.key}?`,children:c.jsx(Re,{"aria-label":`Remove ${ke.key}`,danger:!0,icon:c.jsx(Hn,{}),type:"text"})})]})]},ke.id||ke.key)):c.jsx(Xt,{className:"mind-map-jira-empty",description:"No Jira issues added yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})]}),c.jsxs(xn,{cancelText:"Cancel",okText:"Move",onCancel:()=>G(!1),onOk:tt,open:W,title:`Move “${(se==null?void 0:se.text)||"idea"}”`,children:[c.jsx(io,{type:"secondary",children:"Choose the node that should become the new parent. The entire subtree will move with it."}),c.jsx(Jl,{changeOnSelect:!0,className:"mind-map-move-select",onChange:te,options:be,placeholder:"Select a parent node",showSearch:!0,value:Y})]}),s&&c.jsx(D4e,{map:s,nodeMaxWidth:j,ref:J})]})}async function Pk(e,t={}){if(typeof window>"u"||!("Notification"in window)||Notification.permission!=="granted")return!1;const n={body:"",icon:"/devbuddy-192.png",tag:`devbuddy-notification-${Date.now()}`,...t};try{if("serviceWorker"in navigator){const r=await navigator.serviceWorker.ready;if(r.active)return r.active.postMessage({type:"SHOW_NOTIFICATION",title:e,...n}),!0}return new Notification(e,n),!0}catch{return!1}}const{Content:L4e,Sider:_4e}=Js,{Title:Dk,Text:Bc}=Cn,zk={dark:"#171c2b",light:"#dbeafe"},B4e="var(--db-font-sans)",H4e=(e,t)=>{var r;const n=(r=e==null?void 0:e.scripts)==null?void 0:r.find(a=>a.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t},F4e=(e,t)=>{const[n,...r]=String(t).split(":"),a=r.join(":"),o=e.find(s=>String(s.id)===n);return`${(o==null?void 0:o.alias)||(o==null?void 0:o.folder)||"Launcher"} · ${H4e(o,a)}`},SA=["overview","launcher","cron-jobs","clipboard","ports","image-compress","json-to-typescript","jira-filters","todo-list","reminders","memos","mind-maps","postman","bookmark-sync","file-organizer","branch-sync","branch-health","package-upgrade","package-versions","presentation-plan","presentation-view","settings","dev-configurations","errors"],V4e={overview:"Overview",launcher:"Launcher","cron-jobs":"Cron Jobs",clipboard:"Clipboard",ports:"Port Diagnostic","todo-list":"To-Do","todo-archived":"Archived Tasks",reminders:"Reminders",memos:"Memos","mind-maps":"Mind Maps","pr-review":"PR Review","pr-conflicts":"Resolve Conflicts","pr-conflict":"Resolve Conflicts","jira-filters":"Jira Workspace","presentation-plan":"Presentations","presentation-view":"Presentation","memo-reader":"Reading","branch-sync":"Branch Sync","branch-health":"Branch Health","package-upgrade":"Package Upgrade","package-versions":"Package Versions",postman:"Postman","image-compress":"Image compression","json-to-typescript":"JSON to TypeScript","bookmark-sync":"Bookmark Sync","file-organizer":"Folder Organizer",settings:"Settings","dev-configurations":"Dev Configurations",errors:"Error Logs"},wA=e=>{if(e==="mind-maps"||e==="mind-maps/")return{page:"mind-maps",mindMapId:null};if(e.startsWith("mind-maps/")){const t=e.slice(10).split("?")[0];return t?{page:"mind-maps",mindMapId:decodeURIComponent(t)}:null}return null},U4e=()=>{const t=(window.location.hash||"#/overview").slice(2),n=wA(t);if(n)return n;if(t==="memo-reader"||t.startsWith("memo-reader?"))return{page:"memo-reader",memoId:new URLSearchParams(t.split("?")[1]||"").get("id")||null};if(t.startsWith("plugin:"))return{page:"plugin",pluginId:t.slice(7)};if(t.startsWith("static:"))return{page:"static-page",staticId:t.slice(7)};if(t.startsWith("logs/"))return{page:"logs",pluginId:null};if(["todo-list/archived","todo-archived"].includes(t))return{page:"todo-archived",pluginId:null};if(t.startsWith("pr-review"))return{page:"pr-review",pluginId:null};if(t==="pr-conflicts"||t.startsWith("pr-conflicts?"))return{page:"pr-conflicts",pluginId:null};if(t.startsWith("pr-conflict"))return{page:"pr-conflict",pluginId:null};if(t.startsWith("branch-sync"))return{page:"branch-sync",pluginId:null};if(t.startsWith("branch-health"))return{page:"branch-health",pluginId:null};if(t==="launcher"||t.startsWith("launcher?")){const r=new URLSearchParams(t.split("?")[1]||"");return{page:"launcher",pluginId:null,launcherRunningOnly:r.get("running")==="1",launcherServiceId:r.get("service")||null}}return t==="home"?{page:"overview",pluginId:null}:SA.includes(t)?{page:t,pluginId:null}:{page:"overview",pluginId:null}};function W4e({theme:e,onThemeChange:t}){var We;const{message:n}=Pr.useApp(),r=U4e(),[a,o]=l.useState([]),[s,u]=l.useState(new Set),[f,m]=l.useState({}),[h,p]=l.useState([]),[v,y]=l.useState(!0),[b,C]=l.useState(null),[x,w]=l.useState(!1),[$,E]=l.useState(!1),[R,N]=l.useState([]),[O,I]=l.useState([]),[j,k]=l.useState(r.page),[T,z]=l.useState(r.launcherRunningOnly||!1),[P,B]=l.useState(r.launcherServiceId||null),[H,A]=l.useState(r.mindMapId||null),[_,F]=l.useState(r.memoId||null),[U,q]=l.useState(()=>{var Le;return((Le=window.matchMedia)==null?void 0:Le.call(window,"(max-width: 991.98px)").matches)??!1}),[L,K]=l.useState(null),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState(""),[ne,ce]=l.useState(null),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),ue=l.useRef(null),ye=l.useRef(new Map),J=l.useRef(null),ve=l.useCallback((Le,tt)=>{Le.preventDefault(),Le.stopPropagation(),oe({key:tt,left:Math.min(Le.clientX,Math.max(8,window.innerWidth-220)),top:Math.min(Le.clientY,Math.max(8,window.innerHeight-58))})},[]),xe=l.useCallback(Le=>{var Ye,He,nt;const tt=(He=(Ye=Le.target).closest)==null?void 0:He.call(Ye,".ant-menu-item"),Je=(nt=tt==null?void 0:tt.querySelector("[data-sidebar-key]"))==null?void 0:nt.dataset.sidebarKey;Je&&ve(Le,Je)},[ve]),ze=l.useCallback(()=>{if(!(re!=null&&re.key))return;const Le=new URL(window.location.href);Le.hash=`#/${re.key}`,window.open(Le.toString(),"_blank","noopener,noreferrer"),oe(null)},[re]),[fe,se]=l.useState(r.pluginId?{id:r.pluginId,name:"Plugin"}:null),[le,ae]=l.useState(null),[pe,Ie]=l.useState(""),Ce=async({showLoading:Le=!1}={})=>{Le&&y(!0);try{const[tt,Je,Ye]=await Promise.all([Br.list(),Br.running(),Zc.list().catch(()=>[])]);o(tt),p(Array.isArray(Ye)?Ye:[]),Array.isArray(Je)?(u(new Set(Je)),m({})):(u(new Set((Je==null?void 0:Je.running)||[])),m((Je==null?void 0:Je.errorCounts)||{})),w(!0),C(null),E(!0)}catch(tt){C((tt==null?void 0:tt.message)||"Unable to load service and runtime data."),E(!1)}finally{Le&&y(!1)}};l.useEffect(()=>{const Le=async()=>{try{const[Je,Ye]=await Promise.all([Br.running(),Zc.list().catch(()=>[])]);Array.isArray(Je)?(u(new Set(Je)),m({})):(u(new Set((Je==null?void 0:Je.running)||[])),m((Je==null?void 0:Je.errorCounts)||{})),Array.isArray(Ye)&&p(Ye)}catch{}},tt=setInterval(()=>{Le()},5e3);return()=>clearInterval(tt)},[]),l.useEffect(()=>{if(!x)return;const Le=Object.fromEntries(Object.entries(f).map(([Ge,Xe])=>[Ge,Number(Xe)||0])),tt=(Array.isArray(h)?h:[]).filter(Ge=>{var Xe;return(Xe=Ge==null?void 0:Ge.source)==null?void 0:Xe.startsWith("Launcher")}),Je=new Set(tt.map(Ge=>Ge.id).filter(Boolean)),Ye=ue.current;if(!Ye){ue.current={counts:Le,ids:Je};return}const He=Object.entries(Le).filter(([Ge,Xe])=>Xe>(Ye.counts[Ge]||0)).map(([Ge,Xe])=>({key:Ge,delta:Xe-(Ye.counts[Ge]||0),count:Xe})),nt=tt.filter(Ge=>Ge.id&&!Ye.ids.has(Ge.id));ue.current={counts:Le,ids:Je};const ft=[...He.map(Ge=>({dedupeKey:Ge.key,label:F4e(a,Ge.key),count:Ge.delta})),...nt.map(Ge=>({dedupeKey:Ge.source,label:`${Ge.source.replace(/^Launcher:\s*/,"")} · ${Ge.message||"Script error"}`,count:1}))],vt=Date.now(),qe=ft.filter(Ge=>{const Xe=ye.current.get(Ge.dedupeKey)||0;return vt-Xe<1e4?!1:(ye.current.set(Ge.dedupeKey,vt),!0)});if(qe.length===0)return;const je=qe.reduce((Ge,Xe)=>Ge+Xe.count,0),Be=qe.slice(0,3).map(Ge=>Ge.label).join(";");Pk(je===1?"Launcher script error":`Launcher: ${je} new script errors`,{body:Be||"A Launcher script reported a new error."})},[f,h,x,a]),l.useEffect(()=>{let Le=!1;const tt=async()=>{var Ye;try{const He=await Td.claimDue();if(Le||!((Ye=He==null?void 0:He.due)!=null&&Ye.length))return;await Promise.all(He.due.map(async nt=>{await Pk(nt.title,{body:nt.content,tag:`devbuddy-reminder-${nt.id}`})||n.info({content:`${nt.title}:${nt.content}`,duration:8})}))}catch{}};tt();const Je=window.setInterval(()=>{tt()},1e4);return()=>{Le=!0,window.clearInterval(Je)}},[n]);const me=async(Le=!1)=>{V(!0);try{K(await nI.status(Le))}catch{K(tt=>tt||{currentVersion:jd.version,latestVersion:jd.version,updateAvailable:!1,releases:[],sourceUnavailable:!0})}finally{V(!1)}},be=()=>Ce({showLoading:!0}),Ee=()=>{ce(null),ee(!0)},Me=()=>{const Le=ne==null?void 0:ne.success;ee(!1),Le&&window.location.reload()},De=async(Le="latest")=>{G(!0),te(Le),ce(null);try{const tt=await nI.selfUpdate(Le);ce({success:!0,message:tt.message}),K(Je=>Je&&{...Je,currentVersion:Le==="latest"?Je.latestVersion:Le,updateAvailable:Le==="latest"?!1:Le!==Je.latestVersion})}catch(tt){ce({success:!1,message:tt.message||"DevBuddy could not be updated."})}finally{G(!1)}},Te=async Le=>{if(Le){Ie("Loading plugin…");try{Ie(Le.view?await(await fetch(Le.view)).text():"This plugin does not provide a view yet.")}catch{Ie("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([Ce({showLoading:!0}),iye.list().then(N),Kc.list().then(I)]).catch(Le=>n.error(Le.message)),me()},[]),l.useEffect(()=>{const Le=()=>{const Je=(window.location.hash||"#/overview").slice(2),Ye=wA(Je);if(Ye){se(null),ae(null),k("mind-maps"),A(Ye.mindMapId);return}if(Je==="memo-reader"||Je.startsWith("memo-reader?")){const He=new URLSearchParams(Je.split("?")[1]||"");se(null),ae(null),k("memo-reader"),A(null),F(He.get("id")||null);return}if(Je.startsWith("plugin:")){const He=Je.slice(7),nt=R.find(ft=>ft.id===He);nt?(ae(null),k("plugin"),A(null),se(nt),Te(nt)):R.length>0&&(window.location.hash="#/overview")}else if(Je.startsWith("static:")){const He=Je.slice(7),nt=O.find(ft=>String(ft.id)===String(He));nt?(se(null),k("static-page"),A(null),ae(nt)):O.length>0&&(window.location.hash="#/overview")}else if(Je.startsWith("logs/"))se(null),ae(null),k("logs"),A(null);else if(["todo-list/archived","todo-archived"].includes(Je))se(null),ae(null),k("todo-archived"),A(null);else if(Je.startsWith("pr-review"))se(null),ae(null),k("pr-review"),A(null);else if(Je==="pr-conflicts"||Je.startsWith("pr-conflicts?"))se(null),ae(null),k("pr-conflicts"),A(null);else if(Je.startsWith("pr-conflict"))se(null),ae(null),k("pr-conflict"),A(null);else if(Je.startsWith("branch-sync"))se(null),ae(null),k("branch-sync"),A(null);else if(Je.startsWith("branch-health"))se(null),ae(null),k("branch-health"),A(null);else if(Je==="launcher"||Je.startsWith("launcher?")){const He=new URLSearchParams(Je.split("?")[1]||"");se(null),ae(null),k("launcher"),A(null),z(He.get("running")==="1"),B(He.get("service")||null)}else Je==="home"||SA.includes(Je)?(se(null),ae(null),k(Je==="home"?"overview":Je),A(null),Je==="launcher"&&z(!1)):window.location.hash="#/overview"};return window.addEventListener("hashchange",Le),window.location.hash?Le():window.location.hash="#/overview",()=>window.removeEventListener("hashchange",Le)},[R,O]),l.useEffect(()=>{if(!re)return;const Le=()=>oe(null),tt=Ye=>{var He,nt;Ye.button!==0||(nt=(He=Ye.target).closest)!=null&&nt.call(He,".sidebar-context-menu")||Le()},Je=Ye=>{Ye.key==="Escape"&&Le()};return document.addEventListener("pointerdown",tt),document.addEventListener("contextmenu",Le),window.addEventListener("blur",Le),window.addEventListener("keydown",Je),()=>{document.removeEventListener("pointerdown",tt),document.removeEventListener("contextmenu",Le),window.removeEventListener("blur",Le),window.removeEventListener("keydown",Je)}},[re]),l.useEffect(()=>{const Le=Je=>{var Ye;(Je.error||Je.message)&&Zc.log({source:"Frontend",message:Je.message||"Uncaught JavaScript Error",details:((Ye=Je.error)==null?void 0:Ye.stack)||`${Je.filename}:${Je.lineno}:${Je.colno}`}).catch(()=>{})},tt=Je=>{var Ye,He;Zc.log({source:"Frontend (Promise)",message:((Ye=Je.reason)==null?void 0:Ye.message)||String(Je.reason||"Unhandled Promise Rejection"),details:((He=Je.reason)==null?void 0:He.stack)||String(Je.reason)}).catch(()=>{})};return window.addEventListener("error",Le),window.addEventListener("unhandledrejection",tt),()=>{window.removeEventListener("error",Le),window.removeEventListener("unhandledrejection",tt)}},[]),l.useLayoutEffect(()=>{var Le;(Le=document.querySelector(".page"))==null||Le.scrollTo({top:0,left:0,behavior:"auto"}),j==="overview"&&J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)},[j,H,fe==null?void 0:fe.id,le==null?void 0:le.id]),l.useEffect(()=>{if(j==="logs")return;const Le=j==="plugin"?(fe==null?void 0:fe.name)||(fe==null?void 0:fe.id):j==="static-page"?le==null?void 0:le.name:V4e[j];document.title=Le?`${Le} · DevBuddy`:"DevBuddy · Workbench"},[j,fe==null?void 0:fe.name,fe==null?void 0:fe.id,le==null?void 0:le.name]);const Ve=()=>{J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)};l.useEffect(()=>{const Le=tt=>{(tt.metaKey||tt.ctrlKey)&&tt.shiftKey&&(tt.key==="r"||tt.key==="R"||tt.code==="KeyR")&&(tt.preventDefault(),tt.stopPropagation())};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[]),l.useEffect(()=>{if(v||!["overview","launcher","ports"].includes(j))return;const Le=setInterval(()=>{Ce()},2e3);return()=>clearInterval(Le)},[j,v]);const _e=l.useMemo(()=>{const Le=Je=>Je.map(Ye=>Ye.children?{...Ye,children:Le(Ye.children)}:Ye.key?{...Ye,icon:Ye.icon?c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":Ye.key,children:Ye.icon}):Ye.icon,label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":Ye.key,children:Ye.label})}:Ye),tt=[...R.map(Je=>({key:`plugin:${Je.id}`,icon:c.jsx("span",{"aria-hidden":"true",children:Je.icon||"✦"}),label:Je.name||Je.id})),...O.map(Je=>({key:`static:${Je.id}`,icon:c.jsx(Mf,{}),label:Je.name}))];return Le([{type:"group",label:"Run & Observe",children:[{key:"launcher",icon:c.jsx(qo,{}),label:"Launcher"},{key:"cron-jobs",icon:c.jsx(Qm,{}),label:"Cron Jobs"},{key:"clipboard",icon:c.jsx(fo,{}),label:"Clipboard"},{key:"ports",icon:c.jsx(e4,{}),label:"Port Diagnostic"}]},{type:"group",label:"Plan & Review",children:[{key:"todo-list",icon:c.jsx(mu,{}),label:"To-Do"},{key:"reminders",icon:c.jsx(Kd,{}),label:"Reminders"},{key:"memos",icon:c.jsx(Ui,{}),label:"Memos"},{key:"mind-maps",icon:c.jsx(TC,{}),label:"Mind Maps"},{key:"pr-review",icon:c.jsx(Ly,{}),label:"PR Review"},{key:"pr-conflicts",icon:c.jsx(w0,{}),label:"Resolve Conflicts"},{key:"jira-filters",icon:c.jsx(ove,{}),label:"Jira Workspace"},{key:"presentation-plan",icon:c.jsx(yve,{}),label:"Presentations"},{key:"branch-sync",icon:c.jsx(ou,{}),label:"Branch Sync"},{key:"branch-health",icon:c.jsx(J$,{}),label:"Branch Health"},{key:"package-upgrade",icon:c.jsx(Z$,{}),label:"Package Upgrade"},{key:"package-versions",icon:c.jsx(Ape,{}),label:"Package Versions"}]},{type:"group",label:"Utilities",children:[{key:"postman",icon:c.jsx(hu,{}),label:"Postman"},{key:"image-compress",icon:c.jsx(Yw,{}),label:"Image compression"},{key:"json-to-typescript",icon:c.jsx(wa,{}),label:"JSON to TypeScript"},{key:"bookmark-sync",icon:c.jsx(_h,{}),label:"Bookmark Sync"},{key:"file-organizer",icon:c.jsx(Fr,{}),label:"Folder Organizer"}]},...tt.length>0?[{type:"group",label:"Extensions",children:tt}]:[]])},[ve,R,O]),Ne=({key:Le})=>{window.location.hash=`#/${Le}`},$e=fe?`plugin:${fe.id}`:le?`static:${le.id}`:j==="todo-archived"?"todo-list":["pr-conflicts","pr-conflict"].includes(j)?"pr-conflicts":j,Ae=b&&!(v&&!x)?c.jsx(mr,{type:x?"warning":"error",showIcon:!0,message:x?"Service status may be out of date":"Unable to load services",description:b,action:c.jsx(Re,{size:"small",loading:v,onClick:be,children:"Retry"}),className:"launcher-data-notice"}):null;return j==="memo-reader"?c.jsx(c4e,{memoId:_}):j==="logs"?c.jsx(Cbe,{}):j==="presentation-view"?c.jsx(S1e,{}):c.jsxs(Js,{className:"workbench",children:[c.jsxs(_4e,{"aria-label":"DevBuddy navigation",breakpoint:"lg",className:"sidebar",collapsed:U,collapsedWidth:64,collapsible:!0,onBreakpoint:q,onCollapse:q,width:240,children:[c.jsxs("div",{className:"brand-row",children:[c.jsxs("a",{className:"brand",href:"#/overview","aria-current":j==="overview"?"page":void 0,"aria-label":`Go to Overview — DevBuddy version ${jd.version}`,onClick:Ve,children:[c.jsx("span",{className:`brand-mark ${$?"":"is-offline"}`,"aria-hidden":"true",children:"✦"}),c.jsx("span",{className:"brand-name",children:"DevBuddy"}),c.jsxs("span",{className:"brand-version",children:["v",jd.version]})]}),!U&&c.jsx(yn,{title:L!=null&&L.updateAvailable?`Update available: v${L.latestVersion}`:"View Change Log",children:c.jsx(sa,{dot:!!(L!=null&&L.updateAvailable),color:"#f5b942",offset:[-2,3],children:c.jsx(Re,{"aria-label":L!=null&&L.updateAvailable?`Update available: version ${L.latestVersion}`:"View Change Log",className:`sidebar-update-button ${L!=null&&L.updateAvailable?"has-update":""}`,icon:c.jsx(TC,{}),loading:X&&!L,onClick:Ee,type:"text"})})})]}),c.jsx("nav",{ref:J,className:"sidebar-nav","aria-label":"Main navigation",onContextMenu:xe,children:c.jsx(Xs,{theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:[$e],items:_e,onClick:Ne})}),c.jsx("div",{className:"sidebar-bottom",children:c.jsx("div",{className:"sidebar-bottom-inner",children:c.jsx("nav",{"aria-label":"Settings navigation",onContextMenu:xe,children:c.jsx(Xs,{className:"sidebar-settings-menu",theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:["settings","errors"].includes(j)?[j]:[],items:[{key:"settings",icon:c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":"settings",children:c.jsx(Gl,{})}),label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":"settings",children:"Settings"})}],onClick:Ne})})})})]}),c.jsx(Js,{children:c.jsx(L4e,{className:`page ${j==="overview"?"is-overview-page":""} ${["static-page","postman"].includes(j)?"is-static-page":""} ${["overview","postman","static-page"].includes(j)?"":"is-workspace-content"} ${j==="mind-maps"&&H?"is-mind-map-detail":""} ${j==="presentation-plan"?"is-presentation-plan":""} ${j==="json-to-typescript"?"is-json-to-typescript":""} ${j==="memos"?"is-memos":""}`,children:fe?c.jsxs(c.Fragment,{children:[c.jsx(Bc,{type:"secondary",children:"PLUGIN"}),c.jsx(Dk,{level:2,children:fe.name}),c.jsx(It,{children:c.jsx("div",{dangerouslySetInnerHTML:{__html:pe}})})]}):j==="static-page"&&le?c.jsx("div",{className:"static-page-container",children:c.jsx("iframe",{src:le.url,title:le.name,className:"static-page-iframe"})}):j==="image-compress"?c.jsx(Yye,{}):j==="json-to-typescript"?c.jsx(O1e,{}):j==="mind-maps"?H?c.jsx(A4e,{mindMapId:H,onNavigate:Le=>{window.location.hash=`#/${Le}`}}):c.jsx(w4e,{onNavigate:Le=>{window.location.hash=`#/${Le}`}}):j==="overview"?c.jsx(s1e,{launchers:a,running:s,errorCounts:f,errorLogs:h,plugins:R,staticPages:O,loading:v,error:b,hasLoaded:x,onRetry:be,onNavigate:Le=>{window.location.hash=`#/${Le}`}}):j==="clipboard"?c.jsx(Cye,{}):j==="cron-jobs"?c.jsx(jye,{}):j==="ports"?c.jsx(_ye,{refreshLaunchers:Ce}):j==="pr-review"?c.jsx(Zye,{}):j==="pr-conflicts"?c.jsx(vI,{listOnly:!0},"pr-conflicts"):j==="pr-conflict"?c.jsx(vI,{},"pr-conflict"):j==="jira-filters"?c.jsx(cbe,{}):j==="todo-list"?c.jsx(pbe,{}):j==="reminders"?c.jsx(p4e,{}):j==="memos"?c.jsx(u4e,{}):j==="todo-archived"?c.jsx(ybe,{}):j==="presentation-plan"?c.jsx(C1e,{}):j==="postman"?c.jsx(Pbe,{}):j==="bookmark-sync"?c.jsx(Dbe,{}):j==="file-organizer"?c.jsx(Abe,{}):j==="branch-sync"?c.jsx(Lbe,{}):j==="branch-health"?c.jsx(Vbe,{}):j==="package-upgrade"?c.jsx(Wbe,{}):j==="package-versions"?c.jsx(Kbe,{}):j==="errors"?c.jsx(Sbe,{}):j==="settings"?c.jsx(Hye,{theme:e,onThemeChange:t,onStaticPagesChange:()=>Kc.list().then(I)}):j==="dev-configurations"?c.jsx(Uye,{}):c.jsxs(c.Fragment,{children:[Ae,(v||x||!b)&&c.jsx(Lye,{launchers:a,running:s,errorCounts:f,refresh:Ce,loading:v&&!x,initialRunningOnly:T,initialServiceId:P})]})})}),re&&c.jsx("div",{className:"sidebar-context-menu",role:"menu",style:{left:re.left,top:re.top},onClick:Le=>Le.stopPropagation(),onContextMenu:Le=>Le.preventDefault(),children:c.jsx("button",{type:"button",role:"menuitem",onClick:ze,children:"Open in new window"})}),c.jsx(xn,{className:"changelog-modal",footer:[(L==null?void 0:L.updateAvailable)&&!(ne!=null&&ne.success)&&c.jsx(Re,{type:"primary",loading:W&&Y===(L==null?void 0:L.latestVersion),onClick:()=>De(L==null?void 0:L.latestVersion),children:"Update now"},"update"),c.jsx(Re,{disabled:W,loading:X,onClick:()=>me(!0),children:"Check again"},"refresh"),c.jsx(Re,{type:"primary",disabled:W,onClick:Me,children:ne!=null&&ne.success?"Close & reload":"Close"},"close")],onCancel:Me,closable:!W,maskClosable:!W,open:Z,title:c.jsxs("div",{className:"changelog-title",children:[c.jsx("span",{className:`changelog-bulb ${L!=null&&L.updateAvailable?"has-update":""}`,children:c.jsx(TC,{})}),c.jsx("span",{children:"Updates"})]}),width:680,children:X&&!L?c.jsx("div",{className:"changelog-loading",children:c.jsx(ar,{})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changelog-version-row",children:[c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Installed"}),c.jsxs(Bc,{strong:!0,children:["v",(L==null?void 0:L.currentVersion)||jd.version]})]}),c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Latest"}),c.jsxs(Bc,{strong:!0,children:["v",(L==null?void 0:L.latestVersion)||jd.version]})]}),c.jsx($t,{color:L!=null&&L.updateAvailable?"gold":"green",children:L!=null&&L.updateAvailable?"Update available":"Up to date"})]}),(L==null?void 0:L.sourceUnavailable)&&c.jsx(mr,{className:"changelog-source-alert",message:"Could not reach the configured npm registry. Showing locally available release notes.",showIcon:!0,type:"info"}),ne&&c.jsx(mr,{className:"changelog-source-alert",description:ne.message,message:ne.success?"DevBuddy updated successfully":"DevBuddy update failed",showIcon:!0,type:ne.success?"success":"error"}),c.jsx("div",{className:"changelog-release-list",children:(We=L==null?void 0:L.releases)!=null&&We.length?L.releases.slice(0,5).map(Le=>c.jsxs("section",{className:"changelog-release",children:[c.jsxs("div",{className:"changelog-release-heading",children:[c.jsxs("div",{className:"changelog-release-title",children:[c.jsxs($t,{className:"changelog-release-version",children:["v",Le.version]}),c.jsx(Dk,{level:4,children:Le.name})]}),c.jsxs("div",{className:"changelog-release-actions",children:[Le.publishedAt&&c.jsx(Bc,{type:"secondary",children:new Date(Le.publishedAt).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}),c.jsx(Re,{size:"small",type:Le.version===(L==null?void 0:L.latestVersion)?"primary":"default",disabled:W||Le.version===(L==null?void 0:L.currentVersion),loading:W&&Y===Le.version,onClick:()=>De(Le.version),children:Le.version===(L==null?void 0:L.currentVersion)?"Installed":"Install"})]})]}),c.jsx(Bc,{className:"changelog-release-notes",children:Le.notes||"Published to the configured npm registry."})]},`${Le.version}-${Le.publishedAt||""}`)):c.jsx(Xt,{description:"No published release notes yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})})]})}function q4e(){const[e,t]=l.useState(()=>document.documentElement.dataset.theme||localStorage.getItem("devbuddy-theme")||"dark");return l.useEffect(()=>{let n=!1;try{n=["dark","light"].includes(localStorage.getItem("devbuddy-theme"))}catch{}n||Un.status().then(r=>{const a=r.theme==="light"?"light":"dark";t(a),localStorage.setItem("devbuddy-theme",a)}).catch(()=>{})},[]),l.useLayoutEffect(()=>{var n;document.documentElement.dataset.theme=e,localStorage.setItem("devbuddy-theme",e),(n=document.querySelector('meta[name="theme-color"]'))==null||n.setAttribute("content",zk[e]||zk.dark)},[e]),l.useLayoutEffect(()=>{const n=()=>{document.querySelectorAll('[role="tab"], [role="tabpanel"]').forEach(o=>{document.activeElement===o&&o.blur(),o.tabIndex!==-1&&(o.tabIndex=-1)})};n();const r=new MutationObserver(n),a=o=>{var s,u;(u=(s=o.target).matches)!=null&&u.call(s,'[role="tab"], [role="tabpanel"]')&&o.target.blur()};return document.addEventListener("focusin",a,!0),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),()=>{r.disconnect(),document.removeEventListener("focusin",a,!0)}},[]),c.jsx(bi,{theme:{token:{fontFamily:B4e,borderRadius:10,colorBgLayout:e==="light"?"#f7f8fc":"#f4f5fa",colorInfo:e==="light"?"#2e83d2":"#6555e8",colorLink:e==="light"?"#2e83d2":"#5b4cc4",colorLinkActive:e==="light"?"#2474bd":"#5143c2",colorLinkHover:e==="light"?"#4593d8":"#7669ee",colorPrimary:e==="light"?"#2e83d2":"#5d63a8",colorPrimaryActive:e==="light"?"#2474bd":"#505690",colorPrimaryHover:e==="light"?"#4593d8":"#6c72b8",controlOutline:e==="light"?"rgba(46, 131, 210, .2)":"rgba(93, 99, 168, .24)",colorTextSecondary:"#667085"},components:{Layout:{bodyBg:e==="light"?"#f7f8fc":"#f4f5fa",siderBg:e==="light"?"#ffffff":"#171c2b",triggerBg:e==="light"?"#f8f9fc":"#101522",triggerColor:e==="light"?"#667085":"#c9ced8"},Menu:{darkItemBg:"#171c2b",darkItemSelectedBg:"#3f476e",darkItemSelectedColor:"#f0f1ff",darkSubMenuItemBg:"#171c2b",itemSelectedBg:"#eeecff",itemSelectedColor:"#5143c2"}}},children:c.jsx(Pr,{children:c.jsx(W4e,{theme:e,onThemeChange:t})})})}const K4e=/Macintosh|Mac OS X|iPhone|iPad/i.test(navigator.userAgent);document.documentElement.dataset.platform=K4e?"mac":"other";const Ak='input, textarea, [contenteditable="true"]',$A=e=>{var t,n;(t=e.matches)!=null&&t.call(e,Ak)&&(e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","none")),(n=e.querySelectorAll)==null||n.call(e,Ak).forEach(r=>{r.setAttribute("spellcheck","false"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","none")})};$A(document);const G4e=new MutationObserver(e=>{e.forEach(({addedNodes:t})=>{t.forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&$A(n)})})});G4e.observe(document.body,{childList:!0,subtree:!0});const Y4e=cB.createRoot(document.getElementById("app"));Y4e.render(c.jsx(q4e,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{updateViaCache:"none"}).catch(e=>{console.warn("DevBuddy service worker registration failed:",e)})});requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.setTimeout(()=>{const e=document.getElementById("app-splash");e&&(e.classList.add("is-hidden"),window.setTimeout(()=>e.remove(),700))},700)})});export{Yo as g,C4 as n};