tower-studio 0.1.8 → 0.1.9
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/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +37 -37
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +23 -23
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/images/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +13 -13
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +13 -13
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/missions/page/server-reference-manifest.json +51 -51
- package/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/onboarding/page/server-reference-manifest.json +23 -23
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding.html +1 -1
- package/.next/server/app/onboarding.rsc +15 -15
- package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
- package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
- package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +23 -23
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/settings/page/server-reference-manifest.json +32 -32
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +15 -15
- package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +77 -77
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +64 -64
- package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +55 -55
- package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +51 -51
- package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +23 -23
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +56 -56
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/page/server-reference-manifest.json +41 -41
- package/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/10ge_next_dist_esm_build_templates_app-route_13~vb_i.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__043lk8~._.js +2 -2
- package/.next/server/chunks/ssr/0~.g_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_0bbseig._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0.8y0n9._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__01ws4-7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__02ipahf._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0bk3s4l._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0~jc3l5._.js → [root-of-the-server]__0i1tzvg._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0hvz_0c._.js → [root-of-the-server]__0i52qt7._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0l~dc3x._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0rs7pkn._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0sysz2q._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0y-lkvf._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0mab0km._.js → [root-of-the-server]__0yuwh~5._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__12f810l._.js +1 -1
- package/.next/server/chunks/ssr/{tower_00.hg6u._.js → tower_0.csoof._.js} +2 -2
- package/.next/server/chunks/ssr/{tower_12sld1c._.js → tower_005_jvc._.js} +2 -2
- package/.next/server/chunks/ssr/{tower_09~lpto._.js → tower_0c8unc1._.js} +2 -2
- package/.next/server/chunks/ssr/{tower_0gzwyem._.js → tower_0cmuq4n._.js} +2 -2
- package/.next/server/chunks/ssr/tower_0ih8lcc._.js +3 -0
- package/.next/server/chunks/ssr/tower_0kl_bfy._.js +1 -1
- package/.next/server/chunks/ssr/tower_0mz4ut.._.js +1 -1
- package/.next/server/chunks/ssr/tower_0pcqezm._.js +1 -1
- package/.next/server/chunks/ssr/{tower_0vo6u9i._.js → tower_0tjo~2z._.js} +2 -2
- package/.next/server/chunks/ssr/tower_0wvk~r.._.js +1 -1
- package/.next/server/chunks/ssr/tower_10p15te._.js +1 -1
- package/.next/server/chunks/ssr/tower_117pzh8._.js +1 -1
- package/.next/server/chunks/ssr/tower_11q5_.m._.js +1 -1
- package/.next/server/chunks/ssr/tower_138qlx5._.js +1 -1
- package/.next/server/chunks/ssr/{tower_src_08t.wy-._.js → tower_src_0lq.aoc._.js} +2 -2
- package/.next/server/chunks/ssr/tower_src_actions_agent-actions_ts_0j.e1tn._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_actions_file-actions_ts_0424lna._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_app_missions_missions-client_tsx_0a9vjyr._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_app_onboarding_page_tsx_0_3krz1._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_app_settings_page_tsx_0vo5e-o._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0zfgzhi._.js +1 -1
- package/.next/server/chunks/ssr/tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0kjp1u0._.js +1 -1
- package/.next/server/chunks/tower_0a-x6m.._.js +1 -1
- package/.next/server/chunks/tower_src_0..vg-t._.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +198 -198
- package/.next/static/chunks/{0kubr70r_r2f2.js → 01499ombtjk9..js} +1 -1
- package/.next/static/chunks/{05j6t69jmpqju.js → 0465wja5wuj_t.js} +1 -1
- package/.next/static/chunks/{0_.pyr2jhdqa2.js → 04zt_ewq9gd.f.js} +2 -2
- package/.next/static/chunks/{0a2blrvqw8t5y.js → 07ll8eylriw_..js} +1 -1
- package/.next/static/chunks/{049.9ha2n6os5.js → 08kdkf9zhbx5h.js} +1 -1
- package/.next/static/chunks/{0z61ts2ro9_k3.js → 0_dgukndtuspa.js} +1 -1
- package/.next/static/chunks/{07a_xadb-3w1a.js → 0focg9l2pd5qe.js} +1 -1
- package/.next/static/chunks/{0-64z7pmj57~d.js → 0jod832.e8dvp.js} +1 -1
- package/.next/static/chunks/{00xbbu.nlx92z.js → 0o0v~cegree8o.js} +1 -1
- package/.next/static/chunks/{0kc-95qs2~eid.js → 0uukquowg_doj.js} +1 -1
- package/.next/static/chunks/{0kojsk~4uroqj.js → 0v593lcts~8.5.js} +1 -1
- package/.next/static/chunks/0yz33_rbgu2sz.js +1 -0
- package/.next/static/chunks/{0_c8duf92i~xg.js → 0~2w0fbj7o3fv.js} +1 -1
- package/.next/static/chunks/{0z-ecklemrfx-.js → 12p4plfwlovc5.js} +1 -1
- package/.next/static/chunks/{0kt2vohpgb7h6.js → 13juk.piouzom.js} +1 -1
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/ssr/tower_02he7d6._.js +0 -3
- package/.next/static/chunks/0ttrpz.l-v-yv.js +0 -1
- /package/.next/static/{6AW1vTU7iJEkEhqIH0txT → uSvLXzMcHlsrWUxtSBOMM}/_buildManifest.js +0 -0
- /package/.next/static/{6AW1vTU7iJEkEhqIH0txT → uSvLXzMcHlsrWUxtSBOMM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{6AW1vTU7iJEkEhqIH0txT → uSvLXzMcHlsrWUxtSBOMM}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,499356,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/tower/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},325200,(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/tower/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)}()},627580,e=>{"use strict";let t=(0,e.i(258114).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])},632612,e=>{"use strict";var t=e.i(430989),r=e.i(641338),s=e.i(347880),a=e.i(226549),n=e.i(306308),o=e.i(304275),i=e.i(894362),l=e.i(584451),c=e.i(935792),d=e.i(258114);let u=(0,d.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,d.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var x=e.i(652459),h=e.i(819614);let p=(0,d.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(690287),g=e.i(24887),j=e.i(331548),b=e.i(814329),v=e.i(744838),w=e.i(745943),N=e.i(755683);let y=(0,N.createServerReference)("40c89bf9e64a1e1920233b0b94d743fe2887013b71",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60f9ee4bb244e607aac2a6f008fd9a5dacfeacf384",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40470e37b1c7162a4b7a1fd09c09cea23fe3474f40",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("40b7be0b17089946da6f118c2077a58e955f17a066",N.callServer,void 0,N.findSourceMapURL,"getLabelsForWorkspace"),T=(0,N.createServerReference)("4056b7c5f523e0a33fc5d66dfb328f45d6dfac3bf4",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("407ad3d09e5b860175f15e9e764377932b020a8357",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(349369),R=e.i(151201);let M=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function A({workspaces:e}){let d,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,z]=(0,r.useState)(!1),[L,O]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[U,W]=(0,r.useState)(""),[H,K]=(0,r.useState)(M[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!U.trim())return;let e=await y({name:U.trim(),description:H});W(""),K(M[0]),z(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[U,H,j]),Y=(0,r.useCallback)(async()=>{U.trim()&&V&&(await k(V,{name:U.trim(),description:H}),W(""),O(!1),q(null),j.refresh())},[U,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),W(e.name),K(e.description&&M.includes(e.description)?e.description:M[0]),O(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{R.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&M.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){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:G,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:N("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=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.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:M.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:()=>z(!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:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(r=X||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:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.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:N("sidebar.archive")})]})]}):null,(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"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:N("missions.navLabel")})]})]}),(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("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:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(u,{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:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),K(M[0]),z(!0)},title:N("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:e.map(r=>{var s;let a,n,o,d=X===r.id,u=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"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:M.includes(u)?u:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:u})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/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:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.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"===w?"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:N("missions.navLabel")})]}),(d=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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)(x.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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:N("sidebar.archive")})]})]}):null,(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)($,{open:L,onOpenChange:e=>{O(e),e||q(null)},title:N("workspace.edit"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(E,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function $({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:M.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 z=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function E({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(z[0]);(0,r.useEffect)(()=>{e&&S(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await S(a)),c(""))},x=async e=>{await D(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:z.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 L=e.i(387104),O=e.i(811163),I=e.i(277547);let B=(0,d.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 F=e.i(514183),_=e.i(38431),U=e.i(924171),W=e.i(114954);e.s([],384466),e.i(384466),e.i(905022);var H=e.i(703995),K=e.i(855604);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=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,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(288782),Y=e.i(239917),Z=e.i(762879),Q=e.i(963195),ee=e.i(680765),et=e.i(534262);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.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,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(109792);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],612115);var eo=e.i(612115),eo=eo,ei=e.i(47816);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.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 ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.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 ed=(0,d.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 eu=e.i(259104);let em=(0,d.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"}]]),ex=(0,d.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 eh=e.i(621994);let ep=(0,N.createServerReference)("603f04ef33073ec65afdcf3aa3d12b2259699d3224",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(333152);let eg=[{id:"all",key:"search.all",icon:O.Search},{id:"task",key:"search.task",icon:x.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??x.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 ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.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,ef.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 ep(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)(O.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)(eh.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:eg.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),{}),ej.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(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(599104),ey=e.i(924609),ek=e.i(698300),eC=e.i(993453),eS=e.i(510291),eT=e.i(696668),eD=e.i(779574);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(499356),e.i(325200);let eR=(0,N.createServerReference)("40414b74111d919c7fde8869cbf34ed4fb0d1551df",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eM=e.i(876449);function eA({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[g,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)("FRONTEND"),[C,S]=(0,r.useState)("idle"),[T,D]=(0,r.useState)(""),[M,A]=(0,r.useState)(!1),$=()=>{l(""),d(""),m(""),h(""),f(""),N(!1),k("FRONTEND"),S("idle"),D(""),A(!1)},z=async()=>{if(p.trim()&&!M&&"success"===C){A(!0);try{let e=await (0,eM.analyzeProjectDirectory)(p.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{A(!1)}}},E=async e=>{h(e),S("idle"),D("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),g||f(await eR(e))},L=async()=>{if(x.trim()&&p.trim()){S("cloning"),D("");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}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:p.trim()})}),r=await t.json();if(!t.ok){S("error"),D(r.error||"Clone failed");return}S("success")}catch{S("error"),D("Network error")}}},O=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:p.trim()||void 0,projectType:y}),$(),s(!1))};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||$()},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:x,onChange:e=>E(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.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:p,onChange:e=>{f(e.target.value),N(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),x.trim()&&p.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===C||"success"===C,onClick:L,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"===C?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===C?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===C?n("git.cloning"):"success"===C?n("git.cloned"):n("git.clone")]}),"error"===C&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),T]}),"success"===C&&(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)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:y,onChange:k})})]}),(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 ${!p.trim()||M?"opacity-50":""}`}),children:[M?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),M?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:p.trim()?"success"!==C?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.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),$()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:O,disabled:!i.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})})})}var e$=e.i(627580),e$=e$,ez=e.i(378399),eE=e.i(108523);let eL=(0,N.createServerReference)("609f31aad35575bab2e16f6c226072881fb1338e3a",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eO=(0,N.createServerReference)("40aad4b7df41d6c70115d6241cb459392eb1c11984",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,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,M]=(0,r.useState)(!1),[A,$]=(0,r.useState)(""),[z,E]=(0,r.useState)(!1),[L,O]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[U,W]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),M(!1),$(""),E(!1),O(""),B(""),_(!1),W(!1)},K=async e=>{g(e),T(!1),M(!1),$(""),O(""),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(M(e),O(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eR(x);e&&($(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{}},[x,f]),q=async()=>{if(f&&!U){W(!0);try{let e=await (0,eM.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{W(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&A&&A!==f&&t&&"id"in t){E(!0),O("");let e=await eO(t.id);if(!e.safe){O(e.reason),E(!1);return}let r=await eL(t.id,A);if(E(!1),!r.success)return void O(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}H(),s(!1)},G=!i.trim()||!f.trim()||z||U||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)(h.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")})]}),x&&(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:x,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)(eE.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:A,onChange:e=>{$(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)(e$.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)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),L&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),L]})]})]}),(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)(eT.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||U?"opacity-50":""}`}),children:[U?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),U?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.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:z?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,L.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)(O.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)(B,{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)(_.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)(F.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:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(U.Sun,{className:"h-4 w-4"}):(0,t.jsx)(W.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(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)(h.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)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{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)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eA,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(709545),e_=r,eU=e.i(232478);class eW extends e_.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(eU.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var eH=e.i(530507),eK=e.i(673898),eV=e.i(260949);let eq=(0,eK.default)(()=>e.A(402824).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[143824]},ssr:!1});function eX({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.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)(_.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)(eV.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)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eq,{}):null})]})}var eG=e.i(315883);function eJ({onDismiss:e}){let{t:s}=(0,P.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)(eG.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 eY=e.i(661074),eZ=e.i(378617);let eQ=[{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 e0({onComplete:e}){let{t:s}=(0,P.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=eQ[a],m=(0,r.useCallback)(async()=>{await (0,eZ.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<eQ.length?t:e}),a>=eQ.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<eQ.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(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,499356,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/tower/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},325200,(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/tower/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)}()},627580,e=>{"use strict";let t=(0,e.i(258114).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])},632612,e=>{"use strict";var t=e.i(430989),r=e.i(641338),s=e.i(347880),a=e.i(226549),n=e.i(306308),o=e.i(304275),i=e.i(894362),l=e.i(584451),c=e.i(935792),d=e.i(258114);let u=(0,d.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,d.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var x=e.i(652459),h=e.i(819614);let p=(0,d.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(690287),g=e.i(24887),j=e.i(331548),b=e.i(814329),v=e.i(744838),w=e.i(745943),N=e.i(755683);let y=(0,N.createServerReference)("4052835964708c3d2b5d85b98110624ed61a4f2439",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60449d4cf48fc16063e8c051c5e42076795b2fdcaf",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("4081d55346a0f46271878f3fcde1aef5f3c91f6346",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("406d77475c2babb800fcb8428625e0d51a3e2735f2",N.callServer,void 0,N.findSourceMapURL,"getLabelsForWorkspace"),T=(0,N.createServerReference)("40d766282a86cab7bf3dc801c30d35c206032d4955",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40cb1f872088018d4b1347bb3fca95fe0366ca425a",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(349369),R=e.i(151201);let M=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function A({workspaces:e}){let d,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,z]=(0,r.useState)(!1),[L,O]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[U,W]=(0,r.useState)(""),[H,K]=(0,r.useState)(M[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!U.trim())return;let e=await y({name:U.trim(),description:H});W(""),K(M[0]),z(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[U,H,j]),Y=(0,r.useCallback)(async()=>{U.trim()&&V&&(await k(V,{name:U.trim(),description:H}),W(""),O(!1),q(null),j.refresh())},[U,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),W(e.name),K(e.description&&M.includes(e.description)?e.description:M[0]),O(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{R.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&M.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){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:G,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:N("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=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.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:M.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:()=>z(!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:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(r=X||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:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.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:N("sidebar.archive")})]})]}):null,(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"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:N("missions.navLabel")})]})]}),(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("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:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(u,{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:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),K(M[0]),z(!0)},title:N("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:e.map(r=>{var s;let a,n,o,d=X===r.id,u=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"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:M.includes(u)?u:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:u})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/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:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.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"===w?"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:N("missions.navLabel")})]}),(d=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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)(x.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/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:N("sidebar.archive")})]})]}):null,(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)($,{open:L,onOpenChange:e=>{O(e),e||q(null)},title:N("workspace.edit"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(E,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function $({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:M.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 z=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function E({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(z[0]);(0,r.useEffect)(()=>{e&&S(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await S(a)),c(""))},x=async e=>{await D(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:z.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 L=e.i(387104),O=e.i(811163),I=e.i(277547);let B=(0,d.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 F=e.i(514183),_=e.i(38431),U=e.i(924171),W=e.i(114954);e.s([],384466),e.i(384466),e.i(905022);var H=e.i(703995),K=e.i(855604);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=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,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(288782),Y=e.i(239917),Z=e.i(762879),Q=e.i(963195),ee=e.i(680765),et=e.i(534262);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.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,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(109792);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],612115);var eo=e.i(612115),eo=eo,ei=e.i(47816);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.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 ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.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 ed=(0,d.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 eu=e.i(259104);let em=(0,d.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"}]]),ex=(0,d.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 eh=e.i(621994);let ep=(0,N.createServerReference)("601e95e0f8db1209731d6d794c1d7142a382eba10b",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(640658);let eg=[{id:"all",key:"search.all",icon:O.Search},{id:"task",key:"search.task",icon:x.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??x.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 ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.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,ef.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 ep(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)(O.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)(eh.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:eg.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),{}),ej.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(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(599104),ey=e.i(924609),ek=e.i(698300),eC=e.i(993453),eS=e.i(510291),eT=e.i(696668),eD=e.i(779574);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(499356),e.i(325200);let eR=(0,N.createServerReference)("4033da9efec93a76fc0620d306c619b298322208ee",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eM=e.i(419574);function eA({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[g,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)("FRONTEND"),[C,S]=(0,r.useState)("idle"),[T,D]=(0,r.useState)(""),[M,A]=(0,r.useState)(!1),$=()=>{l(""),d(""),m(""),h(""),f(""),N(!1),k("FRONTEND"),S("idle"),D(""),A(!1)},z=async()=>{if(p.trim()&&!M&&"success"===C){A(!0);try{let e=await (0,eM.analyzeProjectDirectory)(p.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{A(!1)}}},E=async e=>{h(e),S("idle"),D("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),g||f(await eR(e))},L=async()=>{if(x.trim()&&p.trim()){S("cloning"),D("");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}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:p.trim()})}),r=await t.json();if(!t.ok){S("error"),D(r.error||"Clone failed");return}S("success")}catch{S("error"),D("Network error")}}},O=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:p.trim()||void 0,projectType:y}),$(),s(!1))};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||$()},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:x,onChange:e=>E(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.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:p,onChange:e=>{f(e.target.value),N(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),x.trim()&&p.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===C||"success"===C,onClick:L,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"===C?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===C?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===C?n("git.cloning"):"success"===C?n("git.cloned"):n("git.clone")]}),"error"===C&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),T]}),"success"===C&&(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)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:y,onChange:k})})]}),(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 ${!p.trim()||M?"opacity-50":""}`}),children:[M?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),M?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:p.trim()?"success"!==C?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.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),$()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:O,disabled:!i.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})})})}var e$=e.i(627580),e$=e$,ez=e.i(378399),eE=e.i(108523);let eL=(0,N.createServerReference)("60574fdac6089bf8fc377ba388554ac09dd4e6dcc4",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eO=(0,N.createServerReference)("40d3abd28d0a5bb431895dd4ac52143ab15cfccb6b",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,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,M]=(0,r.useState)(!1),[A,$]=(0,r.useState)(""),[z,E]=(0,r.useState)(!1),[L,O]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[U,W]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),M(!1),$(""),E(!1),O(""),B(""),_(!1),W(!1)},K=async e=>{g(e),T(!1),M(!1),$(""),O(""),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(M(e),O(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eR(x);e&&($(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{}},[x,f]),q=async()=>{if(f&&!U){W(!0);try{let e=await (0,eM.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{W(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&A&&A!==f&&t&&"id"in t){E(!0),O("");let e=await eO(t.id);if(!e.safe){O(e.reason),E(!1);return}let r=await eL(t.id,A);if(E(!1),!r.success)return void O(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}H(),s(!1)},G=!i.trim()||!f.trim()||z||U||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)(h.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")})]}),x&&(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:x,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)(eE.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:A,onChange:e=>{$(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)(e$.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)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),L&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),L]})]})]}),(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)(eT.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||U?"opacity-50":""}`}),children:[U?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),U?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.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:z?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,L.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)(O.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)(B,{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)(_.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)(F.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:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(U.Sun,{className:"h-4 w-4"}):(0,t.jsx)(W.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(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)(h.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)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{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)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eA,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(709545),e_=r,eU=e.i(232478);class eW extends e_.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(eU.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var eH=e.i(859123),eK=e.i(673898),eV=e.i(260949);let eq=(0,eK.default)(()=>e.A(402824).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[143824]},ssr:!1});function eX({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.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)(_.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)(eV.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)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eq,{}):null})]})}var eG=e.i(315883);function eJ({onDismiss:e}){let{t:s}=(0,P.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)(eG.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 eY=e.i(115537),eZ=e.i(330019);let eQ=[{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 e0({onComplete:e}){let{t:s}=(0,P.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=eQ[a],m=(0,r.useCallback)(async()=>{await (0,eZ.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<eQ.length?t:e}),a>=eQ.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<eQ.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
2
|
ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
|
|
3
3
|
transparent ${Math.max(o.width,o.height)}px,
|
|
4
4
|
rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,251449,302320,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return function t(){for(var r=this,n=arguments.length,a=Array(n),i=0;i<n;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(a,n))}}}function o(e){return({}).toString.call(e).includes("Object")}function c(e){return"function"==typeof e}var l,u,d=s(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),f=function(e,t){return o(t)||d("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&d("changeField"),t},m=function(e){c(e)||d("selectorType")},h=function(e){c(e)||o(e)||d("handlerType"),o(e)&&Object.values(e).some(function(e){return!c(e)})&&d("handlersType")},x=function(e){e||d("initialIsRequired"),o(e)||d("initialType"),Object.keys(e).length||d("initialContent")};function g(e,t){return c(t)?t(e.current):t}function p(e,t){return e.current=i(i({},e.current),t),t}function v(e,t,r){return c(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var b={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},y=(l=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];return n.length>=l.length?l.apply(this,n):function(){for(var r=arguments.length,a=Array(r),i=0;i<r;i++)a[i]=arguments[i];return e.apply(t,[].concat(n,a))}})(b),j=function(e){return(e||y("configIsRequired"),({}).toString.call(e).includes("Object")||y("configType"),e.urls)?(console.warn(b.deprecation),{paths:{vs:e.urls.monacoBase}}):e},w=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},N={type:"cancelation",msg:"operation is manually canceled"};function k(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(N):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],M=function(e){if(Array.isArray(e))return e}(u=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(e),h(t);var r={current:e},n=s(v)(r,t),a=s(p)(r),i=s(f)(e),o=s(g)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return m(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,a,i,o)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,a,i,s=[],o=!0,c=!1;try{a=(t=t.call(e)).next,!1;for(;!(o=(r=a.call(t)).done)&&(s.push(r.value),2!==s.length);o=!0);}catch(e){c=!0,n=e}finally{try{if(!o&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw n}}return s}}(u)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),C=M[0],O=M[1];function R(e){return document.body.appendChild(e)}function E(e){var t,r,n=C(function(e){return{config:e.config,reject:e.reject}}),a=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return a.onload=function(){return e()},a.onerror=n.reject,a}function P(){var e=C(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;L(r),e.resolve(r)},function(t){e.reject(t)})}function L(e){C().monaco||O({monaco:e})}var T=new Promise(function(e,t){return O({resolve:e,reject:t})}),D={config:function(e){var t=j(e),r=t.monaco,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,S);O(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),n(n({},t),r)}(e.config,a),monaco:r}})},init:function(){var e=C(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(O({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),k(T);if(window.monaco&&window.monaco.editor)return L(window.monaco),e.resolve(window.monaco),k(T);w(R,E)(P)}return k(T)},__getMonacoInstance:function(){return C(function(e){return e.monaco})}};e.s(["default",0,D],302320);var A=e.i(641338),I={display:"flex",position:"relative",textAlign:"initial"},U={width:"100%"},F={display:"none"},z={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},B=function({children:e}){return A.default.createElement("div",{style:z},e)},$=(0,A.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:i,wrapperProps:s}){return A.default.createElement("section",{style:{...I,width:e,height:t},...s},!r&&A.default.createElement(B,null,n),A.default.createElement("div",{ref:a,style:{...U,...!r&&F},className:i}))}),V=function(e){(0,A.useEffect)(e,[])},q=function(e,t,r=!0){let n=(0,A.useRef)(!0);(0,A.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function W(e,t,r,n){var a,i,s,o,c,l;return a=e,i=n,a.editor.getModel(_(a,i))||(s=e,o=t,c=r,l=n,s.editor.createModel(o,c,l?_(s,l):void 0))}function _(e,t){return e.Uri.parse(t)}var H=(0,A.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:c=!1,theme:l="light",loading:u="Loading...",options:d={},height:f="100%",width:m="100%",className:h,wrapperProps:x={},beforeMount:g=G,onMount:p=G}){let[v,b]=(0,A.useState)(!1),[y,j]=(0,A.useState)(!0),w=(0,A.useRef)(null),N=(0,A.useRef)(null),k=(0,A.useRef)(null),S=(0,A.useRef)(p),M=(0,A.useRef)(g),C=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(N.current=e)&&j(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return w.current?(t=w.current?.getModel(),void(o||t?.original?.dispose(),c||t?.modified?.dispose(),w.current?.dispose())):e.cancel()}}),q(()=>{if(w.current&&N.current){let t=w.current.getOriginalEditor(),a=W(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],v),q(()=>{if(w.current&&N.current){let e=w.current.getModifiedEditor(),n=W(N.current,t||"",a||r||"text",s||"");n!==e.getModel()&&e.setModel(n)}},[s],v),q(()=>{let e=w.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),q(()=>{w.current?.getModel()?.original.setValue(e||"")},[e],v),q(()=>{let{original:e,modified:t}=w.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],v),q(()=>{N.current?.editor.setTheme(l)},[l],v),q(()=>{w.current?.updateOptions(d)},[d],v);let O=(0,A.useCallback)(()=>{if(!N.current)return;M.current(N.current);let o=W(N.current,e||"",n||r||"text",i||""),c=W(N.current,t||"",a||r||"text",s||"");w.current?.setModel({original:o,modified:c})},[r,t,a,e,n,i,s]),R=(0,A.useCallback)(()=>{!C.current&&k.current&&(w.current=N.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),O(),N.current?.editor.setTheme(l),b(!0),C.current=!0)},[d,l,O]);return(0,A.useEffect)(()=>{v&&S.current(w.current,N.current)},[v]),(0,A.useEffect)(()=>{y||v||R()},[y,v,R]),A.default.createElement($,{width:m,height:f,isEditorReady:v,loading:u,_ref:k,className:h,wrapperProps:x})}),J=function(e){let t=(0,A.useRef)();return(0,A.useEffect)(()=>{t.current=e},[e]),t.current},K=new Map,X=(0,A.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:s="light",line:o,loading:c="Loading...",options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:m="100%",height:h="100%",className:x,wrapperProps:g={},beforeMount:p=G,onMount:v=G,onChange:b,onValidate:y=G}){let[j,w]=(0,A.useState)(!1),[N,k]=(0,A.useState)(!0),S=(0,A.useRef)(null),M=(0,A.useRef)(null),C=(0,A.useRef)(null),O=(0,A.useRef)(v),R=(0,A.useRef)(p),E=(0,A.useRef)(void 0),P=(0,A.useRef)(n),L=J(i),T=(0,A.useRef)(!1),I=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(S.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>M.current?void(E.current?.dispose(),f?d&&K.set(i,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose(),M.current=null,T.current=!1,w(!1)):e.cancel()}),q(()=>{let s=W(S.current,e||n||"",t||a||"",i||r||"");s!==M.current?.getModel()&&(d&&K.set(L,M.current?.saveViewState()),M.current?.setModel(s),d&&M.current?.restoreViewState(K.get(i)))},[i],j),q(()=>{M.current?.updateOptions(l)},[l],j),q(()=>{M.current&&void 0!==n&&(M.current.getOption(S.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(I.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),I.current=!1))},[n],j),q(()=>{let e=M.current?.getModel();j&&e&&a&&S.current?.editor.setModelLanguage(e,a)},[a,j],j),q(()=>{void 0!==o&&M.current?.revealLine(o)},[o],j),q(()=>{S.current?.editor.setTheme(s)},[s],j);let U=(0,A.useCallback)(()=>{if(!(!C.current||!S.current)&&!T.current){R.current(S.current);let c=i||r,f=W(S.current,n||e||"",t||a||"",c||"");M.current=S.current?.editor.create(C.current,{model:f,automaticLayout:!0,...l},u),d&&M.current.restoreViewState(K.get(c)),S.current.editor.setTheme(s),void 0!==o&&M.current.revealLine(o),w(!0),T.current=!0}},[e,t,r,n,a,i,l,u,d,s,o]);return(0,A.useEffect)(()=>{j&&O.current(M.current,S.current)},[j]),(0,A.useEffect)(()=>{N||j||U()},[N,j,U]),P.current=n,(0,A.useEffect)(()=>{j&&b&&(E.current?.dispose(),E.current=M.current?.onDidChangeModelContent(e=>{I.current||b(M.current.getValue(),e)}))},[j,b]),(0,A.useEffect)(()=>{if(j){let e=S.current.editor.onDidChangeMarkers(e=>{let t=M.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});y?.(e)}});return()=>{e?.dispose()}}return()=>{}},[j,y]),A.default.createElement($,{width:m,height:h,isEditorReady:j,loading:c,_ref:C,className:x,wrapperProps:g})});e.s(["DiffEditor",0,H,"Editor",0,X,"default",0,X,"useMonaco",0,function(){let[e,t]=(0,A.useState)(D.__getMonacoInstance());return V(()=>{let r;return e||(r=D.init()).then(e=>{t(e)}),()=>r?.cancel()}),e}],251449)},583315,e=>{"use strict";let t=(0,e.i(258114).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],583315)},113205,e=>{"use strict";var t=e.i(430989),r=e.i(47816);e.s(["EmptyState",0,function({icon:e,title:n,description:a,action:i,className:s}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",s),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:n}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},2139,e=>{"use strict";let t=(0,e.i(258114).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],2139)},653157,e=>{"use strict";let t=(0,e.i(258114).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],653157)},180685,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("78c11d994f9eece26b847bf3139b779d97ec363c54",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},945954,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("40b0be328179f86f28b11332f6259165af2ee8a56c",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},636477,545315,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("60448ee810344f12b03a536b18e82bfe384bfce12b",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r],636477);let n=(0,e.i(258114).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,n],545315)},898604,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("400780c443fb050d9591e15b8073c04e74b57790c1",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,r])},793832,474596,246534,510994,509558,942941,567598,539977,757272,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("6051797ae13c7f9f063b7dd8ec4373aa5c366931d0",t.callServer,void 0,t.findSourceMapURL,"listDirectory");e.s(["listDirectory",0,r],793832);let n=(0,t.createServerReference)("70b78aabdff6c2b0a720717a580aab126c0aecc30c",t.callServer,void 0,t.findSourceMapURL,"getGitStatus");e.s(["getGitStatus",0,n],474596);let a=(0,t.createServerReference)("60319a173a6c63c20224da28e585cebd6048355bcc",t.callServer,void 0,t.findSourceMapURL,"createFile");e.s(["createFile",0,a],246534);let i=(0,t.createServerReference)("604db8994a1a9fdaf604fa9620f7645a80ad8e2dfe",t.callServer,void 0,t.findSourceMapURL,"createDirectory");e.s(["createDirectory",0,i],510994);let s=(0,t.createServerReference)("70a44bf6396be70abf75e67ac7f9157582ac3b3c2b",t.callServer,void 0,t.findSourceMapURL,"renameEntry");e.s(["renameEntry",0,s],509558);let o=(0,t.createServerReference)("60cb8dc17b3aa2799997660bd076d3d80b5325d650",t.callServer,void 0,t.findSourceMapURL,"deleteEntry");e.s(["deleteEntry",0,o],942941);let c=(0,t.createServerReference)("40542d7ce68ba4ce25a505be5e3dcdba4ab027f1a2",t.callServer,void 0,t.findSourceMapURL,"listAllFiles");e.s(["listAllFiles",0,c],567598);let l=(0,t.createServerReference)("60b2fffce31254b391b97a4b5ff8ee3fe9c55715e5",t.callServer,void 0,t.findSourceMapURL,"readFileContent");e.s(["readFileContent",0,l],539977);let u=(0,t.createServerReference)("70b0c3e3d6914589ad6ebed3e9cb2fdb44b06ee178",t.callServer,void 0,t.findSourceMapURL,"writeFileContent");e.s(["writeFileContent",0,u],757272)},174145,e=>{"use strict";var t=e.i(228202),r=e.i(703995),n=e.i(555138),a=e.i(47816);let i=(0,n.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:n="default",render:s,...o}){var c;return c={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:n}),e)},o),render:s,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(c.defaultTagName??"div",c,c)}],174145)},170528,581511,e=>{"use strict";var t=e.i(93850);e.s(["CheckCircle2",()=>t.default],170528);let r=(0,e.i(258114).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,r],581511)},678978,e=>{"use strict";let t=(0,e.i(258114).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],678978)},202830,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("400c873233a97b2c1311dd18d7381863d05c9633e5",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},597736,e=>{"use strict";var t=e.i(794097);e.s(["ChevronRight",()=>t.default])},986633,e=>{"use strict";let t=(0,e.i(258114).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],986633)},928951,e=>{"use strict";let t=(0,e.i(258114).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],928951)},421051,e=>{"use strict";var t=e.i(860875);e.s(["AlertTriangle",()=>t.default])},246762,960732,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(597736),a=e.i(260949),i=e.i(421051),s=e.i(928951),o=e.i(258114);let c=(0,o.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var l=e.i(744838),u=e.i(113205),d=e.i(174145),f=e.i(331548),m=e.i(779574),h=e.i(349369);e.s(["TaskDiffView",0,function({files:e,totalAdded:o,totalRemoved:x,hasConflicts:g,conflictFiles:p,onCommit:v,hasUncommitted:b}){let{t:y}=(0,h.useI18n)(),[j,w]=(0,r.useState)(new Set),[N,k]=(0,r.useState)(!1),[S,M]=(0,r.useState)(""),[C,O]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[e.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",o]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",x]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:b&&v&&(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>k(!0),className:"gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),y("diff.commit")]})})]}),g&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(i.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",p.length," conflicting file",1!==p.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:p.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===e.length?(0,t.jsx)(u.EmptyState,{icon:s.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:e.map(e=>{let r=j.has(e.filename);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{var t;return t=e.filename,void w(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(n.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(d.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&e.patch&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:e.patch.split("\n").map((e,r)=>{let n=e.startsWith("+")&&!e.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")&&!e.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:n,children:e||" "},r)})})})]},e.filename)})})}),(0,t.jsx)(f.Dialog,{open:N,onOpenChange:k,children:(0,t.jsxs)(f.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsx)(f.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:S,onChange:e=>M(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>k(!1),children:y("common.cancel")}),(0,t.jsx)(l.Button,{onClick:async()=>{if(S.trim()&&v){O(!0);try{await v(S.trim()),M(""),k(!1)}finally{O(!1)}}},disabled:!S.trim()||C,children:C?"...":y("diff.commit")})]})]})})]})}],246762);var x=e.i(347880);let g=(0,o.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var p=e.i(924609);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:n,taskId:a,taskTitle:i,baseBranch:s,fileCount:o,commitCount:c,commitLog:u=[],onMergeComplete:d}){let m=(0,x.useRouter)(),[h,v]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null),j=async()=>{v(!0),y(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){n(!1),d(),m.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{v(!1)}};return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(f.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsxs)(f.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:s})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:c})]})]}),u.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:u.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>n(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(l.Button,{onClick:j,disabled:h,className:"gap-2",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],960732)},121505,e=>{"use strict";let t=(0,e.i(258114).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],121505)},775899,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(259104),a=e.i(260949),i=e.i(811163),s=e.i(698300),o=e.i(924609),c=e.i(331548),l=e.i(744838),u=e.i(745943),d=e.i(779574),f=e.i(349369);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:x,localPath:g,onCreated:p,onError:v}){let{t:b}=(0,f.useI18n)(),[y,j]=(0,r.useState)(""),[w,N]=(0,r.useState)(x),[k,S]=(0,r.useState)(""),[M,C]=(0,r.useState)(!1),[O,R]=(0,r.useState)(""),[E,P]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),N(x),S(""),R(""))},[e,x]);let L=[...new Set(h)].filter(e=>e.toLowerCase().includes(O.toLowerCase())),T=async()=>{if(y.trim()){C(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:y.trim(),baseBranch:w})});if(e.ok)m(!1),p();else{let t=await e.json();v(t.error||"Unknown error")}}catch{v("Network error")}finally{C(!1)}}};return(0,t.jsx)(c.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(c.DialogHeader,{children:(0,t.jsx)(c.DialogTitle,{children:b("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.branchName")}),(0,t.jsx)(u.Input,{value:y,onChange:e=>j(e.target.value),placeholder:b("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&T()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>P(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:O,onChange:e=>R(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:L.map(e=>(0,t.jsxs)("button",{onClick:()=>{N(e),P(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===w&&(0,t.jsx)(s.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.branchDesc")}),(0,t.jsx)(d.Textarea,{value:k,onChange:e=>S(e.target.value),placeholder:b("git.branchDescPlaceholder"),rows:2,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"})]})]}),(0,t.jsxs)(c.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>m(!1),children:b("common.cancel")}),(0,t.jsxs)(l.Button,{onClick:T,disabled:!y.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[M?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,b("common.create")]})]})]})})}])},426175,e=>{"use strict";async function t(e,r,n={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...n})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},155366,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("609f8c1d7710961168b065bc20bd93438bb2e77880",t.callServer,void 0,t.findSourceMapURL,"updateProject");e.s(["updateProject",0,r])},656284,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("4024f6d9f41e09e98a12ce95afe006665fa0a81c7d",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},697264,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("4072d632192adf6a43f929ae7adc0a98eb7e20c0e2",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},698173,664941,29571,43108,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("60f82bde7263a3f07ea777541e73f88165bb7d11d9",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],698173);let n=(0,t.createServerReference)("400594b8d851febc7cb9864815ee520e678cd8c582",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,n],664941);let a=(0,t.createServerReference)("604a3523f69d9a89b467a06177bf20792b0f8e5cb5",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],29571);let i=(0,e.i(258114).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,i],43108)},586211,e=>{"use strict";let t=(0,e.i(258114).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],586211)},711958,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(260949),a=e.i(569021),i=e.i(170528),s=e.i(581511),o=e.i(924609),c=e.i(43108),l=e.i(2139),u=e.i(545315),d=e.i(586211);let f=(0,e.i(258114).default)("history",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var m=e.i(744838),h=e.i(113205),x=e.i(349369);function g({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(i.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(s.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(c.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:s}){let{t:o,locale:c}=(0,x.useI18n)(),[p,v]=(0,r.useState)(null),[b,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:f,title:o("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("execution.history")}),e.map(r=>{let f=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),h=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let n=Math.floor(r/1e3);if(n<60)return`${n}s`;let a=Math.floor(n/60);if(a<60)return`${a}m ${n%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),x=p===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(g,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),n=Math.floor((new Date().getTime()-r.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",i=r.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===n?i:1===n?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:n<7?"zh"===t?`${n}天前 ${i}`:`${n}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,c)}),h&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",h,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||o("execution.noSummary")}),f&&(f.commits||f.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[f.commits?(0,t.jsxs)("span",{children:[f.commits," ",o("execution.commits")]}):null,f.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[f.filesChanged," ",o("execution.files")]})]}):null,f.insertions||f.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),f.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",f.insertions]}):null,f.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",f.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(b===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(d.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),b===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(n.ChevronDown,{className:"h-3 w-3"})]}),b===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&i?(0,t.jsxs)(m.Button,{size:"sm",onClick:()=>i(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(l.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&s?(0,t.jsxs)(m.Button,{size:"sm",onClick:s,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>v(x?null:r.id),className:"bg-muted text-muted-foreground",children:[x?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5"}),x?o("execution.collapse"):o("execution.details")]})]})]}),x&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}],711958)},555273,e=>{e.v(t=>Promise.all(["static/chunks/0ttrpz.l-v-yv.js"].map(t=>e.l(t))).then(()=>t(425393)))},286723,e=>{e.v(t=>Promise.all(["static/chunks/0tcl81ybuob5i.js"].map(t=>e.l(t))).then(()=>t(466255)))},885431,e=>{e.v(t=>Promise.all(["static/chunks/16w-ap~msrwpj.js"].map(t=>e.l(t))).then(()=>t(649318)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,251449,302320,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return function t(){for(var r=this,n=arguments.length,a=Array(n),i=0;i<n;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(a,n))}}}function o(e){return({}).toString.call(e).includes("Object")}function c(e){return"function"==typeof e}var l,u,d=s(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),f=function(e,t){return o(t)||d("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&d("changeField"),t},m=function(e){c(e)||d("selectorType")},h=function(e){c(e)||o(e)||d("handlerType"),o(e)&&Object.values(e).some(function(e){return!c(e)})&&d("handlersType")},x=function(e){e||d("initialIsRequired"),o(e)||d("initialType"),Object.keys(e).length||d("initialContent")};function g(e,t){return c(t)?t(e.current):t}function p(e,t){return e.current=i(i({},e.current),t),t}function v(e,t,r){return c(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var b={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},y=(l=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];return n.length>=l.length?l.apply(this,n):function(){for(var r=arguments.length,a=Array(r),i=0;i<r;i++)a[i]=arguments[i];return e.apply(t,[].concat(n,a))}})(b),j=function(e){return(e||y("configIsRequired"),({}).toString.call(e).includes("Object")||y("configType"),e.urls)?(console.warn(b.deprecation),{paths:{vs:e.urls.monacoBase}}):e},w=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},N={type:"cancelation",msg:"operation is manually canceled"};function k(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(N):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],M=function(e){if(Array.isArray(e))return e}(u=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(e),h(t);var r={current:e},n=s(v)(r,t),a=s(p)(r),i=s(f)(e),o=s(g)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return m(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,a,i,o)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,a,i,s=[],o=!0,c=!1;try{a=(t=t.call(e)).next,!1;for(;!(o=(r=a.call(t)).done)&&(s.push(r.value),2!==s.length);o=!0);}catch(e){c=!0,n=e}finally{try{if(!o&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw n}}return s}}(u)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),C=M[0],O=M[1];function R(e){return document.body.appendChild(e)}function E(e){var t,r,n=C(function(e){return{config:e.config,reject:e.reject}}),a=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return a.onload=function(){return e()},a.onerror=n.reject,a}function P(){var e=C(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;L(r),e.resolve(r)},function(t){e.reject(t)})}function L(e){C().monaco||O({monaco:e})}var T=new Promise(function(e,t){return O({resolve:e,reject:t})}),D={config:function(e){var t=j(e),r=t.monaco,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,S);O(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),n(n({},t),r)}(e.config,a),monaco:r}})},init:function(){var e=C(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(O({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),k(T);if(window.monaco&&window.monaco.editor)return L(window.monaco),e.resolve(window.monaco),k(T);w(R,E)(P)}return k(T)},__getMonacoInstance:function(){return C(function(e){return e.monaco})}};e.s(["default",0,D],302320);var A=e.i(641338),I={display:"flex",position:"relative",textAlign:"initial"},U={width:"100%"},z={display:"none"},F={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},B=function({children:e}){return A.default.createElement("div",{style:F},e)},$=(0,A.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:i,wrapperProps:s}){return A.default.createElement("section",{style:{...I,width:e,height:t},...s},!r&&A.default.createElement(B,null,n),A.default.createElement("div",{ref:a,style:{...U,...!r&&z},className:i}))}),V=function(e){(0,A.useEffect)(e,[])},q=function(e,t,r=!0){let n=(0,A.useRef)(!0);(0,A.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function W(e,t,r,n){var a,i,s,o,c,l;return a=e,i=n,a.editor.getModel(_(a,i))||(s=e,o=t,c=r,l=n,s.editor.createModel(o,c,l?_(s,l):void 0))}function _(e,t){return e.Uri.parse(t)}var H=(0,A.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:c=!1,theme:l="light",loading:u="Loading...",options:d={},height:f="100%",width:m="100%",className:h,wrapperProps:x={},beforeMount:g=G,onMount:p=G}){let[v,b]=(0,A.useState)(!1),[y,j]=(0,A.useState)(!0),w=(0,A.useRef)(null),N=(0,A.useRef)(null),k=(0,A.useRef)(null),S=(0,A.useRef)(p),M=(0,A.useRef)(g),C=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(N.current=e)&&j(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return w.current?(t=w.current?.getModel(),void(o||t?.original?.dispose(),c||t?.modified?.dispose(),w.current?.dispose())):e.cancel()}}),q(()=>{if(w.current&&N.current){let t=w.current.getOriginalEditor(),a=W(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],v),q(()=>{if(w.current&&N.current){let e=w.current.getModifiedEditor(),n=W(N.current,t||"",a||r||"text",s||"");n!==e.getModel()&&e.setModel(n)}},[s],v),q(()=>{let e=w.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),q(()=>{w.current?.getModel()?.original.setValue(e||"")},[e],v),q(()=>{let{original:e,modified:t}=w.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],v),q(()=>{N.current?.editor.setTheme(l)},[l],v),q(()=>{w.current?.updateOptions(d)},[d],v);let O=(0,A.useCallback)(()=>{if(!N.current)return;M.current(N.current);let o=W(N.current,e||"",n||r||"text",i||""),c=W(N.current,t||"",a||r||"text",s||"");w.current?.setModel({original:o,modified:c})},[r,t,a,e,n,i,s]),R=(0,A.useCallback)(()=>{!C.current&&k.current&&(w.current=N.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),O(),N.current?.editor.setTheme(l),b(!0),C.current=!0)},[d,l,O]);return(0,A.useEffect)(()=>{v&&S.current(w.current,N.current)},[v]),(0,A.useEffect)(()=>{y||v||R()},[y,v,R]),A.default.createElement($,{width:m,height:f,isEditorReady:v,loading:u,_ref:k,className:h,wrapperProps:x})}),J=function(e){let t=(0,A.useRef)();return(0,A.useEffect)(()=>{t.current=e},[e]),t.current},K=new Map,X=(0,A.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:s="light",line:o,loading:c="Loading...",options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:m="100%",height:h="100%",className:x,wrapperProps:g={},beforeMount:p=G,onMount:v=G,onChange:b,onValidate:y=G}){let[j,w]=(0,A.useState)(!1),[N,k]=(0,A.useState)(!0),S=(0,A.useRef)(null),M=(0,A.useRef)(null),C=(0,A.useRef)(null),O=(0,A.useRef)(v),R=(0,A.useRef)(p),E=(0,A.useRef)(void 0),P=(0,A.useRef)(n),L=J(i),T=(0,A.useRef)(!1),I=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(S.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>M.current?void(E.current?.dispose(),f?d&&K.set(i,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose(),M.current=null,T.current=!1,w(!1)):e.cancel()}),q(()=>{let s=W(S.current,e||n||"",t||a||"",i||r||"");s!==M.current?.getModel()&&(d&&K.set(L,M.current?.saveViewState()),M.current?.setModel(s),d&&M.current?.restoreViewState(K.get(i)))},[i],j),q(()=>{M.current?.updateOptions(l)},[l],j),q(()=>{M.current&&void 0!==n&&(M.current.getOption(S.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(I.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),I.current=!1))},[n],j),q(()=>{let e=M.current?.getModel();j&&e&&a&&S.current?.editor.setModelLanguage(e,a)},[a,j],j),q(()=>{void 0!==o&&M.current?.revealLine(o)},[o],j),q(()=>{S.current?.editor.setTheme(s)},[s],j);let U=(0,A.useCallback)(()=>{if(!(!C.current||!S.current)&&!T.current){R.current(S.current);let c=i||r,f=W(S.current,n||e||"",t||a||"",c||"");M.current=S.current?.editor.create(C.current,{model:f,automaticLayout:!0,...l},u),d&&M.current.restoreViewState(K.get(c)),S.current.editor.setTheme(s),void 0!==o&&M.current.revealLine(o),w(!0),T.current=!0}},[e,t,r,n,a,i,l,u,d,s,o]);return(0,A.useEffect)(()=>{j&&O.current(M.current,S.current)},[j]),(0,A.useEffect)(()=>{N||j||U()},[N,j,U]),P.current=n,(0,A.useEffect)(()=>{j&&b&&(E.current?.dispose(),E.current=M.current?.onDidChangeModelContent(e=>{I.current||b(M.current.getValue(),e)}))},[j,b]),(0,A.useEffect)(()=>{if(j){let e=S.current.editor.onDidChangeMarkers(e=>{let t=M.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});y?.(e)}});return()=>{e?.dispose()}}return()=>{}},[j,y]),A.default.createElement($,{width:m,height:h,isEditorReady:j,loading:c,_ref:C,className:x,wrapperProps:g})});e.s(["DiffEditor",0,H,"Editor",0,X,"default",0,X,"useMonaco",0,function(){let[e,t]=(0,A.useState)(D.__getMonacoInstance());return V(()=>{let r;return e||(r=D.init()).then(e=>{t(e)}),()=>r?.cancel()}),e}],251449)},583315,e=>{"use strict";let t=(0,e.i(258114).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],583315)},113205,e=>{"use strict";var t=e.i(430989),r=e.i(47816);e.s(["EmptyState",0,function({icon:e,title:n,description:a,action:i,className:s}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",s),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:n}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},2139,e=>{"use strict";let t=(0,e.i(258114).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],2139)},653157,e=>{"use strict";let t=(0,e.i(258114).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],653157)},111470,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("784ae1b90278fff4ac2f4d261a8f5298a3e7986b0a",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},681021,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("40d3c7de8b64ddb900e3f7ac46ac802673feb23198",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},481786,545315,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("607d47f7159f261048faf87ff026b8508d0239fdaa",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r],481786);let n=(0,e.i(258114).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,n],545315)},256974,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("40501732ea446df50236c8eec161d0fa22375ef8db",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,r])},849722,814121,327310,730984,846845,808246,240371,531723,436797,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("60203f8464f71f835fa0c7aea24f89c04d846c417a",t.callServer,void 0,t.findSourceMapURL,"listDirectory");e.s(["listDirectory",0,r],849722);let n=(0,t.createServerReference)("707293b7cd639d2a181551963b9e1b387cdcd20e64",t.callServer,void 0,t.findSourceMapURL,"getGitStatus");e.s(["getGitStatus",0,n],814121);let a=(0,t.createServerReference)("605d925686c6ab0560bb67dda69f4d70364e784cee",t.callServer,void 0,t.findSourceMapURL,"createFile");e.s(["createFile",0,a],327310);let i=(0,t.createServerReference)("60e4e7f53ae75eb6a626fdbbc4b371479b29fb9eb0",t.callServer,void 0,t.findSourceMapURL,"createDirectory");e.s(["createDirectory",0,i],730984);let s=(0,t.createServerReference)("70736c9ece34db9daa3639e21560c13dd43cf54836",t.callServer,void 0,t.findSourceMapURL,"renameEntry");e.s(["renameEntry",0,s],846845);let o=(0,t.createServerReference)("6085a3e2548ea2306c0a5fb125ea4da31854c43fc5",t.callServer,void 0,t.findSourceMapURL,"deleteEntry");e.s(["deleteEntry",0,o],808246);let c=(0,t.createServerReference)("40a296174ea48d9e38b684ac931876314af079eac8",t.callServer,void 0,t.findSourceMapURL,"listAllFiles");e.s(["listAllFiles",0,c],240371);let l=(0,t.createServerReference)("602bc85ea12826c838ddf574df8bb1cdc0fbc18c75",t.callServer,void 0,t.findSourceMapURL,"readFileContent");e.s(["readFileContent",0,l],531723);let u=(0,t.createServerReference)("70df9fa87c19ee1edbfba54ca7fad255c4021ca114",t.callServer,void 0,t.findSourceMapURL,"writeFileContent");e.s(["writeFileContent",0,u],436797)},174145,e=>{"use strict";var t=e.i(228202),r=e.i(703995),n=e.i(555138),a=e.i(47816);let i=(0,n.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:n="default",render:s,...o}){var c;return c={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:n}),e)},o),render:s,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(c.defaultTagName??"div",c,c)}],174145)},170528,581511,e=>{"use strict";var t=e.i(93850);e.s(["CheckCircle2",()=>t.default],170528);let r=(0,e.i(258114).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,r],581511)},678978,e=>{"use strict";let t=(0,e.i(258114).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],678978)},398965,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("408ea8569fbeb88bb94d6cfaa372c2c69cf2e78140",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},597736,e=>{"use strict";var t=e.i(794097);e.s(["ChevronRight",()=>t.default])},986633,e=>{"use strict";let t=(0,e.i(258114).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],986633)},928951,e=>{"use strict";let t=(0,e.i(258114).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],928951)},421051,e=>{"use strict";var t=e.i(860875);e.s(["AlertTriangle",()=>t.default])},246762,960732,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(597736),a=e.i(260949),i=e.i(421051),s=e.i(928951),o=e.i(258114);let c=(0,o.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var l=e.i(744838),u=e.i(113205),d=e.i(174145),f=e.i(331548),m=e.i(779574),h=e.i(349369);e.s(["TaskDiffView",0,function({files:e,totalAdded:o,totalRemoved:x,hasConflicts:g,conflictFiles:p,onCommit:v,hasUncommitted:b}){let{t:y}=(0,h.useI18n)(),[j,w]=(0,r.useState)(new Set),[N,k]=(0,r.useState)(!1),[S,M]=(0,r.useState)(""),[C,O]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[e.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",o]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",x]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:b&&v&&(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>k(!0),className:"gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),y("diff.commit")]})})]}),g&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(i.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",p.length," conflicting file",1!==p.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:p.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===e.length?(0,t.jsx)(u.EmptyState,{icon:s.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:e.map(e=>{let r=j.has(e.filename);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{var t;return t=e.filename,void w(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(n.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(d.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&e.patch&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:e.patch.split("\n").map((e,r)=>{let n=e.startsWith("+")&&!e.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")&&!e.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:n,children:e||" "},r)})})})]},e.filename)})})}),(0,t.jsx)(f.Dialog,{open:N,onOpenChange:k,children:(0,t.jsxs)(f.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsx)(f.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:S,onChange:e=>M(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>k(!1),children:y("common.cancel")}),(0,t.jsx)(l.Button,{onClick:async()=>{if(S.trim()&&v){O(!0);try{await v(S.trim()),M(""),k(!1)}finally{O(!1)}}},disabled:!S.trim()||C,children:C?"...":y("diff.commit")})]})]})})]})}],246762);var x=e.i(347880);let g=(0,o.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var p=e.i(924609);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:n,taskId:a,taskTitle:i,baseBranch:s,fileCount:o,commitCount:c,commitLog:u=[],onMergeComplete:d}){let m=(0,x.useRouter)(),[h,v]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null),j=async()=>{v(!0),y(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){n(!1),d(),m.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{v(!1)}};return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(f.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsxs)(f.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:s})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:c})]})]}),u.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:u.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>n(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(l.Button,{onClick:j,disabled:h,className:"gap-2",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],960732)},121505,e=>{"use strict";let t=(0,e.i(258114).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],121505)},775899,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(259104),a=e.i(260949),i=e.i(811163),s=e.i(698300),o=e.i(924609),c=e.i(331548),l=e.i(744838),u=e.i(745943),d=e.i(779574),f=e.i(349369);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:x,localPath:g,onCreated:p,onError:v}){let{t:b}=(0,f.useI18n)(),[y,j]=(0,r.useState)(""),[w,N]=(0,r.useState)(x),[k,S]=(0,r.useState)(""),[M,C]=(0,r.useState)(!1),[O,R]=(0,r.useState)(""),[E,P]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),N(x),S(""),R(""))},[e,x]);let L=[...new Set(h)].filter(e=>e.toLowerCase().includes(O.toLowerCase())),T=async()=>{if(y.trim()){C(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:y.trim(),baseBranch:w})});if(e.ok)m(!1),p();else{let t=await e.json();v(t.error||"Unknown error")}}catch{v("Network error")}finally{C(!1)}}};return(0,t.jsx)(c.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(c.DialogHeader,{children:(0,t.jsx)(c.DialogTitle,{children:b("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.branchName")}),(0,t.jsx)(u.Input,{value:y,onChange:e=>j(e.target.value),placeholder:b("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&T()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>P(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:O,onChange:e=>R(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:L.map(e=>(0,t.jsxs)("button",{onClick:()=>{N(e),P(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===w&&(0,t.jsx)(s.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.branchDesc")}),(0,t.jsx)(d.Textarea,{value:k,onChange:e=>S(e.target.value),placeholder:b("git.branchDescPlaceholder"),rows:2,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"})]})]}),(0,t.jsxs)(c.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>m(!1),children:b("common.cancel")}),(0,t.jsxs)(l.Button,{onClick:T,disabled:!y.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[M?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,b("common.create")]})]})]})})}])},426175,e=>{"use strict";async function t(e,r,n={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...n})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},136591,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("600fac665056812ea5f79dbd12710695302158346f",t.callServer,void 0,t.findSourceMapURL,"updateProject");e.s(["updateProject",0,r])},442960,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("40f21730f368b920d8bd0817480ffbbc2b201c3e95",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},604324,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("4047135f0933191c5ee458162e6e6d92a29ed59f4b",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},34179,814986,14532,43108,e=>{"use strict";var t=e.i(755683);let r=(0,t.createServerReference)("60af9bb4c12c5ad908eb74c7d14f1d1f25baea4eab",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],34179);let n=(0,t.createServerReference)("406a216a33797e8e8d95bd4b55e31a9e670f7acfe8",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,n],814986);let a=(0,t.createServerReference)("60b2324a08134cea27b48821a7151f989d0f6a9fb0",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],14532);let i=(0,e.i(258114).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,i],43108)},586211,e=>{"use strict";let t=(0,e.i(258114).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],586211)},711958,e=>{"use strict";var t=e.i(430989),r=e.i(641338),n=e.i(260949),a=e.i(569021),i=e.i(170528),s=e.i(581511),o=e.i(924609),c=e.i(43108),l=e.i(2139),u=e.i(545315),d=e.i(586211);let f=(0,e.i(258114).default)("history",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var m=e.i(744838),h=e.i(113205),x=e.i(349369);function g({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(i.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(s.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(c.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:s}){let{t:o,locale:c}=(0,x.useI18n)(),[p,v]=(0,r.useState)(null),[b,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:f,title:o("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("execution.history")}),e.map(r=>{let f=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),h=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let n=Math.floor(r/1e3);if(n<60)return`${n}s`;let a=Math.floor(n/60);if(a<60)return`${a}m ${n%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),x=p===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(g,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),n=Math.floor((new Date().getTime()-r.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",i=r.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===n?i:1===n?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:n<7?"zh"===t?`${n}天前 ${i}`:`${n}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,c)}),h&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",h,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||o("execution.noSummary")}),f&&(f.commits||f.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[f.commits?(0,t.jsxs)("span",{children:[f.commits," ",o("execution.commits")]}):null,f.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[f.filesChanged," ",o("execution.files")]})]}):null,f.insertions||f.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),f.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",f.insertions]}):null,f.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",f.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(b===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(d.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),b===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(n.ChevronDown,{className:"h-3 w-3"})]}),b===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&i?(0,t.jsxs)(m.Button,{size:"sm",onClick:()=>i(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(l.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&s?(0,t.jsxs)(m.Button,{size:"sm",onClick:s,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>v(x?null:r.id),className:"bg-muted text-muted-foreground",children:[x?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5"}),x?o("execution.collapse"):o("execution.details")]})]})]}),x&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}],711958)},555273,e=>{e.v(t=>Promise.all(["static/chunks/0yz33_rbgu2sz.js"].map(t=>e.l(t))).then(()=>t(425393)))},286723,e=>{e.v(t=>Promise.all(["static/chunks/0tcl81ybuob5i.js"].map(t=>e.l(t))).then(()=>t(466255)))},885431,e=>{e.v(t=>Promise.all(["static/chunks/16w-ap~msrwpj.js"].map(t=>e.l(t))).then(()=>t(649318)))}]);
|