tower-studio 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +59 -59
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +43 -43
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +86 -86
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +78 -78
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +61 -61
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +59 -59
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +68 -68
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +72 -72
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sy6lau._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0i~v.f0._.js → [root-of-the-server]__0-o.l41._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03e009u._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0x2jop0._.js → [root-of-the-server]__0jti4~k._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0l1.bgv._.js → [root-of-the-server]__0s-a4ku._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vrp4wc._.js → [root-of-the-server]__12p2zz2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_07ca~8h._.js → _0-9.ea2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_02o-w3k._.js → _012.igw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0385-.g._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0zbuayb._.js → _04y89b3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_04yogxq._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0ncltnn._.js → _0bk06da._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0cc0gt8._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_01xe7~b._.js → _0hzckhd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_13dksil._.js → _0m.4akk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0oq26rv._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0z-b00b._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_075_.cb._.js → _0~v4z8z._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_060_9cj._.js → _10-.n35._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +234 -234
- package/.next/standalone/.next/static/chunks/{0htnxzje.8d3f.js → 0-.9k92iyul5o.js} +2 -2
- package/.next/standalone/.next/static/chunks/{13z_8s26xa~p1.js → 0.qj9vorfgtnt.js} +1 -1
- package/.next/standalone/.next/static/chunks/00-6_m40h14vl.js +1 -0
- package/.next/standalone/.next/static/chunks/02.ihz-~spbi-.js +1 -0
- package/.next/standalone/.next/static/chunks/{0.onfoo7t4w-m.js → 04axhlp_leiii.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0t92fwd6kv5j_.js → 05a6uzgclxdsk.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0w1jry5z5w5~5.js → 099eecj285cbx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_t-j983f5f0p.js → 0c~0amyhws3l0.js} +1 -1
- package/.next/standalone/.next/static/chunks/0e8r37m0q.z0p.js +1 -0
- package/.next/standalone/.next/static/chunks/{11yv2zlsl_i7z.js → 0ik7-_3wrtspq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ima0i0p489ty.js +1 -0
- package/.next/standalone/.next/static/chunks/{0feyhaj64gfd~.js → 0p9zhbwmnn0j4.js} +1 -1
- package/.next/standalone/.next/static/chunks/{01vvdks5yzk7x.js → 0rec91xfsdv8r.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0y8ywrftfsnux.js → 0so-w5.m3jaxi.js} +1 -1
- package/.next/standalone/.next/static/chunks/{030g1-s.qdj2n.js → 0zfszxiw4cx9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{11jg-t_iw_8i6.js → 0ztty8z0obk5f.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0132~w09sg8ej.js → 1007_ur3fj.~m.js} +1 -1
- package/.next/standalone/.next/static/chunks/{08vuh22p.47~b.js → 10r4y1zzk24jy.js} +2 -2
- package/.next/standalone/.next/static/chunks/10vl5vq1_rh1..js +1 -0
- package/.next/standalone/.next/static/chunks/120x-nmim1wfz.js +1 -0
- package/.next/standalone/.next/static/chunks/{015m584n.xxu~.js → 12iivlft6u_tt.js} +1 -1
- package/.next/standalone/.next/static/chunks/134onqxk2foh5.js +5 -0
- package/.next/standalone/.next/static/chunks/{15.pdp8xgoni1.js → 16r-tz37aqyoa.js} +1 -1
- package/.next/standalone/.next/static/chunks/16ukg_cswejw4.js +5 -0
- package/.next/standalone/.next/static/chunks/{07ucj-4sybtq9.js → 17n~0msyl8bur.js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_00xgezz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0564air._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_084ifnn._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0qq3k6g._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0z58pqh._.js +0 -7
- package/.next/standalone/.next/static/chunks/01fk6.8bw14.7.js +0 -1
- package/.next/standalone/.next/static/chunks/0cn44krrztr-n.js +0 -1
- package/.next/standalone/.next/static/chunks/0hf2igz3z1v.5.js +0 -1
- package/.next/standalone/.next/static/chunks/0lq9lfznfhl-6.js +0 -1
- package/.next/standalone/.next/static/chunks/0plqjpgas0ygu.js +0 -1
- package/.next/standalone/.next/static/chunks/0tfc~d_oxesgk.js +0 -5
- package/.next/standalone/.next/static/chunks/11x05y67gti4v.js +0 -5
- package/.next/standalone/.next/static/chunks/15vogvewouq8e.js +0 -1
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645119,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(538059),n=e.i(210702),a=e.i(232545),i=e.i(487278),l=e.i(368490),o=e.i(259846),d=e.i(572989);let c=(0,d.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(519455),m=e.i(759684),u=e.i(606393),p=e.i(226145),h=e.i(340873),f=e.i(263938),g=e.i(960518),v=e.i(453889),j=e.i(645378);let b=(0,d.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var N=e.i(464249);let y=(0,d.default)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]),w=(0,d.default)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var C=e.i(746798),S=e.i(685149),k=e.i(35967),D=e.i(533499);function T(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${r}`}let B=Object.fromEntries(S.BOARD_COLUMNS.map(e=>[e.id,e.color]));function E({children:e,className:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground ${s??""}`,children:e})}function I({task:e,onOpenDetail:r}){let{t:n}=(0,D.useI18n)(),[a,i]=(0,s.useState)(!1),o="CANCELLED"===e.status?"text-muted-foreground line-through decoration-muted-foreground/40":"DONE"===e.status?"text-muted-foreground":"text-foreground";return(0,t.jsxs)("div",{className:"rounded-[10px]",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-2.5 rounded-[10px] px-2.5 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${a?"rotate-90":""}`}),(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:`text-[13.5px] font-medium ${o}`,children:e.title}),e.labels.map(({label:e})=>(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-px text-[10.5px] text-muted-foreground",style:e.color?{borderColor:e.color+"55",color:e.color}:void 0,children:e.name},e.id)),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"flex w-16 flex-none justify-center",children:(0,t.jsx)("span",{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-bold ${S.PRIORITY_CONFIG[e.priority]?.color??S.PRIORITY_CONFIG.LOW.color}`,children:e.priority})}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsxs)("span",{className:"flex w-[72px] flex-none items-center gap-1.5",children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:"truncate text-[10.5px] text-muted-foreground",children:n(`version.taskStatus.${e.status}`)})]}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsx)("span",{className:"flex w-6 flex-none justify-center",children:r&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:t=>{t.stopPropagation(),r(e.id)}}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:n("version.detail")})]})})]}),a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 pb-3 pl-[30px] pr-3 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.FolderOpen,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.resources")})]}),0===e.assets.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.resources")}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.assets.map(e=>{var s;let r=e.mimeType?.startsWith("image/");return(0,t.jsxs)("span",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground shadow-sm transition-colors hover:border-primary/50",children:[r?(0,t.jsx)(b,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(j.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:e.filename}),null!=e.size&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60",children:(s=e.size)<1024?`${s} B`:s<1048576?`${Math.round(s/1024)} KB`:`${(s/1048576).toFixed(1)} MB`})]},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(j.FileText,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.notes")})]}),0===e.notes.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.notes")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.notes.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-border border-l-violet-500/50 bg-background px-2.5 py-2 shadow-sm [border-left-width:3px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-foreground",children:e.title}),e.category&&(0,t.jsx)("span",{className:"rounded-[5px] border border-violet-500/30 bg-violet-500/15 px-1.5 py-px text-[10px] font-bold text-violet-300",children:e.category})]})},e.id))})]})]})]})}function L({version:e,diffStat:r,onEdit:n,onRelease:a,onViewDiff:i,onOpenTaskDetail:o}){var d;let c,{t:m}=(0,D.useI18n)(),[v,j]=(0,s.useState)(e.isCurrent),b="RELEASED"===e.status,w="ACTIVE"===e.status,S=e.tasks.length,B=e.tasks.filter(e=>"DONE"===e.status).length,R=!!(e.releaseCommit||r),_=(c=`${S} ${m("version.tasksCount")}`,B>0&&B<S?`${c} \xb7 ${B} ${m("version.doneCount")}`:B>0&&B===S?`${c} \xb7 ${m("version.allDone")}`:c);return(0,t.jsxs)("div",{className:["overflow-hidden rounded-[14px] border bg-card shadow-sm transition-shadow duration-150 hover:shadow-md",e.isCurrent?"border-border border-l-2 border-l-primary ring-1 ring-primary/20":"border-border",b?"opacity-[.96]":""].filter(Boolean).join(" "),children:[(0,t.jsx)("button",{type:"button",onClick:()=>j(e=>!e),className:"w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsxs)("div",{className:"px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(l.ChevronRight,{className:`h-4 w-4 flex-none text-muted-foreground/60 transition-transform duration-150 ${v?"rotate-90":""}`}),(0,t.jsx)("span",{className:"font-mono text-[14.5px] font-bold text-foreground",children:e.number}),(0,t.jsx)("span",{className:"text-[14.5px] font-semibold text-foreground",children:e.name}),(0,t.jsx)(k.VersionTypeBadge,{name:e.type?.name??null}),(0,t.jsx)(k.VersionStatusBadge,{status:e.status}),e.isCurrent&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/15 px-2.5 py-0.5 text-[11px] font-bold text-primary shadow-sm",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-primary opacity-90"}),m("version.current")]}),(0,t.jsx)("span",{className:"flex-1"}),S>0&&(0,t.jsx)("span",{className:"text-[11.5px] text-muted-foreground",children:_}),(0,t.jsxs)("span",{className:"flex items-center gap-1",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[n&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>n(e.id)}),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:m("version.edit")})]}),w&&a&&(0,t.jsxs)(x.Button,{variant:"outline",className:"h-7 px-2 text-xs font-semibold",onClick:()=>a(e.id),children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5"}),m("version.release")]})]})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[b&&e.releasedAt?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),m("version.releasedAt"),(0,t.jsx)("strong",{className:"text-foreground",children:T(e.releasedAt)})]}):e.startDate||e.targetDate?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),e.startDate?T(e.startDate):"—"," → ",e.targetDate?(0,t.jsx)("strong",{className:"text-foreground",children:T(e.targetDate)}):"—"]}):null,e.baseBranch&&(0,t.jsxs)(E,{children:[(0,t.jsx)(p.GitBranch,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.baseBranch})]}),e.baseCommit&&(0,t.jsxs)(E,{children:[(0,t.jsx)(h.GitCommitHorizontal,{className:"h-3 w-3"}),m("version.field.baseCommit"),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:(d=e.baseCommit)?d.slice(0,7):""})]}),b&&(0,t.jsxs)(E,{children:[(0,t.jsx)(f.Tag,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.number})]}),r&&(0,t.jsxs)(E,{children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),!b&&(0,t.jsx)("span",{className:"text-muted-foreground",children:m("version.diff.live")}),(0,t.jsxs)("span",{className:"font-bold text-emerald-400",children:["+",r.additions.toLocaleString()]}),(0,t.jsxs)("span",{className:"font-bold text-rose-400",children:["−",r.deletions.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["· ",r.files," ",m("version.diff.files")]})]}),R&&i&&(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),m("version.diff.view")," →"]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:e.description})]})}),v&&S>0&&(0,t.jsx)("div",{className:"border-t border-dashed border-border bg-muted/40 px-2 pb-2 pt-1.5",children:e.tasks.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:o},e.id))})]})}var R=e.i(360112),_=e.i(597746),$=e.i(456346),O=e.i(776639),A=e.i(793479),V=e.i(110204),P=e.i(280027),M=e.i(337822),F=e.i(317056),z=e.i(699375),U=e.i(624687),H=e.i(514798);let G=(0,H.createServerReference)("407e92e12a238142cac903aa29762cec5139d994f0",H.callServer,void 0,H.findSourceMapURL,"createVersion"),K=(0,H.createServerReference)("60bf022158db96ef30b4e4f426ec1c1dee63276a64",H.callServer,void 0,H.findSourceMapURL,"updateVersion"),W=(0,H.createServerReference)("40bd9633230d3611d5f15c9dbae16300969d203d48",H.callServer,void 0,H.findSourceMapURL,"getVersionTypes");var Y=e.i(183286),q=e.i(157368),J=e.i(998626);let Q=(0,H.createServerReference)("40563702b621cd67b53caf3a7542f50445b51af0e6",H.callServer,void 0,H.findSourceMapURL,"createVersionType"),X=(0,H.createServerReference)("60281aa7aeb67c8a7cd1951429a81e53def98ac2e5",H.callServer,void 0,H.findSourceMapURL,"updateVersionType"),Z=(0,H.createServerReference)("4078e93ded1e345d46ff827d156e605cabfd4f9528",H.callServer,void 0,H.findSourceMapURL,"deleteVersionType");function ee({open:e,onOpenChange:r,workspaceId:n,onChanged:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useState)([]),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)({}),[p,h]=(0,s.useTransition)(),f=async()=>{let e=await W(n);o(e),u(t=>{let s={};return e.forEach(e=>{s[e.id]=e.id in t?t[e.id]:e.name}),s})};(0,s.useEffect)(()=>{e&&(f(),c(""))},[e,n]);let g=()=>{let e=d.trim();e&&h(async()=>{try{await Q({workspaceId:n,name:e}),c(""),await f(),a?.(),R.toast.success(i("version.type.add"))}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})};return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:i("version.manageTypes")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(A.Input,{value:d,onChange:e=>c(e.target.value),placeholder:i("version.type.namePlaceholder"),disabled:p,onKeyDown:e=>{"Enter"===e.key&&g()},className:"flex-1"}),(0,t.jsx)(x.Button,{onClick:g,disabled:p||!d.trim(),children:i("version.type.add")})]}),0===l.length?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground py-4",children:i("version.type.empty")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:l.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("span",{className:`inline-flex h-2.5 w-2.5 flex-none rounded-full ${(0,k.typeBadgeColor)(m[e.id]??e.name).split(" ").filter(e=>e.startsWith("bg-"))[0]??"bg-muted"}`}),(0,t.jsx)(A.Input,{value:m[e.id]??e.name,onChange:t=>u(s=>({...s,[e.id]:t.target.value})),onBlur:()=>(e=>{let t=(m[e]??"").trim();if(!t)return;let s=l.find(t=>t.id===e);s?.name!==t&&h(async()=>{try{await X(e,{name:t}),await f(),a?.()}catch(t){R.toast.error(t instanceof Error?t.message:String(t)),u(t=>({...t,[e]:s?.name??""}))}})})(e.id),onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:p,className:"h-7 flex-1 border-transparent bg-transparent shadow-none focus-visible:border-input focus-visible:bg-background focus-visible:shadow-sm"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-none text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void(window.confirm(i("version.type.deleteConfirm"))&&h(async()=>{try{await Z(t),await f(),a?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}}))},disabled:p,children:(0,t.jsx)(J.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))})]})]})})}function et(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function es(e){if(!e)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t}function er({open:e,onOpenChange:r,projectId:n,workspaceId:a,editVersion:i,defaultBaseBranch:l,projectLocalPath:o,onSuccess:d}){let{t:c}=(0,D.useI18n)(),m=!!i,[u,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[v,j]=(0,s.useState)(""),[b,N]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[k,T]=(0,s.useState)(""),[B,E]=(0,s.useState)(""),[I,L]=(0,s.useState)(""),[H,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)([]),[Z,en]=(0,s.useState)(!1),[ea,ei]=(0,s.useState)(!1),el=!!o,[eo,ed]=(0,s.useTransition)();return(0,s.useEffect)(()=>{e&&(i?(h(i.number),g(i.name),j(i.typeId??""),S(i.baseBranch??""),T(et(i.startDate)),E(et(i.targetDate)),L(i.description??"")):(h(""),g(""),j(""),S(l??""),T(""),E(""),L("")),J(!1))},[e,i,l]),(0,s.useEffect)(()=>{e&&W(a).then(N).catch(()=>N([]))},[e,a]),(0,s.useEffect)(()=>{e&&el?(en(!0),(0,Y.getProjectBranches)(o).then(X).catch(()=>X([])).finally(()=>en(!1)),(0,q.fetchRemoteBranches)(o).then(()=>(0,Y.getProjectBranches)(o).then(X)).catch(()=>{})):X([])},[e,el,o]),(0,t.jsxs)(O.Dialog,{open:e,onOpenChange:r,children:[(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:m?c("version.edit"):c("version.new")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-number",children:[c("version.field.number"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-number",value:u,onChange:e=>h(e.target.value),placeholder:c("version.placeholder.number"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-name",children:[c("version.field.name"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-name",value:f,onChange:e=>g(e.target.value),placeholder:c("version.placeholder.name"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.type")}),(0,t.jsxs)(P.Select,{value:v||"__none__",onValueChange:e=>{j(e&&"__none__"!==e?e:"")},children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",disabled:eo,children:(0,t.jsx)("span",{className:"truncate",children:v?b.find(e=>e.id===v)?.name??c("version.type.uncategorized"):c("version.type.uncategorized")})}),(0,t.jsxs)(P.SelectContent,{children:[(0,t.jsx)(P.SelectItem,{value:"__none__",children:c("version.type.uncategorized")}),b.map(e=>(0,t.jsx)(P.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-auto justify-start px-0 py-0.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>w(!0),disabled:eo,children:["+ ",c("version.manageTypes")]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.baseBranch")}),Z?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:c("task.branchLoading")}):el&&Q.length>0?(0,t.jsxs)(M.Popover,{open:ea,onOpenChange:ei,children:[(0,t.jsxs)(M.PopoverTrigger,{className:"flex h-8 w-full items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",disabled:eo,"data-testid":"version-branch-selector",children:[(0,t.jsx)(p.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:`flex-1 truncate text-left text-xs ${C?"font-mono":"text-muted-foreground"}`,title:C||void 0,children:C||c("version.field.noBranch")}),(0,t.jsx)($.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(M.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(F.Command,{children:[(0,t.jsx)(F.CommandInput,{placeholder:c("task.branchSearch")}),(0,t.jsxs)(F.CommandList,{children:[(0,t.jsx)(F.CommandEmpty,{children:c("task.branchNone")}),(0,t.jsxs)(F.CommandGroup,{children:[(0,t.jsxs)(F.CommandItem,{value:"__none__",onSelect:()=>{S(""),ei(!1)},children:[(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:c("version.field.noBranch")}),!C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]}),Q.map(e=>(0,t.jsxs)(F.CommandItem,{value:e,onSelect:()=>{S(e),ei(!1)},children:[(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]},e))]})]})]})})]}):(0,t.jsx)(A.Input,{id:"version-base-branch",value:C,onChange:e=>S(e.target.value),placeholder:"main",disabled:eo})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-start-date",children:c("version.field.startDate")}),(0,t.jsx)("input",{id:"version-start-date",type:"date",value:k,onChange:e=>T(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-target-date",children:c("version.field.targetDate")}),(0,t.jsx)("input",{id:"version-target-date",type:"date",value:B,onChange:e=>E(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-description",children:c("version.field.description")}),(0,t.jsx)(U.Textarea,{id:"version-description",value:I,onChange:e=>L(e.target.value),rows:3,disabled:eo})]}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(z.Switch,{id:"version-set-current",checked:H,onCheckedChange:J,disabled:eo}),(0,t.jsx)(V.Label,{htmlFor:"version-set-current",className:"cursor-pointer",children:c("version.field.setCurrent")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:eo,children:c("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{u.trim()&&f.trim()&&ed(async()=>{try{m&&i?await K(i.id,{number:u.trim(),name:f.trim(),typeId:v||null,baseBranch:C.trim()||null,startDate:es(k)??null,targetDate:es(B)??null,description:I.trim()||null}):await G({projectId:n,number:u.trim(),name:f.trim(),typeId:v||void 0,baseBranch:C.trim()||void 0,startDate:es(k),targetDate:es(B),description:I.trim()||void 0,setCurrent:H}),R.toast.success(m?c("version.edit"):c("version.new")),r(!1),d?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:eo||!u.trim()||!f.trim(),children:m?c("common.save"):c("common.create")})]})]}),(0,t.jsx)(ee,{open:y,onOpenChange:w,workspaceId:a,onChanged:()=>W(a).then(N)})]})}let en=(0,H.createServerReference)("6068a01925b71ab73203b8c19cf34e354c3114d375",H.callServer,void 0,H.findSourceMapURL,"releaseVersion");function ea({open:e,onOpenChange:r,version:n,candidates:a,onSuccess:i}){let{t:l}=(0,D.useI18n)(),[o,d]=(0,s.useState)(""),[c,m]=(0,s.useTransition)();(0,s.useEffect)(()=>{e&&d("")},[e,n]);let u=a.find(e=>e.id===o),p=a.length>0,h=p&&!!o&&!c;return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:l("version.releaseAction")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[n&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[n.number," · ",n.name]}),(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{children:l("version.release.rolloverHint")}),n?.unfinishedCount!==void 0&&n.unfinishedCount>0&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-foreground",children:["(",n.unfinishedCount,")"]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:l("version.release.nextVersion")}),p?(0,t.jsxs)(P.Select,{value:o,onValueChange:e=>{e&&d(e)},disabled:c,children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:u?`${u.number} \xb7 ${u.name}`:""})}),(0,t.jsx)(P.SelectContent,{children:a.map(e=>(0,t.jsxs)(P.SelectItem,{value:e.id,children:[e.number," · ",e.name]},e.id))})]}):(0,t.jsx)("p",{className:"text-xs text-destructive",children:l("version.release.noCandidates")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:c,children:l("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{n&&o&&m(async()=>{try{await en(n.id,o),R.toast.success(l("version.release")),r(!1),i?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:!h,children:l("version.release")})]})]})})}var ei=e.i(400355);let el=(0,H.createServerReference)("40499a10859014f48ea8ec5108bad8b253d6fc3007",H.callServer,void 0,H.findSourceMapURL,"getVersionDiff");var eo=e.i(196199);function ed({file:e}){let{t:r}=(0,D.useI18n)(),[n,a]=(0,s.useState)(!0),i=e.to&&"/dev/null"!==e.to?e.to:e.from??"",o=e.additions??0,d=e.deletions??0,c=[];for(let t of e.chunks)for(let e of(c.push({type:"normal",content:t.content,chunkHeader:t.content}),t.changes))c.push({type:e.type,content:e.content});let x=c.length>500,m=x?c.slice(0,500):c;return(0,t.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"flex w-full items-center gap-2 bg-muted/40 px-3 py-2 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${n?"rotate-90":""}`}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono text-[12px] font-medium text-foreground",children:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-emerald-400",children:["+",o]}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-rose-400",children:["−",d]})]}),n&&(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsx)("pre",{className:"m-0 p-0",children:m.map((e,s)=>void 0!==e.chunkHeader?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground bg-muted/40",children:e.content},s):"add"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-emerald-300 bg-emerald-500/10",children:e.content},s):"del"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-rose-300 bg-rose-500/10",children:e.content},s):(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground",children:e.content},s))}),x&&(0,t.jsx)("p",{className:"border-t border-border px-3 py-2 text-[11px] text-muted-foreground/70 italic",children:r("version.diff.truncated")})]})]})}function ec({open:e,onOpenChange:r,versionId:n,versionLabel:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useTransition)(),[d,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n&&(c(null),m(!1),o(async()=>{let e=await el(n);if(!e)return void m(!0);let t=(0,eo.parseUnifiedDiff)(e.patch);0===t.length||""===e.patch?m(!0):c(t)}))},[e,n]),(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-3xl max-h-[80vh] overflow-auto",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsxs)(O.DialogTitle,{children:[i("version.diff.title"),a?` — ${a}`:""]})}),l&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-muted-foreground",children:[(0,t.jsx)(ei.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:i("version.diff.loading")})]}),!l&&x&&(0,t.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:i("version.diff.empty")}),!l&&d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:d.map((e,s)=>(0,t.jsx)(ed,{file:e},s))})]})})}var ex=e.i(605005);function em({version:e,isFirst:s,isLast:r,dashed:n=!1,diffStat:a,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d}){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:["w-px flex-none",s?"h-0":"h-6",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].filter(Boolean).join(" ")}),(0,t.jsx)("div",{className:["z-10 h-3.5 w-3.5 flex-none rounded-full border-2",e.isCurrent?"border-primary bg-primary ring-2 ring-primary/30":"ACTIVE"===e.status?"border-emerald-400 bg-emerald-400":"RELEASED"===e.status?"border-zinc-500 bg-zinc-500":"border-muted-foreground/40 bg-transparent border-dashed"].join(" ")}),!r&&(0,t.jsx)("div",{className:["w-px flex-1",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].join(" ")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsx)(L,{version:e,diffStat:a??null,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d})})]})}e.s(["VersionTimelineClient",0,function({project:e,workspaceId:d,versions:u,diffStats:p,backlog:h}){let f,{t:g}=(0,D.useI18n)(),v=(0,r.useRouter)(),[j,b]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[S,k]=(0,s.useState)(!1),[T,B]=(0,s.useState)(null),[E,L]=(0,s.useState)(null),[R,_]=(0,s.useState)(null),[$,O]=(0,s.useState)(!1),A=[...[...u.filter(e=>"RELEASED"!==e.status)].sort((e,t)=>{if(!e.targetDate&&!t.targetDate)return 0;if(!e.targetDate)return 1;if(!t.targetDate)return -1;let s=new Date(t.targetDate).getTime()-new Date(e.targetDate).getTime();return 0!==s?s:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}),...[...u.filter(e=>"RELEASED"===e.status)].sort((e,t)=>e.releasedAt||t.releasedAt?e.releasedAt?t.releasedAt?new Date(t.releasedAt).getTime()-new Date(e.releasedAt).getTime():-1:1:0)],V=e=>{let t=u.find(t=>t.id===e);t&&(y({id:t.id,number:t.number,name:t.name,typeId:t.typeId??null,baseBranch:t.baseBranch,startDate:t.startDate,targetDate:t.targetDate,description:t.description}),b(!0))},P=e=>{let t=u.find(t=>t.id===e);t&&(B(t),k(!0))},M=e=>{L(e)},F=()=>{y(null),b(!0)},z=()=>{v.refresh()},U=T?u.filter(e=>e.id!==T.id&&("PLANNED"===e.status||"ACTIVE"===e.status)).map(e=>({id:e.id,number:e.number,name:e.name})):[],H=T?T.tasks.filter(e=>"DONE"!==e.status&&"CANCELLED"!==e.status).length:void 0;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-xl flex shrink-0 items-center gap-4 border-b px-6",children:[(0,t.jsxs)(n.default,{href:`/workspaces/${d}`,className:"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(o.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:g("archive.backToBoard")})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("span",{children:g("version.timeline")})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:()=>C(!0),children:[(0,t.jsx)(c,{className:"h-4 w-4"}),g("version.manageTypes")]}),(0,t.jsxs)(x.Button,{onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),(0,t.jsx)(m.ScrollArea,{className:"min-h-0 flex-1",children:(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl",children:[0===u.length&&0===h.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-20 text-center text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:g("version.empty.list")}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),A.length>0&&(0,t.jsx)("div",{className:"relative",children:A.map((e,s)=>(0,t.jsx)(em,{version:e,isFirst:0===s,isLast:s===A.length-1&&0===h.length,diffStat:p[e.id],onEdit:V,onRelease:P,onViewDiff:M,onOpenTaskDetail:_},e.id))}),h.length>0&&(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:"h-6 w-px bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]"}),(0,t.jsx)("div",{className:"z-10 h-3.5 w-3.5 flex-none rounded-full border-2 border-dashed border-muted-foreground/40 bg-transparent"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-[14px] border border-dashed bg-muted/40 shadow-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>O(e=>!e),className:"w-full px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${$?"rotate-90":""}`}),(0,t.jsx)(i.Archive,{className:"h-4 w-4 flex-none text-muted-foreground/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:g("version.history")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:g("version.historySub")}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"text-[11.5px] text-muted-foreground",children:[h.length," ",g("version.tasksCount")]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),$&&(0,t.jsx)("div",{className:"border-t border-dashed border-border px-2 pb-2 pt-1.5",children:h.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:_},e.id))})]})})]})]})})}),(0,t.jsx)(er,{open:j,onOpenChange:e=>{b(e),e||y(null)},projectId:e.id,workspaceId:d,editVersion:N,defaultBaseBranch:null,projectLocalPath:e.localPath,onSuccess:z}),(0,t.jsx)(ee,{open:w,onOpenChange:C,workspaceId:d,onChanged:()=>v.refresh()}),(0,t.jsx)(ea,{open:S,onOpenChange:e=>{k(e),e||B(null)},version:T?{id:T.id,number:T.number,name:T.name,unfinishedCount:H}:null,candidates:U,onSuccess:z}),(0,t.jsx)(ec,{open:!!E,onOpenChange:e=>{e||L(null)},versionId:E,versionLabel:E&&(f=u.find(e=>e.id===E))?`${f.number} ${f.name}`:void 0}),(0,t.jsx)(ex.TaskOverviewDrawer,{open:!!R,onOpenChange:e=>{e||_(null)},taskId:R})]})}],645119)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645119,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(538059),n=e.i(210702),a=e.i(232545),i=e.i(487278),l=e.i(368490),o=e.i(259846),d=e.i(572989);let c=(0,d.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(519455),m=e.i(759684),u=e.i(606393),p=e.i(226145),h=e.i(340873),f=e.i(263938),g=e.i(960518),v=e.i(453889),j=e.i(645378);let b=(0,d.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var N=e.i(464249);let y=(0,d.default)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]),w=(0,d.default)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var C=e.i(746798),S=e.i(685149),k=e.i(35967),D=e.i(533499);function T(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${r}`}let B=Object.fromEntries(S.BOARD_COLUMNS.map(e=>[e.id,e.color]));function E({children:e,className:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground ${s??""}`,children:e})}function I({task:e,onOpenDetail:r}){let{t:n}=(0,D.useI18n)(),[a,i]=(0,s.useState)(!1),o="CANCELLED"===e.status?"text-muted-foreground line-through decoration-muted-foreground/40":"DONE"===e.status?"text-muted-foreground":"text-foreground";return(0,t.jsxs)("div",{className:"rounded-[10px]",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-2.5 rounded-[10px] px-2.5 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${a?"rotate-90":""}`}),(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:`text-[13.5px] font-medium ${o}`,children:e.title}),e.labels.map(({label:e})=>(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-px text-[10.5px] text-muted-foreground",style:e.color?{borderColor:e.color+"55",color:e.color}:void 0,children:e.name},e.id)),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"flex w-16 flex-none justify-center",children:(0,t.jsx)("span",{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-bold ${S.PRIORITY_CONFIG[e.priority]?.color??S.PRIORITY_CONFIG.LOW.color}`,children:e.priority})}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsxs)("span",{className:"flex w-[72px] flex-none items-center gap-1.5",children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:"truncate text-[10.5px] text-muted-foreground",children:n(`version.taskStatus.${e.status}`)})]}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsx)("span",{className:"flex w-6 flex-none justify-center",children:r&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:t=>{t.stopPropagation(),r(e.id)}}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:n("version.detail")})]})})]}),a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 pb-3 pl-[30px] pr-3 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.FolderOpen,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.resources")})]}),0===e.assets.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.resources")}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.assets.map(e=>{var s;let r=e.mimeType?.startsWith("image/");return(0,t.jsxs)("span",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground shadow-sm transition-colors hover:border-primary/50",children:[r?(0,t.jsx)(b,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(j.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:e.filename}),null!=e.size&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60",children:(s=e.size)<1024?`${s} B`:s<1048576?`${Math.round(s/1024)} KB`:`${(s/1048576).toFixed(1)} MB`})]},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(j.FileText,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.notes")})]}),0===e.notes.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.notes")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.notes.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-border border-l-violet-500/50 bg-background px-2.5 py-2 shadow-sm [border-left-width:3px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-foreground",children:e.title}),e.category&&(0,t.jsx)("span",{className:"rounded-[5px] border border-violet-500/30 bg-violet-500/15 px-1.5 py-px text-[10px] font-bold text-violet-300",children:e.category})]})},e.id))})]})]})]})}function L({version:e,diffStat:r,onEdit:n,onRelease:a,onViewDiff:i,onOpenTaskDetail:o}){var d;let c,{t:m}=(0,D.useI18n)(),[v,j]=(0,s.useState)(e.isCurrent),b="RELEASED"===e.status,w="ACTIVE"===e.status,S=e.tasks.length,B=e.tasks.filter(e=>"DONE"===e.status).length,R=!!(e.releaseCommit||r),_=(c=`${S} ${m("version.tasksCount")}`,B>0&&B<S?`${c} \xb7 ${B} ${m("version.doneCount")}`:B>0&&B===S?`${c} \xb7 ${m("version.allDone")}`:c);return(0,t.jsxs)("div",{className:["overflow-hidden rounded-[14px] border bg-card shadow-sm transition-shadow duration-150 hover:shadow-md",e.isCurrent?"border-border border-l-2 border-l-primary ring-1 ring-primary/20":"border-border",b?"opacity-[.96]":""].filter(Boolean).join(" "),children:[(0,t.jsx)("button",{type:"button",onClick:()=>j(e=>!e),className:"w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsxs)("div",{className:"px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(l.ChevronRight,{className:`h-4 w-4 flex-none text-muted-foreground/60 transition-transform duration-150 ${v?"rotate-90":""}`}),(0,t.jsx)("span",{className:"font-mono text-[14.5px] font-bold text-foreground",children:e.number}),(0,t.jsx)("span",{className:"text-[14.5px] font-semibold text-foreground",children:e.name}),(0,t.jsx)(k.VersionTypeBadge,{name:e.type?.name??null}),(0,t.jsx)(k.VersionStatusBadge,{status:e.status}),e.isCurrent&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/15 px-2.5 py-0.5 text-[11px] font-bold text-primary shadow-sm",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-primary opacity-90"}),m("version.current")]}),(0,t.jsx)("span",{className:"flex-1"}),S>0&&(0,t.jsx)("span",{className:"text-[11.5px] text-muted-foreground",children:_}),(0,t.jsxs)("span",{className:"flex items-center gap-1",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[n&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>n(e.id)}),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:m("version.edit")})]}),w&&a&&(0,t.jsxs)(x.Button,{variant:"outline",className:"h-7 px-2 text-xs font-semibold",onClick:()=>a(e.id),children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5"}),m("version.release")]})]})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[b&&e.releasedAt?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),m("version.releasedAt"),(0,t.jsx)("strong",{className:"text-foreground",children:T(e.releasedAt)})]}):e.startDate||e.targetDate?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),e.startDate?T(e.startDate):"—"," → ",e.targetDate?(0,t.jsx)("strong",{className:"text-foreground",children:T(e.targetDate)}):"—"]}):null,e.baseBranch&&(0,t.jsxs)(E,{children:[(0,t.jsx)(p.GitBranch,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.baseBranch})]}),e.baseCommit&&(0,t.jsxs)(E,{children:[(0,t.jsx)(h.GitCommitHorizontal,{className:"h-3 w-3"}),m("version.field.baseCommit"),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:(d=e.baseCommit)?d.slice(0,7):""})]}),b&&(0,t.jsxs)(E,{children:[(0,t.jsx)(f.Tag,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.number})]}),r&&(0,t.jsxs)(E,{children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),!b&&(0,t.jsx)("span",{className:"text-muted-foreground",children:m("version.diff.live")}),(0,t.jsxs)("span",{className:"font-bold text-emerald-400",children:["+",r.additions.toLocaleString()]}),(0,t.jsxs)("span",{className:"font-bold text-rose-400",children:["−",r.deletions.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["· ",r.files," ",m("version.diff.files")]})]}),R&&i&&(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),m("version.diff.view")," →"]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:e.description})]})}),v&&S>0&&(0,t.jsx)("div",{className:"border-t border-dashed border-border bg-muted/40 px-2 pb-2 pt-1.5",children:e.tasks.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:o},e.id))})]})}var R=e.i(360112),_=e.i(597746),$=e.i(456346),O=e.i(776639),A=e.i(793479),V=e.i(110204),P=e.i(280027),M=e.i(337822),F=e.i(317056),z=e.i(699375),U=e.i(624687),H=e.i(514798);let G=(0,H.createServerReference)("401d229feefc4e2d103c4dc434232660d8f7f16ffc",H.callServer,void 0,H.findSourceMapURL,"createVersion"),K=(0,H.createServerReference)("608800938e4a0f56bc384158467b8bffbefecb15c0",H.callServer,void 0,H.findSourceMapURL,"updateVersion"),W=(0,H.createServerReference)("4032d571cfac26fccc236b64f8c65328886d7f6cc0",H.callServer,void 0,H.findSourceMapURL,"getVersionTypes");var Y=e.i(650059),q=e.i(812822),J=e.i(998626);let Q=(0,H.createServerReference)("4021c0128f02653d7b83e2f3fc0d55e29e6fbd6654",H.callServer,void 0,H.findSourceMapURL,"createVersionType"),X=(0,H.createServerReference)("60f1dd8fe5645bf33eb54950e8118ad0b3277ae1a9",H.callServer,void 0,H.findSourceMapURL,"updateVersionType"),Z=(0,H.createServerReference)("40ad3d288cf0041cc6b722313eee99caed9aa51258",H.callServer,void 0,H.findSourceMapURL,"deleteVersionType");function ee({open:e,onOpenChange:r,workspaceId:n,onChanged:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useState)([]),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)({}),[p,h]=(0,s.useTransition)(),f=async()=>{let e=await W(n);o(e),u(t=>{let s={};return e.forEach(e=>{s[e.id]=e.id in t?t[e.id]:e.name}),s})};(0,s.useEffect)(()=>{e&&(f(),c(""))},[e,n]);let g=()=>{let e=d.trim();e&&h(async()=>{try{await Q({workspaceId:n,name:e}),c(""),await f(),a?.(),R.toast.success(i("version.type.add"))}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})};return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:i("version.manageTypes")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(A.Input,{value:d,onChange:e=>c(e.target.value),placeholder:i("version.type.namePlaceholder"),disabled:p,onKeyDown:e=>{"Enter"===e.key&&g()},className:"flex-1"}),(0,t.jsx)(x.Button,{onClick:g,disabled:p||!d.trim(),children:i("version.type.add")})]}),0===l.length?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground py-4",children:i("version.type.empty")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:l.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("span",{className:`inline-flex h-2.5 w-2.5 flex-none rounded-full ${(0,k.typeBadgeColor)(m[e.id]??e.name).split(" ").filter(e=>e.startsWith("bg-"))[0]??"bg-muted"}`}),(0,t.jsx)(A.Input,{value:m[e.id]??e.name,onChange:t=>u(s=>({...s,[e.id]:t.target.value})),onBlur:()=>(e=>{let t=(m[e]??"").trim();if(!t)return;let s=l.find(t=>t.id===e);s?.name!==t&&h(async()=>{try{await X(e,{name:t}),await f(),a?.()}catch(t){R.toast.error(t instanceof Error?t.message:String(t)),u(t=>({...t,[e]:s?.name??""}))}})})(e.id),onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:p,className:"h-7 flex-1 border-transparent bg-transparent shadow-none focus-visible:border-input focus-visible:bg-background focus-visible:shadow-sm"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-none text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void(window.confirm(i("version.type.deleteConfirm"))&&h(async()=>{try{await Z(t),await f(),a?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}}))},disabled:p,children:(0,t.jsx)(J.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))})]})]})})}function et(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function es(e){if(!e)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t}function er({open:e,onOpenChange:r,projectId:n,workspaceId:a,editVersion:i,defaultBaseBranch:l,projectLocalPath:o,onSuccess:d}){let{t:c}=(0,D.useI18n)(),m=!!i,[u,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[v,j]=(0,s.useState)(""),[b,N]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[k,T]=(0,s.useState)(""),[B,E]=(0,s.useState)(""),[I,L]=(0,s.useState)(""),[H,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)([]),[Z,en]=(0,s.useState)(!1),[ea,ei]=(0,s.useState)(!1),el=!!o,[eo,ed]=(0,s.useTransition)();return(0,s.useEffect)(()=>{e&&(i?(h(i.number),g(i.name),j(i.typeId??""),S(i.baseBranch??""),T(et(i.startDate)),E(et(i.targetDate)),L(i.description??"")):(h(""),g(""),j(""),S(l??""),T(""),E(""),L("")),J(!1))},[e,i,l]),(0,s.useEffect)(()=>{e&&W(a).then(N).catch(()=>N([]))},[e,a]),(0,s.useEffect)(()=>{e&&el?(en(!0),(0,Y.getProjectBranches)(o).then(X).catch(()=>X([])).finally(()=>en(!1)),(0,q.fetchRemoteBranches)(o).then(()=>(0,Y.getProjectBranches)(o).then(X)).catch(()=>{})):X([])},[e,el,o]),(0,t.jsxs)(O.Dialog,{open:e,onOpenChange:r,children:[(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:m?c("version.edit"):c("version.new")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-number",children:[c("version.field.number"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-number",value:u,onChange:e=>h(e.target.value),placeholder:c("version.placeholder.number"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-name",children:[c("version.field.name"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-name",value:f,onChange:e=>g(e.target.value),placeholder:c("version.placeholder.name"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.type")}),(0,t.jsxs)(P.Select,{value:v||"__none__",onValueChange:e=>{j(e&&"__none__"!==e?e:"")},children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",disabled:eo,children:(0,t.jsx)("span",{className:"truncate",children:v?b.find(e=>e.id===v)?.name??c("version.type.uncategorized"):c("version.type.uncategorized")})}),(0,t.jsxs)(P.SelectContent,{children:[(0,t.jsx)(P.SelectItem,{value:"__none__",children:c("version.type.uncategorized")}),b.map(e=>(0,t.jsx)(P.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-auto justify-start px-0 py-0.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>w(!0),disabled:eo,children:["+ ",c("version.manageTypes")]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.baseBranch")}),Z?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:c("task.branchLoading")}):el&&Q.length>0?(0,t.jsxs)(M.Popover,{open:ea,onOpenChange:ei,children:[(0,t.jsxs)(M.PopoverTrigger,{className:"flex h-8 w-full items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",disabled:eo,"data-testid":"version-branch-selector",children:[(0,t.jsx)(p.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:`flex-1 truncate text-left text-xs ${C?"font-mono":"text-muted-foreground"}`,title:C||void 0,children:C||c("version.field.noBranch")}),(0,t.jsx)($.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(M.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(F.Command,{children:[(0,t.jsx)(F.CommandInput,{placeholder:c("task.branchSearch")}),(0,t.jsxs)(F.CommandList,{children:[(0,t.jsx)(F.CommandEmpty,{children:c("task.branchNone")}),(0,t.jsxs)(F.CommandGroup,{children:[(0,t.jsxs)(F.CommandItem,{value:"__none__",onSelect:()=>{S(""),ei(!1)},children:[(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:c("version.field.noBranch")}),!C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]}),Q.map(e=>(0,t.jsxs)(F.CommandItem,{value:e,onSelect:()=>{S(e),ei(!1)},children:[(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]},e))]})]})]})})]}):(0,t.jsx)(A.Input,{id:"version-base-branch",value:C,onChange:e=>S(e.target.value),placeholder:"main",disabled:eo})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-start-date",children:c("version.field.startDate")}),(0,t.jsx)("input",{id:"version-start-date",type:"date",value:k,onChange:e=>T(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-target-date",children:c("version.field.targetDate")}),(0,t.jsx)("input",{id:"version-target-date",type:"date",value:B,onChange:e=>E(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-description",children:c("version.field.description")}),(0,t.jsx)(U.Textarea,{id:"version-description",value:I,onChange:e=>L(e.target.value),rows:3,disabled:eo})]}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(z.Switch,{id:"version-set-current",checked:H,onCheckedChange:J,disabled:eo}),(0,t.jsx)(V.Label,{htmlFor:"version-set-current",className:"cursor-pointer",children:c("version.field.setCurrent")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:eo,children:c("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{u.trim()&&f.trim()&&ed(async()=>{try{m&&i?await K(i.id,{number:u.trim(),name:f.trim(),typeId:v||null,baseBranch:C.trim()||null,startDate:es(k)??null,targetDate:es(B)??null,description:I.trim()||null}):await G({projectId:n,number:u.trim(),name:f.trim(),typeId:v||void 0,baseBranch:C.trim()||void 0,startDate:es(k),targetDate:es(B),description:I.trim()||void 0,setCurrent:H}),R.toast.success(m?c("version.edit"):c("version.new")),r(!1),d?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:eo||!u.trim()||!f.trim(),children:m?c("common.save"):c("common.create")})]})]}),(0,t.jsx)(ee,{open:y,onOpenChange:w,workspaceId:a,onChanged:()=>W(a).then(N)})]})}let en=(0,H.createServerReference)("609d3d7177804ef8e588c8cd4249e7ee72343aae94",H.callServer,void 0,H.findSourceMapURL,"releaseVersion");function ea({open:e,onOpenChange:r,version:n,candidates:a,onSuccess:i}){let{t:l}=(0,D.useI18n)(),[o,d]=(0,s.useState)(""),[c,m]=(0,s.useTransition)();(0,s.useEffect)(()=>{e&&d("")},[e,n]);let u=a.find(e=>e.id===o),p=a.length>0,h=p&&!!o&&!c;return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:l("version.releaseAction")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[n&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[n.number," · ",n.name]}),(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{children:l("version.release.rolloverHint")}),n?.unfinishedCount!==void 0&&n.unfinishedCount>0&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-foreground",children:["(",n.unfinishedCount,")"]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:l("version.release.nextVersion")}),p?(0,t.jsxs)(P.Select,{value:o,onValueChange:e=>{e&&d(e)},disabled:c,children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:u?`${u.number} \xb7 ${u.name}`:""})}),(0,t.jsx)(P.SelectContent,{children:a.map(e=>(0,t.jsxs)(P.SelectItem,{value:e.id,children:[e.number," · ",e.name]},e.id))})]}):(0,t.jsx)("p",{className:"text-xs text-destructive",children:l("version.release.noCandidates")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:c,children:l("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{n&&o&&m(async()=>{try{await en(n.id,o),R.toast.success(l("version.release")),r(!1),i?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:!h,children:l("version.release")})]})]})})}var ei=e.i(400355);let el=(0,H.createServerReference)("400acfd4453438b3dc8e26e66b3d3e970ba5b16a93",H.callServer,void 0,H.findSourceMapURL,"getVersionDiff");var eo=e.i(196199);function ed({file:e}){let{t:r}=(0,D.useI18n)(),[n,a]=(0,s.useState)(!0),i=e.to&&"/dev/null"!==e.to?e.to:e.from??"",o=e.additions??0,d=e.deletions??0,c=[];for(let t of e.chunks)for(let e of(c.push({type:"normal",content:t.content,chunkHeader:t.content}),t.changes))c.push({type:e.type,content:e.content});let x=c.length>500,m=x?c.slice(0,500):c;return(0,t.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"flex w-full items-center gap-2 bg-muted/40 px-3 py-2 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${n?"rotate-90":""}`}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono text-[12px] font-medium text-foreground",children:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-emerald-400",children:["+",o]}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-rose-400",children:["−",d]})]}),n&&(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsx)("pre",{className:"m-0 p-0",children:m.map((e,s)=>void 0!==e.chunkHeader?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground bg-muted/40",children:e.content},s):"add"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-emerald-300 bg-emerald-500/10",children:e.content},s):"del"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-rose-300 bg-rose-500/10",children:e.content},s):(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground",children:e.content},s))}),x&&(0,t.jsx)("p",{className:"border-t border-border px-3 py-2 text-[11px] text-muted-foreground/70 italic",children:r("version.diff.truncated")})]})]})}function ec({open:e,onOpenChange:r,versionId:n,versionLabel:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useTransition)(),[d,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n&&(c(null),m(!1),o(async()=>{let e=await el(n);if(!e)return void m(!0);let t=(0,eo.parseUnifiedDiff)(e.patch);0===t.length||""===e.patch?m(!0):c(t)}))},[e,n]),(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-3xl max-h-[80vh] overflow-auto",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsxs)(O.DialogTitle,{children:[i("version.diff.title"),a?` — ${a}`:""]})}),l&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-muted-foreground",children:[(0,t.jsx)(ei.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:i("version.diff.loading")})]}),!l&&x&&(0,t.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:i("version.diff.empty")}),!l&&d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:d.map((e,s)=>(0,t.jsx)(ed,{file:e},s))})]})})}var ex=e.i(605005);function em({version:e,isFirst:s,isLast:r,dashed:n=!1,diffStat:a,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d}){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:["w-px flex-none",s?"h-0":"h-6",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].filter(Boolean).join(" ")}),(0,t.jsx)("div",{className:["z-10 h-3.5 w-3.5 flex-none rounded-full border-2",e.isCurrent?"border-primary bg-primary ring-2 ring-primary/30":"ACTIVE"===e.status?"border-emerald-400 bg-emerald-400":"RELEASED"===e.status?"border-zinc-500 bg-zinc-500":"border-muted-foreground/40 bg-transparent border-dashed"].join(" ")}),!r&&(0,t.jsx)("div",{className:["w-px flex-1",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].join(" ")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsx)(L,{version:e,diffStat:a??null,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d})})]})}e.s(["VersionTimelineClient",0,function({project:e,workspaceId:d,versions:u,diffStats:p,backlog:h}){let f,{t:g}=(0,D.useI18n)(),v=(0,r.useRouter)(),[j,b]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[S,k]=(0,s.useState)(!1),[T,B]=(0,s.useState)(null),[E,L]=(0,s.useState)(null),[R,_]=(0,s.useState)(null),[$,O]=(0,s.useState)(!1),A=[...[...u.filter(e=>"RELEASED"!==e.status)].sort((e,t)=>{if(!e.targetDate&&!t.targetDate)return 0;if(!e.targetDate)return 1;if(!t.targetDate)return -1;let s=new Date(t.targetDate).getTime()-new Date(e.targetDate).getTime();return 0!==s?s:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}),...[...u.filter(e=>"RELEASED"===e.status)].sort((e,t)=>e.releasedAt||t.releasedAt?e.releasedAt?t.releasedAt?new Date(t.releasedAt).getTime()-new Date(e.releasedAt).getTime():-1:1:0)],V=e=>{let t=u.find(t=>t.id===e);t&&(y({id:t.id,number:t.number,name:t.name,typeId:t.typeId??null,baseBranch:t.baseBranch,startDate:t.startDate,targetDate:t.targetDate,description:t.description}),b(!0))},P=e=>{let t=u.find(t=>t.id===e);t&&(B(t),k(!0))},M=e=>{L(e)},F=()=>{y(null),b(!0)},z=()=>{v.refresh()},U=T?u.filter(e=>e.id!==T.id&&("PLANNED"===e.status||"ACTIVE"===e.status)).map(e=>({id:e.id,number:e.number,name:e.name})):[],H=T?T.tasks.filter(e=>"DONE"!==e.status&&"CANCELLED"!==e.status).length:void 0;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-xl flex shrink-0 items-center gap-4 border-b px-6",children:[(0,t.jsxs)(n.default,{href:`/workspaces/${d}`,className:"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(o.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:g("archive.backToBoard")})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("span",{children:g("version.timeline")})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:()=>C(!0),children:[(0,t.jsx)(c,{className:"h-4 w-4"}),g("version.manageTypes")]}),(0,t.jsxs)(x.Button,{onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),(0,t.jsx)(m.ScrollArea,{className:"min-h-0 flex-1",children:(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl",children:[0===u.length&&0===h.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-20 text-center text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:g("version.empty.list")}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),A.length>0&&(0,t.jsx)("div",{className:"relative",children:A.map((e,s)=>(0,t.jsx)(em,{version:e,isFirst:0===s,isLast:s===A.length-1&&0===h.length,diffStat:p[e.id],onEdit:V,onRelease:P,onViewDiff:M,onOpenTaskDetail:_},e.id))}),h.length>0&&(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:"h-6 w-px bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]"}),(0,t.jsx)("div",{className:"z-10 h-3.5 w-3.5 flex-none rounded-full border-2 border-dashed border-muted-foreground/40 bg-transparent"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-[14px] border border-dashed bg-muted/40 shadow-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>O(e=>!e),className:"w-full px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${$?"rotate-90":""}`}),(0,t.jsx)(i.Archive,{className:"h-4 w-4 flex-none text-muted-foreground/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:g("version.history")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:g("version.historySub")}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"text-[11.5px] text-muted-foreground",children:[h.length," ",g("version.tasksCount")]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),$&&(0,t.jsx)("div",{className:"border-t border-dashed border-border px-2 pb-2 pt-1.5",children:h.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:_},e.id))})]})})]})]})})}),(0,t.jsx)(er,{open:j,onOpenChange:e=>{b(e),e||y(null)},projectId:e.id,workspaceId:d,editVersion:N,defaultBaseBranch:null,projectLocalPath:e.localPath,onSuccess:z}),(0,t.jsx)(ee,{open:w,onOpenChange:C,workspaceId:d,onChanged:()=>v.refresh()}),(0,t.jsx)(ea,{open:S,onOpenChange:e=>{k(e),e||B(null)},version:T?{id:T.id,number:T.number,name:T.name,unfinishedCount:H}:null,candidates:U,onSuccess:z}),(0,t.jsx)(ec,{open:!!E,onOpenChange:e=>{e||L(null)},versionId:E,versionLabel:E&&(f=u.find(e=>e.id===E))?`${f.number} ${f.name}`:void 0}),(0,t.jsx)(ex.TaskOverviewDrawer,{open:!!R,onOpenChange:e=>{e||_(null)},taskId:R})]})}],645119)}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98577,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40117712ad7408641fee51911c6a78855c43a16445",t.callServer,void 0,t.findSourceMapURL,"createTask");e.s(["createTask",0,r])},456346,317056,650059,812822,e=>{"use strict";let t,r,n,a=(0,e.i(572989).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,a],456346);var o,i,l,u,s,c,d,f,p,m=e.i(289721),v=/[\\\/_+.#"@\[\(\{&]/,h=/[\\\/_+.#"@\[\(\{&]/g,g=/[\s-]/,b=/[\s-]/g;function y(e){return e.toLowerCase().replace(b," ")}var x=e.i(965652);function E(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function w(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function C(...e){return t=>{let r=!1,n=e.map(e=>{let n=w(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():w(e[t],null)}}}}function k(...e){return x.useCallback(C(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var S=globalThis?.document?x.useLayoutEffect:()=>{},N=x[" useId ".trim().toString()]||(()=>void 0),j=0;function R(e){let[t,r]=x.useState(N());return S(()=>{e||r(e=>e??String(j++))},[e]),e||(t?`radix-${t}`:"")}x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var I=x[" useInsertionEffect ".trim().toString()]||S;Symbol("RADIX:SYNC_STATE");var D=e.i(585012);function P(e){var t;let r,n=(t=e,(r=x.forwardRef((e,t)=>{let{children:r,...n}=e;if(x.isValidElement(r)){var a;let e,o,i=(a=r,(o=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(o=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),l=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==x.Fragment&&(l.ref=t?C(t,i):i),x.cloneElement(r,l)}return x.Children.count(r)>1?x.Children.only(null):null})).displayName=`${t}.SlotClone`,r),a=x.forwardRef((e,t)=>{let{children:r,...a}=e,o=x.Children.toArray(r),i=o.find(A);if(i){let e=i.props.children,r=o.map(t=>t!==i?t:x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null);return(0,m.jsx)(n,{...a,ref:t,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,m.jsx)(n,{...a,ref:t,children:r})});return a.displayName=`${e}.Slot`,a}var M=Symbol("radix.slottable");function A(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===M}var O=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=P(`Primitive.${t}`),n=x.forwardRef((e,n)=>{let{asChild:a,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(a?r:t,{...o,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function L(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var T="dismissableLayer.update",_=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...u}=e,s=x.useContext(_),[c,d]=x.useState(null),p=c?.ownerDocument??globalThis?.document,[,v]=x.useState({}),h=k(t,e=>d(e)),g=Array.from(s.layers),[b]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(b),w=c?g.indexOf(c):-1,C=s.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,N=function(e,t=globalThis?.document){let r=L(e),n=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){W("dismissableLayer.pointerDownOutside",r,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...s.branches].some(e=>e.contains(t));S&&!r&&(a?.(e),i?.(e),e.defaultPrevented||l?.())},p),j=function(e,t=globalThis?.document){let r=L(e),n=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!n.current&&W("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let t=e.target;![...s.branches].some(e=>e.contains(t))&&(o?.(e),i?.(e),e.defaultPrevented||l?.())},p);return!function(e,t=globalThis?.document){let r=L(e);x.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===s.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),x.useEffect(()=>{if(c)return r&&(0===s.layersWithOutsidePointerEventsDisabled.size&&(f=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(c)),s.layers.add(c),F(),()=>{r&&1===s.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=f)}},[c,p,r,s]),x.useEffect(()=>()=>{c&&(s.layers.delete(c),s.layersWithOutsidePointerEventsDisabled.delete(c),F())},[c,s]),x.useEffect(()=>{let e=()=>v({});return document.addEventListener(T,e),()=>document.removeEventListener(T,e)},[]),(0,m.jsx)(O.div,{...u,ref:h,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,j.onFocusCapture),onBlurCapture:E(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,N.onPointerDownCapture)})});function F(){let e=new CustomEvent(T);document.dispatchEvent(e)}function W(e,t,r,{discrete:n}){let a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&a.addEventListener(e,t,{once:!0}),n)a&&D.flushSync(()=>a.dispatchEvent(o));else a.dispatchEvent(o)}$.displayName="DismissableLayer",x.forwardRef((e,t)=>{let r=x.useContext(_),n=x.useRef(null),a=k(t,n);return x.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,m.jsx)(O.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var B="focusScope.autoFocusOnMount",U="focusScope.autoFocusOnUnmount",z={bubbles:!1,cancelable:!0},K=x.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[l,u]=x.useState(null),s=L(a),c=L(o),d=x.useRef(null),f=k(t,e=>u(e)),p=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||q(d.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(l)});return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,l,p.paused]),x.useEffect(()=>{if(l){Y.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(B,z);l.addEventListener(B,s),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(q(n,{select:t}),document.activeElement!==r)return}(V(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&q(l))}return()=>{l.removeEventListener(B,s),setTimeout(()=>{let t=new CustomEvent(U,z);l.addEventListener(U,c),l.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),l.removeEventListener(U,c),Y.remove(p)},0)}}},[l,s,c,p]);let v=x.useCallback(e=>{if(!r&&!n||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){var o;let t,n=e.currentTarget,[i,l]=[H(t=V(o=n),o),H(t.reverse(),o)];i&&l?e.shiftKey||a!==l?e.shiftKey&&a===i&&(e.preventDefault(),r&&q(l,{select:!0})):(e.preventDefault(),r&&q(i,{select:!0})):a===n&&e.preventDefault()}},[r,n,p.paused]);return(0,m.jsx)(O.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});function V(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function H(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function q(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}K.displayName="FocusScope";var Y=(n=[],{add(e){let t=n[0];e!==t&&t?.pause(),(n=G(n,e)).unshift(e)},remove(e){n=G(n,e),n[0]?.resume()}});function G(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var X=x.forwardRef((e,t)=>{let{container:r,...n}=e,[a,o]=x.useState(!1);S(()=>o(!0),[]);let i=r||a&&globalThis?.document?.body;return i?D.default.createPortal((0,m.jsx)(O.div,{...n,ref:t}),i):null});X.displayName="Portal";var Z=e=>{var t;let r,n,{present:a,children:o}=e,i=function(e){var t,r;let[n,a]=x.useState(),o=x.useRef(null),i=x.useRef(e),l=x.useRef("none"),[u,s]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>r[e][t]??e,t));return x.useEffect(()=>{let e=J(o.current);l.current="mounted"===u?e:"none"},[u]),S(()=>{let t=o.current,r=i.current;if(r!==e){let n=l.current,a=J(t);e?s("MOUNT"):"none"===a||t?.display==="none"?s("UNMOUNT"):r&&n!==a?s("ANIMATION_OUT"):s("UNMOUNT"),i.current=e}},[e,s]),S(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=J(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(s("ANIMATION_END"),!i.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(l.current=J(o.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(e=>{o.current=e?getComputedStyle(e):null,a(e)},[])}}(a),l="function"==typeof o?o({present:i.isPresent}):x.Children.only(o),u=k(i.ref,(t=l,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||i.isPresent?x.cloneElement(l,{ref:u}):null};function J(e){return e?.animationName||"none"}Z.displayName="Presence";var Q=0;function ee(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var et=function(){return(et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function er(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var en=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),ea="width-before-scroll-bar";function eo(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ei="u">typeof window?x.useLayoutEffect:x.useEffect,el=new WeakMap,eu=(void 0===o&&(o={}),(void 0===i&&(i=function(e){return e}),l=[],u=!1,s={read:function(){if(u)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:null},useMedium:function(e){var t=i(e,u);return l.push(t),function(){l=l.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(u=!0;l.length;){var t=l;l=[],t.forEach(e)}l={push:function(t){return e(t)},filter:function(){return l}}},assignMedium:function(e){u=!0;var t=[];if(l.length){var r=l;l=[],r.forEach(e),t=l}var n=function(){var r=t;t=[],r.forEach(e)},a=function(){return Promise.resolve().then(n)};a(),l={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),l}}}}).options=et({async:!0,ssr:!1},o),s),es=function(){},ec=x.forwardRef(function(e,t){var r,n,a,o,i=x.useRef(null),l=x.useState({onScrollCapture:es,onWheelCapture:es,onTouchMoveCapture:es}),u=l[0],s=l[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,v=e.shards,h=e.sideCar,g=e.noRelative,b=e.noIsolation,y=e.inert,E=e.allowPinchZoom,w=e.as,C=e.gapMode,k=er(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=(r=[i,t],n=function(e){return r.forEach(function(t){return eo(t,e)})},(a=(0,x.useState)(function(){return{value:null,callback:n,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=n,o=a.facade,ei(function(){var e=el.get(o);if(e){var t=new Set(e),n=new Set(r),a=o.current;t.forEach(function(e){n.has(e)||eo(e,null)}),n.forEach(function(e){t.has(e)||eo(e,a)})}el.set(o,r)},[r]),o),N=et(et({},k),u);return x.createElement(x.Fragment,null,m&&x.createElement(h,{sideCar:eu,removeScrollBar:p,shards:v,noRelative:g,noIsolation:b,inert:y,setCallbacks:s,allowPinchZoom:!!E,lockRef:i,gapMode:C}),c?x.cloneElement(x.Children.only(d),et(et({},N),{ref:S})):x.createElement(void 0===w?"div":w,et({},N,{className:f,ref:S}),d))});ec.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ec.classNames={fullWidth:ea,zeroRight:en};var ed=function(e){var t=e.sideCar,r=er(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return x.createElement(n,et({},r))};ed.isSideCarExport=!0;var ef=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,a;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ep=function(){var e=ef();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},em=function(){var e=ep();return function(t){return e(t.styles,t.dynamic),null}},ev={left:0,top:0,right:0,gap:0},eh=function(e){return parseInt(e||"",10)||0},eg=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[eh(r),eh(n),eh(a)]},eb=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return ev;var t=eg(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ey=em(),ex="data-scroll-locked",eE=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,l=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(l,"px ").concat(n,";\n }\n body[").concat(ex,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(en," {\n right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(ea," {\n margin-right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(en," .").concat(en," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ea," .").concat(ea," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(ex,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},ew=function(){var e=parseInt(document.body.getAttribute(ex)||"0",10);return isFinite(e)?e:0},eC=function(){x.useEffect(function(){return document.body.setAttribute(ex,(ew()+1).toString()),function(){var e=ew()-1;e<=0?document.body.removeAttribute(ex):document.body.setAttribute(ex,e.toString())}},[])},ek=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;eC();var o=x.useMemo(function(){return eb(a)},[a]);return x.createElement(ey,{styles:eE(o,!t,a,r?"":"!important")})},eS=!1;if("u">typeof window)try{var eN=Object.defineProperty({},"passive",{get:function(){return eS=!0,!0}});window.addEventListener("test",eN,eN),window.removeEventListener("test",eN,eN)}catch(e){eS=!1}var ej=!!eS&&{passive:!1},eR=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},eI=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),eD(e,n)){var a=eP(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},eD=function(e,t){return"v"===e?eR(t,"overflowY"):eR(t,"overflowX")},eP=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eM=function(e,t,r,n,a){var o,i=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),l=i*n,u=r.target,s=t.contains(u),c=!1,d=l>0,f=0,p=0;do{if(!u)break;var m=eP(e,u),v=m[0],h=m[1]-m[2]-i*v;(v||h)&&eD(e,u)&&(f+=h,p+=v);var g=u.parentNode;u=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!s&&u!==document.body||s&&(t.contains(u)||t===u))return d&&(a&&1>Math.abs(f)||!a&&l>f)?c=!0:!d&&(a&&1>Math.abs(p)||!a&&-l>p)&&(c=!0),c},eA=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eO=function(e){return[e.deltaX,e.deltaY]},eL=function(e){return e&&"current"in e?e.current:e},eT=0,e_=[];let e$=(c=function(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),a=x.useState(eT++)[0],o=x.useState(em)[0],i=x.useRef(e);x.useEffect(function(){i.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(eL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=eA(e),l=r.current,u="deltaX"in e?e.deltaX:l[0]-o[0],s="deltaY"in e?e.deltaY:l[1]-o[1],c=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var m=eI(d,c);if(!m)return!0;if(m?a=d:(a="v"===d?"h":"v",m=eI(d,c)),!m)return!1;if(!n.current&&"changedTouches"in e&&(u||s)&&(n.current=a),!a)return!0;var v=n.current||a;return eM(v,t,e,"h"===v?u:s,!0)},[]),u=x.useCallback(function(e){if(e_.length&&e_[e_.length-1]===o){var r="deltaY"in e?eO(e):eA(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(i.current.shards||[]).map(eL).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),s=x.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),c=x.useCallback(function(e){r.current=eA(e),n.current=void 0},[]),d=x.useCallback(function(t){s(t.type,eO(t),t.target,l(t,e.lockRef.current))},[]),f=x.useCallback(function(t){s(t.type,eA(t),t.target,l(t,e.lockRef.current))},[]);x.useEffect(function(){return e_.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,ej),document.addEventListener("touchmove",u,ej),document.addEventListener("touchstart",c,ej),function(){e_=e_.filter(function(e){return e!==o}),document.removeEventListener("wheel",u,ej),document.removeEventListener("touchmove",u,ej),document.removeEventListener("touchstart",c,ej)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(o,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?x.createElement(ek,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},eu.useMedium(c),ed);var eF=x.forwardRef(function(e,t){return x.createElement(ec,et({},e,{ref:t,sideCar:e$}))});eF.classNames=ec.classNames;var eW=new WeakMap,eB=new WeakMap,eU={},ez=0,eK=function(e){return e&&(e.host||eK(e.parentNode))},eV=function(e,t,r,n){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=eK(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eU[r]||(eU[r]=new WeakMap);var o=eU[r],i=[],l=new Set,u=new Set(a),s=function(e){!e||l.has(e)||(l.add(e),s(e.parentNode))};a.forEach(s);var c=function(e){!e||u.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))c(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,u=(eW.get(e)||0)+1,s=(o.get(e)||0)+1;eW.set(e,u),o.set(e,s),i.push(e),1===u&&a&&eB.set(e,!0),1===s&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),l.clear(),ez++,function(){i.forEach(function(e){var t=eW.get(e)-1,a=o.get(e)-1;eW.set(e,t),o.set(e,a),t||(eB.has(e)||e.removeAttribute(n),eB.delete(e)),a||e.removeAttribute(r)}),--ez||(eW=new WeakMap,eW=new WeakMap,eB=new WeakMap,eU={})}},eH=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),eV(n,a,r,"aria-hidden")):function(){return null}},eq="Dialog",[eY,eG]=function(e,t=[]){let r=[],n=()=>{let t=r.map(e=>x.createContext(e));return function(r){let n=r?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let a=x.createContext(n),o=r.length;r=[...r,n];let i=t=>{let{scope:r,children:n,...i}=t,l=r?.[e]?.[o]||a,u=x.useMemo(()=>i,Object.values(i));return(0,m.jsx)(l.Provider,{value:u,children:n})};return i.displayName=t+"Provider",[i,function(r,i){let l=i?.[e]?.[o]||a,u=x.useContext(l);if(u)return u;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}(eq),[eX,eZ]=eY(eq),eJ=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,l=x.useRef(null),u=x.useRef(null),[s,c]=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[a,o,i]=function({defaultProp:e,onChange:t}){let[r,n]=x.useState(e),a=x.useRef(r),o=x.useRef(t);return I(()=>{o.current=t},[t]),x.useEffect(()=>{a.current!==r&&(o.current?.(r),a.current=r)},[r,a]),[r,n,o]}({defaultProp:t,onChange:r}),l=void 0!==e,u=l?e:a;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,n])}return[u,x.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&i.current?.(r)}else o(t)},[l,e,o,i])]}({prop:n,defaultProp:a??!1,onChange:o,caller:eq});return(0,m.jsx)(eX,{scope:t,triggerRef:l,contentRef:u,contentId:R(),titleId:R(),descriptionId:R(),open:s,onOpenChange:c,onOpenToggle:x.useCallback(()=>c(e=>!e),[c]),modal:i,children:r})};eJ.displayName=eq;var eQ="DialogTrigger";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(eQ,r),o=k(t,a.triggerRef);return(0,m.jsx)(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ti(a.open),...n,ref:o,onClick:E(e.onClick,a.onOpenToggle)})}).displayName=eQ;var e0="DialogPortal",[e1,e5]=eY(e0,{forceMount:void 0}),e2=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=eZ(e0,t);return(0,m.jsx)(e1,{scope:t,forceMount:r,children:x.Children.map(n,e=>(0,m.jsx)(Z,{present:r||o.open,children:(0,m.jsx)(X,{asChild:!0,container:a,children:e})}))})};e2.displayName=e0;var e3="DialogOverlay",e9=x.forwardRef((e,t)=>{let r=e5(e3,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=eZ(e3,e.__scopeDialog);return o.modal?(0,m.jsx)(Z,{present:n||o.open,children:(0,m.jsx)(e4,{...a,ref:t})}):null});e9.displayName=e3;var e7=P("DialogOverlay.RemoveScroll"),e4=x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(e3,r);return(0,m.jsx)(eF,{as:e7,allowPinchZoom:!0,shards:[a.contentRef],children:(0,m.jsx)(O.div,{"data-state":ti(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),e6="DialogContent",e8=x.forwardRef((e,t)=>{let r=e5(e6,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=eZ(e6,e.__scopeDialog);return(0,m.jsx)(Z,{present:n||o.open,children:o.modal?(0,m.jsx)(te,{...a,ref:t}):(0,m.jsx)(tt,{...a,ref:t})})});e8.displayName=e6;var te=x.forwardRef((e,t)=>{let r=eZ(e6,e.__scopeDialog),n=x.useRef(null),a=k(t,r.contentRef,n);return x.useEffect(()=>{let e=n.current;if(e)return eH(e)},[]),(0,m.jsx)(tr,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:E(e.onFocusOutside,e=>e.preventDefault())})}),tt=x.forwardRef((e,t)=>{let r=eZ(e6,e.__scopeDialog),n=x.useRef(!1),a=x.useRef(!1);return(0,m.jsx)(tr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let o=t.target;r.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),tr=x.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,l=eZ(e6,r),u=x.useRef(null),s=k(t,u);return x.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ee()),document.body.insertAdjacentElement("beforeend",e[1]??ee()),Q++,()=>{1===Q&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Q--}},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(K,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,m.jsx)($,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ti(l.open),...i,ref:s,onDismiss:()=>l.onOpenChange(!1)})}),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tc,{titleId:l.titleId}),(0,m.jsx)(td,{contentRef:u,descriptionId:l.descriptionId})]})]})}),tn="DialogTitle";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(tn,r);return(0,m.jsx)(O.h2,{id:a.titleId,...n,ref:t})}).displayName=tn;var ta="DialogDescription";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(ta,r);return(0,m.jsx)(O.p,{id:a.descriptionId,...n,ref:t})}).displayName=ta;var to="DialogClose";function ti(e){return e?"open":"closed"}x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(to,r);return(0,m.jsx)(O.button,{type:"button",...n,ref:t,onClick:E(e.onClick,()=>a.onOpenChange(!1))})}).displayName=to;var tl="DialogTitleWarning",[tu,ts]=(d={contentName:e6,titleName:tn,docsSlug:"dialog"},t=x.createContext(d),(r=e=>{let{children:r,...n}=e,a=x.useMemo(()=>n,Object.values(n));return(0,m.jsx)(t.Provider,{value:a,children:r})}).displayName=tl+"Provider",[r,function(e){let r=x.useContext(t);if(r)return r;if(void 0!==d)return d;throw Error(`\`${e}\` must be used within \`${tl}\``)}]),tc=({titleId:e})=>{let t=ts(tl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},td=({contentRef:e,descriptionId:t})=>{let r=ts("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return x.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},tf=Symbol.for("react.lazy"),tp=x[" use ".trim().toString()];function tm(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===tf&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var tv=Symbol("radix.slottable");function th(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tv}var tg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var r,n;let a,o,i,l=(n=r=`Primitive.${t}`,(a=x.forwardRef((e,t)=>{let{children:r,...n}=e;if(tm(r)&&"function"==typeof tp&&(r=tp(r._payload)),x.isValidElement(r)){var a;let e,o,i=(a=r,(o=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(o=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),l=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==x.Fragment&&(l.ref=t?C(t,i):i),x.cloneElement(r,l)}return x.Children.count(r)>1?x.Children.only(null):null})).displayName=`${n}.SlotClone`,o=a,(i=x.forwardRef((e,t)=>{let{children:r,...n}=e;tm(r)&&"function"==typeof tp&&(r=tp(r._payload));let a=x.Children.toArray(r),i=a.find(th);if(i){let e=i.props.children,r=a.map(t=>t!==i?t:x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null);return(0,m.jsx)(o,{...n,ref:t,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,m.jsx)(o,{...n,ref:t,children:r})})).displayName=`${r}.Slot`,i),u=x.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(n?l:t,{...a,ref:r})});return u.displayName=`Primitive.${t}`,{...e,[t]:u}},{}),tb='[cmdk-group=""]',ty='[cmdk-group-items=""]',tx='[cmdk-item=""]',tE=`${tx}:not([aria-disabled="true"])`,tw="cmdk-item-select",tC="data-value",tk=(e,t,r)=>{var n;return n=e,function e(t,r,n,a,o,i,l){if(i===r.length)return o===t.length?1:.99;var u=`${o},${i}`;if(void 0!==l[u])return l[u];for(var s,c,d,f,p=a.charAt(i),m=n.indexOf(p,o),y=0;m>=0;)(s=e(t,r,n,a,m+1,i+1,l))>y&&(m===o?s*=1:v.test(t.charAt(m-1))?(s*=.8,(d=t.slice(o,m-1).match(h))&&o>0&&(s*=Math.pow(.999,d.length))):g.test(t.charAt(m-1))?(s*=.9,(f=t.slice(o,m-1).match(b))&&o>0&&(s*=Math.pow(.999,f.length))):(s*=.17,o>0&&(s*=Math.pow(.999,m-o))),t.charAt(m)!==r.charAt(i)&&(s*=.9999)),(s<.1&&n.charAt(m-1)===a.charAt(i+1)||a.charAt(i+1)===a.charAt(i)&&n.charAt(m-1)!==a.charAt(i))&&.1*(c=e(t,r,n,a,m+1,i+2,l))>s&&(s=.1*c),s>y&&(y=s),m=n.indexOf(p,m+1);return l[u]=y,y}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,t,y(n),y(t),0,0,{})},tS=x.createContext(void 0),tN=x.createContext(void 0),tj=x.createContext(void 0),tR=x.forwardRef((e,t)=>{let r=t$(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=t$(()=>new Set),a=t$(()=>new Map),o=t$(()=>new Map),i=t$(()=>new Set),l=tT(e),{label:u,children:s,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:v=!1,vimBindings:h=!0,...g}=e,b=R(),y=R(),E=R(),w=x.useRef(null),C=tB();t_(()=>{if(void 0!==c){let e=c.trim();r.current.value=e,k.emit()}},[c]),t_(()=>{C(6,P)},[]);let k=x.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i,u;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)D(),j(),C(1,I);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(E);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,P),(null==(o=l.current)?void 0:o.value)!==void 0){null==(u=(i=l.current).onValueChange)||u.call(i,null!=t?t:"");return}}k.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),S=x.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=o.current.get(e))?void 0:a.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),C(2,()=>{j(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),C(3,()=>{D(),j(),r.current.value||I(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=M();C(4,()=>{D(),(null==t?void 0:t.getAttribute("id"))===e&&I(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:E,labelId:y,listInnerRef:w}),[]);function N(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:tk;return e?o(e,r.current.search,t):0}function j(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),o=0;n.forEach(t=>{o=Math.max(e.get(t),o)}),t.push([r,o])});let n=w.current;A().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(ty);t?t.appendChild(e.parentElement===t?e:e.closest(`${ty} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ty} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=w.current)?void 0:t.querySelector(`${tb}[${tC}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function I(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(tC);k.setState("value",t||void 0)}function D(){var e,t,i,u;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let s=0;for(let a of n.current){let n=N(null!=(t=null==(e=o.current.get(a))?void 0:e.value)?t:"",null!=(u=null==(i=o.current.get(a))?void 0:i.keywords)?u:[]);r.current.filtered.items.set(a,n),n>0&&s++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=s}function P(){var e,t,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(tb))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=w.current)?void 0:e.querySelector(`${tx}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=w.current)?void 0:e.querySelectorAll(tE))||[])}function O(e){let t=A()[e];t&&k.setState("value",t.getAttribute(tC))}function L(e){var t;let r=M(),n=A(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&k.setState("value",o.getAttribute(tC))}function T(e){let t=M(),r=null==t?void 0:t.closest(tb),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,tb):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,tb))?void 0:r.querySelector(tE);n?k.setState("value",n.getAttribute(tC)):L(e)}let _=()=>O(A().length-1),$=e=>{e.preventDefault(),e.metaKey?_():e.altKey?T(1):L(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?T(-1):L(-1)};return x.createElement(tg.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=g.onKeyDown)||t.call(g,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":h&&e.ctrlKey&&$(e);break;case"ArrowDown":$(e);break;case"p":case"k":h&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),_();break;case"Enter":{e.preventDefault();let t=M();if(t){let e=new Event(tw);t.dispatchEvent(e)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:tz},u),tU(e,e=>x.createElement(tN.Provider,{value:k},x.createElement(tS.Provider,{value:S},e))))}),tI=x.forwardRef((e,t)=>{var r,n;let a=R(),o=x.useRef(null),i=x.useContext(tj),l=x.useContext(tS),u=tT(e),s=null!=(n=null==(r=u.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;t_(()=>{if(!s)return l.item(a,null==i?void 0:i.id)},[s]);let c=tW(a,o,[e.value,e.children,o],e.keywords),d=x.useContext(tN),f=tF(e=>e.value&&e.value===c.current),p=tF(e=>!!s||!1===l.filter()||!e.search||e.filtered.items.get(a)>0);function m(){var e,t;v(),null==(t=(e=u.current).onSelect)||t.call(e,c.current)}function v(){d.setState("value",c.current,!0)}if(x.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(tw,m),()=>t.removeEventListener(tw,m)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:h,value:g,onSelect:b,forceMount:y,keywords:E,...w}=e;return x.createElement(tg.div,{ref:C(o,t),...w,id:a,"cmdk-item":"",role:"option","aria-disabled":!!h,"aria-selected":!!f,"data-disabled":!!h,"data-selected":!!f,onPointerMove:h||l.getDisablePointerSelection()?void 0:v,onClick:h?void 0:m},e.children)}),tD=x.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,i=R(),l=x.useRef(null),u=x.useRef(null),s=R(),c=x.useContext(tS),d=tF(e=>!!a||!1===c.filter()||!e.search||e.filtered.groups.has(i));t_(()=>c.group(i),[]),tW(i,l,[e.value,e.heading,u]);let f=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(tg.div,{ref:C(l,t),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&x.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:s},r),tU(e,e=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?s:void 0},x.createElement(tj.Provider,{value:f},e))))}),tP=x.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=x.useRef(null),o=tF(e=>!e.search);return r||o?x.createElement(tg.div,{ref:C(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),tM=x.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,o=x.useContext(tN),i=tF(e=>e.search),l=tF(e=>e.selectedItemId),u=x.useContext(tS);return x.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),x.createElement(tg.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:a?e.value:i,onChange:e=>{a||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),tA=x.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=x.useRef(null),i=x.useRef(null),l=tF(e=>e.selectedItemId),u=x.useContext(tS);return x.useEffect(()=>{if(i.current&&o.current){let e=i.current,t=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),x.createElement(tg.div,{ref:C(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:u.listId},tU(e,e=>x.createElement("div",{ref:C(i,u.listInnerRef),"cmdk-list-sizer":""},e)))}),tO=x.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:i,...l}=e;return x.createElement(eJ,{open:r,onOpenChange:n},x.createElement(e2,{container:i},x.createElement(e9,{"cmdk-overlay":"",className:a}),x.createElement(e8,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(tR,{ref:t,...l}))))}),tL=Object.assign(tR,{List:tA,Item:tI,Input:tM,Group:tD,Separator:tP,Dialog:tO,Empty:x.forwardRef((e,t)=>tF(e=>0===e.filtered.count)?x.createElement(tg.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:x.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return x.createElement(tg.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},tU(e,e=>x.createElement("div",{"aria-hidden":!0},e)))})});function tT(e){let t=x.useRef(e);return t_(()=>{t.current=e}),t}var t_="u"<typeof window?x.useEffect:x.useLayoutEffect;function t$(e){let t=x.useRef();return void 0===t.current&&(t.current=e()),t}function tF(e){let t=x.useContext(tN),r=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,r,r)}function tW(e,t,r,n=[]){let a=x.useRef(),o=x.useContext(tS);return t_(()=>{var i;let l=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),u=n.map(e=>e.trim());o.value(e,l,u),null==(i=t.current)||i.setAttribute(tC,l),a.current=l}),a}var tB=()=>{let[e,t]=x.useState(),r=t$(()=>new Map);return t_(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function tU({asChild:e,children:t},r){let n;return e&&x.isValidElement(t)?x.cloneElement("function"==typeof(n=t.type)?n(t.props):"render"in n?n.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var tz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},tK=e.i(975157);e.i(776639);var tV=e.i(294237);function tH({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,tK.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}e.i(519455),e.i(793479),e.i(624687);let tq=(0,tV.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function tY({className:e,align:t="inline-start",...r}){return(0,m.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,tK.cn)(tq({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,tV.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});var tG=e.i(298751),tG=tG,tX=e.i(533133);e.s(["Command",0,function({className:e,...t}){return(0,m.jsx)(tL,{"data-slot":"command",className:(0,tK.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})},"CommandEmpty",0,function({className:e,...t}){return(0,m.jsx)(tL.Empty,{"data-slot":"command-empty",className:(0,tK.cn)("py-6 text-center text-sm",e),...t})},"CommandGroup",0,function({className:e,...t}){return(0,m.jsx)(tL.Group,{"data-slot":"command-group",className:(0,tK.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})},"CommandInput",0,function({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,m.jsxs)(tH,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,m.jsx)(tL.Input,{"data-slot":"command-input",className:(0,tK.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,m.jsx)(tY,{children:(0,m.jsx)(tG.default,{className:"size-4 shrink-0 opacity-50"})})]})})},"CommandItem",0,function({className:e,children:t,...r}){return(0,m.jsxs)(tL.Item,{"data-slot":"command-item",className:(0,tK.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...r,children:[t,(0,m.jsx)(tX.CheckIcon,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})},"CommandList",0,function({className:e,...t}){return(0,m.jsx)(tL.List,{"data-slot":"command-list",className:(0,tK.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}],317056);var tZ=e.i(514798);let tJ=(0,tZ.createServerReference)("40f7cf30af1b8a2bd3cbfede819764e7e96d095692",tZ.callServer,void 0,tZ.findSourceMapURL,"getProjectBranches");e.s(["getProjectBranches",0,tJ],650059);let tQ=(0,tZ.createServerReference)("40575c16babf8bfd0918e5724fd055664c9093f5c1",tZ.callServer,void 0,tZ.findSourceMapURL,"fetchRemoteBranches");e.s(["fetchRemoteBranches",0,tQ],812822)},744798,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(776639),a=e.i(519455),o=e.i(793479),i=e.i(624687),l=e.i(110204),u=e.i(226145),s=e.i(597746),c=e.i(456346),d=e.i(280027),f=e.i(337822),p=e.i(317056),m=e.i(533499),v=e.i(650059),h=e.i(812822),g=e.i(514798);let b=(0,g.createServerReference)("406f6fca97fa66a01443e29f2340f27050dedd2c80",g.callServer,void 0,g.findSourceMapURL,"getCurrentBranch");var y=e.i(993830);e.s(["CreateTaskDialog",0,function({open:e,onOpenChange:g,onSubmit:x,onUpdate:E,defaultStatus:w="TODO",editTask:C,editTaskLabelIds:k,prefillFromTask:S,labels:N,projectType:j,projectLocalPath:R,versions:I,defaultVersionId:D}){let P,[M,A]=(0,r.useState)(""),[O,L]=(0,r.useState)(""),[T,_]=(0,r.useState)("MEDIUM"),[$,F]=(0,r.useState)(""),[W,B]=(0,r.useState)([]),[U,z]=(0,r.useState)([]),[K,V]=(0,r.useState)(!1),[H,q]=(0,r.useState)(""),[Y,G]=(0,r.useState)(!1),[X,Z]=(0,r.useState)(!0),[J,Q]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(null),{t:er}=(0,m.useI18n)();(0,r.useEffect)(()=>{if(!e||C)return;let t=!1;return(0,y.getConfigValues)(["task.defaultUseWorktree","task.defaultAutoStart"]).then(e=>{if(t)return;let r=e["task.defaultUseWorktree"],n=e["task.defaultAutoStart"];"boolean"==typeof r&&Z(r),"boolean"==typeof n&&Q(n)}).catch(()=>{}),()=>{t=!0}},[e,C]);let en=!!C,ea=!!R;return(0,r.useEffect)(()=>{C?(A(C.title),L(C.description??""),_(C.priority),F(C.subPath??""),B(k??[]),et(C.versionId??null)):(S?(A(S.title??""),L(S.description??""),_(S.priority??"MEDIUM"),F(S.subPath??""),B(S.labelIds??[])):(A(""),L(""),_("MEDIUM"),F(""),B([])),et(D??null))},[C,k,S,D]),(0,r.useEffect)(()=>{e||C||(A(""),L(""),_("MEDIUM"),F(""),B([]),z([]),q(""),G(!1),et(D??null))},[e,C,D]),(0,r.useEffect)(()=>{e&&ea&&!C&&(V(!0),Promise.all([(0,v.getProjectBranches)(R),b(R)]).then(([e,t])=>{z(e);let r=S?.baseBranch??null;r&&e.includes(r)?q(r):q(t&&e.includes(t)?t:e[0]??""),V(!1),(0,h.fetchRemoteBranches)(R).then(()=>{setTimeout(()=>{(0,v.getProjectBranches)(R).then(e=>{z(e),q(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{z([]),q(""),V(!1)}))},[e,ea,R,C,S]),(0,t.jsx)(n.Dialog,{open:e,onOpenChange:g,disablePointerDismissal:!0,children:(0,t.jsxs)(n.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(n.DialogHeader,{children:(0,t.jsx)(n.DialogTitle,{children:en?er("task.edit"):er("task.create")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"title",children:er("task.title")}),(0,t.jsx)(o.Input,{id:"title","data-testid":"task-title",placeholder:er("task.titlePlaceholder"),value:M,onChange:e=>A(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"description",children:er("task.description")}),(0,t.jsx)(i.Textarea,{id:"description",placeholder:er("task.descPlaceholder"),rows:4,value:O,onChange:e=>L(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"subPath",children:er("task.subPath")}),(0,t.jsx)(o.Input,{id:"subPath",placeholder:er("task.subPathPlaceholder"),value:$,onChange:e=>F(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:er("task.subPathHint")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.priority")}),(0,t.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let r={LOW:{label:er("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:er("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:er("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:er("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${T===e?`${r.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:r.label},e)})})]}),ea&&!en&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.baseBranch")}),K?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchLoading")}):U.length>0?(0,t.jsxs)(f.Popover,{open:Y,onOpenChange:G,children:[(0,t.jsxs)(f.PopoverTrigger,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left text-xs",title:H||void 0,children:H||er("task.branchNone")}),(0,t.jsx)(c.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(f.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(p.Command,{children:[(0,t.jsx)(p.CommandInput,{placeholder:er("task.branchSearch")}),(0,t.jsxs)(p.CommandList,{children:[(0,t.jsx)(p.CommandEmpty,{children:er("task.branchNone")}),(0,t.jsx)(p.CommandGroup,{children:U.map(e=>(0,t.jsxs)(p.CommandItem,{value:e,onSelect:()=>{q(e),G(!1)},children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===H&&(0,t.jsx)(s.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchNone")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,t.jsx)(l.Label,{className:"text-xs text-muted-foreground",children:er("task.worktreeLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Z(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${X===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.worktreeYes"):er("task.worktreeNo")},String(e)))})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(l.Label,{className:"text-xs text-muted-foreground",children:er("task.autoStartLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Q(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${J===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.autoStartYes"):er("task.autoStartNo")},String(e)))})]})]}),N.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:N.map(e=>{let r=W.includes(e.id);return(0,t.jsx)("button",{type:"button",onClick:()=>{B(t=>r?t.filter(t=>t!==e.id):[...t,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${r?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:r?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]}),(!en||I&&I.length>0)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("version.picker.label")}),I&&I.length>0?(0,t.jsxs)(d.Select,{value:ee??"__none__",onValueChange:e=>et("__none__"===e?null:e),children:[(0,t.jsx)(d.SelectTrigger,{children:(0,t.jsx)("span",{className:"truncate text-sm",children:ee&&(P=I.find(e=>e.id===ee))?P.isCurrent?`${P.number} \xb7 ${P.name} \xb7 ${er("version.currentShort")}`:`${P.number} \xb7 ${P.name}`:er("version.picker.none")})}),(0,t.jsxs)(d.SelectContent,{children:[(0,t.jsx)(d.SelectItem,{value:"__none__",children:er("version.picker.none")}),I.map(e=>(0,t.jsx)(d.SelectItem,{value:e.id,children:e.isCurrent?`${e.number} \xb7 ${e.name} \xb7 ${er("version.currentShort")}`:`${e.number} \xb7 ${e.name}`},e.id))]})]}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground",children:er("version.picker.empty")})]})]}),(0,t.jsxs)(n.DialogFooter,{children:[(0,t.jsx)(a.Button,{variant:"outline",onClick:()=>g(!1),children:er("common.cancel")}),(0,t.jsx)(a.Button,{onClick:()=>{M.trim()&&(en&&E?E(C.id,{title:M,description:O,priority:T,labelIds:W,subPath:$.trim()||"",versionId:ee}):x({title:M,description:O,priority:T,status:w,labelIds:W,...ea&&X&&H?{baseBranch:H}:{},...$.trim()?{subPath:$.trim()}:{},versionId:ee,autoStart:J}),A(""),L(""),_("MEDIUM"),F(""),B([]),z([]),q(""),Z(!0),et(null),g(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:en?er("common.save"):er("common.create")})]})]})})}],744798)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let a=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,a],181209)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let a=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,a],181209)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},610328,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40b7501e08e21609968acead49b3d4b4c1b9bd1b09",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,a])},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},991838,e=>{"use strict";var t=e.i(965652),a=e.i(770303);e.s(["useExtension",0,function(e){let s=(0,t.useContext)(a.ExtensionContext);if(!s)throw Error("useExtension must be used inside <ExtensionProvider>");return{status:s.statusMap[e],loading:s.loading,isInstalling:s.installing.has(e),install:()=>s.install(e),uninstall:()=>s.uninstall(e),refresh:()=>s.refresh(e)}}])}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),x=e.i(453889),h=e.i(572989);let p=(0,h.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(755146),g=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("40531d44fc6a969dfc8cdcd960018a0fecb76fa761",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60dee5fdefcfc5bc4fbaa455a9a46fdbbc76ede5e8",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40ff4f6f97e83422f41dc091226ce39b9ab7e6d367",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("40e8dcd3a0f7d21d56cbdf5134bf0d107e94cc96cc",N.callServer,void 0,N.findSourceMapURL,"reorderWorkspaces");var T=e.i(503350);let D=(0,N.createServerReference)("40c8e22cbbec38a0b343cc303ab78f15dee059b736",N.callServer,void 0,N.findSourceMapURL,"createLabel"),P=(0,N.createServerReference)("4005b705697e7e71d6a43b505aebdc5ba493f42166",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var M=e.i(533499),R=e.i(360112),$=e.i(720247),L=e.i(775712),A=e.i(67013);let E=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function O({workspaces:e}){let i,l=(0,s.useRouter)(),c=(0,s.usePathname)(),{t:u}=(0,M.useI18n)(),[h,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&f(!0)},[]);let[j,w]=(0,r.useState)(!1),[N,T]=(0,r.useState)(!1),[D,P]=(0,r.useState)(!1),[A,B]=(0,r.useState)(null),[_,W]=(0,r.useState)(""),[U,H]=(0,r.useState)(E[0]),[K,V]=(0,r.useState)(null),[q,X]=(0,r.useState)(e);(0,r.useEffect)(()=>{X(e)},[e]);let G=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:8}})),J=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=q.findIndex(e=>e.id===r.id),n=q.findIndex(e=>e.id===s.id);if(-1===a||-1===n)return;let o=(0,L.arrayMove)(q,a,n);X(o),S(o.map(e=>e.id)).then(()=>l.refresh()).catch(()=>{X(e),R.toast.error(u("sidebar.reorderError"))})},[q,e,l,u]),Y=c.split("/workspaces/")[1]?.split("/")[0],Z=(0,r.useCallback)(()=>{f(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),Q=(0,r.useCallback)(async()=>{if(!_.trim())return;let e=await y({name:_.trim(),description:U});W(""),H(E[0]),w(!1),l.refresh(),l.push(`/workspaces/${e.id}`)},[_,U,l]),ee=(0,r.useCallback)(async()=>{_.trim()&&K&&(await k(K,{name:_.trim(),description:U}),W(""),T(!1),V(null),l.refresh())},[_,U,K,l]),et=(0,r.useCallback)(e=>{V(e.id),W(e.name),H(e.description&&E.includes(e.description)?e.description:E[0]),T(!0)},[]),er=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(u("sidebar.lastWorkspaceError"));if(confirm(u("sidebar.deleteConfirm",{name:r})))try{await C(t),l.refresh(),Y===t&&l.push("/workspaces")}catch{R.toast.error(u("sidebar.lastWorkspaceError"))}},[Y,l,u,e.length]),es=(0,r.useCallback)(e=>{B(e),P(!0)},[]),ea=e=>e.description&&E.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(h){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:Z,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=Y===e.id,s=ea(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||l.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:E.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>w(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===c?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("missions.navLabel")})]}),(r=Y||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${c.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${c.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${c.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.archive")})]})]}):null]}),(0,t.jsx)(I,{open:j,onOpenChange:w,title:u("workspace.create"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:Q,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:Z,className:"text-muted-foreground",title:u("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:u("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),H(E[0]),w(!0)},title:u("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)($.DndContext,{id:"workspace-sidebar",sensors:G,collisionDetection:$.closestCenter,onDragEnd:J,children:(0,t.jsx)(L.SortableContext,{items:q.map(e=>e.id),strategy:L.verticalListSortingStrategy,children:q.map(e=>(0,t.jsx)(z,{ws:e,isActive:Y===e.id,icon:ea(e),disableDelete:q.length<=1,t:u,onSelect:()=>{Y!==e.id&&l.push(`/workspaces/${e.id}`)},onEdit:()=>et(e),onManageLabels:()=>es(e.id),onDelete:()=>er(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("missions.navLabel")})]}),(i=Y||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${i}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.archive")})]})]}):null,(0,t.jsx)(I,{open:j,onOpenChange:w,title:u("workspace.create"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:Q,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),(0,t.jsx)(I,{open:N,onOpenChange:e=>{T(e),e||V(null)},title:u("workspace.edit"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:ee,submitLabel:u("common.save"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),A&&(0,t.jsx)(F,{open:D,onOpenChange:e=>{P(e),e||B(null)},workspaceId:A})]})}function z({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:d,onManageLabels:m,onDelete:x}){var h;let p,g,j,{attributes:b,listeners:v,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,L.useSortable)({id:e.id}),C={transform:A.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...b,...v,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:E.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(h=e.updatedAt,g=Math.floor((p=Date.now()-new Date(h).getTime())/6e4),j=Math.floor(p/36e5),g<60?`${g}m ago`:j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:m,children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:x,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function I({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:E.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let B=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function F({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,M.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(B[0]);(0,r.useEffect)(()=>{e&&(0,T.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await D({name:l.trim(),color:d,workspaceId:a}),i(await (0,T.getLabelsForWorkspace)(a)),c(""))},x=async e=>{await P(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:B.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var _=e.i(821957),W=e.i(738690),U=e.i(386343);let H=(0,h.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var K=e.i(242941),V=e.i(989548),q=e.i(387091),X=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var G=e.i(581263),J=e.i(462902);let Y=r.createContext(void 0);function Z(){let e=r.useContext(Y);if(void 0===e)throw Error((0,J.default)(13));return e}let Q={imageLoadingStatus:()=>null},ee=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,G.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:Q});return(0,t.jsx)(Y.Provider,{value:c,children:d})});var et=e.i(887642),er=e.i(804849),es=e.i(504068),ea=e.i(809058),en=e.i(193214),eo=e.i(954588);let ei={...Q,...ea.transitionStatusMapping},el=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=Z(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,er.useIsoLayoutEffect)(()=>{if(!e)return n("error"),eo.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,en.useTransitionStatus)(u),p=r.useRef(null),f=(0,et.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,er.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,es.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,G.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:ei,enabled:m});return m?g:null});var ec=e.i(161476);let ed=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=Z(),[l,c]=r.useState(void 0===n),d=(0,ec.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,G.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:Q,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,ed,"Image",0,el,"Root",0,ee],129448);var eu=e.i(129448),eu=eu,em=e.i(975157);function ex({className:e,size:r="default",...s}){return(0,t.jsx)(eu.Root,{"data-slot":"avatar","data-size":r,className:(0,em.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function eh({className:e,...r}){return(0,t.jsx)(eu.Fallback,{"data-slot":"avatar-fallback",className:(0,em.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ep=(0,h.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var ef=e.i(226145);let eg=(0,h.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ej=(0,h.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eb=e.i(657153);let ev=(0,N.createServerReference)("60c95388940c8d3b45d2a8be13a34a5dd553b61d67",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ew=e.i(237179);let eN=[{id:"all",key:"search.all",icon:W.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:ep},{id:"repository",key:"search.repository",icon:ef.GitBranch},{id:"note",key:"search.note",icon:eg},{id:"asset",key:"search.asset",icon:ej}],ey=["task","project","repository","note","asset"],ek={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eC({result:e,onSelect:r}){let s=eN.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eS({open:e,onOpenChange:a}){let n,{t:o}=(0,M.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ew.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ev(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(W.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eb.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eN.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ey.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(ek[e])}),n[e].map(e=>(0,t.jsx)(eC,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eC,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eT=e.i(338187),eD=e.i(400355),eP=e.i(597746),eM=e.i(938499),eR=e.i(233274),e$=e.i(905455),eL=e.i(624687);function eA(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eE=(0,N.createServerReference)("40da3399fdc20b802b5d4546d6674588913190bf1d",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eO=e.i(270839),ez=e.i(224277);function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)("idle"),[D,P]=(0,r.useState)(""),[$,L]=(0,r.useState)(!1),[A,E]=(0,r.useState)(!1),O=()=>{l(""),d(""),m(""),p(""),g(""),y(!1),C("FRONTEND"),T("idle"),P(""),L(!1)},z=async()=>{if(f.trim()&&!$&&"success"===S){L(!0);try{let e=await (0,eO.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{L(!1)}}},I=async e=>{p(e),T("idle"),P("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eA(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eA(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),N||g(await eE(e))},B=async()=>{if(h.trim()&&f.trim()){T("cloning"),P("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(h.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:f.trim()})}),r=await t.json();if(!t.ok){T("error"),P(r.error||"Clone failed");return}T("success")}catch{T("error"),P("Network error")}}},F=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k}),O(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||O()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:h,onChange:e=>I(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:f,onChange:e=>{g(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>E(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),f.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),h.trim()&&f.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===S||"success"===S,onClick:B,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===S?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===S?(0,t.jsx)(eP.Check,{className:"h-3 w-3"}):(0,t.jsx)(ef.GitBranch,{className:"h-3 w-3"}),"cloning"===S?n("git.cloning"):"success"===S?n("git.cloned"):n("git.clone")]}),"error"===S&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),D]}),"success"===S&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(e$.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:z,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f.trim()||$?"opacity-50":""}`}),children:[$?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eR.Sparkles,{className:"h-3 w-3"}),$?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f.trim()?"success"!==S?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eL.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),O()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:F,disabled:!i.trim()||$,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:A,onOpenChange:E,onSelect:e=>{if(g(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eB=e.i(756502),eB=eB,eF=e.i(699375);let e_=(0,N.createServerReference)("6010d2ca5b605450312f869eafcd0b1b4643681ec6",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eW=(0,N.createServerReference)("40e8dd01fe9d2dc40496bc845f1f6a95be3454af33",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eU({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,P]=(0,r.useState)(!1),[$,L]=(0,r.useState)(""),[A,E]=(0,r.useState)(!1),[O,z]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),P(!1),L(""),E(!1),z(""),B(""),_(!1),U(!1)},K=async e=>{g(e),T(!1),P(!1),L(""),z(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(P(e),z(""),B(""),_(!1),!e)return void L("");if(h)try{let e=await eE(h);e&&(L(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[h,f]),q=async()=>{if(f&&!W){U(!0);try{let e=await (0,eO.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{U(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&$&&$!==f&&t&&"id"in t){E(!0),z("");try{let e=await eW(t.id);if(!e.safe)return void z(e.reason);let r=await e_(t.id,$);if(!r.success)return void z(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);z(`${n("project.migrateError")}:${e}`);return}finally{E(!1)}}H(),s(!1)},G=!i.trim()||!f.trim()||A||W||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),h&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:h,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eF.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:$,onChange:e=>{L(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eB.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),I]}),O&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),O]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(e$.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eR.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eL.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eH({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function eK({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,M.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eT.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:h}=function(){let{resolvedTheme:e,setTheme:t}=(0,_.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(W.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(H,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(V.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(K.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:h,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(q.Sun,{className:"h-4 w-4"}):(0,t.jsx)(X.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":n("topbar.github")}),children:(0,t.jsx)(eH,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(ex,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(eh,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(U.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(eS,{open:g,onOpenChange:j}),(0,t.jsx)(eI,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eU,{open:y,onOpenChange:k,onCreateProject:e})]})}var eV=e.i(83434),eq=e.i(966001),eX=e.i(940220),eG=e.i(19578),eJ=e.i(232280);let eY=(0,eG.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function eZ({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eT.useAssistant)(),{t:u}=(0,M.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(V.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eJ.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eb.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eY,{}):null})]})}var eQ=e.i(125177);function e0({onDismiss:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eQ.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var e1=e.i(774168),e2=e.i(490019);let e5=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function e4({onComplete:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=e5[a],m=(0,r.useCallback)(async()=>{await (0,e2.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<e5.length?t:e}),a>=e5.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<e5.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
2
|
+
ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
|
|
3
|
+
transparent ${Math.max(o.width,o.height)}px,
|
|
4
|
+
rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
|
|
5
|
+
)`},onClick:p}),(0,t.jsx)("div",{className:"pointer-events-none fixed z-[10001] rounded-lg ring-2 ring-amber-400 ring-offset-2 ring-offset-background",style:{left:o.left-4,top:o.top-4,width:o.width+8,height:o.height+8}}),(0,t.jsxs)("div",{className:"fixed z-[10002] w-72 rounded-xl border border-border bg-card p-4 shadow-2xl",style:(()=>{if(!o)return{display:"none"};let e={position:"fixed",zIndex:10001};switch(u.placement){case"right":e.left=o.right+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"bottom":e.left=o.left+o.width/2,e.top=o.bottom+12,e.transform="translateX(-50%)";break;case"left":e.right=window.innerWidth-o.left+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"top":e.left=o.left+o.width/2,e.bottom=window.innerHeight-o.top+12,e.transform="translateX(-50%)"}return e})(),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:s(u.titleKey)}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:s(u.descKey)})]}),(0,t.jsx)("button",{onClick:m,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(eb.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex gap-1",children:e5.map((e,r)=>(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${r===a?"bg-amber-400":r<a?"bg-amber-400/40":"bg-muted"}`},r))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.Button,{variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:m,children:s("tour.skip")}),(0,t.jsx)(v.Button,{className:"h-7 px-3 text-xs bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/25 hover:bg-amber-500/25",onClick:p,children:s(a<e5.length-1?"tour.next":"tour.done")})]})]})]})]})}):null}function e3({workspaces:e,isFirstRun:a,username:n,children:o,handleCreateProject:i}){let l=(0,s.usePathname)(),c=(0,s.useRouter)(),{isOpen:d,displayMode:u,closeAssistant:m}=(0,eT.useAssistant)();(0,r.useEffect)(()=>{a&&!l.startsWith("/onboarding")&&c.replace("/onboarding")},[a,l,c]);let[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a||l.startsWith("/onboarding")||(0,ew.getConfigValue)("onboarding.tourCompleted",!1).then(e=>{e?f(!0):h(!0)})},[a,l]);let g=()=>{h(!1),f(!0)},[b,v]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(0,ew.getConfigValue)("notification.enabled",!0).then(v)},[]);let w=l.startsWith("/onboarding");if(!function(e){let t=(0,s.useRouter)(),a=(0,r.useRef)(t),n=(0,r.useRef)(e),{t:o}=(0,M.useI18n)(),i=(0,r.useRef)(o);a.current=t,n.current=e,i.current=o,(0,r.useEffect)(()=>{if(!e)return;let t=null,r=null,s=!1;async function o(){if(s)return;let e=await (0,e1.getActualWsPort)();s||((t=new WebSocket(`ws://localhost:${e}/terminal?taskId=__notifications__`)).onmessage=e=>{if(n.current)try{let t=JSON.parse(e.data);if("type"in t&&"stop"===t.type)R.toast.success(t.taskTitle,{description:i.current("notification.taskCompleted"),duration:8e3});else if("Notification"in window&&"granted"===window.Notification.permission){let e=new window.Notification("Tower",{body:t.taskTitle,icon:"/web-app-manifest-192x192.png"});e.onclick=()=>{window.focus(),a.current.push(`/workspaces/${t.workspaceId}/tasks/${t.taskId}`),e.close()}}else R.toast.info(t.taskTitle,{description:"COMPLETED"===t.status?i.current("notification.taskCompleted"):i.current("notification.taskFailed")})}catch{}},t.onclose=()=>{s||(r=setTimeout(o,5e3))},t.onerror=()=>{t?.close()})}return o(),()=>{s=!0,r&&clearTimeout(r),t?.close()}},[e])}(b&&!w),w)return(0,t.jsx)(t.Fragment,{children:o});let N=/\/workspaces\/[^/]+\/tasks\/[^/]+/.test(l),y=/\/workspaces\/[^/]+\/(notes|assets|archive)/.test(l),k=d&&"sidebar"===u?(0,t.jsx)(eZ,{mode:"sidebar"}):null,C="dialog"===u?(0,t.jsx)(j.Dialog,{open:d,onOpenChange:e=>{e||m()},children:(0,t.jsx)(j.DialogContent,{showCloseButton:!1,style:{width:"90vw",minWidth:"360px",maxWidth:"600px",height:"70vh",minHeight:"480px",maxHeight:"800px",padding:0},children:(0,t.jsx)(eZ,{mode:"dialog"})})}):null;return N||y?(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)(e0,{onDismiss:()=>f(!1)}),(0,t.jsx)("div",{className:"flex h-screen overflow-hidden",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eK,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[k,(0,t.jsx)("main",{className:"flex-1 overflow-hidden bg-background",children:(0,t.jsx)(eq.ErrorBoundary,{children:o})})]})]})}),C,x&&(0,t.jsx)(e4,{onComplete:g})]}):(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)(e0,{onDismiss:()=>f(!1)}),(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)(O,{workspaces:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eK,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[k,(0,t.jsx)("main",{className:"flex-1 overflow-auto bg-background",children:(0,t.jsx)(eq.ErrorBoundary,{children:o})})]})]})]}),C,x&&(0,t.jsx)(e4,{onComplete:g})]})}e.s(["LayoutClient",0,function({workspaces:e,isFirstRun:r,username:a,children:n}){let o=(0,s.useRouter)(),i=(0,s.usePathname)(),l=i.split("/workspaces/")[1]?.split("/")[0],c=async t=>{let r=l||(e.length>0?e[0].id:null);if(!r){let e=await y({name:"Default Workspace"}),r=await (0,eX.createProject)({...t,workspaceId:e.id});return o.refresh(),o.push(`/workspaces/${e.id}`),{id:r.id}}let s=await (0,eX.createProject)({...t,workspaceId:r});return o.refresh(),o.push(`/workspaces/${r}`),{id:s.id}};return(0,t.jsx)(eT.AssistantProvider,{children:(0,t.jsx)(eV.TerminalPortalProvider,{children:(0,t.jsx)(e3,{workspaces:e,isFirstRun:r,username:a,handleCreateProject:c,children:n})})})}],914935)},782406,e=>{"use strict";var t=e.i(289721),r=e.i(821957);e.s(["ThemeProvider",0,function({children:e,...s}){return(0,t.jsx)(r.ThemeProvider,{...s,children:e})}])},713354,e=>{"use strict";var t=e.i(289721),r=e.i(821957),s=e.i(360112),a=e.i(59737),a=a,n=e.i(756502),n=n,o=e.i(567098),o=o;let i=(0,e.i(572989).default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var l=e.i(519587),l=l;e.s(["Toaster",0,({...e})=>{let{theme:c="system"}=(0,r.useTheme)();return(0,t.jsx)(s.Toaster,{theme:c,className:"toaster group",icons:{success:(0,t.jsx)(a.default,{className:"size-4"}),info:(0,t.jsx)(n.default,{className:"size-4"}),warning:(0,t.jsx)(o.default,{className:"size-4"}),error:(0,t.jsx)(i,{className:"size-4"}),loading:(0,t.jsx)(l.default,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})}],713354)}]);
|