purplemux-improved 0.5.12 → 0.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +13 -13
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +8 -8
  6. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05dwgd0._.js +1 -1
  7. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0a0mdoy._.js +1 -1
  8. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pg7_fw._.js +1 -1
  9. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u1k-9q._.js +1 -1
  10. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0v3gf92._.js +1 -1
  11. package/.next/standalone/.next/server/chunks/src_lib_0h.cczv._.js +3 -3
  12. package/.next/standalone/.next/server/chunks/ssr/_0a3w-rg._.js +1 -1
  13. package/.next/standalone/.next/server/chunks/ssr/_0bnw_6t._.js +1 -1
  14. package/.next/standalone/.next/server/chunks/ssr/_0rqsi1~._.js +1 -1
  15. package/.next/standalone/.next/server/middleware-build-manifest.js +13 -13
  16. package/.next/standalone/.next/server/pages/_app/build-manifest.json +2 -2
  17. package/.next/standalone/.next/server/pages/_app/client-build-manifest.json +1 -1
  18. package/.next/standalone/.next/server/pages/de/404.html +1 -1
  19. package/.next/standalone/.next/server/pages/de/500.html +1 -1
  20. package/.next/standalone/.next/server/pages/en/404.html +1 -1
  21. package/.next/standalone/.next/server/pages/en/500.html +1 -1
  22. package/.next/standalone/.next/server/pages/es/404.html +1 -1
  23. package/.next/standalone/.next/server/pages/es/500.html +1 -1
  24. package/.next/standalone/.next/server/pages/fr/404.html +1 -1
  25. package/.next/standalone/.next/server/pages/fr/500.html +1 -1
  26. package/.next/standalone/.next/server/pages/index/build-manifest.json +2 -2
  27. package/.next/standalone/.next/server/pages/index/client-build-manifest.json +1 -1
  28. package/.next/standalone/.next/server/pages/ja/404.html +1 -1
  29. package/.next/standalone/.next/server/pages/ja/500.html +1 -1
  30. package/.next/standalone/.next/server/pages/ko/404.html +1 -1
  31. package/.next/standalone/.next/server/pages/ko/500.html +1 -1
  32. package/.next/standalone/.next/server/pages/pt-BR/404.html +1 -1
  33. package/.next/standalone/.next/server/pages/pt-BR/500.html +1 -1
  34. package/.next/standalone/.next/server/pages/reports/build-manifest.json +2 -2
  35. package/.next/standalone/.next/server/pages/reports/client-build-manifest.json +1 -1
  36. package/.next/standalone/.next/server/pages/ru/404.html +1 -1
  37. package/.next/standalone/.next/server/pages/ru/500.html +1 -1
  38. package/.next/standalone/.next/server/pages/stats/build-manifest.json +2 -2
  39. package/.next/standalone/.next/server/pages/stats/client-build-manifest.json +1 -1
  40. package/.next/standalone/.next/server/pages/tr/404.html +1 -1
  41. package/.next/standalone/.next/server/pages/tr/500.html +1 -1
  42. package/.next/standalone/.next/server/pages/webview/build-manifest.json +2 -2
  43. package/.next/standalone/.next/server/pages/webview/client-build-manifest.json +1 -1
  44. package/.next/standalone/.next/server/pages/zh-CN/404.html +1 -1
  45. package/.next/standalone/.next/server/pages/zh-CN/500.html +1 -1
  46. package/.next/standalone/.next/server/pages/zh-TW/404.html +1 -1
  47. package/.next/standalone/.next/server/pages/zh-TW/500.html +1 -1
  48. package/.next/standalone/.next/static/{KSPZEOKlXuaPhmdGlwZxT → XH8X_54L0fDdER84NbvuC}/_buildManifest.js +4 -4
  49. package/.next/standalone/.next/static/chunks/{08.oo9haaotgu.js → 04-vr2~bhe3gk.js} +2 -2
  50. package/.next/standalone/.next/static/chunks/{0ar6x3d9tv434.js → 071fxwl82dusg.js} +1 -1
  51. package/.next/standalone/.next/static/chunks/{0r1_xeag0fz_b.js → 076b08p6gqmyb.js} +2 -2
  52. package/.next/standalone/.next/static/chunks/{0pbxj99mr9un4.js → 0i8skr_nole58.js} +2 -2
  53. package/.next/standalone/.next/static/chunks/{0-o3i9rwv6dzj.js → 11q9_-n21exoy.js} +2 -2
  54. package/.next/standalone/.next/static/chunks/14f5wx9jk1m2-.css +1 -0
  55. package/.next/standalone/.next/static/chunks/{01migx8xnb_bj.js → 16rs.mjtytb3l.js} +1 -1
  56. package/.next/standalone/.next/static/chunks/{0ti45-0zl-td0.js → 17~ejwmffd00t.js} +2 -2
  57. package/.next/standalone/.next/static/chunks/{0a4~vp7vd624o.js → 180lem0m4ri1v.js} +1 -1
  58. package/.next/standalone/.next/static/chunks/{turbopack-0gp8agrlmjdt6.js → turbopack-0.emi_o0dsjxa.js} +1 -1
  59. package/.next/standalone/.next/static/chunks/{turbopack-11792u34c2ui6.js → turbopack-0ql66xj_3-uuv.js} +1 -1
  60. package/.next/standalone/.next/static/chunks/{turbopack-17i5zynk90874.js → turbopack-0ve1z-8gcwn9~.js} +1 -1
  61. package/.next/standalone/.next/static/chunks/{turbopack-0s1h8a5y98z1k.js → turbopack-0xw9814ea_y1n.js} +1 -1
  62. package/.next/standalone/.next/static/chunks/{turbopack-0r891i.lhjx4o.js → turbopack-174jxp06a7x5h.js} +1 -1
  63. package/.next/standalone/package.json +1 -1
  64. package/.next/standalone/server.js +1 -1
  65. package/bin/process-lifecycle.cjs +53 -0
  66. package/bin/server-supervisor.cjs +24 -4
  67. package/dist/server.js +43 -15
  68. package/package.json +1 -1
  69. package/.next/standalone/.next/static/chunks/00vworbelwh9a.css +0 -1
  70. /package/.next/standalone/.next/static/{KSPZEOKlXuaPhmdGlwZxT → XH8X_54L0fDdER84NbvuC}/_clientMiddlewareManifest.js +0 -0
  71. /package/.next/standalone/.next/static/{KSPZEOKlXuaPhmdGlwZxT → XH8X_54L0fDdER84NbvuC}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,131464,e=>{"use strict";let t=(0,e.i(205270).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],131464)},350064,e=>{"use strict";var t=e.i(191788);let s=e=>{let t=window.visualViewport;return t?.addEventListener("resize",e),t?.addEventListener("scroll",e),()=>{t?.removeEventListener("resize",e),t?.removeEventListener("scroll",e)}},a=()=>{let e=window.visualViewport;return e&&1===e.scale?`${e.height}:${Math.max(0,e.offsetTop)}`:""},r=()=>"";e.s(["default",0,e=>{let i=(0,t.useSyncExternalStore)(s,a,r);if(!e||!i)return;let[l,n]=i.split(":").map(Number);return{position:"fixed",left:0,right:0,top:n,height:l}}])},734549,456992,644113,390995,75769,e=>{"use strict";var t=e.i(191788),s=e.i(950323),a=e.i(679935),r=e.i(844044);let i=e=>fetch(e).then(e=>{if(!e.ok)throw Error("fetch failed");return e.json()}),l={builtins:[],custom:[],order:[]},n=(e,t)=>{if(0===t.length)return e;let s=new Map(e.map(e=>[e.id,e])),a=[];for(let e of t){let t=s.get(e);t&&(a.push(t),s.delete(e))}for(let e of s.values())a.push(e);return a};e.s(["default",0,()=>{let{data:e,isLoading:d,mutate:o}=(0,s.default)("/api/sidebar-items",i,{revalidateOnFocus:!1}),c=e??l,u=(0,t.useMemo)(()=>n([...c.builtins,...c.custom].filter(e=>e.enabled),c.order),[c]),m=(0,t.useMemo)(()=>n([...c.builtins,...c.custom],c.order),[c]),p=(0,t.useCallback)(async(e,t,s)=>{let a=e.filter(e=>!e.enabled).map(e=>e.id);if(!(await fetch("/api/sidebar-items",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:t,disabledBuiltinIds:a,order:s})})).ok)throw Error("save failed")},[]),h=(0,t.useCallback)(async(e,t)=>{let s=s=>({...s,builtins:s.builtins.map(s=>s.id===e?{...s,enabled:t}:s)});await o(async e=>{let t=s(e??l);return await p(t.builtins,t.custom,t.order),t},{optimisticData:e=>s(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),x=(0,t.useCallback)(async e=>{let t=t=>({...t,custom:e});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),f=(0,t.useCallback)(async e=>{let t=t=>({...t,order:e});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),g=(0,t.useCallback)(async e=>{let t=t=>({...t,custom:t.custom.filter(t=>t.id!==e),order:t.order.filter(t=>t!==e)});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),v=(0,t.useCallback)(async()=>{let e=e=>({builtins:e.builtins.map(e=>({...e,enabled:!0})),custom:[],order:[]});await o(async t=>{let s=e(t??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:t=>e(t??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]);return{items:u,allOrderedItems:m,builtinItems:c.builtins,customItems:c.custom,order:c.order,isLoading:d,toggleBuiltin:h,saveCustom:x,saveOrder:f,deleteItem:g,resetAll:v}}],734549);var d=e.i(205270);let o=(0,d.default)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);e.s(["Link",0,o],456992);let c=(0,d.default)("bookmark",[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]]);e.s(["Bookmark",0,c],644113);let u=(0,d.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",0,u],390995);let m=(0,d.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,m],75769)},292057,e=>{"use strict";let t=(0,e.i(205270).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);e.s(["BarChart3",0,t],292057)},595838,405624,545719,920814,477254,809852,575461,398024,409155,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);e.s(["PieChart",0,s],595838);let a=(0,t.default)("chart-line",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);e.s(["LineChart",0,a],405624);let r=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,r],545719);let i=(0,t.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);e.s(["Database",0,i],920814);let l=(0,t.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,l],477254);let n=(0,t.default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,n],809852);let d=(0,t.default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);e.s(["Key",0,d],575461);let o=(0,t.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,o],398024);let c=(0,t.default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,c],409155)},983832,e=>{"use strict";let t=(0,e.i(205270).default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,t],983832)},218516,798656,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,s],218516);let a=(0,t.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);e.s(["Camera",0,a],798656)},676618,e=>{"use strict";let t=(0,e.i(205270).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",0,t])},674389,201692,786428,985044,117595,526251,536586,606306,504838,143547,e=>{"use strict";var t=e.i(676618);e.s(["Image",()=>t.default],674389);var s=e.i(205270);let a=(0,s.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,a],201692);let r=(0,s.default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,r],786428);let i=(0,s.default)("headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);e.s(["Headphones",0,i],985044);let l=(0,s.default)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);e.s(["Mic",0,l],117595);let n=(0,s.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["File",0,n],526251);let d=(0,s.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,d],536586);let o=(0,s.default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);e.s(["GitFork",0,o],606306);let c=(0,s.default)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);e.s(["Bug",0,c],504838);let u=(0,s.default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);e.s(["Sliders",0,u],143547)},401686,e=>{"use strict";let t=(0,e.i(205270).default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s(["Palette",0,t],401686)},593828,353028,686047,348916,230129,561275,258769,503808,472930,47091,506495,239845,993101,548361,836294,749141,502599,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("brush",[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]]);e.s(["Brush",0,s],593828);let a=(0,t.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);e.s(["Map",0,a],353028);let r=(0,t.default)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);e.s(["MapPin",0,r],686047);let i=(0,t.default)("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);e.s(["Navigation",0,i],348916);let l=(0,t.default)("compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]);e.s(["Compass",0,l],230129);let n=(0,t.default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,n],561275);let d=(0,t.default)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);e.s(["Tablet",0,d],258769);let o=(0,t.default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);e.s(["Laptop",0,o],503808);let c=(0,t.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,c],472930);let u=(0,t.default)("circuit-board",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]]);e.s(["CircuitBoard",0,u],47091);let m=(0,t.default)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Radio",0,m],506495);let p=(0,t.default)("bluetooth",[["path",{d:"m7 7 10 10-5 5V2l5 5L7 17",key:"1q5490"}]]);e.s(["Bluetooth",0,p],239845);let h=(0,t.default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);e.s(["Heart",0,h],993101);let x=(0,t.default)("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);e.s(["ThumbsUp",0,x],548361);let f=(0,t.default)("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);e.s(["Smile",0,f],836294);let g=(0,t.default)("coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);e.s(["Coffee",0,g],749141);let v=(0,t.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);e.s(["Rocket",0,v],502599)},19080,760709,629679,289133,401399,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);e.s(["Award",0,s],19080);let a=(0,t.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Target",0,a],760709);let r=(0,t.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);e.s(["Flag",0,r],629679);let i=(0,t.default)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);e.s(["Crosshair",0,i],289133);let l=(0,t.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);e.s(["Layers",0,l],401399)},40546,e=>{"use strict";let t=(0,e.i(205270).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["Layout",0,t],40546)},274489,e=>{"use strict";var t=e.i(191788),s=e.i(878528),a=e.i(456992),r=e.i(23826),i=e.i(644113),l=e.i(390995),n=e.i(75769),d=e.i(781641),o=e.i(292057),c=e.i(595838),u=e.i(405624),m=e.i(383751),p=e.i(815242),h=e.i(21152),x=e.i(545719),f=e.i(920814),g=e.i(477254),v=e.i(809852),j=e.i(470656),y=e.i(769480),b=e.i(575461),k=e.i(398024),N=e.i(665263),w=e.i(409155),C=e.i(918703),S=e.i(983832),M=e.i(218516),A=e.i(484862),T=e.i(550309),D=e.i(609104),I=e.i(798656),P=e.i(674389),E=e.i(201692),z=e.i(786428),B=e.i(985044),L=e.i(117595),R=e.i(835838),F=e.i(526251),O=e.i(661059),H=e.i(883210),V=e.i(536586),$=e.i(817908),q=e.i(932268),G=e.i(735299),K=e.i(606306),U=e.i(504838),_=e.i(399366),W=e.i(480778),Y=e.i(143547),J=e.i(401686),Z=e.i(593828),X=e.i(353028),Q=e.i(686047),ee=e.i(348916),et=e.i(230129),es=e.i(561275),ea=e.i(584166),er=e.i(830422),ei=e.i(258769),el=e.i(503808),en=e.i(520688),ed=e.i(472930),eo=e.i(976977),ec=e.i(47091),eu=e.i(506495),em=e.i(239845),ep=e.i(993101),eh=e.i(548361),ex=e.i(836294),ef=e.i(749141),eg=e.i(502599),ev=e.i(718581),ej=e.i(692127),ey=e.i(582809),eb=e.i(131464),ek=e.i(19080),eN=e.i(186534),ew=e.i(760709),eC=e.i(629679),eS=e.i(289133),eM=e.i(401399),eA=e.i(40546),eT=e.i(205270);let eD=(0,eT.default)("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),eI=(0,eT.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),eP=(0,eT.default)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]),eE=(0,eT.default)("kanban",[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]]);var ez=e.i(977356);let eB=(0,eT.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),eL=(0,eT.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"}]]),eR=(0,eT.default)("graduation-cap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]),eF=(0,eT.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),eO={Globe:s.Globe,Link:a.Link,ExternalLink:r.ExternalLink,Bookmark:i.Bookmark,Star:l.Star,Home:n.Home,FileText:d.FileText,BarChart3:o.BarChart3,PieChart:c.PieChart,LineChart:u.LineChart,Activity:m.Activity,Zap:p.Zap,Terminal:h.Terminal,Code:x.Code,Database:f.Database,Server:g.Server,Cloud:v.Cloud,Shield:j.Shield,Lock:y.Lock,Key:b.Key,User:k.User,Users:N.Users,Mail:w.Mail,MessageSquare:C.MessageSquare,Bell:S.Bell,Calendar:M.Calendar,Clock:A.Clock,Search:T.Search,Eye:D.Eye,Camera:I.Camera,Image:P.Image,Film:E.Film,Music:z.Music,Headphones:B.Headphones,Mic:L.Mic,Folder:R.Folder,File:F.File,Archive:O.Archive,Download:H.Download,Upload:V.Upload,GitBranch:$.GitBranch,GitCommit:q.GitCommit,GitPullRequest:G.GitPullRequest,GitFork:K.GitFork,Bug:U.Bug,Wrench:_.Wrench,Settings:W.Settings,Sliders:Y.Sliders,Palette:J.Palette,Brush:Z.Brush,Map:X.Map,MapPin:Q.MapPin,Navigation:ee.Navigation,Compass:et.Compass,Wifi:es.Wifi,Monitor:ea.Monitor,Smartphone:er.Smartphone,Tablet:ei.Tablet,Laptop:el.Laptop,Cpu:en.Cpu,HardDrive:ed.HardDrive,MemoryStick:eo.MemoryStick,CircuitBoard:ec.CircuitBoard,Radio:eu.Radio,Bluetooth:em.Bluetooth,Heart:ep.Heart,ThumbsUp:eh.ThumbsUp,Smile:ex.Smile,Coffee:ef.Coffee,Rocket:eg.Rocket,Flame:ev.Flame,Sun:ej.Sun,Moon:ey.Moon,Sparkles:eb.Sparkles,Award:ek.Award,Trophy:eN.Trophy,Target:ew.Target,Flag:eC.Flag,Crosshair:eS.Crosshair,Layers:eM.Layers,Layout:eA.Layout,Grid:eD,List:eI,Table:eP,Kanban:eE,Bot:ez.Bot,Brain:eB,Lightbulb:eL,GraduationCap:eR,BookOpen:eF};e.s(["default",0,e=>{let{name:s,className:a,style:r}=e,i=eO[s];return i?(0,t.createElement)(i,{className:a,style:r}):null},"getIcon",0,e=>eO[e]],274489)},518313,e=>{"use strict";var t=e.i(391398),s=e.i(191788),a=e.i(352819),r=e.i(679935),i=e.i(939310),l=e.i(45124),n=e.i(31050),d=e.i(246618);e.s(["default",0,()=>{let e=(0,a.useTranslations)("settings.typography"),o=(0,n.default)(e=>e.regionTypography),c=(0,n.default)(e=>e.setRegionTypography),[u,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(!1),x=u??o,f=(0,d.isValidRegionTypography)(x),g=!(0,d.regionTypographyEqual)(x,o),v=(e,t,s)=>{let a={...x[e],[t]:s};void 0===s&&delete a[t];let r={...x,[e]:a};0===Object.keys(a).length&&delete r[e],m(r)},j=async()=>{h(!0);try{await c(x),m(null),r.toast.success(e("applied"))}catch(t){r.toast.error(e("failed"),{description:t instanceof Error?t.message:void 0})}finally{h(!1)}};return(0,t.jsxs)("fieldset",{disabled:p,className:"space-y-4 border-b pb-4",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("fontHelp")}),d.TYPOGRAPHY_REGIONS.map(s=>{let a=x[s]??{},r=(0,d.isValidRegionTypography)({[s]:a})?a:{};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e(`regions.${s}`)}),(0,t.jsx)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:!x[s],onClick:()=>{let e={...x};delete e[s],m(e)},children:e("reset")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("label",{className:"space-y-1 text-xs sm:col-span-2",children:[(0,t.jsx)("span",{children:e("fontFamily")}),(0,t.jsx)(l.Input,{value:a.fontFamily??"",maxLength:200,placeholder:e("fontPlaceholder"),onChange:e=>v(s,"fontFamily",e.target.value||void 0)})]}),(0,t.jsxs)("label",{className:"space-y-1 text-xs",children:[(0,t.jsx)("span",{children:e("fontSize")}),(0,t.jsx)(l.Input,{type:"number",min:d.MIN_REGION_FONT_SIZE,max:d.MAX_REGION_FONT_SIZE,step:"1",value:a.fontSize??"",placeholder:e("default"),onChange:e=>v(s,"fontSize",""===e.target.value?void 0:Number(e.target.value))})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("label",{htmlFor:`typography-color-${s}`,children:e("color")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[a.color&&!(0,d.isValidTypographyColor)(a.color)?(0,t.jsx)("span",{role:"img","aria-label":e("invalid"),className:"flex h-9 w-9 shrink-0 items-center justify-center rounded border border-destructive text-destructive",children:"!"}):(0,t.jsx)("input",{type:"color",className:"h-9 w-9 shrink-0 cursor-pointer rounded border bg-transparent","aria-label":`${e(`regions.${s}`)} ${e("color")}`,title:a.color??e("default"),value:a.color??"#808080",onChange:e=>v(s,"color",e.target.value)}),(0,t.jsx)(l.Input,{id:`typography-color-${s}`,value:a.color??"",maxLength:7,placeholder:e("default"),"aria-invalid":!!a.color&&!(0,d.isValidTypographyColor)(a.color),onChange:e=>v(s,"color",e.target.value||void 0)})]})]})]}),(0,t.jsx)("div",{className:"overflow-auto rounded bg-muted/30 p-2",style:{fontFamily:r.fontFamily?(0,d.regionFontFamily)(r.fontFamily):void 0,fontSize:r.fontSize,color:r.color},children:e("preview")})]},s)}),!f&&(0,t.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:e("invalid")}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-between gap-2",children:[(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",disabled:0===Object.keys(x).length,onClick:()=>m({}),children:e("resetAll")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",disabled:!g,onClick:()=>m(null),children:e("cancel")}),(0,t.jsx)(i.Button,{type:"button",size:"sm",disabled:!g||!f,onClick:j,children:e(p?"saving":"apply")})]})]})]})}])},524845,(e,t,s)=>{t.exports={name:"purplemux-improved",version:"0.5.12",description:"Manage multiple Claude Code sessions from your browser",license:"MIT",author:"subicura",repository:{type:"git",url:"https://github.com/stirp/purplemux-improved.git"},homepage:"https://github.com/stirp/purplemux-improved",bugs:{url:"https://github.com/stirp/purplemux-improved/issues"},keywords:["claude","terminal","multiplexer","tmux","claude-code"],engines:{node:">=24.0.0"},packageManager:"pnpm@12.11.2",browserslist:["chrome 111","edge 111","firefox 111","safari 15.4","ios_saf 15.4"],main:"dist-electron/main.js",bin:{"purplemux-improved":"./bin/purplemux.js",pmuxi:"./bin/cli.js"},files:["bin/","dist/",".next/standalone/","src/config/tmux.conf"],scripts:{dev:"tsx watch server.ts",build:"next build && node scripts/post-build.js && tsup","build:landing":"eleventy","dev:landing":"eleventy --serve","build:server":"tsup","build:electron:main":"tsup --config electron/tsup.config.ts","build:electron":"next build && node scripts/post-build.js --electron && tsup && pnpm build:electron:main","dev:electron":"ELECTRON_DEV_URL=http://localhost:8022 electron .","pack:electron":"pnpm build:electron && electron-builder --mac","pack:electron:linux":"pnpm build:electron && electron-builder --linux AppImage","pack:electron:dev":"pnpm build:electron && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --mac -c.mac.identity=null -c.mac.notarize=false",start:"NODE_ENV=production tsx server.ts",lint:"eslint",test:"vitest run && pnpm test:cli","test:cli":"node --test tests/cli/*.test.cjs","test:watch":"vitest",ralph:"node ralph-loop.js",prepublishOnly:"rm -rf .next dist dist-electron && pnpm build",postinstall:"chmod +x node_modules/.pnpm/node-pty@*/node_modules/node-pty/prebuilds/*/spawn-helper 2>/dev/null; exit 0"},dependencies:{"@base-ui/react":"^1.3.0","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@git-diff-view/core":"^0.1.3","@git-diff-view/file":"^0.1.3","@git-diff-view/react":"^0.1.3","@hookform/resolvers":"^5.9.1","@tailwindcss/typography":"^0.5.19","@xterm/addon-clipboard":"^0.2.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-unicode11":"^0.9.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0",acorn:"^8.18.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",cmdk:"^1.1.1",dayjs:"^1.11.20",diff:"^9.0.0",jose:"^6.2.2",koffi:"2.15.2","lucide-react":"^1.7.0",motion:"^12.38.0",nanoid:"^5.1.7",next:"16.2.6","next-intl":"^4.11.0","next-themes":"^0.4.6","node-pty":"1.2.0-beta.12",pino:"^10.3.1","pino-pretty":"^13.1.3","pino-roll":"^4.0.0",react:"19.2.5","react-dom":"19.2.5","react-hook-form":"^7.90.0","react-hotkeys-hook":"^5.2.4","react-icons":"^5.6.0","react-markdown":"^10.1.0","react-resizable-panels":"^4.10.0",recharts:"^3.8.0","rehype-highlight":"^7.0.2","rehype-raw":"^7.0.0","remark-gfm":"^4.0.1","smol-toml":"^1.6.1",sonner:"^2.0.7",swr:"^2.4.1","tailwind-merge":"^3.5.0","tw-animate-css":"^1.4.0","update-notifier":"^7.3.1","use-stick-to-bottom":"^1.1.3",vaul:"^1.1.2","web-push":"^3.6.7",ws:"^8.20.0",zod:"^4.3.6",zustand:"^5.0.12"},devDependencies:{"@11ty/eleventy":"^3.1.5","@electron/rebuild":"^4.0.3","@tailwindcss/postcss":"^4","@types/node":"^24.12.0","@types/react":"^19","@types/react-dom":"^19","@types/web-push":"^3.6.4","@types/ws":"^8.18.1",chalk:"^5.6.2",electron:"^41.1.1","electron-builder":"^26.8.1","electron-updater":"^6.8.3",eslint:"^9","eslint-config-next":"16.2.5",jsdom:"^26.1.0",shadcn:"^4.1.2",tailwindcss:"^4",tsup:"^8.5.1",tsx:"^4.21.0",typescript:"^5.9.3",vitest:"^4.1.4"}}},88883,e=>{"use strict";var t=e.i(391398),s=e.i(883210),a=e.i(637939),a=a,r=e.i(53073),i=e.i(191788),l=e.i(352819),n=e.i(939310),d=e.i(212283),o=e.i(950323);let c=async(e,t)=>{let s=window.electronAPI;if(s?.isElectron){if(!s.getAppUpdate||!s.appUpdateAction)throw Error("This desktop version does not expose update controls. Use the application menu.");return e?s.appUpdateAction(e,t):s.getAppUpdate()}let a=await fetch("/api/app-update",{method:e?"POST":"GET",cache:"no-store",...e?{headers:{"Content-Type":"application/json","x-purplemux-update":"1"},body:JSON.stringify({action:e,version:t})}:{}});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error||`Update service: HTTP ${a.status}`)}return a.json()},u=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,m=e=>"string"==typeof e&&u.test(e)&&e.split(".").every(e=>Number.isSafeInteger(Number(e)));e.s(["default",0,e=>{let{compact:u=!1}=e,p=(0,l.useTranslations)("settings.appUpdate"),{state:h,error:x,requesting:f,run:g,desktop:v,reconnectTimedOut:j}=(()=>{let e=!!window.electronAPI?.isElectron,{data:t,error:s,mutate:a}=(0,o.default)(e?"app-update:desktop":"app-update:server",()=>c(),{refreshInterval:e=>e&&["checking","downloading","restarting"].includes(e.phase)?2e3:3e4,dedupingInterval:1e3,shouldRetryOnError:!0,errorRetryInterval:3e3}),[r,l]=(0,i.useState)(!1),[n,d]=(0,i.useState)(null),[u,m]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(t?.phase!=="restarting")return;let e=setTimeout(()=>m(!0),15e4);return()=>clearTimeout(e)},[t?.phase]);let p=(0,i.useRef)(null);(0,i.useEffect)(()=>{t&&(p.current&&p.current!==t.currentVersion&&window.location.reload(),p.current=t.currentVersion)},[t]);let h=async(e,t)=>{l(!0),d(null),m(!1);try{await a(await c(e,t),{revalidate:!1})}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}};return{state:t,error:n||(s instanceof Error?s.message:null),requesting:r,run:h,desktop:e,reconnectTimedOut:t?.phase==="restarting"&&u}})(),[y,b]=(0,i.useState)(null),k=!!h?.latestVersion&&((e,t)=>{if(!m(e)||!m(t))return!1;let s=e.split(".").map(Number),a=t.split(".").map(Number);for(let e=0;e<s.length;e++)if(s[e]!==a[e])return s[e]>a[e];return!1})(h.latestVersion,h.currentVersion),N=k&&h?.skippedVersion===h?.latestVersion,w=f||!!h?.installing||["checking","downloading","restarting"].includes(h?.phase||""),C=h?.installing||["downloading","ready","blocked","restarting"].includes(h?.phase||"");return(!u||!N||C||h?.error||x)&&(!u||k||h?.error||["downloading","blocked","restarting"].includes(h?.phase||""))?(0,t.jsxs)("section",{"aria-label":p("title"),className:u?"shrink-0 border-b bg-muted px-3 py-2":"space-y-3",children:[(0,t.jsxs)("div",{className:u?"flex flex-wrap items-center justify-between gap-3":"flex flex-col items-stretch justify-between gap-3 sm:flex-row sm:items-center",children:[(0,t.jsxs)("div",{className:u?"min-w-0 flex-1 basis-48 space-y-1":"min-w-0 flex-1 space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:u&&k?p("available",{version:h.latestVersion}):p("title")}),!u&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p(v?"desktopDescription":"serverDescription")}),h&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",role:"status",children:[p("current",{version:h.currentVersion})," · ",p("idle"!==h.phase||h.checkedAt?h.phase:"notChecked",{version:h.latestVersion||""}),!u&&k&&"available"!==h.phase&&` \xb7 ${p("available",{version:h.latestVersion})}`,null!==h.progress&&"downloading"===h.phase&&` ${Math.round(h.progress)}%`]}),!u&&N&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("skipped",{version:h.latestVersion})})]}),(0,t.jsxs)("div",{className:"flex max-w-full shrink-0 flex-wrap gap-2",children:[!u&&(0,t.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:w,onClick:()=>void g("check"),children:[w?(0,t.jsx)(a.default,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(r.RefreshCw,{className:"h-4 w-4"}),p("check")]}),k&&(0,t.jsxs)(n.Button,{size:"sm",disabled:w||!h?.supported,onClick:()=>void g("install"),children:[w?(0,t.jsx)(a.default,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(s.Download,{className:"h-4 w-4"}),p("install")]}),k&&(0,t.jsx)(n.Button,{variant:"destructive",size:"sm",disabled:w||!h?.supported,onClick:()=>b(h.latestVersion),children:p("forceInstall")}),k&&!N&&(0,t.jsx)(n.Button,{variant:"outline",size:"sm",disabled:w,onClick:()=>void g("skip",h.latestVersion),children:p("skip")})]})]}),h?.phase==="restarting"&&(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p(v?"desktopReconnecting":"reconnecting")}),j&&(0,t.jsxs)("div",{role:"alert",className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-destructive",children:p("reconnectFailed")}),(0,t.jsx)(n.Button,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),children:p("reload")})]}),(h?.error||x)&&h?.phase!=="restarting"&&(0,t.jsx)("p",{role:"alert",className:"mt-2 break-words text-xs text-destructive",children:x||(h?.phase==="blocked"?p("busyHint"):h?.error)}),h&&!h.supported&&(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p(v?"desktopUnsupported":"serverUnsupported")}),(0,t.jsx)(d.AlertDialog,{open:null!==y,onOpenChange:e=>{e||b(null)},children:(0,t.jsxs)(d.AlertDialogContent,{children:[(0,t.jsxs)(d.AlertDialogHeader,{children:[(0,t.jsx)(d.AlertDialogTitle,{children:p("forceInstall")}),(0,t.jsx)(d.AlertDialogDescription,{children:p("forceConfirm",{version:y||""})})]}),(0,t.jsxs)(d.AlertDialogFooter,{children:[(0,t.jsx)(d.AlertDialogCancel,{children:p("cancel")}),(0,t.jsx)(n.Button,{variant:"destructive",disabled:w||!h?.supported||y!==h?.latestVersion,onClick:()=>{y&&(g("force-install",y),b(null))},children:p("forceInstall")})]})]})})]}):null}],88883)},374255,e=>{"use strict";let t=(0,e.i(205270).default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);e.s(["Dices",0,t],374255)},833060,e=>{"use strict";var t=e.i(676618);e.s(["ImageIcon",()=>t.default])},425560,e=>{"use strict";let t=(0,e.i(205270).default)("monitor-smartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);e.s(["MonitorSmartphone",0,t],425560)},208501,621504,636989,170004,468528,e=>{"use strict";var t,s=e.i(391398);e.i(977848);var a=e.i(542151),r=e.i(648684),i=e.i(353533);e.i(227384);let l=(0,r.cva)("flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",{variants:{orientation:{horizontal:"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",vertical:"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"}},defaultVariants:{orientation:"horizontal"}});e.s(["ButtonGroup",0,function(e){let{className:t,orientation:a,...r}=e;return(0,s.jsx)("div",{role:"group","data-slot":"button-group","data-orientation":a,className:(0,i.cn)(l({orientation:a}),t),...r})}],208501);var n=e.i(191788),d=e.i(91762);let o=(0,r.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function(e){let{className:t,orientation:a="vertical",...r}=e;return(0,s.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,i.cn)(o({orientation:a}),t),...r})},"FieldDescription",0,function(e){let{className:t,...a}=e;return(0,s.jsx)("p",{"data-slot":"field-description",className:(0,i.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",t),...a})},"FieldLabel",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(d.Label,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",t),...a})}],621504),e.s([],48543),e.i(48543),e.i(350461);var c=e.i(978054),u=e.i(95349),m=e.i(25104),p=e.i(931497),h=e.i(562912),x=e.i(245925),f=e.i(203799),g=e.i(872863),v=e.i(408372);let j=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),y={checked:e=>e?{[j.checked]:""}:{[j.unchecked]:""},...g.transitionStatusMapping,...v.fieldValidityMapping};var b=e.i(333961),k=e.i(817806),N=e.i(495247),w=e.i(623377),C=e.i(660566),S=e.i(699140),M=e.i(653054),A=e.i(780023),T=e.i(552413);let D=n.createContext(void 0);var I=e.i(308665),P=e.i(579907);let E=n.createContext(void 0),z=n.forwardRef(function(e,t){let{render:r,className:i,disabled:l=!1,readOnly:d=!1,required:o=!1,"aria-labelledby":g,value:v,inputRef:j,nativeButton:P=!1,id:z,style:B,...L}=e,R=n.useContext(D),{disabled:F,readOnly:O,required:H,form:V,checkedValue:$,touched:q=!1,validation:G,name:K}=R??{},U=R?.setCheckedValue??h.NOOP,_=R?.setTouched??h.NOOP,W=R?.registerControlRef??h.NOOP,Y=R?.registerInputRef??h.NOOP,{setDirty:J,validityData:Z,setTouched:X,setFilled:Q,state:ee,disabled:et}=(0,C.useFieldRootContext)(),es=(0,S.useFieldItemContext)(),{labelId:ea,getDescriptionProps:er}=(0,M.useLabelableContext)(),ei=et||es.disabled||F||l,el=O||d,en=H||o,ed=R?$===v:""===v,eo=n.useMemo(()=>(0,I.serializeValue)(v),[v]),ec=n.useRef(null),eu=n.useRef(null),em=(0,m.useStableCallback)(e=>{e&&W(e,ei)}),ep=(0,c.useMergedRefs)(j,eu,Y);(0,u.useIsoLayoutEffect)(()=>{eu.current?.checked&&Q(!0)},[Q]),(0,u.useIsoLayoutEffect)(()=>{if(eu.current){if(ei&&ed)return void Y(null);ec.current&&W(ec.current,ei),Y(eu.current)}},[ed,ei,W,Y]);let eh=(0,b.useBaseUiId)(),ex=(0,T.useLabelableId)({id:z,implicit:!1,controlRef:ec}),ef=P?void 0:ex,eg={role:"radio","aria-checked":ed,"aria-required":en||void 0,"aria-readonly":el||void 0,"aria-labelledby":(0,A.useAriaLabelledBy)(g,ea,eu,!P,ef),[N.ACTIVE_COMPOSITE_ITEM]:ed?"":void 0,id:P?ex:eh,onKeyDown(e){"Enter"===e.key&&e.preventDefault()},onClick(e){e.defaultPrevented||ei||el||(e.preventDefault(),eu.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))},onFocus(e){e.defaultPrevented||ei||el||!q||(eu.current?.click(),_(!1))}},{getButtonProps:ev,buttonRef:ej}=(0,k.useButton)({disabled:ei,native:P}),ey={type:"radio",ref:ep,form:V,id:ef,name:K,tabIndex:-1,style:K?p.visuallyHiddenInput:p.visuallyHidden,"aria-hidden":!0,...void 0!==v?{value:eo}:h.EMPTY_OBJECT,disabled:ei,checked:ed,required:en,readOnly:el,onChange(e){if(e.nativeEvent.defaultPrevented||ei||el||void 0===v)return;let t=(0,x.createChangeEventDetails)(f.REASONS.none,e.nativeEvent);t.isCanceled||(X(!0),J(v!==Z.initialValue),Q(!0),U(v,t))},onFocus(){ec.current?.focus()}},eb=n.useMemo(()=>({...ee,required:en,disabled:ei,readOnly:el,checked:ed}),[ee,ei,el,ed,en]),ek=void 0!==R,eN=[t,ec,ej,em],ew=[eg,er,G?.getValidationProps??h.EMPTY_OBJECT,L,ev],eC=(0,a.useRenderElement)("span",e,{enabled:!ek,state:eb,ref:eN,props:ew,stateAttributesMapping:y});return(0,s.jsxs)(E.Provider,{value:eb,children:[ek?(0,s.jsx)(w.CompositeItem,{tag:"span",render:r,className:i,style:B,state:eb,refs:eN,props:ew,stateAttributesMapping:y}):eC,(0,s.jsx)("input",{...ey,suppressHydrationWarning:!0})]})});var B=e.i(657681),L=e.i(276149);let R=n.forwardRef(function(e,t){let{render:s,className:r,style:i,keepMounted:l=!1,...d}=e,o=function(){let e=n.useContext(E);if(void 0===e)throw Error((0,P.default)(52));return e}(),c=o.checked,{mounted:u,transitionStatus:m,setMounted:p}=(0,L.useTransitionStatus)(c),h={...o,transitionStatus:m},x=n.useRef(null),f=(0,a.useRenderElement)("span",e,{ref:[t,x],state:h,props:d,stateAttributesMapping:y});return((0,B.useOpenChangeComplete)({open:c,ref:x,onComplete(){c||p(!1)}}),l||u)?f:null});e.s(["Indicator",0,R,"Root",0,z],648646);var F=e.i(648646),F=F,O=e.i(176955),H=e.i(154532),V=e.i(113292),$=e.i(324083),q=e.i(390940),G=e.i(935942),K=e.i(598634),U=e.i(944306);let _=[V.SHIFT],W=n.forwardRef(function(e,t){let{render:a,className:r,disabled:i,readOnly:l,required:d,onValueChange:o,value:c,defaultValue:u,form:p,name:h,inputRef:x,id:f,style:g,...j}=e,{setTouched:y,setFocused:k,shouldValidateOnChange:N,validationMode:w,name:S,disabled:A,state:T,validation:I,setDirty:P,setFilled:E,validityData:z}=(0,C.useFieldRootContext)(),{labelId:B}=(0,M.useLabelableContext)(),{clearErrors:L}=(0,K.useFormContext)(),R=(0,G.useFieldsetRootContext)(!0),F=A||i,V=S??h,W=(0,b.useBaseUiId)(f),[Y,J]=(0,O.useControlled)({controlled:c,default:u,name:"RadioGroup",state:"value"}),Z=(0,m.useStableCallback)(o),X=(0,m.useStableCallback)((e,t)=>{Z(e,t),t.isCanceled||J(e)}),Q=n.useRef(null),ee=n.useRef(null),et=n.useRef(null);function es(e){let t;return x&&("function"==typeof x?t=x(e):x.current=e),ee.current=e,I.inputRef.current=e,t}let ea=(0,m.useStableCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){if(t){Q.current===e&&(Q.current=null);return}null==Q.current&&(Q.current=e)}}),er=(0,m.useStableCallback)(e=>{if(!e||e.disabled)return;et.current||(et.current=e);let t=ee.current;if(e.checked||null==t||t.disabled)return es(e)}),ei=(0,m.useStableCallback)(()=>Y??null);(0,q.useRegisterFieldControl)(Q,{id:W,value:Y,getValue:ei}),(0,U.useValueChanged)(Y,()=>{L(V),P(Y!==z.initialValue),E(null!=Y),N()?I.commit(Y):I.commit(Y,!0);let e=et.current;null==Y&&e&&!e.disabled&&es(e)});let[el,en]=n.useState(!1),ed=j["aria-labelledby"]??B??R?.legendId,eo={...T,disabled:F??!1,required:d??!1,readOnly:l??!1},ec=n.useMemo(()=>({...T,checkedValue:Y,disabled:F,form:p,validation:I,name:V,onValueChange:Z,readOnly:l,registerControlRef:ea,registerInputRef:er,required:d,setCheckedValue:X,setTouched:en,touched:el}),[Y,F,p,I,T,V,Z,l,ea,er,d,X,en,el]);return(0,s.jsx)(D.Provider,{value:ec,children:(0,s.jsx)($.CompositeRoot,{render:a,className:r,style:g,state:eo,props:[{role:"radiogroup","aria-required":d||void 0,"aria-disabled":F||void 0,"aria-readonly":l||void 0,"aria-labelledby":ed,onFocus(){k(!0)},onBlur(e){(0,H.contains)(e.currentTarget,e.relatedTarget)||(y(!0),k(!1),"onBlur"===w&&I.commit(Y))},onKeyDownCapture(e){e.key.startsWith("Arrow")&&(y(!0),en(!0),k(!0))}},I.getValidationProps,j],refs:[t],stateAttributesMapping:v.fieldValidityMapping,enableHomeAndEndKeys:!1,modifierKeys:_})})});e.s(["RadioGroup",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(W,{"data-slot":"radio-group",className:(0,i.cn)("grid w-full gap-2",t),...a})},"RadioGroupItem",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(F.Root,{"data-slot":"radio-group-item",className:(0,i.cn)("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",t),...a,children:(0,s.jsx)(F.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:(0,s.jsx)("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}],636989),e.s(["TOAST_POSITIONS",0,["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]],170004);var Y=e.i(352819),J=e.i(745725),Z=e.i(59295),X=e.i(706277),Q=e.i(146341),ee=e.i(849271),et=e.i(861416),es=e.i(265524),ea=e.i(749999),er=e.i(620216),ei=e.i(939310),el=e.i(45124),en=e.i(130027),ed=e.i(443915),eo=e.i(212283),ec=e.i(639530),eu=e.i(658662);let em=e=>{let{prompt:t,onToggle:a}=e,{attributes:r,listeners:i,setNodeRef:l,setActivatorNodeRef:n,transform:d,transition:o,isDragging:c}=(0,X.useSortable)({id:t.id}),u={transform:Q.CSS.Translate.toString(d),transition:o,zIndex:c?1:void 0,position:c?"relative":void 0};return(0,s.jsxs)("div",{ref:l,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:u,children:[(0,s.jsx)("div",{ref:n,...r,...i,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,s.jsx)(ee.GripVertical,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.name}),(0,s.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:t.prompt})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center",children:(0,s.jsx)(en.Switch,{checked:t.enabled,onCheckedChange:e=>a(t.id,e)})})]})},ep=e=>{let{prompt:t,onEdit:a,onDelete:r,onToggle:i}=e,{attributes:l,listeners:n,setNodeRef:d,setActivatorNodeRef:o,transform:c,transition:u,isDragging:m}=(0,X.useSortable)({id:t.id}),p={transform:Q.CSS.Translate.toString(c),transition:u,zIndex:m?1:void 0,position:m?"relative":void 0};return(0,s.jsxs)("div",{ref:d,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:p,children:[(0,s.jsx)("div",{ref:o,...l,...n,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,s.jsx)(ee.GripVertical,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.name}),(0,s.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:t.prompt})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,s.jsx)(ei.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>a(t),children:(0,s.jsx)(et.Pencil,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(ei.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-ui-red hover:text-ui-red/80",onClick:()=>r(t.id),children:(0,s.jsx)(er.Trash2,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(en.Switch,{checked:t.enabled,onCheckedChange:e=>i(t.id,e)})]})]})};e.s(["default",0,()=>{let e=(0,Y.useTranslations)("settings.quickPrompts"),{allOrderedPrompts:t,customPrompts:a,toggleBuiltin:r,saveCustom:i,saveOrder:l,deletePrompt:d,resetAll:o}=(0,ec.default)(),[c,u]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[h,x]=(0,n.useState)(null),f=(0,Z.useSensors)((0,Z.useSensor)(Z.PointerSensor,{activationConstraint:{distance:5}})),g=(0,n.useCallback)((e,t)=>{e.startsWith("builtin-")?r(e,t):i(a.map(s=>s.id===e?{...s,enabled:t}:s))},[a,r,i]),v=(0,n.useCallback)(e=>{x(e)},[]),j=(0,n.useCallback)(()=>{h&&(d(h),x(null))},[h,d]),y=(0,n.useCallback)(e=>{u({mode:"edit",id:e.id,name:e.name,prompt:e.prompt})},[]),b=(0,n.useCallback)(()=>{u({mode:"add",name:"",prompt:""})},[]),k=(0,n.useCallback)(()=>{c&&c.name.trim()&&c.prompt.trim()&&("edit"===c.mode&&c.id?i(a.map(e=>e.id===c.id?{...e,name:c.name.trim(),prompt:c.prompt}:e)):i([...a,{id:`custom-${(0,J.nanoid)(8)}`,name:c.name.trim(),prompt:c.prompt,enabled:!0}]),u(null))},[c,a,i]),N=(0,n.useCallback)(()=>{o(),p(!1)},[o]),w=(0,n.useCallback)(e=>{let{active:s,over:a}=e;if(!a||s.id===a.id)return;let r=t.findIndex(e=>e.id===s.id),i=t.findIndex(e=>e.id===a.id);-1===r||-1===i||l((0,X.arrayMove)(t,r,i).map(e=>e.id))},[t,l]),C=!!c&&c.name.trim().length>0&&c.prompt.trim().length>0;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("itemsSection")}),t.length>0&&(0,s.jsx)(Z.DndContext,{sensors:f,collisionDetection:Z.closestCenter,modifiers:[eu.restrictToVerticalAxis],onDragEnd:w,children:(0,s.jsx)(X.SortableContext,{items:t.map(e=>e.id),strategy:X.verticalListSortingStrategy,children:(0,s.jsx)("div",{className:"overflow-hidden rounded-lg border",children:t.map(e=>e.id.startsWith("builtin-")?(0,s.jsx)(em,{prompt:e,onToggle:g},e.id):(0,s.jsx)(ep,{prompt:e,onEdit:y,onDelete:v,onToggle:g},e.id))})})}),c&&(0,s.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e("add"===c.mode?"addPrompt":"editPrompt")}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:e("nameLabel")}),(0,s.jsx)(el.Input,{value:c.name,onChange:e=>u({...c,name:e.target.value}),placeholder:e("namePlaceholder"),autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:e("promptLabel")}),(0,s.jsx)(ed.Textarea,{value:c.prompt,onChange:e=>u({...c,prompt:e.target.value}),placeholder:e("promptPlaceholder"),rows:3})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(ei.Button,{variant:"outline",size:"sm",onClick:()=>u(null),children:e("cancel")}),(0,s.jsx)(ei.Button,{size:"sm",onClick:k,disabled:!C,children:e("save")})]})]}),!c&&(0,s.jsxs)(ei.Button,{variant:"outline",size:"sm",onClick:b,children:[(0,s.jsx)(es.Plus,{className:"mr-1 h-3.5 w-3.5"}),e("addButton")]})]}),(0,s.jsxs)(ei.Button,{variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:()=>p(!0),children:[(0,s.jsx)(ea.RotateCcw,{className:"mr-1 h-3.5 w-3.5"}),e("resetToDefault")]}),(0,s.jsx)(eo.AlertDialog,{open:!!h,onOpenChange:e=>!e&&x(null),children:(0,s.jsxs)(eo.AlertDialogContent,{children:[(0,s.jsxs)(eo.AlertDialogHeader,{children:[(0,s.jsx)(eo.AlertDialogTitle,{children:e("deleteTitle")}),(0,s.jsx)(eo.AlertDialogDescription,{children:e("deleteDescription")})]}),(0,s.jsxs)(eo.AlertDialogFooter,{children:[(0,s.jsx)(eo.AlertDialogCancel,{children:e("deleteCancel")}),(0,s.jsx)(eo.AlertDialogAction,{onClick:j,children:e("deleteConfirm")})]})]})}),(0,s.jsx)(eo.AlertDialog,{open:m,onOpenChange:p,children:(0,s.jsxs)(eo.AlertDialogContent,{children:[(0,s.jsxs)(eo.AlertDialogHeader,{children:[(0,s.jsx)(eo.AlertDialogTitle,{children:e("resetTitle")}),(0,s.jsx)(eo.AlertDialogDescription,{children:e("resetDescription")})]}),(0,s.jsxs)(eo.AlertDialogFooter,{children:[(0,s.jsx)(eo.AlertDialogCancel,{children:e("resetCancel")}),(0,s.jsx)(eo.AlertDialogAction,{onClick:N,children:e("resetConfirm")})]})]})})]})}],468528)},934048,e=>{"use strict";e.i(350461);var t=e.i(391398),s=e.i(518313),a=e.i(191788),r=e.i(352819),i=e.i(679935),l=e.i(603331),n=e.i(524845),d=e.i(29803),o=e.i(266231),c=e.i(350064),u=e.i(88883),m=e.i(983832),p=e.i(977356),h=e.i(444957),x=e.i(377216),f=e.i(374255),g=e.i(511892),v=e.i(878528),j=e.i(833060),y=e.i(958282),b=e.i(40546),k=e.i(769480),N=e.i(584166),w=e.i(425560),C=e.i(582809),S=e.i(112285),M=e.i(401686),A=e.i(749999),T=e.i(480778),D=e.i(692127),I=e.i(21152),P=e.i(620216),E=e.i(399366),z=e.i(909725),B=e.i(815242),L=e.i(939310),R=e.i(208501),F=e.i(45124),O=e.i(130027),H=e.i(621504),V=e.i(91762),$=e.i(636989),q=e.i(550292),G=e.i(296202),K=e.i(212283),U=e.i(690176),_=e.i(353533),W=e.i(117369),Y=e.i(31050),J=e.i(841250),Z=e.i(170004),X=e.i(490034),Q=e.i(535099),ee=e.i(998234),et=e.i(700599),es=e.i(468528),ea=e.i(745725),er=e.i(59295),ei=e.i(706277),el=e.i(146341),en=e.i(849271),ed=e.i(861416),eo=e.i(265524),ec=e.i(734549),eu=e.i(348370),em=e.i(274489);let ep=["Globe","Link","ExternalLink","Bookmark","Star","Home","FileText","BarChart3","PieChart","LineChart","Activity","Zap","Terminal","Code","Database","Server","Cloud","Shield","Lock","Key","User","Users","Mail","MessageSquare","Bell","Calendar","Clock","Search","Eye","Camera","Image","Film","Music","Headphones","Mic","Folder","File","Archive","Download","Upload","GitBranch","GitCommit","GitPullRequest","GitFork","Bug","Wrench","Settings","Sliders","Palette","Brush","Map","MapPin","Navigation","Compass","Wifi","Monitor","Smartphone","Tablet","Laptop","Cpu","HardDrive","MemoryStick","CircuitBoard","Radio","Bluetooth","Heart","ThumbsUp","Smile","Coffee","Rocket","Flame","Sun","Moon","Sparkles","Award","Trophy","Target","Flag","Crosshair","Layers","Layout","Grid","List","Table","Kanban","Bot","Brain","Lightbulb","GraduationCap","BookOpen"],eh=e=>{let{value:s,onChange:i,readonly:l,size:n=16}=e,d=(0,r.useTranslations)("settings.sidebarItems"),[o,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(""),p=(0,a.useMemo)(()=>{if(!u.trim())return ep;let e=u.toLowerCase();return ep.filter(t=>t.toLowerCase().includes(e))},[u]);return l?(0,t.jsx)(em.default,{name:s,className:"shrink-0 text-muted-foreground",style:{width:n,height:n}}):(0,t.jsxs)(eu.Popover,{open:o,onOpenChange:c,children:[(0,t.jsxs)(eu.PopoverTrigger,{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-xs transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,t.jsx)(em.default,{name:s,className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s})]}),(0,t.jsxs)(eu.PopoverContent,{className:"w-72 p-2",align:"start",children:[(0,t.jsx)(F.Input,{placeholder:d("iconSearch"),value:u,onChange:e=>m(e.target.value),className:"mb-2 h-8 text-xs",autoFocus:!0}),(0,t.jsx)("div",{className:"grid max-h-48 grid-cols-8 gap-0.5 overflow-y-auto p-1",children:p.map(e=>(0,em.getIcon)(e)?(0,t.jsx)("button",{type:"button",className:(0,_.cn)("flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-accent",s===e&&"bg-accent ring-1 ring-primary"),onClick:()=>{i?.(e),c(!1),m("")},title:e,children:(0,t.jsx)(em.default,{name:e,className:"h-4 w-4"})},e):null)}),0===p.length&&(0,t.jsx)("p",{className:"py-4 text-center text-xs text-muted-foreground",children:d("iconNotFound")})]})]})};var ex=e.i(658662);let ef=e=>{let{item:s,onEdit:a,onDelete:r,onToggle:i}=e,{attributes:l,listeners:n,setNodeRef:d,setActivatorNodeRef:o,transform:c,transition:u,isDragging:m}=(0,ei.useSortable)({id:s.id}),p={transform:el.CSS.Translate.toString(c),transition:u,zIndex:m?1:void 0,position:m?"relative":void 0};return(0,t.jsxs)("div",{ref:d,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:p,children:[(0,t.jsx)("div",{ref:o,...l,...n,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,t.jsx)(en.GripVertical,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eh,{value:s.icon,readonly:!0,size:14}),(0,t.jsx)("p",{className:"text-sm font-medium",children:s.name})]}),(0,t.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.url})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(L.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>a(s),children:(0,t.jsx)(ed.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-ui-red hover:text-ui-red/80",onClick:()=>r(s.id),children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.Switch,{checked:s.enabled,onCheckedChange:e=>i(s.id,e)})]})]})},eg=e=>{let{item:s,onToggle:a}=e,{attributes:r,listeners:i,setNodeRef:l,setActivatorNodeRef:n,transform:d,transition:o,isDragging:c}=(0,ei.useSortable)({id:s.id}),u={transform:el.CSS.Translate.toString(d),transition:o,zIndex:c?1:void 0,position:c?"relative":void 0};return(0,t.jsxs)("div",{ref:l,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:u,children:[(0,t.jsx)("div",{ref:n,...r,...i,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,t.jsx)(en.GripVertical,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eh,{value:s.icon,readonly:!0,size:14}),(0,t.jsx)("p",{className:"text-sm font-medium",children:s.name})]}),(0,t.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.url})]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(O.Switch,{checked:s.enabled,onCheckedChange:e=>a(s.id,e)})})]})},ev=()=>{let e=(0,r.useTranslations)("settings.sidebarItems"),{allOrderedItems:s,customItems:i,toggleBuiltin:l,saveCustom:n,saveOrder:d,deleteItem:o,resetAll:c}=(0,ec.default)(),[u,m]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null),g=(0,er.useSensors)((0,er.useSensor)(er.PointerSensor,{activationConstraint:{distance:5}})),v=(0,a.useCallback)((e,t)=>{e.startsWith("builtin-")?l(e,t):n(i.map(s=>s.id===e?{...s,enabled:t}:s))},[i,l,n]),j=(0,a.useCallback)(e=>{f(e)},[]),y=(0,a.useCallback)(()=>{x&&(o(x),f(null))},[x,o]),b=(0,a.useCallback)(e=>{m({mode:"edit",id:e.id,name:e.name,icon:e.icon,url:e.url})},[]),k=(0,a.useCallback)(()=>{m({mode:"add",name:"",icon:"Globe",url:""})},[]),N=(0,a.useCallback)(()=>{u&&u.name.trim()&&u.url.trim()&&("edit"===u.mode&&u.id?n(i.map(e=>e.id===u.id?{...e,name:u.name.trim(),icon:u.icon,url:u.url.trim()}:e)):n([...i,{id:`custom-${(0,ea.nanoid)(8)}`,name:u.name.trim(),icon:u.icon,url:u.url.trim(),enabled:!0}]),m(null))},[u,i,n]),w=(0,a.useCallback)(()=>{c(),h(!1)},[c]),C=(0,a.useCallback)(e=>{let{active:t,over:a}=e;if(!a||t.id===a.id)return;let r=s.findIndex(e=>e.id===t.id),i=s.findIndex(e=>e.id===a.id);-1===r||-1===i||d((0,ei.arrayMove)(s,r,i).map(e=>e.id))},[s,d]),S=!!u&&u.name.trim().length>0&&u.url.trim().length>0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("itemsSection")}),s.length>0&&(0,t.jsx)(er.DndContext,{sensors:g,collisionDetection:er.closestCenter,modifiers:[ex.restrictToVerticalAxis],onDragEnd:C,children:(0,t.jsx)(ei.SortableContext,{items:s.map(e=>e.id),strategy:ei.verticalListSortingStrategy,children:(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border",children:s.map(e=>e.id.startsWith("builtin-")?(0,t.jsx)(eg,{item:e,onToggle:v},e.id):(0,t.jsx)(ef,{item:e,onEdit:b,onDelete:j,onToggle:v},e.id))})})}),u&&(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eh,{value:u.icon,onChange:e=>m({...u,icon:e})}),(0,t.jsx)(F.Input,{value:u.name,onChange:e=>m({...u,name:e.target.value}),placeholder:e("namePlaceholder"),autoFocus:!0})]}),(0,t.jsx)(F.Input,{value:u.url,onChange:e=>m({...u,url:e.target.value}),placeholder:e("urlPlaceholder")}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(L.Button,{variant:"outline",size:"sm",onClick:()=>m(null),children:e("cancel")}),(0,t.jsx)(L.Button,{size:"sm",onClick:N,disabled:!S,children:e("save")})]})]}),!u&&(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",onClick:k,children:[(0,t.jsx)(eo.Plus,{className:"mr-1 h-3.5 w-3.5"}),e("addButton")]})]}),(0,t.jsxs)(L.Button,{variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:()=>h(!0),children:[(0,t.jsx)(A.RotateCcw,{className:"mr-1 h-3.5 w-3.5"}),e("resetToDefault")]}),(0,t.jsx)(K.AlertDialog,{open:!!x,onOpenChange:e=>!e&&f(null),children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("deleteTitle")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("deleteDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:e("deleteCancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:y,children:e("deleteConfirm")})]})]})}),(0,t.jsx)(K.AlertDialog,{open:p,onOpenChange:h,children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("resetTitle")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("resetDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:e("resetCancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:w,children:e("resetConfirm")})]})]})})]})};var ej=e.i(189257),ey=e.i(26857),eb=e.i(23826),ek=e.i(894915),eN=e.i(53073),ew=e.i(880179),eC=e.i(199648),eS=e.i(13628);let eM=e=>{let{text:s}=e,[r,i]=(0,a.useState)(!1),l=async()=>{await (0,eS.copyToClipboard)(s)&&(i(!0),setTimeout(()=>i(!1),1500))};return(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:l,children:r?(0,t.jsx)(ej.Check,{className:"h-3 w-3 text-positive"}):(0,t.jsx)(ey.Copy,{className:"h-3 w-3"})})},eA=()=>{let e=(0,r.useTranslations)("settings.tailscale");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-ui-amber/30 bg-ui-amber/5 p-4",children:[(0,t.jsx)(ew.AlertTriangle,{className:"mt-0.5 h-5 w-5 shrink-0 text-ui-amber"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("notInstalled")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notInstalledDescription")})]})]}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentMac")}),(0,t.jsx)("p",{children:"brew install tailscale"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentMacAppStore")}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentLinux")}),(0,t.jsx)("p",{children:"curl -fsSL https://tailscale.com/install.sh | sh"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentAfterInstall")}),(0,t.jsx)("p",{children:"tailscale up"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("installGuide",{link:e=>(0,t.jsxs)("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline hover:text-foreground",children:[e,(0,t.jsx)(eb.ExternalLink,{className:"h-3 w-3"})]})})})]})},eT=()=>{let e=(0,r.useTranslations)("settings.tailscale"),[s,l]=(0,a.useState)(null),[n,o]=(0,a.useState)(!0),[c,u]=(0,a.useState)(null),m=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/tailscale/status");if(!e.ok)throw Error();let t=await e.json();l(t)}catch{l(null)}finally{o(!1)}},[]);(0,a.useEffect)(()=>{m()},[m]);let p=async t=>{u(`remove-${t}`);try{let s=await fetch("/api/tailscale/serve",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({httpsPort:t})});if(!s.ok){let t=await s.json();throw Error(t.error||e("removeFailed"))}i.toast.success(e("removedToast",{httpsPort:t})),await m()}catch(t){i.toast.error(t instanceof Error?t.message:e("removeFailed"))}finally{u(null)}};if(n)return(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(eC.default,{className:"h-4 w-4 text-muted-foreground"})});if(!s||!s.installed)return(0,t.jsx)(eA,{});if(!s.running)return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-ui-amber/30 bg-ui-amber/5 p-4",children:[(0,t.jsx)(ew.AlertTriangle,{className:"mt-0.5 h-5 w-5 shrink-0 text-ui-amber"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("notRunning")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notRunningDescription")})]})]}),(0,t.jsx)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:(0,t.jsx)("p",{children:"tailscale up"})})]});let h=s.serveEntries,x=s.serverPort,f=8022!==x;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("deviceInfo")}),(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{o(!0),m()},children:(0,t.jsx)(eN.RefreshCw,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"rounded-md border p-3 text-sm",children:(0,t.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e("host")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.hostname}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"DNS"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:s.dnsName}),s.dnsName&&(0,t.jsx)(eM,{text:s.dnsName})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"IP"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:s.tailscaleIp}),s.tailscaleIp&&(0,t.jsx)(eM,{text:s.tailscaleIp})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:e("version")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.version})]})})]}),f&&(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-accent-color/30 bg-accent-color/5 p-4",children:[(0,t.jsx)(ek.Info,{className:"mt-0.5 h-5 w-5 shrink-0 text-accent-color"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("nonDefaultPortTitle",{port:x})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("nonDefaultPortDescription",{defaultPort:8022,currentPort:x,restartAction:d.default?e("appRestart"):e("serverRestart")})}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentFixedPort",{port:8022})}),(0,t.jsxs)("p",{children:["PORT=",8022," purplemux"]}),(0,t.jsx)("p",{className:"mt-1.5 text-muted-foreground/60",children:e("commentOrTerminate",{port:8022})})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("serveStatus")}),0===h.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("noActiveServe")}):(0,t.jsx)("div",{className:"rounded-md border",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b text-muted-foreground",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("httpsPort")}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("proxyTarget")}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("url")}),(0,t.jsx)("th",{className:"w-10 px-3 py-2"})]})}),(0,t.jsx)("tbody",{children:h.map(e=>{let a="443"===e.httpsPort?`https://${s.dnsName}`:`https://${s.dnsName}:${e.httpsPort}`;return(0,t.jsxs)("tr",{className:"border-b last:border-b-0",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e.httpsPort}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e.proxy}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs underline hover:text-foreground",children:a}),(0,t.jsx)(eM,{text:a})]})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:null!==c,onClick:()=>p(e.httpsPort),children:c===`remove-${e.httpsPort}`?(0,t.jsx)(eC.default,{className:"h-3 w-3"}):(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})})]},e.httpsPort)})})]})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("setupGuide")}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentStep1Install")}),(0,t.jsx)("p",{children:"brew install tailscale"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentStep2Activate")}),(0,t.jsx)("p",{children:"tailscale up"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentStep3Add")}),(0,t.jsxs)("p",{children:["tailscale serve --bg --https=443 http://localhost:",x]})]})]})]})};var eD=e.i(489623);function eI(){let e=(0,r.useTranslations)("settings.branchName"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.branchNameProvider),n=(0,Y.default)(e=>e.branchNamePrompt),d=(0,Y.default)(e=>e.setBranchNameSettings),[o,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),p=o??{provider:l,prompt:n},h=(0,eD.isValidBranchNamePrompt)(p.prompt),x=async()=>{m(!0);try{await d(p.provider,p.prompt),c(null),i.toast.success(s("saved"))}catch(e){i.toast.error(s("error"),{description:e instanceof Error?e.message:String(e)})}finally{m(!1)}};return(0,t.jsxs)("fieldset",{disabled:u,className:"space-y-3",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[e("agent"),(0,t.jsxs)("select",{className:"rounded-md border bg-background p-2",value:p.provider,"aria-describedby":"branch-name-provider-help",onChange:e=>c({...p,provider:e.target.value}),children:[(0,t.jsx)("option",{value:"claude",children:"Claude Code"}),(0,t.jsx)("option",{value:"codex",disabled:!0,children:"Codex CLI"})]})]}),(0,t.jsx)("p",{id:"branch-name-provider-help",className:"rounded-md border bg-muted/50 p-3 text-sm text-muted-foreground",children:e("codexUnavailable")}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[e("prompt"),(0,t.jsx)("textarea",{className:"min-h-48 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:p.prompt,maxLength:1e4,spellCheck:!1,"aria-invalid":!h,"aria-describedby":"branch-name-variables",onChange:e=>c({...p,prompt:e.target.value})})]}),(0,t.jsx)("p",{id:"branch-name-variables",className:"text-xs text-muted-foreground",children:e("variables")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eD.BRANCH_NAME_VARIABLES.map(e=>(0,t.jsx)(L.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>c({...p,prompt:`${p.prompt}{{${e}}}`}),children:`{{${e}}}`},e))}),!h&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:e("invalid")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(L.Button,{type:"button",onClick:()=>void x(),disabled:u||"codex"===p.provider||!h||p.provider===l&&p.prompt===n,children:u?s("loading"):s("save")}),(0,t.jsx)(L.Button,{type:"button",variant:"outline",onClick:()=>c({...p,prompt:eD.DEFAULT_BRANCH_NAME_PROMPT}),children:e("reset")})]})]})}var eP=e.i(133214);function eE(e){let{promptKey:s}=e,l=(0,r.useTranslations)("settings.gitGenerationPrompts"),n=(0,r.useTranslations)("common"),d=(0,Y.default)(e=>e[s]),o=(0,Y.default)(e=>e.setGitGenerationPrompt),[c,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),h=c??d,x=(0,eP.isValidGitGenerationPrompt)(s,h),f=eP.GIT_GENERATION_PROMPTS[s],g=async()=>{if(!m&&x){p(!0);try{await o(s,h),u(null),i.toast.success(n("saved"))}catch(e){i.toast.error(n("error"),{description:e instanceof Error?e.message:String(e)})}finally{p(!1)}}};return(0,t.jsxs)("fieldset",{disabled:m,className:"space-y-3",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:l(`${s}.title`)}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l(`${s}.description`)}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[l("prompt"),(0,t.jsx)("textarea",{className:"min-h-40 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:h,maxLength:1e4,spellCheck:!1,"aria-invalid":!x,"aria-describedby":`${s}-variables`,onChange:e=>u(e.target.value)})]}),(0,t.jsx)("p",{id:`${s}-variables`,className:"text-xs text-muted-foreground",children:l("variables")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:f.variables.map(e=>(0,t.jsx)(L.Button,{type:"button",size:"sm",variant:"outline",disabled:h.length+e.length+4>1e4,onClick:()=>u(`${h}{{${e}}}`),children:`{{${e}}}`},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l("evidenceHint")}),!x&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:l("invalid")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(L.Button,{type:"button",onClick:()=>void g(),disabled:m||!x||h===d,children:m?n("loading"):n("save")}),(0,t.jsx)(L.Button,{type:"button",variant:"outline",onClick:()=>u(f.defaultPrompt),children:l("reset")})]})]})}var ez=e.i(983040);let eB=e=>{let{provider:s}=e,l=`${s}-environment`,n=(0,r.useTranslations)("settings.claude"),d=(0,r.useTranslations)("common"),o=(0,Y.default)(e=>e[`${s}Environment`]),c=(0,Y.default)(e=>"codex"===s?e.setCodexEnvironment:e.setClaudeEnvironment),[u,m]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),g=(0,ez.formatAgentEnvironment)(o),v=u??g,j=async()=>{let e;try{e=(0,ez.parseAgentEnvironment)(v)}catch{f(!0);return}h(!0);try{await c(e),m(null),i.toast.success(d("saved"))}catch(e){i.toast.error(d("error"),{description:e instanceof Error?e.message:String(e)})}finally{h(!1)}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(V.Label,{htmlFor:l,children:n("environmentTitle",{agent:"codex"===s?"Codex":"Claude"})}),(0,t.jsx)("p",{id:`${l}-description`,className:"text-sm text-muted-foreground",children:n("environmentDescription",{agent:"codex"===s?"Codex":"Claude"})}),(0,t.jsx)("textarea",{id:l,"aria-describedby":`${l}-description${x?` ${l}-error`:""}`,"aria-invalid":x,className:"min-h-32 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:v,onChange:e=>{m(e.target.value),f(!1)},placeholder:"HTTP_PROXY=http://127.0.0.1:7890\nHTTPS_PROXY=http://127.0.0.1:7890\nNO_PROXY=localhost,127.0.0.1",spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",disabled:p}),x&&(0,t.jsx)("p",{id:`${l}-error`,role:"alert",className:"text-sm text-destructive",children:n("environmentInvalid")}),(0,t.jsx)(L.Button,{onClick:j,disabled:p||v===g,children:p?d("loading"):d("save")})]})};var eL=e.i(260449);function eR(){let e=(0,r.useTranslations)("settings.browserStorage"),s=(0,r.useTranslations)("common"),[i,l]=(0,a.useState)(!1),[n,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(!1),u=async()=>{if(!n){d(!0),c(!1);try{await (0,eL.clearBrowserStorage)(),(0,eL.reloadWithFreshPage)()}catch{c(!0),d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(L.Button,{variant:"outline",className:"shrink-0",onClick:()=>{c(!1),l(!0)},children:e("action")}),(0,t.jsx)(K.AlertDialog,{open:i,onOpenChange:e=>{n||l(e)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("title")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("confirm")})]}),o&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-ui-red",children:e("failed")}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(L.Button,{variant:"outline",disabled:n,onClick:()=>l(!1),children:s("cancel")}),o&&(0,t.jsx)(L.Button,{variant:"outline",onClick:eL.reloadWithFreshPage,children:e("reload")}),(0,t.jsx)(L.Button,{variant:"destructive",disabled:n,onClick:()=>void u(),children:e(n?"clearing":"action")})]})]})})]})}var eF=e.i(950323),eO=e.i(494834),eH=e.i(558021),eV=e.i(815363),e$=e.i(821384);let eq=e$.z.object({enabled:e$.z.boolean(),idleMinutes:e$.z.number().int().min(15).max(10080)}).strict();e$.z.object({workspaceId:e$.z.string().min(1),paneId:e$.z.string().min(1),tabId:e$.z.string().min(1),sessionId:e$.z.string().min(1),lastActivityAt:e$.z.number().finite().positive()}).strict();let eG="x-purplemux-process-action",eK="/api/system/idle-tabs",eU=async(e,t)=>{let s=await fetch(eK,{method:e,headers:{"Content-Type":"application/json",[eG]:"1"},...void 0===t?{}:{body:JSON.stringify(t)}}),a=await s.json();if(!s.ok)throw Error(a.error??"Idle tab operation failed");return a},e_=e=>{let{policy:s,onSave:a}=e,l=(0,r.useTranslations)("settings.idleTabs"),{register:n,handleSubmit:d,control:o,setValue:c,formState:{errors:u,isSubmitting:m,isDirty:p}}=(0,eH.useForm)({resolver:(0,eV.zodResolver)(eq),defaultValues:s}),h=(0,eH.useWatch)({control:o,name:"enabled"}),x=d(async e=>{try{await eU("PATCH",e),await a(),i.toast.success(l("saved"))}catch(e){i.toast.error(e instanceof Error?e.message:l("failed"))}});return(0,t.jsxs)("form",{onSubmit:x,className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("label",{htmlFor:"idle-tabs-enabled",className:"text-sm",children:l("automatic")}),(0,t.jsx)(O.Switch,{id:"idle-tabs-enabled",checked:h,disabled:m,onCheckedChange:e=>c("enabled",e,{shouldDirty:!0})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{htmlFor:"idle-tabs-minutes",className:"text-xs",children:l("timeout")}),(0,t.jsx)(F.Input,{id:"idle-tabs-minutes",type:"number",min:15,max:10080,step:1,className:"w-36",disabled:m,...n("idleMinutes",{valueAsNumber:!0})})]}),(0,t.jsx)(L.Button,{type:"submit",size:"sm",variant:"outline",disabled:m||!p,children:l("save")})]}),u.idleMinutes&&(0,t.jsx)("p",{role:"alert",className:"text-xs text-negative",children:l("range")})]})},eW=()=>{let e=(0,r.useTranslations)("settings.idleTabs"),s=(0,r.useTranslations)("common"),{data:l,error:n,isValidating:d,mutate:o}=(0,eF.default)(eK,()=>eU("GET"),{refreshInterval:6e4}),[c,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),[h,x]=(0,a.useState)(null),f=async()=>{if(c&&!m){p(!0);try{let e=await eU("POST",{...c,confirmed:!0});x(e),u(null),await o()}catch(t){i.toast.error(t instanceof Error?t.message:e("failed"))}finally{p(!1)}}};return(0,t.jsxs)("section",{className:"space-y-3 rounded-md border p-3","aria-busy":m,children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")}),l&&(0,t.jsx)(e_,{policy:l.policy,onSave:o},`${l.policy.enabled}-${l.policy.idleMinutes}`),n&&(0,t.jsxs)("p",{role:"alert",className:"break-words text-sm text-negative",children:[e("failed"),": ",n.message]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:d||m,onClick:()=>void o(),children:e("refresh")}),(0,t.jsx)(L.Button,{size:"sm",disabled:m||!!n||!l?.candidates.length,onClick:()=>{l&&u({policy:{...l.policy},targets:l.candidates.slice(0,100).map(e=>{let{workspaceId:t,paneId:s,tabId:a,sessionId:r,lastActivityAt:i}=e;return{workspaceId:t,paneId:s,tabId:a,sessionId:r,lastActivityAt:i}})})},children:e("reclaim")})]}),l&&!n&&!l.candidates.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("empty")}),l?.candidates.map(s=>(0,t.jsxs)("div",{className:"space-y-1 border-t pt-2 text-xs",children:[(0,t.jsxs)("p",{className:"break-words",children:[s.workspaceName," · ",s.tabName," · ",s.providerId]}),(0,t.jsx)("p",{className:"break-all text-muted-foreground",children:s.cwd}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e("idleFor",{minutes:Math.floor((Date.now()-s.lastActivityAt)/6e4)})})]},s.tabId)),h&&(0,t.jsxs)("div",{role:"status",className:"space-y-1 text-xs",children:[(0,t.jsx)("p",{children:e("result",{reclaimed:h.reclaimed.length,skipped:h.skipped.length})}),h.skipped.map((e,s)=>(0,t.jsxs)("p",{className:"break-all",children:[e.target.tabId,": ",e.reason]},s))]}),(0,t.jsx)(K.AlertDialog,{open:!!c,onOpenChange:e=>{e||m||u(null)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("confirmTitle",{count:c?.targets.length??0})}),(0,t.jsx)(K.AlertDialogDescription,{children:e("confirmDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{disabled:m,children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{disabled:m,onClick:e=>{e.preventDefault(),f()},children:s("confirm")})]})]})})]})},eY="/api/system/agent-processes",eJ=async()=>{let e=await fetch(eY),t=await e.json();if(!e.ok)throw Error(t.error??"Unable to load processes");return t},eZ=()=>{let e=(0,r.useTranslations)("settings.processes"),s=(0,r.useTranslations)("common"),{data:l,error:n,isLoading:d,isValidating:o,mutate:c}=(0,eF.default)(eY,eJ,{refreshInterval:1e4}),[u,m]=(0,a.useState)(""),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null),g=async e=>{let t=X.default.getState();await t.fetchWorkspaces(),t.switchWorkspace(e),t.setSettingsDialogOpen(!1)},v=async()=>{if(x&&!p){h(!0);try{let t=await fetch(eY,{method:"POST",headers:{"Content-Type":"application/json",[eG]:"1"},body:JSON.stringify({...x,confirmed:!0})}),s=await t.json();if(!t.ok)throw Error(s.error??e("failed"));i.toast.success(e("stop"===x.action?"stopped":"started")),f(null),await c(),s.workspaceId&&await g(s.workspaceId)}catch(t){i.toast.error(t instanceof Error?t.message:e("failed")),await c()}finally{h(!1)}}},j=u.trim().toLocaleLowerCase(),y=(l?.processes??[]).filter(e=>`${e.providerId} ${e.pid} ${e.cwd??""} ${e.workspaceName??""}`.toLocaleLowerCase().includes(j));return(0,t.jsxs)("div",{className:"space-y-4","aria-busy":p,children:[(0,t.jsx)(eW,{}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.Input,{value:u,onChange:e=>m(e.target.value),placeholder:e("search"),"aria-label":e("search")}),(0,t.jsx)(L.Button,{variant:"outline",size:"icon",disabled:o||p,onClick:()=>void c(),"aria-label":e("refresh"),children:(0,t.jsx)(eN.RefreshCw,{className:o?"h-4 w-4 animate-spin":"h-4 w-4"})})]}),n&&(0,t.jsxs)("p",{role:"alert",className:"break-words text-sm text-negative",children:[e("failed"),": ",n.message]}),d&&(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:e("loading")}),!d&&!n&&!y.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("empty")}),l?.transfers.map(s=>(0,t.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,t.jsxs)("p",{className:"text-sm font-medium",children:[e("unfinished")," · ",s.providerId," · PID ",s.pid]}),(0,t.jsxs)("p",{className:"break-all text-xs text-muted-foreground",children:[s.workspaceName," · ",s.cwd]}),(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.sessionId}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(L.Button,{size:"sm",disabled:p||!!n,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"adopt"}),children:e("retry")}),(0,t.jsx)(L.Button,{size:"sm",variant:"outline",disabled:p,onClick:()=>void g(s.workspaceId),children:e("open")})]})]},`${s.pid}-${s.startedAt}`)),y.map(s=>(0,t.jsxs)("div",{className:"space-y-2 border-b py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:"claude"===s.providerId?"Claude Code":"Codex"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["PID ",s.pid]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e(s.managed?"managed":"external")})]}),(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.cwd??e("unknownDirectory")}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,eO.default)(s.startedAt).format("YYYY-MM-DD HH:mm:ss"),s.workspaceName&&` \xb7 ${s.workspaceName}`]}),s.session&&(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.session.sessionId}),!s.managed&&!s.session&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("unavailable")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[s.workspaceId?(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:p,onClick:()=>void g(s.workspaceId),children:e("open")}):(0,t.jsx)(L.Button,{size:"sm",disabled:p||!!n||!s.cwd||!s.session,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"adopt"}),children:e("adopt")}),(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:p||!!n,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"stop"}),children:e("stop")})]})]},`${s.pid}-${s.startedAt}`)),(0,t.jsx)(K.AlertDialog,{open:null!==x,onOpenChange:e=>{e||p||f(null)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsxs)(K.AlertDialogTitle,{children:[e(x?.action==="adopt"?"adopt":"stop")," · PID ",x?.pid]}),(0,t.jsx)(K.AlertDialogDescription,{children:e(x?.action==="adopt"?"adoptConfirm":"stopConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{disabled:p,children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{disabled:p,onClick:e=>{e.preventDefault(),v()},children:p?e("working"):s("confirm")})]})]})})]})},eX=()=>{let e=(0,r.useTranslations)("settings.linuxStartup"),s=window.electronAPI,l=s?.platform==="linux"&&!!s.canManageDesktopAutostart&&!!s.getDesktopAutostartStatus&&!!s.setDesktopAutostartEnabled,[n,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(0),g=(0,a.useCallback)(()=>f(e=>e+1),[]);(0,a.useEffect)(()=>{if(!l||u)return;let e=!1;return window.electronAPI.canManageDesktopAutostart().then(async t=>{if(!e){if(d(t),!t){c(null),h(!1);return}try{let t=await window.electronAPI.getDesktopAutostartStatus();e||(c(t),h(!1))}catch{e||h(!0)}}}).catch(()=>{e||(d(!1),c(null),h(!1))}),window.addEventListener("focus",g),()=>{e=!0,window.removeEventListener("focus",g)}},[l,u,g,x]);let v=async t=>{if(n&&!u){m(!0);try{c(await window.electronAPI.setDesktopAutostartEnabled(t)),h(!1),i.toast.success(e(t?"enabled":"disabled"))}catch{i.toast.error(e("saveFailed"))}finally{m(!1)}}};return l&&n?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"linux-desktop-startup",children:e("title")}),(0,t.jsx)("p",{id:"linux-startup-description",className:"text-sm text-muted-foreground",children:o?.supported===!1?e(o.reason||"packagedOnly"):e("description")})]}),(0,t.jsx)(O.Switch,{id:"linux-desktop-startup","aria-describedby":"linux-startup-description",checked:o?.enabled??!1,onCheckedChange:v,disabled:u||p||!o||!o.supported&&!o.enabled})]}),p&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center gap-2 text-sm text-destructive",children:[e("loadFailed"),(0,t.jsx)(L.Button,{variant:"outline",size:"sm",onClick:g,children:e("retry")})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("serverHint")})]}):null},eQ=[{id:"general",labelKey:"general",icon:(0,t.jsx)(T.Settings,{className:"h-4 w-4"})},{id:"appearance",labelKey:"appearance",icon:(0,t.jsx)(M.Palette,{className:"h-4 w-4"})},{id:"terminal",labelKey:"terminal",icon:(0,t.jsx)(I.Terminal,{className:"h-4 w-4"})},{id:"claude",labelKey:"agent",icon:(0,t.jsx)(p.Bot,{className:"h-4 w-4"})},{id:"processes",labelKey:"processes",icon:(0,t.jsx)(N.Monitor,{className:"h-4 w-4"})},{id:"notification",labelKey:"notification",icon:(0,t.jsx)(m.Bell,{className:"h-4 w-4"})},{id:"editor",labelKey:"editor",icon:(0,t.jsx)(g.FolderCode,{className:"h-4 w-4"})},{id:"auth",labelKey:"auth",icon:(0,t.jsx)(k.Lock,{className:"h-4 w-4"})},{id:"tailscale",labelKey:"tailscale",icon:(0,t.jsx)(v.Globe,{className:"h-4 w-4"})},{id:"quick-prompts",labelKey:"quickPrompts",icon:(0,t.jsx)(B.Zap,{className:"h-4 w-4"})},{id:"sidebar-items",labelKey:"sidebarItems",icon:(0,t.jsx)(b.Layout,{className:"h-4 w-4"})},{id:"system",labelKey:"system",icon:(0,t.jsx)(E.Wrench,{className:"h-4 w-4"})}],e0=[{id:"en",label:"English"},{id:"ko",label:"한국어"},{id:"ja",label:"日本語"},{id:"zh-CN",label:"中文(简体)"},{id:"zh-TW",label:"中文(繁體)"},{id:"es",label:"Español"},{id:"fr",label:"Français"},{id:"de",label:"Deutsch"},{id:"pt-BR",label:"Português (BR)"},{id:"ru",label:"Русский"},{id:"tr",label:"Türkçe"}],e1=[{id:"normal",labelKey:"fontSizeNormal"},{id:"large",labelKey:"fontSizeLarge"},{id:"x-large",labelKey:"fontSizeXLarge"}],e2=[{id:"tight",labelKey:"lineSpacingTight"},{id:"normal",labelKey:"lineSpacingNormal"},{id:"relaxed",labelKey:"lineSpacingRelaxed"},{id:"custom",labelKey:"lineSpacingCustom"}],e5=()=>{let e=(0,r.useTranslations)("settings.general"),s=(0,r.useTranslations)("common"),{theme:i,setTheme:d}=(0,l.useTheme)(),o=(0,Y.default)(e=>e.locale),c=(0,Y.default)(e=>e.setLocale),u=(0,Y.default)(e=>e.fontSize),m=(0,Y.default)(e=>e.setFontSize),p=(0,Y.default)(e=>e.lineHeight),h=(0,Y.default)(e=>e.setLineHeight),f=(0,Y.default)(e=>e.lineHeightCustom),g=(0,Y.default)(e=>e.setLineHeightCustom),v=(0,X.default)(e=>e.setSettingsDialogOpen),[j,b]=(0,a.useState)(null),k=j??String(f),w=(0,X.default)(e=>e.setCheatSheetOpen),S=e=>{d(e),fetch("/api/config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({appTheme:e})}).catch(()=>{}),window.electronAPI&&window.electronAPI.setNativeTheme(e)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("language")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("languageDescription")})]}),(0,t.jsxs)(U.Select,{items:e0.map(e=>({label:e.label,value:e.id})),value:o,onValueChange:e=>e&&c(e),children:[(0,t.jsx)(U.SelectTrigger,{className:"min-w-[200px]",children:(0,t.jsx)(U.SelectValue,{})}),(0,t.jsx)(U.SelectContent,{children:e0.map(e=>(0,t.jsx)(U.SelectItem,{value:e.id,children:e.label},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("theme")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("themeDescription")})]}),(0,t.jsxs)(R.ButtonGroup,{children:[(0,t.jsxs)(L.Button,{variant:"light"===i?"default":"outline",size:"sm",onClick:()=>S("light"),children:[(0,t.jsx)(D.Sun,{className:"h-4 w-4"}),s("light")]}),(0,t.jsxs)(L.Button,{variant:"dark"===i?"default":"outline",size:"sm",onClick:()=>S("dark"),children:[(0,t.jsx)(C.Moon,{className:"h-4 w-4"}),s("dark")]}),(0,t.jsxs)(L.Button,{variant:"system"===i?"default":"outline",size:"sm",onClick:()=>S("system"),children:[(0,t.jsx)(N.Monitor,{className:"h-4 w-4"}),s("system")]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("fontSize")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("fontSizeDescription")})]}),(0,t.jsx)(R.ButtonGroup,{children:e1.map(s=>(0,t.jsx)(L.Button,{variant:u===s.id?"default":"outline",size:"sm",onClick:()=>m(s.id),children:e(s.labelKey)},s.id))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("lineSpacing")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("lineSpacingDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["custom"===p&&(0,t.jsx)(F.Input,{type:"number",min:J.LINE_HEIGHT_CUSTOM_MIN,max:J.LINE_HEIGHT_CUSTOM_MAX,step:J.LINE_HEIGHT_CUSTOM_STEP,value:k,onChange:e=>b(e.target.value),onBlur:()=>{let e=Number(j);if(b(null),!Number.isFinite(e))return;let t=(0,J.clampCustomLineHeight)(Math.round(100*e)/100);t!==f&&g(t)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},className:"h-8 w-20 text-sm","aria-label":e("lineSpacingCustom")}),(0,t.jsx)(R.ButtonGroup,{children:e2.map(s=>(0,t.jsx)(L.Button,{variant:p===s.id?"default":"outline",size:"sm",onClick:()=>h(s.id),children:e(s.labelKey)},s.id))})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("keyboardShortcuts")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("keyboardShortcutsDescription")})]}),(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",onClick:()=>{v(!1),w(!0)},children:[(0,t.jsx)(y.Keyboard,{className:"h-4 w-4"}),e("openShortcuts"),(0,t.jsx)(x.ChevronRight,{className:"h-3.5 w-3.5"})]})]}),(0,t.jsx)(eR,{}),(0,t.jsxs)("a",{href:"https://github.com/stirp/purplemux-improved/releases",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 hover:text-muted-foreground hover:underline w-fit",children:[n.default.version,"(","76c1790",")"]})]})},e3=[{label:"Surface",vars:["--background","--card","--popover","--muted","--secondary","--accent","--sidebar"]},{label:"Text",vars:["--foreground","--card-foreground","--popover-foreground","--muted-foreground","--secondary-foreground","--accent-foreground","--sidebar-foreground"]},{label:"Interactive",vars:["--primary","--primary-foreground","--destructive"]},{label:"Border",vars:["--border","--input","--ring"]},{label:"Palette",vars:["--ui-blue","--ui-teal","--ui-coral","--ui-amber","--ui-purple","--ui-pink","--ui-green","--ui-gray","--ui-red"]},{label:"Semantic",vars:["--positive","--negative","--accent-color","--brand","--focus-indicator","--claude-active"]}],e4=()=>{let e=(0,r.useTranslations)("settings.appearance"),l=(0,r.useTranslations)("common"),n=(0,Y.default)(e=>e.customCSS),d=(0,Y.default)(e=>e.setCustomCSS),[o,c]=(0,a.useState)(n),[u,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c(n)},[n]);let p=o!==n;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(s.default,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("customCSS")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("customCSSDescription")})]}),(0,t.jsx)("textarea",{className:"h-56 w-full resize-y rounded-md border border-input bg-muted/30 p-3 font-mono text-xs leading-relaxed text-foreground placeholder:text-muted-foreground/40 focus:border-ring focus:outline-none",placeholder:e("placeholder"),value:o,onChange:e=>c(e.target.value),spellCheck:!1}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(K.AlertDialog,{children:[(0,t.jsx)(K.AlertDialogTrigger,{render:(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:!n,children:e("reset")})}),(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("reset")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("resetConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:l("cancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:()=>{c(""),d("")},children:e("reset")})]})]})]}),(0,t.jsx)(L.Button,{size:"sm",disabled:!p,onClick:()=>{d(o),i.toast.success(e("applied"))},children:e("apply")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>m(!u),children:[(0,t.jsx)(h.ChevronDown,{className:(0,_.cn)("h-3.5 w-3.5 transition-transform",u&&"rotate-180")}),e("availableVariables")]}),u&&(0,t.jsx)("div",{className:"mt-2 space-y-3",children:e3.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 text-[11px] font-medium text-muted-foreground",children:e.label}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.vars.map(e=>(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:e},e))})]},e.label))})]})]})},e8=e=>{let{list:s,selectedId:a,onSelect:r}=e;return(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-3",children:s.map(e=>{let s;return(0,t.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,_.cn)("flex flex-col gap-2 rounded-lg border p-3 text-left transition-colors",a===e.id?"border-primary bg-accent":"border-border hover:border-muted-foreground/50"),children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),(0,t.jsx)("div",{className:"flex h-5 items-center gap-1 rounded px-2",style:{backgroundColor:e.colors.background},children:[(s=e.colors).red,s.green,s.yellow,s.blue,s.magenta,s.cyan,s.white].map((e,s)=>(0,t.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}},s))})]},e.id)})})},e6=["auto","always","never"],e9=()=>{let e=(0,r.useTranslations)("settings.terminal"),s=(0,r.useTranslations)("common"),{mode:a,themeIds:i,setTerminalTheme:l,themes:n}=(0,W.default)(),d=(0,Y.default)(e=>e.terminalKeyBar),o=(0,Y.default)(e=>e.setTerminalKeyBar),c=n.filter(e=>"dark"===e.variant),u=n.filter(e=>"light"===e.variant);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("theme")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("themeDescription")})]}),(0,t.jsxs)(q.Tabs,{defaultValue:a,children:[(0,t.jsxs)(q.TabsList,{children:[(0,t.jsx)(q.TabsTrigger,{value:"dark",children:s("dark")}),(0,t.jsx)(q.TabsTrigger,{value:"light",children:s("light")})]}),(0,t.jsx)(q.TabsContent,{value:"dark",className:"mt-3",children:(0,t.jsx)(e8,{list:c,selectedId:i.dark,onSelect:e=>l("dark",e)})}),(0,t.jsx)(q.TabsContent,{value:"light",className:"mt-3",children:(0,t.jsx)(e8,{list:u,selectedId:i.light,onSelect:e=>l("light",e)})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-6 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("keyBar")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("keyBarDescription")})]}),(0,t.jsx)(R.ButtonGroup,{children:e6.map(s=>(0,t.jsx)(L.Button,{variant:d===s?"default":"outline",size:"sm",onClick:()=>o(s),children:e(`keyBarOptions.${s}`)},s))})]})]})},e7=()=>{let e=(0,r.useTranslations)("settings.editor"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.editorUrl),n=(0,Y.default)(e=>e.editorPreset),d=(0,Y.default)(e=>e.setEditorUrl),o=(0,Y.default)(e=>e.setEditorPreset),[c,u]=(0,a.useState)(l),[m,p]=(0,a.useState)(n),h="vscode-remote"===m,x="code-server"===m||"custom"===m||h,f=m!==n||x&&c.trim()!==l,g=(0,ee.buildEditorUrl)(m,c,"/Users/me/project"),v=()=>{let t=x?c.trim():"";if(h&&!(0,ee.isValidSshHost)(t))return void i.toast.error(e("errorSshHost"));if("code-server"===m&&t)try{let s=new URL(t);if("http:"!==s.protocol&&"https:"!==s.protocol)return void i.toast.error(e("errorHttpRequired"))}catch{i.toast.error(e("errorHttpRequired"));return}"custom"!==m||!t||t.includes("{folder}")||t.includes("{folderEncoded}")?(u(t),d(t),o(m),i.toast.success(s("saved"))):i.toast.error(e("errorCustomTemplate"))};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("preset")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("presetDescription")})]}),(0,t.jsx)($.RadioGroup,{value:m,onValueChange:e=>p(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:ee.EDITOR_PRESETS.map(s=>(0,t.jsxs)(V.Label,{htmlFor:`editor-preset-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",m===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`editor-preset-${s}`,value:s}),(0,t.jsx)(et.EditorIcon,{preset:s,className:"h-5 w-5 shrink-0"}),e(`presets.${s}`)]},s))})]}),x&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:h?e("sshHost"):"custom"===m?e("customTemplate"):e("url")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h?e("sshHostDescription"):"custom"===m?e("customTemplateDescription"):e("urlDescription")}),(0,t.jsx)(F.Input,{placeholder:h?"my-server":"custom"===m?"myeditor://open?path={folderEncoded}":"https://example.com:8080",value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()}}),"code-server"===m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("urlHelp",{link:e=>(0,t.jsx)("a",{href:"https://github.com/coder/code-server",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:e}),code:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"?folder="})})}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:"# Install on macOS"}),(0,t.jsx)("p",{children:"brew install code-server"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:"# Run"}),(0,t.jsx)("p",{children:"code-server --port 8080"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:"# External access via Tailscale (optional)"}),(0,t.jsx)("p",{children:"tailscale serve --bg --https=8443 http://localhost:8080"})]})]}),"custom"===m&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("customHelp",{folder:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"{folder}"}),folderEncoded:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"{folderEncoded}"})})})]}),!x&&"off"!==m&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm text-muted-foreground",children:e("localIdeHint")}),"off"===m&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm text-muted-foreground",children:e("offHint")}),g&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("preview")}),(0,t.jsx)("code",{className:"block break-all rounded-md bg-muted p-2 font-mono text-xs",children:g})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(L.Button,{disabled:!f,onClick:v,children:s("save")})})]})},te=()=>{let e=(0,r.useTranslations)("settings.claude"),s=(0,Y.default)(e=>e.dangerouslySkipPermissions),a=(0,Y.default)(e=>e.setDangerouslySkipPermissions),i=(0,Y.default)(e=>e.claudeShowTerminal),l=(0,Y.default)(e=>e.setClaudeShowTerminal),n=(0,Y.default)(e=>e.gitAskProvider),d=(0,Y.default)(e=>e.setGitAskProvider),o=(0,Y.default)(e=>e.noteSummaryProvider),c=(0,Y.default)(e=>e.setNoteSummaryProvider);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(eB,{provider:"claude"}),(0,t.jsx)(eB,{provider:"codex"}),(0,t.jsx)(eI,{}),(0,t.jsx)(eE,{promptKey:"commitMessagePrompt"}),(0,t.jsx)(eE,{promptKey:"reviewDescriptionPrompt"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"skip-permissions",className:"text-sm font-medium",children:e("skipPermissions")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("skipPermissionsDescription")}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:["Claude: ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:"--dangerously-skip-permissions"})]}),(0,t.jsxs)("span",{children:["Codex: ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:"--yolo"})]})]})]}),(0,t.jsx)(O.Switch,{id:"skip-permissions",checked:s,onCheckedChange:a})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"show-terminal",className:"text-sm font-medium",children:e("showTerminal")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("showTerminalDescription")})]}),(0,t.jsx)(O.Switch,{id:"show-terminal",checked:i,onCheckedChange:l})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("gitAskProvider")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("gitAskProviderDescription")})]}),(0,t.jsx)($.RadioGroup,{value:n,onValueChange:e=>d(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:["claude","codex"].map(s=>(0,t.jsxs)(V.Label,{htmlFor:`git-ask-provider-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",n===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`git-ask-provider-${s}`,value:s}),e(`gitAskProviderOptions.${s}`)]},s))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("noteSummaryProvider")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("noteSummaryProviderDescription")})]}),(0,t.jsx)($.RadioGroup,{value:o,onValueChange:e=>c(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:["claude","codex"].map(s=>(0,t.jsxs)(V.Label,{htmlFor:`note-summary-provider-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",o===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`note-summary-provider-${s}`,value:s}),e(`noteSummaryProviderOptions.${s}`)]},s))})]})]})},tt=e=>{let{value:s,onChange:a,ariaLabel:i}=e,l=(0,r.useTranslations)("settings.notification"),n=Z.TOAST_POSITIONS.map(e=>({label:l(`positions.${e}`),value:e}));return(0,t.jsxs)(U.Select,{items:n,value:s,onValueChange:e=>e&&a(e),children:[(0,t.jsx)(U.SelectTrigger,{"aria-label":i,className:"min-w-[160px]",children:(0,t.jsx)(U.SelectValue,{})}),(0,t.jsx)(U.SelectContent,{children:n.map(e=>(0,t.jsx)(U.SelectItem,{value:e.value,children:e.label},e.value))})]})},ts=()=>{let e=(0,r.useTranslations)("settings.notification"),s=(0,Y.default)(e=>e.notificationsEnabled),l=(0,Y.default)(e=>e.setNotificationsEnabled),n=(0,Y.default)(e=>e.toastOnCompleteEnabled),d=(0,Y.default)(e=>e.setToastOnCompleteEnabled),o=(0,Y.default)(e=>e.toastDuration),c=(0,Y.default)(e=>e.setToastDuration),u=(0,Y.default)(e=>e.toastPositionDesktop),m=(0,Y.default)(e=>e.setToastPositionDesktop),p=(0,Y.default)(e=>e.toastPositionMobile),h=(0,Y.default)(e=>e.setToastPositionMobile),[x,f]=(0,a.useState)(null),g=x??String(Math.round(o/1e3)),[v,j]=(0,a.useState)([]),[y,b]=(0,a.useState)(null),k=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/push/subscribe"),t=await e.json();return Array.isArray(t.devices)?t.devices:[]}catch{return[]}},[]);(0,a.useEffect)(()=>{k().then(j),(0,Q.getEndpoint)().then(b)},[k]);let N=async t=>{try{await fetch("/api/push/subscribe",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:t})}),i.toast.success(e("deviceRemoved")),j(await k())}catch{i.toast.error(e("deviceRemoveFailed"))}},C=!window.electronAPI&&!("PushManager"in window),S=!window.electronAPI&&"Notification"in window&&"denied"===Notification.permission;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"notifications-enabled",className:"text-sm font-medium",children:e("enable")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("enableDescription")})]}),(0,t.jsx)(O.Switch,{id:"notifications-enabled",checked:s,onCheckedChange:l,disabled:C||S})]}),S&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:e("permissionDenied")}),C&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notSupported")})]}),v.length>0&&(0,t.jsxs)("div",{className:"border-t pt-6 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("devicesSection")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("devicesSectionDescription")})]}),(0,t.jsx)("div",{className:"space-y-2",children:v.map(s=>{let a=!!y&&s.endpoint===y;return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(w.MonitorSmartphone,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate text-sm",children:(e=>{try{let t=new URL(e).host;if(t.includes("apple"))return"Apple";if(t.includes("fcm")||t.includes("google"))return"Chrome / Android";if(t.includes("mozilla"))return"Firefox";if(t.includes("windows")||t.includes("wns"))return"Windows";return t}catch{return"Unknown"}})(s.endpoint)}),a&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e("deviceThis")})]}),(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>N(s.endpoint),"aria-label":e("deviceRemove"),children:(0,t.jsx)(P.Trash2,{className:"h-4 w-4"})})]},s.endpoint)})})]}),(0,t.jsxs)("div",{className:"border-t pt-6 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastSection")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastSectionDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"toast-enabled",className:"text-sm font-medium",children:e("toastEnable")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastEnableDescription")})]}),(0,t.jsx)(O.Switch,{id:"toast-enabled",checked:n,onCheckedChange:d})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastDuration")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastDurationDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.Input,{type:"number",min:1,max:60,step:1,value:g,onChange:e=>f(e.target.value),onBlur:()=>{let e=Number(x);if(f(null),!Number.isFinite(e))return;let t=1e3*Math.min(60,Math.max(1,Math.round(e)));t!==o&&c(t)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:!n,className:"h-8 w-20 text-sm"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e("toastDurationUnit")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastPositionDesktop")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastPositionDesktopDescription")})]}),(0,t.jsx)(tt,{value:u,onChange:m,ariaLabel:e("toastPositionDesktop")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastPositionMobile")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastPositionMobileDescription")})]}),(0,t.jsx)(tt,{value:p,onChange:h,ariaLabel:e("toastPositionMobile")})]})]})]})},ta=()=>{let e=(0,r.useTranslations)("settings.auth"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.hasAuthPassword),n=(0,Y.default)(e=>e.changePassword),[o,c]=(0,a.useState)(""),[u,m]=(0,a.useState)(!1),p=u&&o.trim().length>=4,h=e=>{c(e),m(!0)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(H.Field,{children:[(0,t.jsx)(H.FieldLabel,{htmlFor:"auth-password",children:e("changePassword")}),(0,t.jsx)(H.FieldDescription,{children:e("changePasswordDescription")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(F.Input,{id:"auth-password",placeholder:l?e("newPasswordPlaceholder"):e("passwordPlaceholder"),value:o,onChange:e=>h(e.target.value)}),(0,t.jsx)(L.Button,{variant:"outline",size:"icon",className:"shrink-0",onClick:()=>{let e;return h((e=new Uint8Array(8),crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("").slice(0,8)))},children:(0,t.jsx)(f.Dices,{className:"h-4 w-4"})})]})]}),(0,t.jsx)(H.FieldDescription,{children:e("resetHint",{action:d.default?e("restartApp"):e("restartServer")})}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(L.Button,{disabled:!p,onClick:()=>{n(o.trim()),c(""),m(!1),i.toast.success(e("savedRestart",{action:d.default?e("restartAppAction"):e("restartServerAction")}))},children:s("save")})})]})},tr=()=>{let e=(0,r.useTranslations)("settings.system"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.systemResourcesEnabled),n=(0,Y.default)(e=>e.setSystemResourcesEnabled),o=(0,Y.default)(e=>e.networkAccess),c=(0,Y.default)(e=>e.setNetworkAccess),m=(0,Y.default)(e=>e.hostEnvLocked),p=(0,Y.default)(e=>e.bindHostIsLocal),[h,x]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[v,y]=(0,a.useState)(!1),b=window.electronAPI,k=d.default&&b?.platform==="darwin",N=d.default&&k&&"function"==typeof b?.getServerLaunchAgentStatus&&"function"==typeof b?.setServerLaunchAgentEnabled;(0,a.useEffect)(()=>{if(!N)return;let e=window.electronAPI;if("function"!=typeof e?.getServerLaunchAgentStatus)return;let t=!1;return e.getServerLaunchAgentStatus().then(e=>{t||g(e)}).catch(()=>{t||g({supported:!1,enabled:!1,loaded:!1,stale:!1,path:""})}),()=>{t=!0}},[N]);let w=async t=>{if(!N)return;let a=window.electronAPI;if("function"==typeof a?.setServerLaunchAgentEnabled){y(!0);try{let s=await a.setServerLaunchAgentEnabled(t);g(s),i.toast.success(t?e("startupEnabled"):e("startupDisabled"))}catch(e){i.toast.error(e instanceof Error?e.message:s("error"))}finally{y(!1)}}},C=async()=>{x(!0);try{let t=await fetch("/api/uploads/cleanup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"all"})});if(!t.ok)throw Error(`HTTP ${t.status}`);let s=await t.json();s.deleted>0?i.toast.success(e("attachedImagesCleaned",{count:s.deleted})):i.toast.info(e("attachedImagesNothing"))}catch{i.toast.error(s("error"))}finally{x(!1)}},[M,T]=(0,a.useState)(o);(0,a.useEffect)(()=>{T(o)},[o]);let D=M!==o,I=p&&"localhost"!==M;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(u.default,{}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(S.Network,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),(0,t.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("networkAccess")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m?e("networkAccessLocked"):e("networkAccessDescription")})]})]}),(0,t.jsx)($.RadioGroup,{value:M,onValueChange:e=>T(e),disabled:m,className:"gap-2",children:["localhost","tailscale","all"].map(s=>(0,t.jsxs)("label",{htmlFor:`network-access-${s}`,className:"flex cursor-pointer items-start gap-3 rounded-md border bg-background px-3 py-2.5 aria-disabled:cursor-not-allowed aria-disabled:opacity-60","aria-disabled":m||void 0,children:[(0,t.jsx)($.RadioGroupItem,{value:s,id:`network-access-${s}`,className:"mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e(`networkAccessOptions.${s}.label`)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e(`networkAccessOptions.${s}.description`)})]})]},s))}),!m&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I?e("restartRequired"):""}),(0,t.jsx)(L.Button,{size:"sm",onClick:()=>{c(M),i.toast.success(I?e("restartRequired"):s("saved"))},disabled:!D,children:s("save")})]})]}),(0,t.jsx)(eX,{}),k&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"server-startup",className:"text-sm font-medium",children:e("startServerAtLogin")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:f?.supported===!1?e("startServerAtLoginUnsupported"):e("startServerAtLoginDescription")})]}),(0,t.jsx)(O.Switch,{id:"server-startup",checked:!!(f?.enabled||f?.stale),onCheckedChange:w,disabled:!N||v||!f?.supported&&!f?.stale})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"system-resources",className:"text-sm font-medium",children:e("showResources")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("showResourcesDescription")})]}),(0,t.jsx)(O.Switch,{id:"system-resources",checked:l,onCheckedChange:n})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(j.ImageIcon,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("attachedImages")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("attachedImagesDescription")})]})]}),(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:C,disabled:h,children:[(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"}),e("cleanAttachedImages")]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("tmuxReset")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tmuxResetDescription",{action:d.default?e("restartApp"):e("restartServer")})})]}),(0,t.jsxs)(K.AlertDialog,{children:[(0,t.jsx)(K.AlertDialogTrigger,{render:(0,t.jsxs)(L.Button,{variant:"destructive",size:"sm",className:"gap-1.5 shrink-0",children:[(0,t.jsx)(A.RotateCcw,{className:"h-3.5 w-3.5"}),s("reset")]})}),(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("tmuxReset")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("tmuxResetConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{className:"bg-ui-red hover:bg-ui-red/80",onClick:()=>{window.location.href="/reset"},children:s("reset")})]})]})]})]})]})};e.s(["default",0,e=>{let{open:s,onOpenChange:i}=e,l=(0,o.default)(),n=(0,c.default)(s&&l),u=(0,r.useTranslations)("settings"),m=(0,r.useTranslations)("common"),[p,h]=(0,a.useState)("general"),x=eQ.find(e=>e.id===p);return(0,t.jsx)(G.Dialog,{open:s,onOpenChange:i,children:(0,t.jsx)(G.DialogContent,{className:"inset-0 top-0 left-0 flex h-dvh w-full max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none p-0 sm:max-w-none md:inset-auto md:top-1/2 md:left-1/2 md:h-[min(520px,calc(100dvh-2rem))] md:w-[calc(100%-2rem)] md:max-w-3xl md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-xl",style:n,showCloseButton:!1,children:(0,t.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] md:flex-row md:p-0",children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-col border-b bg-muted/30 px-3 pt-3 pb-0 md:p-3 md:w-48 md:border-b-0 md:border-r",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between px-2 md:mb-4",children:[(0,t.jsx)(G.DialogTitle,{className:"text-base font-semibold",children:u("title")}),(0,t.jsxs)(L.Button,{variant:"ghost",size:"icon",onClick:()=>i(!1),className:"h-11 w-11 shrink-0 opacity-70 hover:opacity-100 md:h-6 md:w-6",children:[(0,t.jsx)(z.X,{className:"h-[18px] w-[18px]"}),(0,t.jsx)("span",{className:"sr-only",children:m("close")})]})]}),(0,t.jsx)("nav",{className:"flex min-h-0 gap-1 overflow-x-auto px-1 pb-2 md:flex-col md:overflow-y-auto md:px-0 md:pb-0",children:eQ.filter(e=>!e.electronOnly||d.default).map(e=>(0,t.jsxs)(L.Button,{variant:"ghost",onClick:()=>h(e.id),className:(0,_.cn)("min-h-11 shrink-0 justify-start gap-2 whitespace-nowrap px-3 py-2 text-sm font-medium md:min-h-0 md:gap-3",p===e.id?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[e.icon,u(`tabs.${e.labelKey}`)]},e.id))})]}),(0,t.jsxs)("div",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto p-4 md:p-6",children:[(0,t.jsx)("h2",{className:"mb-6 text-lg font-semibold",children:x?u(`tabs.${x.labelKey}`):""}),"general"===p&&(0,t.jsx)(e5,{}),"appearance"===p&&(0,t.jsx)(e4,{}),"terminal"===p&&(0,t.jsx)(e9,{}),"notification"===p&&(0,t.jsx)(ts,{}),"editor"===p&&(0,t.jsx)(e7,{}),"claude"===p&&(0,t.jsx)(te,{}),"processes"===p&&(0,t.jsx)(eZ,{}),"auth"===p&&(0,t.jsx)(ta,{}),"tailscale"===p&&(0,t.jsx)(eT,{}),"quick-prompts"===p&&(0,t.jsx)(es.default,{}),"sidebar-items"===p&&(0,t.jsx)(ev,{}),"system"===p&&(0,t.jsx)(tr,{})]})]})})})}],934048)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,131464,e=>{"use strict";let t=(0,e.i(205270).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],131464)},350064,e=>{"use strict";var t=e.i(191788);let s=e=>{let t=window.visualViewport;return t?.addEventListener("resize",e),t?.addEventListener("scroll",e),()=>{t?.removeEventListener("resize",e),t?.removeEventListener("scroll",e)}},a=()=>{let e=window.visualViewport;return e&&1===e.scale?`${e.height}:${Math.max(0,e.offsetTop)}`:""},r=()=>"";e.s(["default",0,e=>{let i=(0,t.useSyncExternalStore)(s,a,r);if(!e||!i)return;let[l,n]=i.split(":").map(Number);return{position:"fixed",left:0,right:0,top:n,height:l}}])},734549,456992,644113,390995,75769,e=>{"use strict";var t=e.i(191788),s=e.i(950323),a=e.i(679935),r=e.i(844044);let i=e=>fetch(e).then(e=>{if(!e.ok)throw Error("fetch failed");return e.json()}),l={builtins:[],custom:[],order:[]},n=(e,t)=>{if(0===t.length)return e;let s=new Map(e.map(e=>[e.id,e])),a=[];for(let e of t){let t=s.get(e);t&&(a.push(t),s.delete(e))}for(let e of s.values())a.push(e);return a};e.s(["default",0,()=>{let{data:e,isLoading:d,mutate:o}=(0,s.default)("/api/sidebar-items",i,{revalidateOnFocus:!1}),c=e??l,u=(0,t.useMemo)(()=>n([...c.builtins,...c.custom].filter(e=>e.enabled),c.order),[c]),m=(0,t.useMemo)(()=>n([...c.builtins,...c.custom],c.order),[c]),p=(0,t.useCallback)(async(e,t,s)=>{let a=e.filter(e=>!e.enabled).map(e=>e.id);if(!(await fetch("/api/sidebar-items",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:t,disabledBuiltinIds:a,order:s})})).ok)throw Error("save failed")},[]),h=(0,t.useCallback)(async(e,t)=>{let s=s=>({...s,builtins:s.builtins.map(s=>s.id===e?{...s,enabled:t}:s)});await o(async e=>{let t=s(e??l);return await p(t.builtins,t.custom,t.order),t},{optimisticData:e=>s(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),x=(0,t.useCallback)(async e=>{let t=t=>({...t,custom:e});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),f=(0,t.useCallback)(async e=>{let t=t=>({...t,order:e});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),g=(0,t.useCallback)(async e=>{let t=t=>({...t,custom:t.custom.filter(t=>t.id!==e),order:t.order.filter(t=>t!==e)});await o(async e=>{let s=t(e??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:e=>t(e??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]),v=(0,t.useCallback)(async()=>{let e=e=>({builtins:e.builtins.map(e=>({...e,enabled:!0})),custom:[],order:[]});await o(async t=>{let s=e(t??l);return await p(s.builtins,s.custom,s.order),s},{optimisticData:t=>e(t??l),rollbackOnError:!0,revalidate:!1}).catch(()=>a.toast.error((0,r.t)("settings","saveFailed")))},[o,p]);return{items:u,allOrderedItems:m,builtinItems:c.builtins,customItems:c.custom,order:c.order,isLoading:d,toggleBuiltin:h,saveCustom:x,saveOrder:f,deleteItem:g,resetAll:v}}],734549);var d=e.i(205270);let o=(0,d.default)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);e.s(["Link",0,o],456992);let c=(0,d.default)("bookmark",[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]]);e.s(["Bookmark",0,c],644113);let u=(0,d.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",0,u],390995);let m=(0,d.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,m],75769)},292057,e=>{"use strict";let t=(0,e.i(205270).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);e.s(["BarChart3",0,t],292057)},595838,405624,545719,920814,477254,809852,575461,398024,409155,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);e.s(["PieChart",0,s],595838);let a=(0,t.default)("chart-line",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);e.s(["LineChart",0,a],405624);let r=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,r],545719);let i=(0,t.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);e.s(["Database",0,i],920814);let l=(0,t.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,l],477254);let n=(0,t.default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,n],809852);let d=(0,t.default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);e.s(["Key",0,d],575461);let o=(0,t.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,o],398024);let c=(0,t.default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,c],409155)},983832,e=>{"use strict";let t=(0,e.i(205270).default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,t],983832)},218516,798656,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,s],218516);let a=(0,t.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);e.s(["Camera",0,a],798656)},676618,e=>{"use strict";let t=(0,e.i(205270).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["default",0,t])},674389,201692,786428,985044,117595,526251,536586,606306,504838,143547,e=>{"use strict";var t=e.i(676618);e.s(["Image",()=>t.default],674389);var s=e.i(205270);let a=(0,s.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,a],201692);let r=(0,s.default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,r],786428);let i=(0,s.default)("headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);e.s(["Headphones",0,i],985044);let l=(0,s.default)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);e.s(["Mic",0,l],117595);let n=(0,s.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["File",0,n],526251);let d=(0,s.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,d],536586);let o=(0,s.default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);e.s(["GitFork",0,o],606306);let c=(0,s.default)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);e.s(["Bug",0,c],504838);let u=(0,s.default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);e.s(["Sliders",0,u],143547)},401686,e=>{"use strict";let t=(0,e.i(205270).default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s(["Palette",0,t],401686)},593828,353028,686047,348916,230129,561275,258769,503808,472930,47091,506495,239845,993101,548361,836294,749141,502599,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("brush",[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]]);e.s(["Brush",0,s],593828);let a=(0,t.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);e.s(["Map",0,a],353028);let r=(0,t.default)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);e.s(["MapPin",0,r],686047);let i=(0,t.default)("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);e.s(["Navigation",0,i],348916);let l=(0,t.default)("compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]);e.s(["Compass",0,l],230129);let n=(0,t.default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,n],561275);let d=(0,t.default)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);e.s(["Tablet",0,d],258769);let o=(0,t.default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);e.s(["Laptop",0,o],503808);let c=(0,t.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,c],472930);let u=(0,t.default)("circuit-board",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]]);e.s(["CircuitBoard",0,u],47091);let m=(0,t.default)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Radio",0,m],506495);let p=(0,t.default)("bluetooth",[["path",{d:"m7 7 10 10-5 5V2l5 5L7 17",key:"1q5490"}]]);e.s(["Bluetooth",0,p],239845);let h=(0,t.default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);e.s(["Heart",0,h],993101);let x=(0,t.default)("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);e.s(["ThumbsUp",0,x],548361);let f=(0,t.default)("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);e.s(["Smile",0,f],836294);let g=(0,t.default)("coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);e.s(["Coffee",0,g],749141);let v=(0,t.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);e.s(["Rocket",0,v],502599)},19080,760709,629679,289133,401399,e=>{"use strict";var t=e.i(205270);let s=(0,t.default)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);e.s(["Award",0,s],19080);let a=(0,t.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Target",0,a],760709);let r=(0,t.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);e.s(["Flag",0,r],629679);let i=(0,t.default)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);e.s(["Crosshair",0,i],289133);let l=(0,t.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);e.s(["Layers",0,l],401399)},40546,e=>{"use strict";let t=(0,e.i(205270).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["Layout",0,t],40546)},274489,e=>{"use strict";var t=e.i(191788),s=e.i(878528),a=e.i(456992),r=e.i(23826),i=e.i(644113),l=e.i(390995),n=e.i(75769),d=e.i(781641),o=e.i(292057),c=e.i(595838),u=e.i(405624),m=e.i(383751),p=e.i(815242),h=e.i(21152),x=e.i(545719),f=e.i(920814),g=e.i(477254),v=e.i(809852),j=e.i(470656),y=e.i(769480),b=e.i(575461),k=e.i(398024),N=e.i(665263),w=e.i(409155),C=e.i(918703),S=e.i(983832),M=e.i(218516),A=e.i(484862),T=e.i(550309),D=e.i(609104),I=e.i(798656),P=e.i(674389),E=e.i(201692),z=e.i(786428),B=e.i(985044),L=e.i(117595),R=e.i(835838),F=e.i(526251),O=e.i(661059),H=e.i(883210),V=e.i(536586),$=e.i(817908),q=e.i(932268),G=e.i(735299),K=e.i(606306),U=e.i(504838),_=e.i(399366),W=e.i(480778),Y=e.i(143547),J=e.i(401686),Z=e.i(593828),X=e.i(353028),Q=e.i(686047),ee=e.i(348916),et=e.i(230129),es=e.i(561275),ea=e.i(584166),er=e.i(830422),ei=e.i(258769),el=e.i(503808),en=e.i(520688),ed=e.i(472930),eo=e.i(976977),ec=e.i(47091),eu=e.i(506495),em=e.i(239845),ep=e.i(993101),eh=e.i(548361),ex=e.i(836294),ef=e.i(749141),eg=e.i(502599),ev=e.i(718581),ej=e.i(692127),ey=e.i(582809),eb=e.i(131464),ek=e.i(19080),eN=e.i(186534),ew=e.i(760709),eC=e.i(629679),eS=e.i(289133),eM=e.i(401399),eA=e.i(40546),eT=e.i(205270);let eD=(0,eT.default)("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),eI=(0,eT.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),eP=(0,eT.default)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]),eE=(0,eT.default)("kanban",[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]]);var ez=e.i(977356);let eB=(0,eT.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),eL=(0,eT.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"}]]),eR=(0,eT.default)("graduation-cap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]),eF=(0,eT.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),eO={Globe:s.Globe,Link:a.Link,ExternalLink:r.ExternalLink,Bookmark:i.Bookmark,Star:l.Star,Home:n.Home,FileText:d.FileText,BarChart3:o.BarChart3,PieChart:c.PieChart,LineChart:u.LineChart,Activity:m.Activity,Zap:p.Zap,Terminal:h.Terminal,Code:x.Code,Database:f.Database,Server:g.Server,Cloud:v.Cloud,Shield:j.Shield,Lock:y.Lock,Key:b.Key,User:k.User,Users:N.Users,Mail:w.Mail,MessageSquare:C.MessageSquare,Bell:S.Bell,Calendar:M.Calendar,Clock:A.Clock,Search:T.Search,Eye:D.Eye,Camera:I.Camera,Image:P.Image,Film:E.Film,Music:z.Music,Headphones:B.Headphones,Mic:L.Mic,Folder:R.Folder,File:F.File,Archive:O.Archive,Download:H.Download,Upload:V.Upload,GitBranch:$.GitBranch,GitCommit:q.GitCommit,GitPullRequest:G.GitPullRequest,GitFork:K.GitFork,Bug:U.Bug,Wrench:_.Wrench,Settings:W.Settings,Sliders:Y.Sliders,Palette:J.Palette,Brush:Z.Brush,Map:X.Map,MapPin:Q.MapPin,Navigation:ee.Navigation,Compass:et.Compass,Wifi:es.Wifi,Monitor:ea.Monitor,Smartphone:er.Smartphone,Tablet:ei.Tablet,Laptop:el.Laptop,Cpu:en.Cpu,HardDrive:ed.HardDrive,MemoryStick:eo.MemoryStick,CircuitBoard:ec.CircuitBoard,Radio:eu.Radio,Bluetooth:em.Bluetooth,Heart:ep.Heart,ThumbsUp:eh.ThumbsUp,Smile:ex.Smile,Coffee:ef.Coffee,Rocket:eg.Rocket,Flame:ev.Flame,Sun:ej.Sun,Moon:ey.Moon,Sparkles:eb.Sparkles,Award:ek.Award,Trophy:eN.Trophy,Target:ew.Target,Flag:eC.Flag,Crosshair:eS.Crosshair,Layers:eM.Layers,Layout:eA.Layout,Grid:eD,List:eI,Table:eP,Kanban:eE,Bot:ez.Bot,Brain:eB,Lightbulb:eL,GraduationCap:eR,BookOpen:eF};e.s(["default",0,e=>{let{name:s,className:a,style:r}=e,i=eO[s];return i?(0,t.createElement)(i,{className:a,style:r}):null},"getIcon",0,e=>eO[e]],274489)},518313,e=>{"use strict";var t=e.i(391398),s=e.i(191788),a=e.i(352819),r=e.i(679935),i=e.i(939310),l=e.i(45124),n=e.i(31050),d=e.i(246618);e.s(["default",0,()=>{let e=(0,a.useTranslations)("settings.typography"),o=(0,n.default)(e=>e.regionTypography),c=(0,n.default)(e=>e.setRegionTypography),[u,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(!1),x=u??o,f=(0,d.isValidRegionTypography)(x),g=!(0,d.regionTypographyEqual)(x,o),v=(e,t,s)=>{let a={...x[e],[t]:s};void 0===s&&delete a[t];let r={...x,[e]:a};0===Object.keys(a).length&&delete r[e],m(r)},j=async()=>{h(!0);try{await c(x),m(null),r.toast.success(e("applied"))}catch(t){r.toast.error(e("failed"),{description:t instanceof Error?t.message:void 0})}finally{h(!1)}};return(0,t.jsxs)("fieldset",{disabled:p,className:"space-y-4 border-b pb-4",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("fontHelp")}),d.TYPOGRAPHY_REGIONS.map(s=>{let a=x[s]??{},r=(0,d.isValidRegionTypography)({[s]:a})?a:{};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e(`regions.${s}`)}),(0,t.jsx)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:!x[s],onClick:()=>{let e={...x};delete e[s],m(e)},children:e("reset")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("label",{className:"space-y-1 text-xs sm:col-span-2",children:[(0,t.jsx)("span",{children:e("fontFamily")}),(0,t.jsx)(l.Input,{value:a.fontFamily??"",maxLength:200,placeholder:e("fontPlaceholder"),onChange:e=>v(s,"fontFamily",e.target.value||void 0)})]}),(0,t.jsxs)("label",{className:"space-y-1 text-xs",children:[(0,t.jsx)("span",{children:e("fontSize")}),(0,t.jsx)(l.Input,{type:"number",min:d.MIN_REGION_FONT_SIZE,max:d.MAX_REGION_FONT_SIZE,step:"1",value:a.fontSize??"",placeholder:e("default"),onChange:e=>v(s,"fontSize",""===e.target.value?void 0:Number(e.target.value))})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("label",{htmlFor:`typography-color-${s}`,children:e("color")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[a.color&&!(0,d.isValidTypographyColor)(a.color)?(0,t.jsx)("span",{role:"img","aria-label":e("invalid"),className:"flex h-9 w-9 shrink-0 items-center justify-center rounded border border-destructive text-destructive",children:"!"}):(0,t.jsx)("input",{type:"color",className:"h-9 w-9 shrink-0 cursor-pointer rounded border bg-transparent","aria-label":`${e(`regions.${s}`)} ${e("color")}`,title:a.color??e("default"),value:a.color??"#808080",onChange:e=>v(s,"color",e.target.value)}),(0,t.jsx)(l.Input,{id:`typography-color-${s}`,value:a.color??"",maxLength:7,placeholder:e("default"),"aria-invalid":!!a.color&&!(0,d.isValidTypographyColor)(a.color),onChange:e=>v(s,"color",e.target.value||void 0)})]})]})]}),(0,t.jsx)("div",{className:"overflow-auto rounded bg-muted/30 p-2",style:{fontFamily:r.fontFamily?(0,d.regionFontFamily)(r.fontFamily):void 0,fontSize:r.fontSize,color:r.color},children:e("preview")})]},s)}),!f&&(0,t.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:e("invalid")}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-between gap-2",children:[(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",disabled:0===Object.keys(x).length,onClick:()=>m({}),children:e("resetAll")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",disabled:!g,onClick:()=>m(null),children:e("cancel")}),(0,t.jsx)(i.Button,{type:"button",size:"sm",disabled:!g||!f,onClick:j,children:e(p?"saving":"apply")})]})]})]})}])},524845,(e,t,s)=>{t.exports={name:"purplemux-improved",version:"0.5.13",description:"Manage multiple Claude Code sessions from your browser",license:"MIT",author:"subicura",repository:{type:"git",url:"https://github.com/stirp/purplemux-improved.git"},homepage:"https://github.com/stirp/purplemux-improved",bugs:{url:"https://github.com/stirp/purplemux-improved/issues"},keywords:["claude","terminal","multiplexer","tmux","claude-code"],engines:{node:">=24.0.0"},packageManager:"pnpm@12.11.2",browserslist:["chrome 111","edge 111","firefox 111","safari 15.4","ios_saf 15.4"],main:"dist-electron/main.js",bin:{"purplemux-improved":"./bin/purplemux.js",pmuxi:"./bin/cli.js"},files:["bin/","dist/",".next/standalone/","src/config/tmux.conf"],scripts:{dev:"tsx watch server.ts",build:"next build && node scripts/post-build.js && tsup","build:landing":"eleventy","dev:landing":"eleventy --serve","build:server":"tsup","build:electron:main":"tsup --config electron/tsup.config.ts","build:electron":"next build && node scripts/post-build.js --electron && tsup && pnpm build:electron:main","dev:electron":"ELECTRON_DEV_URL=http://localhost:8022 electron .","pack:electron":"pnpm build:electron && electron-builder --mac","pack:electron:linux":"pnpm build:electron && electron-builder --linux AppImage","pack:electron:dev":"pnpm build:electron && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --mac -c.mac.identity=null -c.mac.notarize=false",start:"NODE_ENV=production tsx server.ts",lint:"eslint",test:"vitest run && pnpm test:cli","test:cli":"node --test tests/cli/*.test.cjs","test:watch":"vitest",ralph:"node ralph-loop.js",prepublishOnly:"rm -rf .next dist dist-electron && pnpm build",postinstall:"chmod +x node_modules/.pnpm/node-pty@*/node_modules/node-pty/prebuilds/*/spawn-helper 2>/dev/null; exit 0"},dependencies:{"@base-ui/react":"^1.3.0","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@git-diff-view/core":"^0.1.3","@git-diff-view/file":"^0.1.3","@git-diff-view/react":"^0.1.3","@hookform/resolvers":"^5.9.1","@tailwindcss/typography":"^0.5.19","@xterm/addon-clipboard":"^0.2.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-unicode11":"^0.9.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0",acorn:"^8.18.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",cmdk:"^1.1.1",dayjs:"^1.11.20",diff:"^9.0.0",jose:"^6.2.2",koffi:"2.15.2","lucide-react":"^1.7.0",motion:"^12.38.0",nanoid:"^5.1.7",next:"16.2.6","next-intl":"^4.11.0","next-themes":"^0.4.6","node-pty":"1.2.0-beta.12",pino:"^10.3.1","pino-pretty":"^13.1.3","pino-roll":"^4.0.0",react:"19.2.5","react-dom":"19.2.5","react-hook-form":"^7.90.0","react-hotkeys-hook":"^5.2.4","react-icons":"^5.6.0","react-markdown":"^10.1.0","react-resizable-panels":"^4.10.0",recharts:"^3.8.0","rehype-highlight":"^7.0.2","rehype-raw":"^7.0.0","remark-gfm":"^4.0.1","smol-toml":"^1.6.1",sonner:"^2.0.7",swr:"^2.4.1","tailwind-merge":"^3.5.0","tw-animate-css":"^1.4.0","update-notifier":"^7.3.1","use-stick-to-bottom":"^1.1.3",vaul:"^1.1.2","web-push":"^3.6.7",ws:"^8.20.0",zod:"^4.3.6",zustand:"^5.0.12"},devDependencies:{"@11ty/eleventy":"^3.1.5","@electron/rebuild":"^4.0.3","@tailwindcss/postcss":"^4","@types/node":"^24.12.0","@types/react":"^19","@types/react-dom":"^19","@types/web-push":"^3.6.4","@types/ws":"^8.18.1",chalk:"^5.6.2",electron:"^41.1.1","electron-builder":"^26.8.1","electron-updater":"^6.8.3",eslint:"^9","eslint-config-next":"16.2.5",jsdom:"^26.1.0",shadcn:"^4.1.2",tailwindcss:"^4",tsup:"^8.5.1",tsx:"^4.21.0",typescript:"^5.9.3",vitest:"^4.1.4"}}},88883,e=>{"use strict";var t=e.i(391398),s=e.i(883210),a=e.i(637939),a=a,r=e.i(53073),i=e.i(191788),l=e.i(352819),n=e.i(939310),d=e.i(212283),o=e.i(950323);let c=async(e,t)=>{let s=window.electronAPI;if(s?.isElectron){if(!s.getAppUpdate||!s.appUpdateAction)throw Error("This desktop version does not expose update controls. Use the application menu.");return e?s.appUpdateAction(e,t):s.getAppUpdate()}let a=await fetch("/api/app-update",{method:e?"POST":"GET",cache:"no-store",...e?{headers:{"Content-Type":"application/json","x-purplemux-update":"1"},body:JSON.stringify({action:e,version:t})}:{}});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error||`Update service: HTTP ${a.status}`)}return a.json()},u=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,m=e=>"string"==typeof e&&u.test(e)&&e.split(".").every(e=>Number.isSafeInteger(Number(e)));e.s(["default",0,e=>{let{compact:u=!1}=e,p=(0,l.useTranslations)("settings.appUpdate"),{state:h,error:x,requesting:f,run:g,desktop:v,reconnectTimedOut:j}=(()=>{let e=!!window.electronAPI?.isElectron,{data:t,error:s,mutate:a}=(0,o.default)(e?"app-update:desktop":"app-update:server",()=>c(),{refreshInterval:e=>e&&["checking","downloading","restarting"].includes(e.phase)?2e3:3e4,dedupingInterval:1e3,shouldRetryOnError:!0,errorRetryInterval:3e3}),[r,l]=(0,i.useState)(!1),[n,d]=(0,i.useState)(null),[u,m]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(t?.phase!=="restarting")return;let e=setTimeout(()=>m(!0),15e4);return()=>clearTimeout(e)},[t?.phase]);let p=(0,i.useRef)(null);(0,i.useEffect)(()=>{t&&(p.current&&p.current!==t.currentVersion&&window.location.reload(),p.current=t.currentVersion)},[t]);let h=async(e,t)=>{l(!0),d(null),m(!1);try{await a(await c(e,t),{revalidate:!1})}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}};return{state:t,error:n||(s instanceof Error?s.message:null),requesting:r,run:h,desktop:e,reconnectTimedOut:t?.phase==="restarting"&&u}})(),[y,b]=(0,i.useState)(null),k=!!h?.latestVersion&&((e,t)=>{if(!m(e)||!m(t))return!1;let s=e.split(".").map(Number),a=t.split(".").map(Number);for(let e=0;e<s.length;e++)if(s[e]!==a[e])return s[e]>a[e];return!1})(h.latestVersion,h.currentVersion),N=k&&h?.skippedVersion===h?.latestVersion,w=f||!!h?.installing||["checking","downloading","restarting"].includes(h?.phase||""),C=h?.installing||["downloading","ready","blocked","restarting"].includes(h?.phase||"");return(!u||!N||C||h?.error||x)&&(!u||k||h?.error||["downloading","blocked","restarting"].includes(h?.phase||""))?(0,t.jsxs)("section",{"aria-label":p("title"),className:u?"shrink-0 border-b bg-muted px-3 py-2":"space-y-3",children:[(0,t.jsxs)("div",{className:u?"flex flex-wrap items-center justify-between gap-3":"flex flex-col items-stretch justify-between gap-3 sm:flex-row sm:items-center",children:[(0,t.jsxs)("div",{className:u?"min-w-0 flex-1 basis-48 space-y-1":"min-w-0 flex-1 space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:u&&k?p("available",{version:h.latestVersion}):p("title")}),!u&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p(v?"desktopDescription":"serverDescription")}),h&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",role:"status",children:[p("current",{version:h.currentVersion})," · ",p("idle"!==h.phase||h.checkedAt?h.phase:"notChecked",{version:h.latestVersion||""}),!u&&k&&"available"!==h.phase&&` \xb7 ${p("available",{version:h.latestVersion})}`,null!==h.progress&&"downloading"===h.phase&&` ${Math.round(h.progress)}%`]}),!u&&N&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("skipped",{version:h.latestVersion})})]}),(0,t.jsxs)("div",{className:"flex max-w-full shrink-0 flex-wrap gap-2",children:[!u&&(0,t.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:w,onClick:()=>void g("check"),children:[w?(0,t.jsx)(a.default,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(r.RefreshCw,{className:"h-4 w-4"}),p("check")]}),k&&(0,t.jsxs)(n.Button,{size:"sm",disabled:w||!h?.supported,onClick:()=>void g("install"),children:[w?(0,t.jsx)(a.default,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(s.Download,{className:"h-4 w-4"}),p("install")]}),k&&(0,t.jsx)(n.Button,{variant:"destructive",size:"sm",disabled:w||!h?.supported,onClick:()=>b(h.latestVersion),children:p("forceInstall")}),k&&!N&&(0,t.jsx)(n.Button,{variant:"outline",size:"sm",disabled:w,onClick:()=>void g("skip",h.latestVersion),children:p("skip")})]})]}),h?.phase==="restarting"&&(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p(v?"desktopReconnecting":"reconnecting")}),j&&(0,t.jsxs)("div",{role:"alert",className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-destructive",children:p("reconnectFailed")}),(0,t.jsx)(n.Button,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),children:p("reload")})]}),(h?.error||x)&&h?.phase!=="restarting"&&(0,t.jsx)("p",{role:"alert",className:"mt-2 break-words text-xs text-destructive",children:x||(h?.phase==="blocked"?p("busyHint"):h?.error)}),h&&!h.supported&&(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p(v?"desktopUnsupported":"serverUnsupported")}),(0,t.jsx)(d.AlertDialog,{open:null!==y,onOpenChange:e=>{e||b(null)},children:(0,t.jsxs)(d.AlertDialogContent,{children:[(0,t.jsxs)(d.AlertDialogHeader,{children:[(0,t.jsx)(d.AlertDialogTitle,{children:p("forceInstall")}),(0,t.jsx)(d.AlertDialogDescription,{children:p("forceConfirm",{version:y||""})})]}),(0,t.jsxs)(d.AlertDialogFooter,{children:[(0,t.jsx)(d.AlertDialogCancel,{children:p("cancel")}),(0,t.jsx)(n.Button,{variant:"destructive",disabled:w||!h?.supported||y!==h?.latestVersion,onClick:()=>{y&&(g("force-install",y),b(null))},children:p("forceInstall")})]})]})})]}):null}],88883)},374255,e=>{"use strict";let t=(0,e.i(205270).default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);e.s(["Dices",0,t],374255)},833060,e=>{"use strict";var t=e.i(676618);e.s(["ImageIcon",()=>t.default])},425560,e=>{"use strict";let t=(0,e.i(205270).default)("monitor-smartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);e.s(["MonitorSmartphone",0,t],425560)},208501,621504,636989,170004,468528,e=>{"use strict";var t,s=e.i(391398);e.i(977848);var a=e.i(542151),r=e.i(648684),i=e.i(353533);e.i(227384);let l=(0,r.cva)("flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",{variants:{orientation:{horizontal:"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",vertical:"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"}},defaultVariants:{orientation:"horizontal"}});e.s(["ButtonGroup",0,function(e){let{className:t,orientation:a,...r}=e;return(0,s.jsx)("div",{role:"group","data-slot":"button-group","data-orientation":a,className:(0,i.cn)(l({orientation:a}),t),...r})}],208501);var n=e.i(191788),d=e.i(91762);let o=(0,r.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function(e){let{className:t,orientation:a="vertical",...r}=e;return(0,s.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,i.cn)(o({orientation:a}),t),...r})},"FieldDescription",0,function(e){let{className:t,...a}=e;return(0,s.jsx)("p",{"data-slot":"field-description",className:(0,i.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",t),...a})},"FieldLabel",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(d.Label,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",t),...a})}],621504),e.s([],48543),e.i(48543),e.i(350461);var c=e.i(978054),u=e.i(95349),m=e.i(25104),p=e.i(931497),h=e.i(562912),x=e.i(245925),f=e.i(203799),g=e.i(872863),v=e.i(408372);let j=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),y={checked:e=>e?{[j.checked]:""}:{[j.unchecked]:""},...g.transitionStatusMapping,...v.fieldValidityMapping};var b=e.i(333961),k=e.i(817806),N=e.i(495247),w=e.i(623377),C=e.i(660566),S=e.i(699140),M=e.i(653054),A=e.i(780023),T=e.i(552413);let D=n.createContext(void 0);var I=e.i(308665),P=e.i(579907);let E=n.createContext(void 0),z=n.forwardRef(function(e,t){let{render:r,className:i,disabled:l=!1,readOnly:d=!1,required:o=!1,"aria-labelledby":g,value:v,inputRef:j,nativeButton:P=!1,id:z,style:B,...L}=e,R=n.useContext(D),{disabled:F,readOnly:O,required:H,form:V,checkedValue:$,touched:q=!1,validation:G,name:K}=R??{},U=R?.setCheckedValue??h.NOOP,_=R?.setTouched??h.NOOP,W=R?.registerControlRef??h.NOOP,Y=R?.registerInputRef??h.NOOP,{setDirty:J,validityData:Z,setTouched:X,setFilled:Q,state:ee,disabled:et}=(0,C.useFieldRootContext)(),es=(0,S.useFieldItemContext)(),{labelId:ea,getDescriptionProps:er}=(0,M.useLabelableContext)(),ei=et||es.disabled||F||l,el=O||d,en=H||o,ed=R?$===v:""===v,eo=n.useMemo(()=>(0,I.serializeValue)(v),[v]),ec=n.useRef(null),eu=n.useRef(null),em=(0,m.useStableCallback)(e=>{e&&W(e,ei)}),ep=(0,c.useMergedRefs)(j,eu,Y);(0,u.useIsoLayoutEffect)(()=>{eu.current?.checked&&Q(!0)},[Q]),(0,u.useIsoLayoutEffect)(()=>{if(eu.current){if(ei&&ed)return void Y(null);ec.current&&W(ec.current,ei),Y(eu.current)}},[ed,ei,W,Y]);let eh=(0,b.useBaseUiId)(),ex=(0,T.useLabelableId)({id:z,implicit:!1,controlRef:ec}),ef=P?void 0:ex,eg={role:"radio","aria-checked":ed,"aria-required":en||void 0,"aria-readonly":el||void 0,"aria-labelledby":(0,A.useAriaLabelledBy)(g,ea,eu,!P,ef),[N.ACTIVE_COMPOSITE_ITEM]:ed?"":void 0,id:P?ex:eh,onKeyDown(e){"Enter"===e.key&&e.preventDefault()},onClick(e){e.defaultPrevented||ei||el||(e.preventDefault(),eu.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))},onFocus(e){e.defaultPrevented||ei||el||!q||(eu.current?.click(),_(!1))}},{getButtonProps:ev,buttonRef:ej}=(0,k.useButton)({disabled:ei,native:P}),ey={type:"radio",ref:ep,form:V,id:ef,name:K,tabIndex:-1,style:K?p.visuallyHiddenInput:p.visuallyHidden,"aria-hidden":!0,...void 0!==v?{value:eo}:h.EMPTY_OBJECT,disabled:ei,checked:ed,required:en,readOnly:el,onChange(e){if(e.nativeEvent.defaultPrevented||ei||el||void 0===v)return;let t=(0,x.createChangeEventDetails)(f.REASONS.none,e.nativeEvent);t.isCanceled||(X(!0),J(v!==Z.initialValue),Q(!0),U(v,t))},onFocus(){ec.current?.focus()}},eb=n.useMemo(()=>({...ee,required:en,disabled:ei,readOnly:el,checked:ed}),[ee,ei,el,ed,en]),ek=void 0!==R,eN=[t,ec,ej,em],ew=[eg,er,G?.getValidationProps??h.EMPTY_OBJECT,L,ev],eC=(0,a.useRenderElement)("span",e,{enabled:!ek,state:eb,ref:eN,props:ew,stateAttributesMapping:y});return(0,s.jsxs)(E.Provider,{value:eb,children:[ek?(0,s.jsx)(w.CompositeItem,{tag:"span",render:r,className:i,style:B,state:eb,refs:eN,props:ew,stateAttributesMapping:y}):eC,(0,s.jsx)("input",{...ey,suppressHydrationWarning:!0})]})});var B=e.i(657681),L=e.i(276149);let R=n.forwardRef(function(e,t){let{render:s,className:r,style:i,keepMounted:l=!1,...d}=e,o=function(){let e=n.useContext(E);if(void 0===e)throw Error((0,P.default)(52));return e}(),c=o.checked,{mounted:u,transitionStatus:m,setMounted:p}=(0,L.useTransitionStatus)(c),h={...o,transitionStatus:m},x=n.useRef(null),f=(0,a.useRenderElement)("span",e,{ref:[t,x],state:h,props:d,stateAttributesMapping:y});return((0,B.useOpenChangeComplete)({open:c,ref:x,onComplete(){c||p(!1)}}),l||u)?f:null});e.s(["Indicator",0,R,"Root",0,z],648646);var F=e.i(648646),F=F,O=e.i(176955),H=e.i(154532),V=e.i(113292),$=e.i(324083),q=e.i(390940),G=e.i(935942),K=e.i(598634),U=e.i(944306);let _=[V.SHIFT],W=n.forwardRef(function(e,t){let{render:a,className:r,disabled:i,readOnly:l,required:d,onValueChange:o,value:c,defaultValue:u,form:p,name:h,inputRef:x,id:f,style:g,...j}=e,{setTouched:y,setFocused:k,shouldValidateOnChange:N,validationMode:w,name:S,disabled:A,state:T,validation:I,setDirty:P,setFilled:E,validityData:z}=(0,C.useFieldRootContext)(),{labelId:B}=(0,M.useLabelableContext)(),{clearErrors:L}=(0,K.useFormContext)(),R=(0,G.useFieldsetRootContext)(!0),F=A||i,V=S??h,W=(0,b.useBaseUiId)(f),[Y,J]=(0,O.useControlled)({controlled:c,default:u,name:"RadioGroup",state:"value"}),Z=(0,m.useStableCallback)(o),X=(0,m.useStableCallback)((e,t)=>{Z(e,t),t.isCanceled||J(e)}),Q=n.useRef(null),ee=n.useRef(null),et=n.useRef(null);function es(e){let t;return x&&("function"==typeof x?t=x(e):x.current=e),ee.current=e,I.inputRef.current=e,t}let ea=(0,m.useStableCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){if(t){Q.current===e&&(Q.current=null);return}null==Q.current&&(Q.current=e)}}),er=(0,m.useStableCallback)(e=>{if(!e||e.disabled)return;et.current||(et.current=e);let t=ee.current;if(e.checked||null==t||t.disabled)return es(e)}),ei=(0,m.useStableCallback)(()=>Y??null);(0,q.useRegisterFieldControl)(Q,{id:W,value:Y,getValue:ei}),(0,U.useValueChanged)(Y,()=>{L(V),P(Y!==z.initialValue),E(null!=Y),N()?I.commit(Y):I.commit(Y,!0);let e=et.current;null==Y&&e&&!e.disabled&&es(e)});let[el,en]=n.useState(!1),ed=j["aria-labelledby"]??B??R?.legendId,eo={...T,disabled:F??!1,required:d??!1,readOnly:l??!1},ec=n.useMemo(()=>({...T,checkedValue:Y,disabled:F,form:p,validation:I,name:V,onValueChange:Z,readOnly:l,registerControlRef:ea,registerInputRef:er,required:d,setCheckedValue:X,setTouched:en,touched:el}),[Y,F,p,I,T,V,Z,l,ea,er,d,X,en,el]);return(0,s.jsx)(D.Provider,{value:ec,children:(0,s.jsx)($.CompositeRoot,{render:a,className:r,style:g,state:eo,props:[{role:"radiogroup","aria-required":d||void 0,"aria-disabled":F||void 0,"aria-readonly":l||void 0,"aria-labelledby":ed,onFocus(){k(!0)},onBlur(e){(0,H.contains)(e.currentTarget,e.relatedTarget)||(y(!0),k(!1),"onBlur"===w&&I.commit(Y))},onKeyDownCapture(e){e.key.startsWith("Arrow")&&(y(!0),en(!0),k(!0))}},I.getValidationProps,j],refs:[t],stateAttributesMapping:v.fieldValidityMapping,enableHomeAndEndKeys:!1,modifierKeys:_})})});e.s(["RadioGroup",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(W,{"data-slot":"radio-group",className:(0,i.cn)("grid w-full gap-2",t),...a})},"RadioGroupItem",0,function(e){let{className:t,...a}=e;return(0,s.jsx)(F.Root,{"data-slot":"radio-group-item",className:(0,i.cn)("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",t),...a,children:(0,s.jsx)(F.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:(0,s.jsx)("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}],636989),e.s(["TOAST_POSITIONS",0,["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]],170004);var Y=e.i(352819),J=e.i(745725),Z=e.i(59295),X=e.i(706277),Q=e.i(146341),ee=e.i(849271),et=e.i(861416),es=e.i(265524),ea=e.i(749999),er=e.i(620216),ei=e.i(939310),el=e.i(45124),en=e.i(130027),ed=e.i(443915),eo=e.i(212283),ec=e.i(639530),eu=e.i(658662);let em=e=>{let{prompt:t,onToggle:a}=e,{attributes:r,listeners:i,setNodeRef:l,setActivatorNodeRef:n,transform:d,transition:o,isDragging:c}=(0,X.useSortable)({id:t.id}),u={transform:Q.CSS.Translate.toString(d),transition:o,zIndex:c?1:void 0,position:c?"relative":void 0};return(0,s.jsxs)("div",{ref:l,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:u,children:[(0,s.jsx)("div",{ref:n,...r,...i,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,s.jsx)(ee.GripVertical,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.name}),(0,s.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:t.prompt})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center",children:(0,s.jsx)(en.Switch,{checked:t.enabled,onCheckedChange:e=>a(t.id,e)})})]})},ep=e=>{let{prompt:t,onEdit:a,onDelete:r,onToggle:i}=e,{attributes:l,listeners:n,setNodeRef:d,setActivatorNodeRef:o,transform:c,transition:u,isDragging:m}=(0,X.useSortable)({id:t.id}),p={transform:Q.CSS.Translate.toString(c),transition:u,zIndex:m?1:void 0,position:m?"relative":void 0};return(0,s.jsxs)("div",{ref:d,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:p,children:[(0,s.jsx)("div",{ref:o,...l,...n,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,s.jsx)(ee.GripVertical,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.name}),(0,s.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:t.prompt})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,s.jsx)(ei.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>a(t),children:(0,s.jsx)(et.Pencil,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(ei.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-ui-red hover:text-ui-red/80",onClick:()=>r(t.id),children:(0,s.jsx)(er.Trash2,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(en.Switch,{checked:t.enabled,onCheckedChange:e=>i(t.id,e)})]})]})};e.s(["default",0,()=>{let e=(0,Y.useTranslations)("settings.quickPrompts"),{allOrderedPrompts:t,customPrompts:a,toggleBuiltin:r,saveCustom:i,saveOrder:l,deletePrompt:d,resetAll:o}=(0,ec.default)(),[c,u]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[h,x]=(0,n.useState)(null),f=(0,Z.useSensors)((0,Z.useSensor)(Z.PointerSensor,{activationConstraint:{distance:5}})),g=(0,n.useCallback)((e,t)=>{e.startsWith("builtin-")?r(e,t):i(a.map(s=>s.id===e?{...s,enabled:t}:s))},[a,r,i]),v=(0,n.useCallback)(e=>{x(e)},[]),j=(0,n.useCallback)(()=>{h&&(d(h),x(null))},[h,d]),y=(0,n.useCallback)(e=>{u({mode:"edit",id:e.id,name:e.name,prompt:e.prompt})},[]),b=(0,n.useCallback)(()=>{u({mode:"add",name:"",prompt:""})},[]),k=(0,n.useCallback)(()=>{c&&c.name.trim()&&c.prompt.trim()&&("edit"===c.mode&&c.id?i(a.map(e=>e.id===c.id?{...e,name:c.name.trim(),prompt:c.prompt}:e)):i([...a,{id:`custom-${(0,J.nanoid)(8)}`,name:c.name.trim(),prompt:c.prompt,enabled:!0}]),u(null))},[c,a,i]),N=(0,n.useCallback)(()=>{o(),p(!1)},[o]),w=(0,n.useCallback)(e=>{let{active:s,over:a}=e;if(!a||s.id===a.id)return;let r=t.findIndex(e=>e.id===s.id),i=t.findIndex(e=>e.id===a.id);-1===r||-1===i||l((0,X.arrayMove)(t,r,i).map(e=>e.id))},[t,l]),C=!!c&&c.name.trim().length>0&&c.prompt.trim().length>0;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("itemsSection")}),t.length>0&&(0,s.jsx)(Z.DndContext,{sensors:f,collisionDetection:Z.closestCenter,modifiers:[eu.restrictToVerticalAxis],onDragEnd:w,children:(0,s.jsx)(X.SortableContext,{items:t.map(e=>e.id),strategy:X.verticalListSortingStrategy,children:(0,s.jsx)("div",{className:"overflow-hidden rounded-lg border",children:t.map(e=>e.id.startsWith("builtin-")?(0,s.jsx)(em,{prompt:e,onToggle:g},e.id):(0,s.jsx)(ep,{prompt:e,onEdit:y,onDelete:v,onToggle:g},e.id))})})}),c&&(0,s.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e("add"===c.mode?"addPrompt":"editPrompt")}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:e("nameLabel")}),(0,s.jsx)(el.Input,{value:c.name,onChange:e=>u({...c,name:e.target.value}),placeholder:e("namePlaceholder"),autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:e("promptLabel")}),(0,s.jsx)(ed.Textarea,{value:c.prompt,onChange:e=>u({...c,prompt:e.target.value}),placeholder:e("promptPlaceholder"),rows:3})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(ei.Button,{variant:"outline",size:"sm",onClick:()=>u(null),children:e("cancel")}),(0,s.jsx)(ei.Button,{size:"sm",onClick:k,disabled:!C,children:e("save")})]})]}),!c&&(0,s.jsxs)(ei.Button,{variant:"outline",size:"sm",onClick:b,children:[(0,s.jsx)(es.Plus,{className:"mr-1 h-3.5 w-3.5"}),e("addButton")]})]}),(0,s.jsxs)(ei.Button,{variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:()=>p(!0),children:[(0,s.jsx)(ea.RotateCcw,{className:"mr-1 h-3.5 w-3.5"}),e("resetToDefault")]}),(0,s.jsx)(eo.AlertDialog,{open:!!h,onOpenChange:e=>!e&&x(null),children:(0,s.jsxs)(eo.AlertDialogContent,{children:[(0,s.jsxs)(eo.AlertDialogHeader,{children:[(0,s.jsx)(eo.AlertDialogTitle,{children:e("deleteTitle")}),(0,s.jsx)(eo.AlertDialogDescription,{children:e("deleteDescription")})]}),(0,s.jsxs)(eo.AlertDialogFooter,{children:[(0,s.jsx)(eo.AlertDialogCancel,{children:e("deleteCancel")}),(0,s.jsx)(eo.AlertDialogAction,{onClick:j,children:e("deleteConfirm")})]})]})}),(0,s.jsx)(eo.AlertDialog,{open:m,onOpenChange:p,children:(0,s.jsxs)(eo.AlertDialogContent,{children:[(0,s.jsxs)(eo.AlertDialogHeader,{children:[(0,s.jsx)(eo.AlertDialogTitle,{children:e("resetTitle")}),(0,s.jsx)(eo.AlertDialogDescription,{children:e("resetDescription")})]}),(0,s.jsxs)(eo.AlertDialogFooter,{children:[(0,s.jsx)(eo.AlertDialogCancel,{children:e("resetCancel")}),(0,s.jsx)(eo.AlertDialogAction,{onClick:N,children:e("resetConfirm")})]})]})})]})}],468528)},934048,e=>{"use strict";e.i(350461);var t=e.i(391398),s=e.i(518313),a=e.i(191788),r=e.i(352819),i=e.i(679935),l=e.i(603331),n=e.i(524845),d=e.i(29803),o=e.i(266231),c=e.i(350064),u=e.i(88883),m=e.i(983832),p=e.i(977356),h=e.i(444957),x=e.i(377216),f=e.i(374255),g=e.i(511892),v=e.i(878528),j=e.i(833060),y=e.i(958282),b=e.i(40546),k=e.i(769480),N=e.i(584166),w=e.i(425560),C=e.i(582809),S=e.i(112285),M=e.i(401686),A=e.i(749999),T=e.i(480778),D=e.i(692127),I=e.i(21152),P=e.i(620216),E=e.i(399366),z=e.i(909725),B=e.i(815242),L=e.i(939310),R=e.i(208501),F=e.i(45124),O=e.i(130027),H=e.i(621504),V=e.i(91762),$=e.i(636989),q=e.i(550292),G=e.i(296202),K=e.i(212283),U=e.i(690176),_=e.i(353533),W=e.i(117369),Y=e.i(31050),J=e.i(841250),Z=e.i(170004),X=e.i(490034),Q=e.i(535099),ee=e.i(998234),et=e.i(700599),es=e.i(468528),ea=e.i(745725),er=e.i(59295),ei=e.i(706277),el=e.i(146341),en=e.i(849271),ed=e.i(861416),eo=e.i(265524),ec=e.i(734549),eu=e.i(348370),em=e.i(274489);let ep=["Globe","Link","ExternalLink","Bookmark","Star","Home","FileText","BarChart3","PieChart","LineChart","Activity","Zap","Terminal","Code","Database","Server","Cloud","Shield","Lock","Key","User","Users","Mail","MessageSquare","Bell","Calendar","Clock","Search","Eye","Camera","Image","Film","Music","Headphones","Mic","Folder","File","Archive","Download","Upload","GitBranch","GitCommit","GitPullRequest","GitFork","Bug","Wrench","Settings","Sliders","Palette","Brush","Map","MapPin","Navigation","Compass","Wifi","Monitor","Smartphone","Tablet","Laptop","Cpu","HardDrive","MemoryStick","CircuitBoard","Radio","Bluetooth","Heart","ThumbsUp","Smile","Coffee","Rocket","Flame","Sun","Moon","Sparkles","Award","Trophy","Target","Flag","Crosshair","Layers","Layout","Grid","List","Table","Kanban","Bot","Brain","Lightbulb","GraduationCap","BookOpen"],eh=e=>{let{value:s,onChange:i,readonly:l,size:n=16}=e,d=(0,r.useTranslations)("settings.sidebarItems"),[o,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(""),p=(0,a.useMemo)(()=>{if(!u.trim())return ep;let e=u.toLowerCase();return ep.filter(t=>t.toLowerCase().includes(e))},[u]);return l?(0,t.jsx)(em.default,{name:s,className:"shrink-0 text-muted-foreground",style:{width:n,height:n}}):(0,t.jsxs)(eu.Popover,{open:o,onOpenChange:c,children:[(0,t.jsxs)(eu.PopoverTrigger,{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-xs transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,t.jsx)(em.default,{name:s,className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s})]}),(0,t.jsxs)(eu.PopoverContent,{className:"w-72 p-2",align:"start",children:[(0,t.jsx)(F.Input,{placeholder:d("iconSearch"),value:u,onChange:e=>m(e.target.value),className:"mb-2 h-8 text-xs",autoFocus:!0}),(0,t.jsx)("div",{className:"grid max-h-48 grid-cols-8 gap-0.5 overflow-y-auto p-1",children:p.map(e=>(0,em.getIcon)(e)?(0,t.jsx)("button",{type:"button",className:(0,_.cn)("flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-accent",s===e&&"bg-accent ring-1 ring-primary"),onClick:()=>{i?.(e),c(!1),m("")},title:e,children:(0,t.jsx)(em.default,{name:e,className:"h-4 w-4"})},e):null)}),0===p.length&&(0,t.jsx)("p",{className:"py-4 text-center text-xs text-muted-foreground",children:d("iconNotFound")})]})]})};var ex=e.i(658662);let ef=e=>{let{item:s,onEdit:a,onDelete:r,onToggle:i}=e,{attributes:l,listeners:n,setNodeRef:d,setActivatorNodeRef:o,transform:c,transition:u,isDragging:m}=(0,ei.useSortable)({id:s.id}),p={transform:el.CSS.Translate.toString(c),transition:u,zIndex:m?1:void 0,position:m?"relative":void 0};return(0,t.jsxs)("div",{ref:d,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:p,children:[(0,t.jsx)("div",{ref:o,...l,...n,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,t.jsx)(en.GripVertical,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eh,{value:s.icon,readonly:!0,size:14}),(0,t.jsx)("p",{className:"text-sm font-medium",children:s.name})]}),(0,t.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.url})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(L.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>a(s),children:(0,t.jsx)(ed.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-ui-red hover:text-ui-red/80",onClick:()=>r(s.id),children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.Switch,{checked:s.enabled,onCheckedChange:e=>i(s.id,e)})]})]})},eg=e=>{let{item:s,onToggle:a}=e,{attributes:r,listeners:i,setNodeRef:l,setActivatorNodeRef:n,transform:d,transition:o,isDragging:c}=(0,ei.useSortable)({id:s.id}),u={transform:el.CSS.Translate.toString(d),transition:o,zIndex:c?1:void 0,position:c?"relative":void 0};return(0,t.jsxs)("div",{ref:l,className:"flex items-center gap-1 bg-background py-2.5 pl-1 pr-3",style:u,children:[(0,t.jsx)("div",{ref:n,...r,...i,className:"flex shrink-0 cursor-grab items-center text-muted-foreground/50 active:cursor-grabbing",children:(0,t.jsx)(en.GripVertical,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eh,{value:s.icon,readonly:!0,size:14}),(0,t.jsx)("p",{className:"text-sm font-medium",children:s.name})]}),(0,t.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.url})]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(O.Switch,{checked:s.enabled,onCheckedChange:e=>a(s.id,e)})})]})},ev=()=>{let e=(0,r.useTranslations)("settings.sidebarItems"),{allOrderedItems:s,customItems:i,toggleBuiltin:l,saveCustom:n,saveOrder:d,deleteItem:o,resetAll:c}=(0,ec.default)(),[u,m]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null),g=(0,er.useSensors)((0,er.useSensor)(er.PointerSensor,{activationConstraint:{distance:5}})),v=(0,a.useCallback)((e,t)=>{e.startsWith("builtin-")?l(e,t):n(i.map(s=>s.id===e?{...s,enabled:t}:s))},[i,l,n]),j=(0,a.useCallback)(e=>{f(e)},[]),y=(0,a.useCallback)(()=>{x&&(o(x),f(null))},[x,o]),b=(0,a.useCallback)(e=>{m({mode:"edit",id:e.id,name:e.name,icon:e.icon,url:e.url})},[]),k=(0,a.useCallback)(()=>{m({mode:"add",name:"",icon:"Globe",url:""})},[]),N=(0,a.useCallback)(()=>{u&&u.name.trim()&&u.url.trim()&&("edit"===u.mode&&u.id?n(i.map(e=>e.id===u.id?{...e,name:u.name.trim(),icon:u.icon,url:u.url.trim()}:e)):n([...i,{id:`custom-${(0,ea.nanoid)(8)}`,name:u.name.trim(),icon:u.icon,url:u.url.trim(),enabled:!0}]),m(null))},[u,i,n]),w=(0,a.useCallback)(()=>{c(),h(!1)},[c]),C=(0,a.useCallback)(e=>{let{active:t,over:a}=e;if(!a||t.id===a.id)return;let r=s.findIndex(e=>e.id===t.id),i=s.findIndex(e=>e.id===a.id);-1===r||-1===i||d((0,ei.arrayMove)(s,r,i).map(e=>e.id))},[s,d]),S=!!u&&u.name.trim().length>0&&u.url.trim().length>0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("itemsSection")}),s.length>0&&(0,t.jsx)(er.DndContext,{sensors:g,collisionDetection:er.closestCenter,modifiers:[ex.restrictToVerticalAxis],onDragEnd:C,children:(0,t.jsx)(ei.SortableContext,{items:s.map(e=>e.id),strategy:ei.verticalListSortingStrategy,children:(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border",children:s.map(e=>e.id.startsWith("builtin-")?(0,t.jsx)(eg,{item:e,onToggle:v},e.id):(0,t.jsx)(ef,{item:e,onEdit:b,onDelete:j,onToggle:v},e.id))})})}),u&&(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eh,{value:u.icon,onChange:e=>m({...u,icon:e})}),(0,t.jsx)(F.Input,{value:u.name,onChange:e=>m({...u,name:e.target.value}),placeholder:e("namePlaceholder"),autoFocus:!0})]}),(0,t.jsx)(F.Input,{value:u.url,onChange:e=>m({...u,url:e.target.value}),placeholder:e("urlPlaceholder")}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(L.Button,{variant:"outline",size:"sm",onClick:()=>m(null),children:e("cancel")}),(0,t.jsx)(L.Button,{size:"sm",onClick:N,disabled:!S,children:e("save")})]})]}),!u&&(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",onClick:k,children:[(0,t.jsx)(eo.Plus,{className:"mr-1 h-3.5 w-3.5"}),e("addButton")]})]}),(0,t.jsxs)(L.Button,{variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:()=>h(!0),children:[(0,t.jsx)(A.RotateCcw,{className:"mr-1 h-3.5 w-3.5"}),e("resetToDefault")]}),(0,t.jsx)(K.AlertDialog,{open:!!x,onOpenChange:e=>!e&&f(null),children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("deleteTitle")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("deleteDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:e("deleteCancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:y,children:e("deleteConfirm")})]})]})}),(0,t.jsx)(K.AlertDialog,{open:p,onOpenChange:h,children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("resetTitle")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("resetDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:e("resetCancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:w,children:e("resetConfirm")})]})]})})]})};var ej=e.i(189257),ey=e.i(26857),eb=e.i(23826),ek=e.i(894915),eN=e.i(53073),ew=e.i(880179),eC=e.i(199648),eS=e.i(13628);let eM=e=>{let{text:s}=e,[r,i]=(0,a.useState)(!1),l=async()=>{await (0,eS.copyToClipboard)(s)&&(i(!0),setTimeout(()=>i(!1),1500))};return(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:l,children:r?(0,t.jsx)(ej.Check,{className:"h-3 w-3 text-positive"}):(0,t.jsx)(ey.Copy,{className:"h-3 w-3"})})},eA=()=>{let e=(0,r.useTranslations)("settings.tailscale");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-ui-amber/30 bg-ui-amber/5 p-4",children:[(0,t.jsx)(ew.AlertTriangle,{className:"mt-0.5 h-5 w-5 shrink-0 text-ui-amber"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("notInstalled")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notInstalledDescription")})]})]}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentMac")}),(0,t.jsx)("p",{children:"brew install tailscale"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentMacAppStore")}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentLinux")}),(0,t.jsx)("p",{children:"curl -fsSL https://tailscale.com/install.sh | sh"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentAfterInstall")}),(0,t.jsx)("p",{children:"tailscale up"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("installGuide",{link:e=>(0,t.jsxs)("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline hover:text-foreground",children:[e,(0,t.jsx)(eb.ExternalLink,{className:"h-3 w-3"})]})})})]})},eT=()=>{let e=(0,r.useTranslations)("settings.tailscale"),[s,l]=(0,a.useState)(null),[n,o]=(0,a.useState)(!0),[c,u]=(0,a.useState)(null),m=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/tailscale/status");if(!e.ok)throw Error();let t=await e.json();l(t)}catch{l(null)}finally{o(!1)}},[]);(0,a.useEffect)(()=>{m()},[m]);let p=async t=>{u(`remove-${t}`);try{let s=await fetch("/api/tailscale/serve",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({httpsPort:t})});if(!s.ok){let t=await s.json();throw Error(t.error||e("removeFailed"))}i.toast.success(e("removedToast",{httpsPort:t})),await m()}catch(t){i.toast.error(t instanceof Error?t.message:e("removeFailed"))}finally{u(null)}};if(n)return(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(eC.default,{className:"h-4 w-4 text-muted-foreground"})});if(!s||!s.installed)return(0,t.jsx)(eA,{});if(!s.running)return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-ui-amber/30 bg-ui-amber/5 p-4",children:[(0,t.jsx)(ew.AlertTriangle,{className:"mt-0.5 h-5 w-5 shrink-0 text-ui-amber"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("notRunning")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notRunningDescription")})]})]}),(0,t.jsx)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:(0,t.jsx)("p",{children:"tailscale up"})})]});let h=s.serveEntries,x=s.serverPort,f=8022!==x;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("deviceInfo")}),(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{o(!0),m()},children:(0,t.jsx)(eN.RefreshCw,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"rounded-md border p-3 text-sm",children:(0,t.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e("host")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.hostname}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"DNS"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:s.dnsName}),s.dnsName&&(0,t.jsx)(eM,{text:s.dnsName})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"IP"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:s.tailscaleIp}),s.tailscaleIp&&(0,t.jsx)(eM,{text:s.tailscaleIp})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:e("version")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.version})]})})]}),f&&(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-accent-color/30 bg-accent-color/5 p-4",children:[(0,t.jsx)(ek.Info,{className:"mt-0.5 h-5 w-5 shrink-0 text-accent-color"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("nonDefaultPortTitle",{port:x})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("nonDefaultPortDescription",{defaultPort:8022,currentPort:x,restartAction:d.default?e("appRestart"):e("serverRestart")})}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentFixedPort",{port:8022})}),(0,t.jsxs)("p",{children:["PORT=",8022," purplemux"]}),(0,t.jsx)("p",{className:"mt-1.5 text-muted-foreground/60",children:e("commentOrTerminate",{port:8022})})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("serveStatus")}),0===h.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("noActiveServe")}):(0,t.jsx)("div",{className:"rounded-md border",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b text-muted-foreground",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("httpsPort")}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("proxyTarget")}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:e("url")}),(0,t.jsx)("th",{className:"w-10 px-3 py-2"})]})}),(0,t.jsx)("tbody",{children:h.map(e=>{let a="443"===e.httpsPort?`https://${s.dnsName}`:`https://${s.dnsName}:${e.httpsPort}`;return(0,t.jsxs)("tr",{className:"border-b last:border-b-0",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e.httpsPort}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e.proxy}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs underline hover:text-foreground",children:a}),(0,t.jsx)(eM,{text:a})]})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:null!==c,onClick:()=>p(e.httpsPort),children:c===`remove-${e.httpsPort}`?(0,t.jsx)(eC.default,{className:"h-3 w-3"}):(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})})]},e.httpsPort)})})]})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("setupGuide")}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:e("commentStep1Install")}),(0,t.jsx)("p",{children:"brew install tailscale"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentStep2Activate")}),(0,t.jsx)("p",{children:"tailscale up"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:e("commentStep3Add")}),(0,t.jsxs)("p",{children:["tailscale serve --bg --https=443 http://localhost:",x]})]})]})]})};var eD=e.i(489623);function eI(){let e=(0,r.useTranslations)("settings.branchName"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.branchNameProvider),n=(0,Y.default)(e=>e.branchNamePrompt),d=(0,Y.default)(e=>e.setBranchNameSettings),[o,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),p=o??{provider:l,prompt:n},h=(0,eD.isValidBranchNamePrompt)(p.prompt),x=async()=>{m(!0);try{await d(p.provider,p.prompt),c(null),i.toast.success(s("saved"))}catch(e){i.toast.error(s("error"),{description:e instanceof Error?e.message:String(e)})}finally{m(!1)}};return(0,t.jsxs)("fieldset",{disabled:u,className:"space-y-3",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[e("agent"),(0,t.jsxs)("select",{className:"rounded-md border bg-background p-2",value:p.provider,"aria-describedby":"branch-name-provider-help",onChange:e=>c({...p,provider:e.target.value}),children:[(0,t.jsx)("option",{value:"claude",children:"Claude Code"}),(0,t.jsx)("option",{value:"codex",disabled:!0,children:"Codex CLI"})]})]}),(0,t.jsx)("p",{id:"branch-name-provider-help",className:"rounded-md border bg-muted/50 p-3 text-sm text-muted-foreground",children:e("codexUnavailable")}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[e("prompt"),(0,t.jsx)("textarea",{className:"min-h-48 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:p.prompt,maxLength:1e4,spellCheck:!1,"aria-invalid":!h,"aria-describedby":"branch-name-variables",onChange:e=>c({...p,prompt:e.target.value})})]}),(0,t.jsx)("p",{id:"branch-name-variables",className:"text-xs text-muted-foreground",children:e("variables")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eD.BRANCH_NAME_VARIABLES.map(e=>(0,t.jsx)(L.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>c({...p,prompt:`${p.prompt}{{${e}}}`}),children:`{{${e}}}`},e))}),!h&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:e("invalid")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(L.Button,{type:"button",onClick:()=>void x(),disabled:u||"codex"===p.provider||!h||p.provider===l&&p.prompt===n,children:u?s("loading"):s("save")}),(0,t.jsx)(L.Button,{type:"button",variant:"outline",onClick:()=>c({...p,prompt:eD.DEFAULT_BRANCH_NAME_PROMPT}),children:e("reset")})]})]})}var eP=e.i(133214);function eE(e){let{promptKey:s}=e,l=(0,r.useTranslations)("settings.gitGenerationPrompts"),n=(0,r.useTranslations)("common"),d=(0,Y.default)(e=>e[s]),o=(0,Y.default)(e=>e.setGitGenerationPrompt),[c,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),h=c??d,x=(0,eP.isValidGitGenerationPrompt)(s,h),f=eP.GIT_GENERATION_PROMPTS[s],g=async()=>{if(!m&&x){p(!0);try{await o(s,h),u(null),i.toast.success(n("saved"))}catch(e){i.toast.error(n("error"),{description:e instanceof Error?e.message:String(e)})}finally{p(!1)}}};return(0,t.jsxs)("fieldset",{disabled:m,className:"space-y-3",children:[(0,t.jsx)("legend",{className:"text-sm font-medium",children:l(`${s}.title`)}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l(`${s}.description`)}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[l("prompt"),(0,t.jsx)("textarea",{className:"min-h-40 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:h,maxLength:1e4,spellCheck:!1,"aria-invalid":!x,"aria-describedby":`${s}-variables`,onChange:e=>u(e.target.value)})]}),(0,t.jsx)("p",{id:`${s}-variables`,className:"text-xs text-muted-foreground",children:l("variables")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:f.variables.map(e=>(0,t.jsx)(L.Button,{type:"button",size:"sm",variant:"outline",disabled:h.length+e.length+4>1e4,onClick:()=>u(`${h}{{${e}}}`),children:`{{${e}}}`},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l("evidenceHint")}),!x&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:l("invalid")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(L.Button,{type:"button",onClick:()=>void g(),disabled:m||!x||h===d,children:m?n("loading"):n("save")}),(0,t.jsx)(L.Button,{type:"button",variant:"outline",onClick:()=>u(f.defaultPrompt),children:l("reset")})]})]})}var ez=e.i(983040);let eB=e=>{let{provider:s}=e,l=`${s}-environment`,n=(0,r.useTranslations)("settings.claude"),d=(0,r.useTranslations)("common"),o=(0,Y.default)(e=>e[`${s}Environment`]),c=(0,Y.default)(e=>"codex"===s?e.setCodexEnvironment:e.setClaudeEnvironment),[u,m]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),g=(0,ez.formatAgentEnvironment)(o),v=u??g,j=async()=>{let e;try{e=(0,ez.parseAgentEnvironment)(v)}catch{f(!0);return}h(!0);try{await c(e),m(null),i.toast.success(d("saved"))}catch(e){i.toast.error(d("error"),{description:e instanceof Error?e.message:String(e)})}finally{h(!1)}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(V.Label,{htmlFor:l,children:n("environmentTitle",{agent:"codex"===s?"Codex":"Claude"})}),(0,t.jsx)("p",{id:`${l}-description`,className:"text-sm text-muted-foreground",children:n("environmentDescription",{agent:"codex"===s?"Codex":"Claude"})}),(0,t.jsx)("textarea",{id:l,"aria-describedby":`${l}-description${x?` ${l}-error`:""}`,"aria-invalid":x,className:"min-h-32 w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm",value:v,onChange:e=>{m(e.target.value),f(!1)},placeholder:"HTTP_PROXY=http://127.0.0.1:7890\nHTTPS_PROXY=http://127.0.0.1:7890\nNO_PROXY=localhost,127.0.0.1",spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",disabled:p}),x&&(0,t.jsx)("p",{id:`${l}-error`,role:"alert",className:"text-sm text-destructive",children:n("environmentInvalid")}),(0,t.jsx)(L.Button,{onClick:j,disabled:p||v===g,children:p?d("loading"):d("save")})]})};var eL=e.i(260449);function eR(){let e=(0,r.useTranslations)("settings.browserStorage"),s=(0,r.useTranslations)("common"),[i,l]=(0,a.useState)(!1),[n,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(!1),u=async()=>{if(!n){d(!0),c(!1);try{await (0,eL.clearBrowserStorage)(),(0,eL.reloadWithFreshPage)()}catch{c(!0),d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(L.Button,{variant:"outline",className:"shrink-0",onClick:()=>{c(!1),l(!0)},children:e("action")}),(0,t.jsx)(K.AlertDialog,{open:i,onOpenChange:e=>{n||l(e)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("title")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("confirm")})]}),o&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-ui-red",children:e("failed")}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(L.Button,{variant:"outline",disabled:n,onClick:()=>l(!1),children:s("cancel")}),o&&(0,t.jsx)(L.Button,{variant:"outline",onClick:eL.reloadWithFreshPage,children:e("reload")}),(0,t.jsx)(L.Button,{variant:"destructive",disabled:n,onClick:()=>void u(),children:e(n?"clearing":"action")})]})]})})]})}var eF=e.i(950323),eO=e.i(494834),eH=e.i(558021),eV=e.i(815363),e$=e.i(821384);let eq=e$.z.object({enabled:e$.z.boolean(),idleMinutes:e$.z.number().int().min(15).max(10080)}).strict();e$.z.object({workspaceId:e$.z.string().min(1),paneId:e$.z.string().min(1),tabId:e$.z.string().min(1),sessionId:e$.z.string().min(1),lastActivityAt:e$.z.number().finite().positive()}).strict();let eG="x-purplemux-process-action",eK="/api/system/idle-tabs",eU=async(e,t)=>{let s=await fetch(eK,{method:e,headers:{"Content-Type":"application/json",[eG]:"1"},...void 0===t?{}:{body:JSON.stringify(t)}}),a=await s.json();if(!s.ok)throw Error(a.error??"Idle tab operation failed");return a},e_=e=>{let{policy:s,onSave:a}=e,l=(0,r.useTranslations)("settings.idleTabs"),{register:n,handleSubmit:d,control:o,setValue:c,formState:{errors:u,isSubmitting:m,isDirty:p}}=(0,eH.useForm)({resolver:(0,eV.zodResolver)(eq),defaultValues:s}),h=(0,eH.useWatch)({control:o,name:"enabled"}),x=d(async e=>{try{await eU("PATCH",e),await a(),i.toast.success(l("saved"))}catch(e){i.toast.error(e instanceof Error?e.message:l("failed"))}});return(0,t.jsxs)("form",{onSubmit:x,className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("label",{htmlFor:"idle-tabs-enabled",className:"text-sm",children:l("automatic")}),(0,t.jsx)(O.Switch,{id:"idle-tabs-enabled",checked:h,disabled:m,onCheckedChange:e=>c("enabled",e,{shouldDirty:!0})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{htmlFor:"idle-tabs-minutes",className:"text-xs",children:l("timeout")}),(0,t.jsx)(F.Input,{id:"idle-tabs-minutes",type:"number",min:15,max:10080,step:1,className:"w-36",disabled:m,...n("idleMinutes",{valueAsNumber:!0})})]}),(0,t.jsx)(L.Button,{type:"submit",size:"sm",variant:"outline",disabled:m||!p,children:l("save")})]}),u.idleMinutes&&(0,t.jsx)("p",{role:"alert",className:"text-xs text-negative",children:l("range")})]})},eW=()=>{let e=(0,r.useTranslations)("settings.idleTabs"),s=(0,r.useTranslations)("common"),{data:l,error:n,isValidating:d,mutate:o}=(0,eF.default)(eK,()=>eU("GET"),{refreshInterval:6e4}),[c,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),[h,x]=(0,a.useState)(null),f=async()=>{if(c&&!m){p(!0);try{let e=await eU("POST",{...c,confirmed:!0});x(e),u(null),await o()}catch(t){i.toast.error(t instanceof Error?t.message:e("failed"))}finally{p(!1)}}};return(0,t.jsxs)("section",{className:"space-y-3 rounded-md border p-3","aria-busy":m,children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")}),l&&(0,t.jsx)(e_,{policy:l.policy,onSave:o},`${l.policy.enabled}-${l.policy.idleMinutes}`),n&&(0,t.jsxs)("p",{role:"alert",className:"break-words text-sm text-negative",children:[e("failed"),": ",n.message]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:d||m,onClick:()=>void o(),children:e("refresh")}),(0,t.jsx)(L.Button,{size:"sm",disabled:m||!!n||!l?.candidates.length,onClick:()=>{l&&u({policy:{...l.policy},targets:l.candidates.slice(0,100).map(e=>{let{workspaceId:t,paneId:s,tabId:a,sessionId:r,lastActivityAt:i}=e;return{workspaceId:t,paneId:s,tabId:a,sessionId:r,lastActivityAt:i}})})},children:e("reclaim")})]}),l&&!n&&!l.candidates.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("empty")}),l?.candidates.map(s=>(0,t.jsxs)("div",{className:"space-y-1 border-t pt-2 text-xs",children:[(0,t.jsxs)("p",{className:"break-words",children:[s.workspaceName," · ",s.tabName," · ",s.providerId]}),(0,t.jsx)("p",{className:"break-all text-muted-foreground",children:s.cwd}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e("idleFor",{minutes:Math.floor((Date.now()-s.lastActivityAt)/6e4)})})]},s.tabId)),h&&(0,t.jsxs)("div",{role:"status",className:"space-y-1 text-xs",children:[(0,t.jsx)("p",{children:e("result",{reclaimed:h.reclaimed.length,skipped:h.skipped.length})}),h.skipped.map((e,s)=>(0,t.jsxs)("p",{className:"break-all",children:[e.target.tabId,": ",e.reason]},s))]}),(0,t.jsx)(K.AlertDialog,{open:!!c,onOpenChange:e=>{e||m||u(null)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("confirmTitle",{count:c?.targets.length??0})}),(0,t.jsx)(K.AlertDialogDescription,{children:e("confirmDescription")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{disabled:m,children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{disabled:m,onClick:e=>{e.preventDefault(),f()},children:s("confirm")})]})]})})]})},eY="/api/system/agent-processes",eJ=async()=>{let e=await fetch(eY),t=await e.json();if(!e.ok)throw Error(t.error??"Unable to load processes");return t},eZ=()=>{let e=(0,r.useTranslations)("settings.processes"),s=(0,r.useTranslations)("common"),{data:l,error:n,isLoading:d,isValidating:o,mutate:c}=(0,eF.default)(eY,eJ,{refreshInterval:1e4}),[u,m]=(0,a.useState)(""),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(null),g=async e=>{let t=X.default.getState();await t.fetchWorkspaces(),t.switchWorkspace(e),t.setSettingsDialogOpen(!1)},v=async()=>{if(x&&!p){h(!0);try{let t=await fetch(eY,{method:"POST",headers:{"Content-Type":"application/json",[eG]:"1"},body:JSON.stringify({...x,confirmed:!0})}),s=await t.json();if(!t.ok)throw Error(s.error??e("failed"));i.toast.success(e("stop"===x.action?"stopped":"started")),f(null),await c(),s.workspaceId&&await g(s.workspaceId)}catch(t){i.toast.error(t instanceof Error?t.message:e("failed")),await c()}finally{h(!1)}}},j=u.trim().toLocaleLowerCase(),y=(l?.processes??[]).filter(e=>`${e.providerId} ${e.pid} ${e.cwd??""} ${e.workspaceName??""}`.toLocaleLowerCase().includes(j));return(0,t.jsxs)("div",{className:"space-y-4","aria-busy":p,children:[(0,t.jsx)(eW,{}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.Input,{value:u,onChange:e=>m(e.target.value),placeholder:e("search"),"aria-label":e("search")}),(0,t.jsx)(L.Button,{variant:"outline",size:"icon",disabled:o||p,onClick:()=>void c(),"aria-label":e("refresh"),children:(0,t.jsx)(eN.RefreshCw,{className:o?"h-4 w-4 animate-spin":"h-4 w-4"})})]}),n&&(0,t.jsxs)("p",{role:"alert",className:"break-words text-sm text-negative",children:[e("failed"),": ",n.message]}),d&&(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:e("loading")}),!d&&!n&&!y.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("empty")}),l?.transfers.map(s=>(0,t.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,t.jsxs)("p",{className:"text-sm font-medium",children:[e("unfinished")," · ",s.providerId," · PID ",s.pid]}),(0,t.jsxs)("p",{className:"break-all text-xs text-muted-foreground",children:[s.workspaceName," · ",s.cwd]}),(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.sessionId}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(L.Button,{size:"sm",disabled:p||!!n,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"adopt"}),children:e("retry")}),(0,t.jsx)(L.Button,{size:"sm",variant:"outline",disabled:p,onClick:()=>void g(s.workspaceId),children:e("open")})]})]},`${s.pid}-${s.startedAt}`)),y.map(s=>(0,t.jsxs)("div",{className:"space-y-2 border-b py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:"claude"===s.providerId?"Claude Code":"Codex"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["PID ",s.pid]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e(s.managed?"managed":"external")})]}),(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.cwd??e("unknownDirectory")}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,eO.default)(s.startedAt).format("YYYY-MM-DD HH:mm:ss"),s.workspaceName&&` \xb7 ${s.workspaceName}`]}),s.session&&(0,t.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:s.session.sessionId}),!s.managed&&!s.session&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("unavailable")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[s.workspaceId?(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:p,onClick:()=>void g(s.workspaceId),children:e("open")}):(0,t.jsx)(L.Button,{size:"sm",disabled:p||!!n||!s.cwd||!s.session,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"adopt"}),children:e("adopt")}),(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:p||!!n,onClick:()=>f({pid:s.pid,startedAt:s.startedAt,action:"stop"}),children:e("stop")})]})]},`${s.pid}-${s.startedAt}`)),(0,t.jsx)(K.AlertDialog,{open:null!==x,onOpenChange:e=>{e||p||f(null)},children:(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsxs)(K.AlertDialogTitle,{children:[e(x?.action==="adopt"?"adopt":"stop")," · PID ",x?.pid]}),(0,t.jsx)(K.AlertDialogDescription,{children:e(x?.action==="adopt"?"adoptConfirm":"stopConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{disabled:p,children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{disabled:p,onClick:e=>{e.preventDefault(),v()},children:p?e("working"):s("confirm")})]})]})})]})},eX=()=>{let e=(0,r.useTranslations)("settings.linuxStartup"),s=window.electronAPI,l=s?.platform==="linux"&&!!s.canManageDesktopAutostart&&!!s.getDesktopAutostartStatus&&!!s.setDesktopAutostartEnabled,[n,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(0),g=(0,a.useCallback)(()=>f(e=>e+1),[]);(0,a.useEffect)(()=>{if(!l||u)return;let e=!1;return window.electronAPI.canManageDesktopAutostart().then(async t=>{if(!e){if(d(t),!t){c(null),h(!1);return}try{let t=await window.electronAPI.getDesktopAutostartStatus();e||(c(t),h(!1))}catch{e||h(!0)}}}).catch(()=>{e||(d(!1),c(null),h(!1))}),window.addEventListener("focus",g),()=>{e=!0,window.removeEventListener("focus",g)}},[l,u,g,x]);let v=async t=>{if(n&&!u){m(!0);try{c(await window.electronAPI.setDesktopAutostartEnabled(t)),h(!1),i.toast.success(e(t?"enabled":"disabled"))}catch{i.toast.error(e("saveFailed"))}finally{m(!1)}}};return l&&n?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"linux-desktop-startup",children:e("title")}),(0,t.jsx)("p",{id:"linux-startup-description",className:"text-sm text-muted-foreground",children:o?.supported===!1?e(o.reason||"packagedOnly"):e("description")})]}),(0,t.jsx)(O.Switch,{id:"linux-desktop-startup","aria-describedby":"linux-startup-description",checked:o?.enabled??!1,onCheckedChange:v,disabled:u||p||!o||!o.supported&&!o.enabled})]}),p&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center gap-2 text-sm text-destructive",children:[e("loadFailed"),(0,t.jsx)(L.Button,{variant:"outline",size:"sm",onClick:g,children:e("retry")})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("serverHint")})]}):null},eQ=[{id:"general",labelKey:"general",icon:(0,t.jsx)(T.Settings,{className:"h-4 w-4"})},{id:"appearance",labelKey:"appearance",icon:(0,t.jsx)(M.Palette,{className:"h-4 w-4"})},{id:"terminal",labelKey:"terminal",icon:(0,t.jsx)(I.Terminal,{className:"h-4 w-4"})},{id:"claude",labelKey:"agent",icon:(0,t.jsx)(p.Bot,{className:"h-4 w-4"})},{id:"processes",labelKey:"processes",icon:(0,t.jsx)(N.Monitor,{className:"h-4 w-4"})},{id:"notification",labelKey:"notification",icon:(0,t.jsx)(m.Bell,{className:"h-4 w-4"})},{id:"editor",labelKey:"editor",icon:(0,t.jsx)(g.FolderCode,{className:"h-4 w-4"})},{id:"auth",labelKey:"auth",icon:(0,t.jsx)(k.Lock,{className:"h-4 w-4"})},{id:"tailscale",labelKey:"tailscale",icon:(0,t.jsx)(v.Globe,{className:"h-4 w-4"})},{id:"quick-prompts",labelKey:"quickPrompts",icon:(0,t.jsx)(B.Zap,{className:"h-4 w-4"})},{id:"sidebar-items",labelKey:"sidebarItems",icon:(0,t.jsx)(b.Layout,{className:"h-4 w-4"})},{id:"system",labelKey:"system",icon:(0,t.jsx)(E.Wrench,{className:"h-4 w-4"})}],e0=[{id:"en",label:"English"},{id:"ko",label:"한국어"},{id:"ja",label:"日本語"},{id:"zh-CN",label:"中文(简体)"},{id:"zh-TW",label:"中文(繁體)"},{id:"es",label:"Español"},{id:"fr",label:"Français"},{id:"de",label:"Deutsch"},{id:"pt-BR",label:"Português (BR)"},{id:"ru",label:"Русский"},{id:"tr",label:"Türkçe"}],e1=[{id:"normal",labelKey:"fontSizeNormal"},{id:"large",labelKey:"fontSizeLarge"},{id:"x-large",labelKey:"fontSizeXLarge"}],e2=[{id:"tight",labelKey:"lineSpacingTight"},{id:"normal",labelKey:"lineSpacingNormal"},{id:"relaxed",labelKey:"lineSpacingRelaxed"},{id:"custom",labelKey:"lineSpacingCustom"}],e5=()=>{let e=(0,r.useTranslations)("settings.general"),s=(0,r.useTranslations)("common"),{theme:i,setTheme:d}=(0,l.useTheme)(),o=(0,Y.default)(e=>e.locale),c=(0,Y.default)(e=>e.setLocale),u=(0,Y.default)(e=>e.fontSize),m=(0,Y.default)(e=>e.setFontSize),p=(0,Y.default)(e=>e.lineHeight),h=(0,Y.default)(e=>e.setLineHeight),f=(0,Y.default)(e=>e.lineHeightCustom),g=(0,Y.default)(e=>e.setLineHeightCustom),v=(0,X.default)(e=>e.setSettingsDialogOpen),[j,b]=(0,a.useState)(null),k=j??String(f),w=(0,X.default)(e=>e.setCheatSheetOpen),S=e=>{d(e),fetch("/api/config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({appTheme:e})}).catch(()=>{}),window.electronAPI&&window.electronAPI.setNativeTheme(e)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("language")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("languageDescription")})]}),(0,t.jsxs)(U.Select,{items:e0.map(e=>({label:e.label,value:e.id})),value:o,onValueChange:e=>e&&c(e),children:[(0,t.jsx)(U.SelectTrigger,{className:"min-w-[200px]",children:(0,t.jsx)(U.SelectValue,{})}),(0,t.jsx)(U.SelectContent,{children:e0.map(e=>(0,t.jsx)(U.SelectItem,{value:e.id,children:e.label},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("theme")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("themeDescription")})]}),(0,t.jsxs)(R.ButtonGroup,{children:[(0,t.jsxs)(L.Button,{variant:"light"===i?"default":"outline",size:"sm",onClick:()=>S("light"),children:[(0,t.jsx)(D.Sun,{className:"h-4 w-4"}),s("light")]}),(0,t.jsxs)(L.Button,{variant:"dark"===i?"default":"outline",size:"sm",onClick:()=>S("dark"),children:[(0,t.jsx)(C.Moon,{className:"h-4 w-4"}),s("dark")]}),(0,t.jsxs)(L.Button,{variant:"system"===i?"default":"outline",size:"sm",onClick:()=>S("system"),children:[(0,t.jsx)(N.Monitor,{className:"h-4 w-4"}),s("system")]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("fontSize")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("fontSizeDescription")})]}),(0,t.jsx)(R.ButtonGroup,{children:e1.map(s=>(0,t.jsx)(L.Button,{variant:u===s.id?"default":"outline",size:"sm",onClick:()=>m(s.id),children:e(s.labelKey)},s.id))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("lineSpacing")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("lineSpacingDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["custom"===p&&(0,t.jsx)(F.Input,{type:"number",min:J.LINE_HEIGHT_CUSTOM_MIN,max:J.LINE_HEIGHT_CUSTOM_MAX,step:J.LINE_HEIGHT_CUSTOM_STEP,value:k,onChange:e=>b(e.target.value),onBlur:()=>{let e=Number(j);if(b(null),!Number.isFinite(e))return;let t=(0,J.clampCustomLineHeight)(Math.round(100*e)/100);t!==f&&g(t)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},className:"h-8 w-20 text-sm","aria-label":e("lineSpacingCustom")}),(0,t.jsx)(R.ButtonGroup,{children:e2.map(s=>(0,t.jsx)(L.Button,{variant:p===s.id?"default":"outline",size:"sm",onClick:()=>h(s.id),children:e(s.labelKey)},s.id))})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("keyboardShortcuts")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("keyboardShortcutsDescription")})]}),(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",onClick:()=>{v(!1),w(!0)},children:[(0,t.jsx)(y.Keyboard,{className:"h-4 w-4"}),e("openShortcuts"),(0,t.jsx)(x.ChevronRight,{className:"h-3.5 w-3.5"})]})]}),(0,t.jsx)(eR,{}),(0,t.jsxs)("a",{href:"https://github.com/stirp/purplemux-improved/releases",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 hover:text-muted-foreground hover:underline w-fit",children:[n.default.version,"(","b76dafd",")"]})]})},e3=[{label:"Surface",vars:["--background","--card","--popover","--muted","--secondary","--accent","--sidebar"]},{label:"Text",vars:["--foreground","--card-foreground","--popover-foreground","--muted-foreground","--secondary-foreground","--accent-foreground","--sidebar-foreground"]},{label:"Interactive",vars:["--primary","--primary-foreground","--destructive"]},{label:"Border",vars:["--border","--input","--ring"]},{label:"Palette",vars:["--ui-blue","--ui-teal","--ui-coral","--ui-amber","--ui-purple","--ui-pink","--ui-green","--ui-gray","--ui-red"]},{label:"Semantic",vars:["--positive","--negative","--accent-color","--brand","--focus-indicator","--claude-active"]}],e4=()=>{let e=(0,r.useTranslations)("settings.appearance"),l=(0,r.useTranslations)("common"),n=(0,Y.default)(e=>e.customCSS),d=(0,Y.default)(e=>e.setCustomCSS),[o,c]=(0,a.useState)(n),[u,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c(n)},[n]);let p=o!==n;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(s.default,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("customCSS")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("customCSSDescription")})]}),(0,t.jsx)("textarea",{className:"h-56 w-full resize-y rounded-md border border-input bg-muted/30 p-3 font-mono text-xs leading-relaxed text-foreground placeholder:text-muted-foreground/40 focus:border-ring focus:outline-none",placeholder:e("placeholder"),value:o,onChange:e=>c(e.target.value),spellCheck:!1}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(K.AlertDialog,{children:[(0,t.jsx)(K.AlertDialogTrigger,{render:(0,t.jsx)(L.Button,{variant:"outline",size:"sm",disabled:!n,children:e("reset")})}),(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("reset")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("resetConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:l("cancel")}),(0,t.jsx)(K.AlertDialogAction,{onClick:()=>{c(""),d("")},children:e("reset")})]})]})]}),(0,t.jsx)(L.Button,{size:"sm",disabled:!p,onClick:()=>{d(o),i.toast.success(e("applied"))},children:e("apply")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>m(!u),children:[(0,t.jsx)(h.ChevronDown,{className:(0,_.cn)("h-3.5 w-3.5 transition-transform",u&&"rotate-180")}),e("availableVariables")]}),u&&(0,t.jsx)("div",{className:"mt-2 space-y-3",children:e3.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 text-[11px] font-medium text-muted-foreground",children:e.label}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.vars.map(e=>(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:e},e))})]},e.label))})]})]})},e8=e=>{let{list:s,selectedId:a,onSelect:r}=e;return(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-3",children:s.map(e=>{let s;return(0,t.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,_.cn)("flex flex-col gap-2 rounded-lg border p-3 text-left transition-colors",a===e.id?"border-primary bg-accent":"border-border hover:border-muted-foreground/50"),children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),(0,t.jsx)("div",{className:"flex h-5 items-center gap-1 rounded px-2",style:{backgroundColor:e.colors.background},children:[(s=e.colors).red,s.green,s.yellow,s.blue,s.magenta,s.cyan,s.white].map((e,s)=>(0,t.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}},s))})]},e.id)})})},e6=["auto","always","never"],e9=()=>{let e=(0,r.useTranslations)("settings.terminal"),s=(0,r.useTranslations)("common"),{mode:a,themeIds:i,setTerminalTheme:l,themes:n}=(0,W.default)(),d=(0,Y.default)(e=>e.terminalKeyBar),o=(0,Y.default)(e=>e.setTerminalKeyBar),c=n.filter(e=>"dark"===e.variant),u=n.filter(e=>"light"===e.variant);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("theme")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("themeDescription")})]}),(0,t.jsxs)(q.Tabs,{defaultValue:a,children:[(0,t.jsxs)(q.TabsList,{children:[(0,t.jsx)(q.TabsTrigger,{value:"dark",children:s("dark")}),(0,t.jsx)(q.TabsTrigger,{value:"light",children:s("light")})]}),(0,t.jsx)(q.TabsContent,{value:"dark",className:"mt-3",children:(0,t.jsx)(e8,{list:c,selectedId:i.dark,onSelect:e=>l("dark",e)})}),(0,t.jsx)(q.TabsContent,{value:"light",className:"mt-3",children:(0,t.jsx)(e8,{list:u,selectedId:i.light,onSelect:e=>l("light",e)})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-6 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("keyBar")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("keyBarDescription")})]}),(0,t.jsx)(R.ButtonGroup,{children:e6.map(s=>(0,t.jsx)(L.Button,{variant:d===s?"default":"outline",size:"sm",onClick:()=>o(s),children:e(`keyBarOptions.${s}`)},s))})]})]})},e7=()=>{let e=(0,r.useTranslations)("settings.editor"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.editorUrl),n=(0,Y.default)(e=>e.editorPreset),d=(0,Y.default)(e=>e.setEditorUrl),o=(0,Y.default)(e=>e.setEditorPreset),[c,u]=(0,a.useState)(l),[m,p]=(0,a.useState)(n),h="vscode-remote"===m,x="code-server"===m||"custom"===m||h,f=m!==n||x&&c.trim()!==l,g=(0,ee.buildEditorUrl)(m,c,"/Users/me/project"),v=()=>{let t=x?c.trim():"";if(h&&!(0,ee.isValidSshHost)(t))return void i.toast.error(e("errorSshHost"));if("code-server"===m&&t)try{let s=new URL(t);if("http:"!==s.protocol&&"https:"!==s.protocol)return void i.toast.error(e("errorHttpRequired"))}catch{i.toast.error(e("errorHttpRequired"));return}"custom"!==m||!t||t.includes("{folder}")||t.includes("{folderEncoded}")?(u(t),d(t),o(m),i.toast.success(s("saved"))):i.toast.error(e("errorCustomTemplate"))};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("preset")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("presetDescription")})]}),(0,t.jsx)($.RadioGroup,{value:m,onValueChange:e=>p(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:ee.EDITOR_PRESETS.map(s=>(0,t.jsxs)(V.Label,{htmlFor:`editor-preset-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",m===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`editor-preset-${s}`,value:s}),(0,t.jsx)(et.EditorIcon,{preset:s,className:"h-5 w-5 shrink-0"}),e(`presets.${s}`)]},s))})]}),x&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:h?e("sshHost"):"custom"===m?e("customTemplate"):e("url")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h?e("sshHostDescription"):"custom"===m?e("customTemplateDescription"):e("urlDescription")}),(0,t.jsx)(F.Input,{placeholder:h?"my-server":"custom"===m?"myeditor://open?path={folderEncoded}":"https://example.com:8080",value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()}}),"code-server"===m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("urlHelp",{link:e=>(0,t.jsx)("a",{href:"https://github.com/coder/code-server",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:e}),code:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"?folder="})})}),(0,t.jsxs)("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground/60",children:"# Install on macOS"}),(0,t.jsx)("p",{children:"brew install code-server"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:"# Run"}),(0,t.jsx)("p",{children:"code-server --port 8080"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground/60",children:"# External access via Tailscale (optional)"}),(0,t.jsx)("p",{children:"tailscale serve --bg --https=8443 http://localhost:8080"})]})]}),"custom"===m&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.rich("customHelp",{folder:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"{folder}"}),folderEncoded:()=>(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"{folderEncoded}"})})})]}),!x&&"off"!==m&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm text-muted-foreground",children:e("localIdeHint")}),"off"===m&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm text-muted-foreground",children:e("offHint")}),g&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e("preview")}),(0,t.jsx)("code",{className:"block break-all rounded-md bg-muted p-2 font-mono text-xs",children:g})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(L.Button,{disabled:!f,onClick:v,children:s("save")})})]})},te=()=>{let e=(0,r.useTranslations)("settings.claude"),s=(0,Y.default)(e=>e.dangerouslySkipPermissions),a=(0,Y.default)(e=>e.setDangerouslySkipPermissions),i=(0,Y.default)(e=>e.claudeShowTerminal),l=(0,Y.default)(e=>e.setClaudeShowTerminal),n=(0,Y.default)(e=>e.gitAskProvider),d=(0,Y.default)(e=>e.setGitAskProvider),o=(0,Y.default)(e=>e.noteSummaryProvider),c=(0,Y.default)(e=>e.setNoteSummaryProvider);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(eB,{provider:"claude"}),(0,t.jsx)(eB,{provider:"codex"}),(0,t.jsx)(eI,{}),(0,t.jsx)(eE,{promptKey:"commitMessagePrompt"}),(0,t.jsx)(eE,{promptKey:"reviewDescriptionPrompt"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"skip-permissions",className:"text-sm font-medium",children:e("skipPermissions")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("skipPermissionsDescription")}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:["Claude: ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:"--dangerously-skip-permissions"})]}),(0,t.jsxs)("span",{children:["Codex: ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:"--yolo"})]})]})]}),(0,t.jsx)(O.Switch,{id:"skip-permissions",checked:s,onCheckedChange:a})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"show-terminal",className:"text-sm font-medium",children:e("showTerminal")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("showTerminalDescription")})]}),(0,t.jsx)(O.Switch,{id:"show-terminal",checked:i,onCheckedChange:l})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("gitAskProvider")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("gitAskProviderDescription")})]}),(0,t.jsx)($.RadioGroup,{value:n,onValueChange:e=>d(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:["claude","codex"].map(s=>(0,t.jsxs)(V.Label,{htmlFor:`git-ask-provider-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",n===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`git-ask-provider-${s}`,value:s}),e(`gitAskProviderOptions.${s}`)]},s))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("noteSummaryProvider")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("noteSummaryProviderDescription")})]}),(0,t.jsx)($.RadioGroup,{value:o,onValueChange:e=>c(e),className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:["claude","codex"].map(s=>(0,t.jsxs)(V.Label,{htmlFor:`note-summary-provider-${s}`,className:(0,_.cn)("flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-normal",o===s&&"border-foreground/30 bg-accent"),children:[(0,t.jsx)($.RadioGroupItem,{id:`note-summary-provider-${s}`,value:s}),e(`noteSummaryProviderOptions.${s}`)]},s))})]})]})},tt=e=>{let{value:s,onChange:a,ariaLabel:i}=e,l=(0,r.useTranslations)("settings.notification"),n=Z.TOAST_POSITIONS.map(e=>({label:l(`positions.${e}`),value:e}));return(0,t.jsxs)(U.Select,{items:n,value:s,onValueChange:e=>e&&a(e),children:[(0,t.jsx)(U.SelectTrigger,{"aria-label":i,className:"min-w-[160px]",children:(0,t.jsx)(U.SelectValue,{})}),(0,t.jsx)(U.SelectContent,{children:n.map(e=>(0,t.jsx)(U.SelectItem,{value:e.value,children:e.label},e.value))})]})},ts=()=>{let e=(0,r.useTranslations)("settings.notification"),s=(0,Y.default)(e=>e.notificationsEnabled),l=(0,Y.default)(e=>e.setNotificationsEnabled),n=(0,Y.default)(e=>e.toastOnCompleteEnabled),d=(0,Y.default)(e=>e.setToastOnCompleteEnabled),o=(0,Y.default)(e=>e.toastDuration),c=(0,Y.default)(e=>e.setToastDuration),u=(0,Y.default)(e=>e.toastPositionDesktop),m=(0,Y.default)(e=>e.setToastPositionDesktop),p=(0,Y.default)(e=>e.toastPositionMobile),h=(0,Y.default)(e=>e.setToastPositionMobile),[x,f]=(0,a.useState)(null),g=x??String(Math.round(o/1e3)),[v,j]=(0,a.useState)([]),[y,b]=(0,a.useState)(null),k=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/push/subscribe"),t=await e.json();return Array.isArray(t.devices)?t.devices:[]}catch{return[]}},[]);(0,a.useEffect)(()=>{k().then(j),(0,Q.getEndpoint)().then(b)},[k]);let N=async t=>{try{await fetch("/api/push/subscribe",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:t})}),i.toast.success(e("deviceRemoved")),j(await k())}catch{i.toast.error(e("deviceRemoveFailed"))}},C=!window.electronAPI&&!("PushManager"in window),S=!window.electronAPI&&"Notification"in window&&"denied"===Notification.permission;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"notifications-enabled",className:"text-sm font-medium",children:e("enable")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("enableDescription")})]}),(0,t.jsx)(O.Switch,{id:"notifications-enabled",checked:s,onCheckedChange:l,disabled:C||S})]}),S&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:e("permissionDenied")}),C&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notSupported")})]}),v.length>0&&(0,t.jsxs)("div",{className:"border-t pt-6 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("devicesSection")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("devicesSectionDescription")})]}),(0,t.jsx)("div",{className:"space-y-2",children:v.map(s=>{let a=!!y&&s.endpoint===y;return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(w.MonitorSmartphone,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate text-sm",children:(e=>{try{let t=new URL(e).host;if(t.includes("apple"))return"Apple";if(t.includes("fcm")||t.includes("google"))return"Chrome / Android";if(t.includes("mozilla"))return"Firefox";if(t.includes("windows")||t.includes("wns"))return"Windows";return t}catch{return"Unknown"}})(s.endpoint)}),a&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e("deviceThis")})]}),(0,t.jsx)(L.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>N(s.endpoint),"aria-label":e("deviceRemove"),children:(0,t.jsx)(P.Trash2,{className:"h-4 w-4"})})]},s.endpoint)})})]}),(0,t.jsxs)("div",{className:"border-t pt-6 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastSection")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastSectionDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"toast-enabled",className:"text-sm font-medium",children:e("toastEnable")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastEnableDescription")})]}),(0,t.jsx)(O.Switch,{id:"toast-enabled",checked:n,onCheckedChange:d})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastDuration")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastDurationDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.Input,{type:"number",min:1,max:60,step:1,value:g,onChange:e=>f(e.target.value),onBlur:()=>{let e=Number(x);if(f(null),!Number.isFinite(e))return;let t=1e3*Math.min(60,Math.max(1,Math.round(e)));t!==o&&c(t)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:!n,className:"h-8 w-20 text-sm"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e("toastDurationUnit")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastPositionDesktop")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastPositionDesktopDescription")})]}),(0,t.jsx)(tt,{value:u,onChange:m,ariaLabel:e("toastPositionDesktop")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("toastPositionMobile")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("toastPositionMobileDescription")})]}),(0,t.jsx)(tt,{value:p,onChange:h,ariaLabel:e("toastPositionMobile")})]})]})]})},ta=()=>{let e=(0,r.useTranslations)("settings.auth"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.hasAuthPassword),n=(0,Y.default)(e=>e.changePassword),[o,c]=(0,a.useState)(""),[u,m]=(0,a.useState)(!1),p=u&&o.trim().length>=4,h=e=>{c(e),m(!0)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(H.Field,{children:[(0,t.jsx)(H.FieldLabel,{htmlFor:"auth-password",children:e("changePassword")}),(0,t.jsx)(H.FieldDescription,{children:e("changePasswordDescription")}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(F.Input,{id:"auth-password",placeholder:l?e("newPasswordPlaceholder"):e("passwordPlaceholder"),value:o,onChange:e=>h(e.target.value)}),(0,t.jsx)(L.Button,{variant:"outline",size:"icon",className:"shrink-0",onClick:()=>{let e;return h((e=new Uint8Array(8),crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("").slice(0,8)))},children:(0,t.jsx)(f.Dices,{className:"h-4 w-4"})})]})]}),(0,t.jsx)(H.FieldDescription,{children:e("resetHint",{action:d.default?e("restartApp"):e("restartServer")})}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(L.Button,{disabled:!p,onClick:()=>{n(o.trim()),c(""),m(!1),i.toast.success(e("savedRestart",{action:d.default?e("restartAppAction"):e("restartServerAction")}))},children:s("save")})})]})},tr=()=>{let e=(0,r.useTranslations)("settings.system"),s=(0,r.useTranslations)("common"),l=(0,Y.default)(e=>e.systemResourcesEnabled),n=(0,Y.default)(e=>e.setSystemResourcesEnabled),o=(0,Y.default)(e=>e.networkAccess),c=(0,Y.default)(e=>e.setNetworkAccess),m=(0,Y.default)(e=>e.hostEnvLocked),p=(0,Y.default)(e=>e.bindHostIsLocal),[h,x]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[v,y]=(0,a.useState)(!1),b=window.electronAPI,k=d.default&&b?.platform==="darwin",N=d.default&&k&&"function"==typeof b?.getServerLaunchAgentStatus&&"function"==typeof b?.setServerLaunchAgentEnabled;(0,a.useEffect)(()=>{if(!N)return;let e=window.electronAPI;if("function"!=typeof e?.getServerLaunchAgentStatus)return;let t=!1;return e.getServerLaunchAgentStatus().then(e=>{t||g(e)}).catch(()=>{t||g({supported:!1,enabled:!1,loaded:!1,stale:!1,path:""})}),()=>{t=!0}},[N]);let w=async t=>{if(!N)return;let a=window.electronAPI;if("function"==typeof a?.setServerLaunchAgentEnabled){y(!0);try{let s=await a.setServerLaunchAgentEnabled(t);g(s),i.toast.success(t?e("startupEnabled"):e("startupDisabled"))}catch(e){i.toast.error(e instanceof Error?e.message:s("error"))}finally{y(!1)}}},C=async()=>{x(!0);try{let t=await fetch("/api/uploads/cleanup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"all"})});if(!t.ok)throw Error(`HTTP ${t.status}`);let s=await t.json();s.deleted>0?i.toast.success(e("attachedImagesCleaned",{count:s.deleted})):i.toast.info(e("attachedImagesNothing"))}catch{i.toast.error(s("error"))}finally{x(!1)}},[M,T]=(0,a.useState)(o);(0,a.useEffect)(()=>{T(o)},[o]);let D=M!==o,I=p&&"localhost"!==M;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(u.default,{}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(S.Network,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),(0,t.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("networkAccess")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m?e("networkAccessLocked"):e("networkAccessDescription")})]})]}),(0,t.jsx)($.RadioGroup,{value:M,onValueChange:e=>T(e),disabled:m,className:"gap-2",children:["localhost","tailscale","all"].map(s=>(0,t.jsxs)("label",{htmlFor:`network-access-${s}`,className:"flex cursor-pointer items-start gap-3 rounded-md border bg-background px-3 py-2.5 aria-disabled:cursor-not-allowed aria-disabled:opacity-60","aria-disabled":m||void 0,children:[(0,t.jsx)($.RadioGroupItem,{value:s,id:`network-access-${s}`,className:"mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e(`networkAccessOptions.${s}.label`)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e(`networkAccessOptions.${s}.description`)})]})]},s))}),!m&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I?e("restartRequired"):""}),(0,t.jsx)(L.Button,{size:"sm",onClick:()=>{c(M),i.toast.success(I?e("restartRequired"):s("saved"))},disabled:!D,children:s("save")})]})]}),(0,t.jsx)(eX,{}),k&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"server-startup",className:"text-sm font-medium",children:e("startServerAtLogin")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:f?.supported===!1?e("startServerAtLoginUnsupported"):e("startServerAtLoginDescription")})]}),(0,t.jsx)(O.Switch,{id:"server-startup",checked:!!(f?.enabled||f?.stale),onCheckedChange:w,disabled:!N||v||!f?.supported&&!f?.stale})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(V.Label,{htmlFor:"system-resources",className:"text-sm font-medium",children:e("showResources")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("showResourcesDescription")})]}),(0,t.jsx)(O.Switch,{id:"system-resources",checked:l,onCheckedChange:n})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(j.ImageIcon,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("attachedImages")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("attachedImagesDescription")})]})]}),(0,t.jsxs)(L.Button,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:C,disabled:h,children:[(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"}),e("cleanAttachedImages")]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("tmuxReset")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tmuxResetDescription",{action:d.default?e("restartApp"):e("restartServer")})})]}),(0,t.jsxs)(K.AlertDialog,{children:[(0,t.jsx)(K.AlertDialogTrigger,{render:(0,t.jsxs)(L.Button,{variant:"destructive",size:"sm",className:"gap-1.5 shrink-0",children:[(0,t.jsx)(A.RotateCcw,{className:"h-3.5 w-3.5"}),s("reset")]})}),(0,t.jsxs)(K.AlertDialogContent,{children:[(0,t.jsxs)(K.AlertDialogHeader,{children:[(0,t.jsx)(K.AlertDialogTitle,{children:e("tmuxReset")}),(0,t.jsx)(K.AlertDialogDescription,{children:e("tmuxResetConfirm")})]}),(0,t.jsxs)(K.AlertDialogFooter,{children:[(0,t.jsx)(K.AlertDialogCancel,{children:s("cancel")}),(0,t.jsx)(K.AlertDialogAction,{className:"bg-ui-red hover:bg-ui-red/80",onClick:()=>{window.location.href="/reset"},children:s("reset")})]})]})]})]})]})};e.s(["default",0,e=>{let{open:s,onOpenChange:i}=e,l=(0,o.default)(),n=(0,c.default)(s&&l),u=(0,r.useTranslations)("settings"),m=(0,r.useTranslations)("common"),[p,h]=(0,a.useState)("general"),x=eQ.find(e=>e.id===p);return(0,t.jsx)(G.Dialog,{open:s,onOpenChange:i,children:(0,t.jsx)(G.DialogContent,{className:"inset-0 top-0 left-0 flex h-dvh w-full max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none p-0 sm:max-w-none md:inset-auto md:top-1/2 md:left-1/2 md:h-[min(520px,calc(100dvh-2rem))] md:w-[calc(100%-2rem)] md:max-w-3xl md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-xl",style:n,showCloseButton:!1,children:(0,t.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] md:flex-row md:p-0",children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-col border-b bg-muted/30 px-3 pt-3 pb-0 md:p-3 md:w-48 md:border-b-0 md:border-r",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between px-2 md:mb-4",children:[(0,t.jsx)(G.DialogTitle,{className:"text-base font-semibold",children:u("title")}),(0,t.jsxs)(L.Button,{variant:"ghost",size:"icon",onClick:()=>i(!1),className:"h-11 w-11 shrink-0 opacity-70 hover:opacity-100 md:h-6 md:w-6",children:[(0,t.jsx)(z.X,{className:"h-[18px] w-[18px]"}),(0,t.jsx)("span",{className:"sr-only",children:m("close")})]})]}),(0,t.jsx)("nav",{className:"flex min-h-0 gap-1 overflow-x-auto px-1 pb-2 md:flex-col md:overflow-y-auto md:px-0 md:pb-0",children:eQ.filter(e=>!e.electronOnly||d.default).map(e=>(0,t.jsxs)(L.Button,{variant:"ghost",onClick:()=>h(e.id),className:(0,_.cn)("min-h-11 shrink-0 justify-start gap-2 whitespace-nowrap px-3 py-2 text-sm font-medium md:min-h-0 md:gap-3",p===e.id?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[e.icon,u(`tabs.${e.labelKey}`)]},e.id))})]}),(0,t.jsxs)("div",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto p-4 md:p-6",children:[(0,t.jsx)("h2",{className:"mb-6 text-lg font-semibold",children:x?u(`tabs.${x.labelKey}`):""}),"general"===p&&(0,t.jsx)(e5,{}),"appearance"===p&&(0,t.jsx)(e4,{}),"terminal"===p&&(0,t.jsx)(e9,{}),"notification"===p&&(0,t.jsx)(ts,{}),"editor"===p&&(0,t.jsx)(e7,{}),"claude"===p&&(0,t.jsx)(te,{}),"processes"===p&&(0,t.jsx)(eZ,{}),"auth"===p&&(0,t.jsx)(ta,{}),"tailscale"===p&&(0,t.jsx)(eT,{}),"quick-prompts"===p&&(0,t.jsx)(es.default,{}),"sidebar-items"===p&&(0,t.jsx)(ev,{}),"system"===p&&(0,t.jsx)(tr,{})]})]})})})}],934048)}]);