@minimalcorp/tsunagi 0.1.38 → 0.1.39

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 (127) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/build-manifest.json +5 -5
  3. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/apps/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
  5. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  6. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
  13. package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  15. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +2 -2
  16. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  23. package/.next/standalone/apps/web/.next/server/app/index.rsc +3 -3
  24. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  25. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +3 -3
  26. package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  27. package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
  28. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  29. package/.next/standalone/apps/web/.next/server/app/page/build-manifest.json +2 -2
  30. package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  31. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/apps/web/.next/server/app/settings/page/build-manifest.json +2 -2
  33. package/.next/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  34. package/.next/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
  36. package/.next/standalone/apps/web/.next/server/app/settings.rsc +3 -3
  37. package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  38. package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  39. package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  40. package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  41. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  42. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  43. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page/build-manifest.json +2 -2
  44. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page.js.nft.json +1 -1
  45. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0nhzci6._.js +4 -8
  47. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0vi01rl._.js +4 -8
  48. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__04g~n~m._.js → [root-of-the-server]__0zf09ry._.js} +2 -2
  49. package/.next/standalone/apps/web/.next/server/chunks/ssr/_04l3mh~._.js +10 -0
  50. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0bt-4.4._.js +3 -0
  51. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0e3431w._.js +10 -0
  52. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0g.cd6a._.js +1 -1
  53. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0lirkqp._.js +10 -0
  54. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0soxqr.._.js +3 -0
  55. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_settings_page_tsx_0i6itlb._.js +1 -1
  56. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +4 -5
  57. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0h0imx2._.js → node_modules_0_4__2k._.js} +1 -1
  58. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0pbr55t._.js → node_modules_0bqsyfk._.js} +1 -1
  59. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_06vr-0a._.js → node_modules_0bzw~9d._.js} +1 -1
  60. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0k7u4.c._.js → node_modules_0fsewd2._.js} +1 -1
  61. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0c6z_cw._.js → node_modules_0l~40og._.js} +1 -1
  62. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0jo-w3s._.js → node_modules_0pk6e0.._.js} +1 -1
  63. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0zkg-x0._.js → node_modules_0smdx~2._.js} +1 -1
  64. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0fcqekz._.js → node_modules_0uej915._.js} +1 -1
  65. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +5 -5
  66. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  67. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
  69. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  70. package/.next/standalone/apps/web/.next/static/chunks/{0p.4ej_8gk7m7.js → 02.u6zk77a338.js} +10 -11
  71. package/.next/standalone/apps/web/.next/static/chunks/05n6~h_wwg.jj.js +5 -0
  72. package/.next/standalone/apps/web/.next/static/chunks/0_ygv4z~5c_9z.js +5 -0
  73. package/.next/standalone/apps/web/.next/static/chunks/0g5hoj5w-z.~6.js +1 -0
  74. package/.next/standalone/apps/web/.next/static/chunks/0nhcl~svhi_26.js +7 -0
  75. package/.next/standalone/apps/web/.next/static/chunks/0p4dfdgz~3qt3.js +5 -0
  76. package/.next/standalone/apps/web/.next/static/chunks/0p9~lk406udl5.css +4 -0
  77. package/.next/standalone/apps/web/.next/static/chunks/0q-u7bl7oa42n.js +1 -0
  78. package/.next/standalone/apps/web/.next/static/chunks/0q_j4~6_etj_q.js +7 -0
  79. package/.next/standalone/apps/web/.next/static/chunks/0zjymvayyxt-d.js +5 -0
  80. package/.next/standalone/apps/web/.next/static/chunks/{0lp.2eizum8y~.js → 11rs2-0jl1rzr.js} +1 -1
  81. package/.next/standalone/apps/web/.next/static/chunks/{15~pc9ql1ab38.js → 158q94mo2-6sx.js} +7 -7
  82. package/.next/standalone/apps/web/.next/static/chunks/167xa3jy_0g.u.js +1 -0
  83. package/.next/standalone/apps/web/.next/static/chunks/{turbopack-0079niub0zo4u.js → turbopack-07pr2uza0.4cp.js} +1 -1
  84. package/dist/server/basic-auth.js +9 -1
  85. package/dist/server/generated/prisma/internal/class.js +1 -1
  86. package/dist/server/index.js +20 -0
  87. package/dist/server/lib/claude-command.d.ts +6 -0
  88. package/dist/server/lib/claude-command.js +85 -0
  89. package/dist/server/lib/claude-config-guard.d.ts +12 -0
  90. package/dist/server/lib/claude-config-guard.js +49 -0
  91. package/dist/server/lib/lmstudio.d.ts +24 -0
  92. package/dist/server/lib/lmstudio.js +198 -0
  93. package/dist/server/lib/local-llm-env.d.ts +28 -0
  94. package/dist/server/lib/local-llm-env.js +91 -0
  95. package/dist/server/lib/local-llm.d.ts +56 -0
  96. package/dist/server/lib/local-llm.js +366 -0
  97. package/dist/server/lib/ollama-settings.d.ts +16 -10
  98. package/dist/server/lib/ollama-settings.js +104 -91
  99. package/dist/server/lib/searxng.d.ts +26 -0
  100. package/dist/server/lib/searxng.js +308 -0
  101. package/dist/server/routes/local-llm.d.ts +2 -0
  102. package/dist/server/routes/local-llm.js +192 -0
  103. package/dist/server/routes/mcp-web.d.ts +2 -0
  104. package/dist/server/routes/mcp-web.js +107 -0
  105. package/dist/server/routes/onboarding.js +4 -4
  106. package/dist/server/routes/settings.js +100 -26
  107. package/dist/server/routes/tasks.js +5 -1
  108. package/dist/server/routes/terminal.js +53 -11
  109. package/npm-shrinkwrap.json +5 -5
  110. package/package.json +1 -1
  111. package/prisma/schema.prisma +1 -1
  112. package/.next/standalone/apps/web/.next/server/chunks/ssr/_016-lxb._.js +0 -3
  113. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0hh~0f6._.js +0 -3
  114. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0r0xwce._.js +0 -6
  115. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0sbp1da._.js +0 -6
  116. package/.next/standalone/apps/web/.next/server/chunks/ssr/_12c1w~~._.js +0 -6
  117. package/.next/standalone/apps/web/.next/static/chunks/0229rjr88pv9k.js +0 -1
  118. package/.next/standalone/apps/web/.next/static/chunks/04l9g6rg7~-d5.js +0 -1
  119. package/.next/standalone/apps/web/.next/static/chunks/0citvl2medd0s.js +0 -11
  120. package/.next/standalone/apps/web/.next/static/chunks/0e8u7rqrqfiiy.js +0 -1
  121. package/.next/standalone/apps/web/.next/static/chunks/0pg---_6a_4ls.css +0 -4
  122. package/.next/standalone/apps/web/.next/static/chunks/0uv~zl3--e3wo.js +0 -11
  123. package/.next/standalone/apps/web/.next/static/chunks/11rpr3..poyv8.js +0 -5
  124. package/.next/standalone/apps/web/.next/static/chunks/1200zkjn5n2w7.js +0 -1
  125. /package/.next/standalone/apps/web/.next/static/{TJDp2MIqJ14hotMmE5sIo → C1cjF-gU-snY_atxJbn1v}/_buildManifest.js +0 -0
  126. /package/.next/standalone/apps/web/.next/static/{TJDp2MIqJ14hotMmE5sIo → C1cjF-gU-snY_atxJbn1v}/_clientMiddlewareManifest.js +0 -0
  127. /package/.next/standalone/apps/web/.next/static/{TJDp2MIqJ14hotMmE5sIo → C1cjF-gU-snY_atxJbn1v}/_ssgManifest.js +0 -0
@@ -1,5 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82341,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(18566),r=e.i(471),l=e.i(70935),n=e.i(75254);let o=(0,n.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),i=(0,n.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var c=e.i(55716),d=e.i(46349),d=d;let m=(0,n.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var u=e.i(85902);function x({node:e,isSelected:s,isExpanded:a,depth:r,onSelect:l,onToggle:n}){let h=e.children&&e.children.length>0;return(0,t.jsxs)("div",{onClick:()=>{l(),h&&n&&!a&&n()},className:`
2
- flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer
3
- transition-colors
4
- ${s?"bg-accent":"hover:bg-accent"}
5
- `,style:{paddingLeft:`${16*r+8}px`},children:[h&&(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),n&&n()},className:"size-4",children:a?(0,t.jsx)(m,{className:"w-3 h-3 text-muted-foreground"}):(0,t.jsx)(d.default,{className:"w-3 h-3 text-muted-foreground"})}),!h&&(0,t.jsx)("div",{className:"w-3"}),(0,t.jsx)("div",{className:"text-foreground",children:(()=>{switch(e.type){case"global":return(0,t.jsx)(o,{className:"w-4 h-4"});case"owner":return(0,t.jsx)(i,{className:"w-4 h-4"});case"repo":return(0,t.jsx)(c.GitBranch,{className:"w-4 h-4"})}})()}),(0,t.jsx)("span",{className:"text-sm text-foreground truncate",children:e.label})]})}function h({selectedNode:e,onNodeSelect:a,refreshKey:r}){let[n,o]=(0,s.useState)([]),[i,c]=(0,s.useState)(new Set),[d,m]=(0,s.useState)(!0);(0,s.useEffect)(()=>{let e=localStorage.getItem("tsunagi:env-tree-expanded");if(e)try{let t=JSON.parse(e);c(new Set(t))}catch(e){console.error("Failed to parse expanded owners:",e)}},[]),(0,s.useEffect)(()=>{localStorage.setItem("tsunagi:env-tree-expanded",JSON.stringify([...i]))},[i]),(0,s.useEffect)(()=>{(async()=>{m(!0);try{let e=await fetch((0,l.apiUrl)("/api/owners"));if(!e.ok)throw Error("Failed to fetch owners");let t=((await e.json()).data.owners||[]).map(e=>({id:`owner:${e.name}`,type:"owner",label:e.name,scope:"owner",owner:e.name,children:e.repositories.map(e=>({id:`repo:${e.owner}/${e.repo}`,type:"repo",label:e.repo,scope:"repo",owner:e.owner,repo:e.repo}))}));o([{id:"global",type:"global",label:"Global",scope:"global"},...t])}catch(e){console.error("Failed to load tree:",e)}finally{m(!1)}})()},[r]);let u=(s,r=0)=>{let l=e?.scope===s.scope&&e?.owner===s.owner&&e?.repo===s.repo,n=i.has(s.id);return(0,t.jsxs)("div",{children:[(0,t.jsx)(x,{node:s,isSelected:l,isExpanded:n,depth:r,onSelect:()=>{a({scope:s.scope,owner:s.owner,repo:s.repo,label:s.label})},onToggle:()=>{var e;return e=s.id,void c(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})}}),n&&s.children?.map(e=>u(e,r+1))]},s.id)};return d?(0,t.jsx)("div",{className:"p-4 text-muted-foreground text-sm",children:"Loading..."}):0===n.length?(0,t.jsx)("div",{className:"p-4 text-muted-foreground text-sm",children:"No repositories found"}):(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)("div",{className:"p-2",children:n.map(e=>u(e))})})}var p=e.i(7233),f=e.i(37727),j=e.i(43531),g=e.i(86536);let v=(0,n.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var N=e.i(27612),b=e.i(88699),w=e.i(10012);function y({variable:e,onToggle:a,onDelete:r,onUpdate:l,isDeletable:n=!0}){let[o,i]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[m,x]=(0,s.useState)(!1),[h,p]=(0,s.useState)(e.value),k=async t=>{d(!0);try{await a(e.key,t.target.checked)}finally{d(!1)}},C=async()=>{await r(e.key)},S=async()=>{try{await l(e.key,h),x(!1)}catch(e){console.error("Failed to update variable:",e),alert("Failed to update variable")}};return(0,t.jsxs)("div",{className:"border border-border rounded p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm font-mono text-foreground",children:e.key}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.enabled,onChange:k,disabled:c,className:"w-4 h-4 cursor-pointer"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Enabled"})]}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:()=>i(!o),title:o?"Hide value":"Show value",children:o?(0,t.jsx)(v,{className:"w-4 h-4 text-muted-foreground"}):(0,t.jsx)(g.Eye,{className:"w-4 h-4 text-muted-foreground"})}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:()=>{x(!0),p(e.value)},title:"Edit",children:(0,t.jsx)(b.Pencil,{className:"w-4 h-4 text-muted-foreground"})}),n&&(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:C,title:"Delete",children:(0,t.jsx)(N.Trash2,{className:"w-4 h-4 text-destructive"})})]})]}),m?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.Input,{type:"password",value:h,onChange:e=>p(e.target.value),className:"w-full font-mono",autoFocus:!0}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(u.Button,{variant:"outline",size:"sm",onClick:()=>{x(!1),p(e.value)},className:"active:scale-95",children:(0,t.jsx)(f.X,{className:"w-4 h-4"})}),(0,t.jsx)(u.Button,{size:"sm",onClick:S,className:"active:scale-95",children:(0,t.jsx)(j.Check,{className:"w-4 h-4"})})]})]}):(0,t.jsx)("div",{children:(0,t.jsx)(w.Input,{type:o?"text":"password",value:e.value,readOnly:!0,className:"w-full font-mono"})})]})}var k=e.i(37870);let C=["ANTHROPIC_API_KEY","CLAUDE_CODE_OAUTH_TOKEN"];function S({selectedNode:e}){let[a,r]=(0,s.useState)([]),[n,o]=(0,s.useState)(!0),[i,c]=(0,s.useState)(null),[d,m]=(0,s.useState)(!1),[x,h]=(0,s.useState)(""),[g,v]=(0,s.useState)(""),[N,b]=(0,s.useState)("");(0,s.useEffect)(()=>{(async()=>{o(!0),c(null);try{let t=new URLSearchParams({scope:e.scope});e.owner&&t.set("owner",e.owner),e.repo&&t.set("repo",e.repo);let s=await fetch((0,l.apiUrl)(`/api/env/list?${t}`));if(!s.ok)throw Error("Failed to fetch environment variables");let a=((await s.json()).data.envVars||[]).filter(e=>!C.includes(e.key));r(a)}catch(e){console.error("Failed to load environment variables:",e),c("Failed to load environment variables")}finally{o(!1)}})()},[e]);let T=async(t,s)=>{if("global"===e.scope&&!s&&("ANTHROPIC_API_KEY"===t||"CLAUDE_CODE_OAUTH_TOKEN"===t)&&!a.find(e=>e.key!==t&&("ANTHROPIC_API_KEY"===e.key||"CLAUDE_CODE_OAUTH_TOKEN"===e.key)&&e.enabled))return void alert("Cannot disable the last enabled Claude Token. Please add or enable another Claude Token first.");try{if(!(await fetch((0,l.apiUrl)("/api/env/toggle"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,scope:e.scope,owner:e.owner,repo:e.repo,enabled:s})})).ok)throw Error("Failed to toggle environment variable");r(e=>e.map(e=>e.key===t?{...e,enabled:s}:e))}catch(e){console.error("Failed to toggle environment variable:",e),r(e=>e.map(e=>e.key===t?{...e,enabled:!s}:e))}},E=async t=>{if(confirm(`Delete ${t}?`))try{let s=new URLSearchParams({key:t,scope:e.scope});if(e.owner&&s.set("owner",e.owner),e.repo&&s.set("repo",e.repo),!(await fetch((0,l.apiUrl)(`/api/env?${s}`),{method:"DELETE"})).ok)throw Error("Failed to delete environment variable");r(e=>e.filter(e=>e.key!==t))}catch(e){console.error("Failed to delete environment variable:",e),alert("Failed to delete environment variable")}},O=async(t,s)=>{try{if(!(await fetch((0,l.apiUrl)("/api/env"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,value:s,scope:e.scope,owner:e.owner,repo:e.repo})})).ok)throw Error("Failed to update environment variable");r(e=>e.map(e=>e.key===t?{...e,value:s}:e))}catch(e){throw console.error("Failed to update environment variable:",e),e}},U=async()=>{var t;if(b(""),!x.trim())return void b("Key is required");if(!g.trim())return void b("Value is required");if(t=x.trim(),/^[A-Z0-9_]+$/.test(t)?C.includes(t)?(b("Claude tokens should be added in the Tokens section"),!1):!a.some(e=>e.key===t)||(b(`Key "${t}" already exists in this scope`),!1):(b("Key must contain only uppercase letters, numbers, and underscores"),!1))try{if(!(await fetch((0,l.apiUrl)("/api/env"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:x.trim(),value:g.trim(),scope:e.scope,owner:e.owner,repo:e.repo})})).ok)throw Error("Failed to add environment variable");let t=new URLSearchParams({scope:e.scope});e.owner&&t.set("owner",e.owner),e.repo&&t.set("repo",e.repo);let s=await fetch((0,l.apiUrl)(`/api/env/list?${t}`));if(s.ok){let e=((await s.json()).data.envVars||[]).filter(e=>!C.includes(e.key));r(e)}m(!1),h(""),v("")}catch(e){console.error("Failed to add environment variable:",e),b("Failed to add environment variable")}};return n?(0,t.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,t.jsx)(k.LoadingSpinner,{size:"md",message:"Loading variables..."})}):i?(0,t.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-destructive text-sm",children:i})}):(0,t.jsxs)("div",{className:"h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)("h2",{className:"text-lg font-bold text-foreground",children:"Environment Variables"}),!d&&(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>m(!0),className:"active:scale-95",children:[(0,t.jsx)(p.Plus,{className:"w-4 h-4"}),"Add Variable"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto space-y-3",children:[d&&(0,t.jsxs)("div",{className:"border border-border rounded p-3 bg-accent space-y-2",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground",children:"New Variable"}),(0,t.jsx)(w.Input,{type:"text",value:x,onChange:e=>h(e.target.value.toUpperCase()),placeholder:"VARIABLE_NAME",className:"w-full font-mono",autoFocus:!0}),(0,t.jsx)(w.Input,{type:"password",value:g,onChange:e=>v(e.target.value),placeholder:"value",className:"w-full font-mono"}),N&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:N}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(u.Button,{variant:"outline",size:"sm",onClick:()=>{m(!1),h(""),v(""),b("")},className:"active:scale-95",children:(0,t.jsx)(f.X,{className:"w-4 h-4"})}),(0,t.jsx)(u.Button,{size:"sm",onClick:U,className:"active:scale-95",children:(0,t.jsx)(j.Check,{className:"w-4 h-4"})})]})]}),0!==a.length||d?a.map(e=>(0,t.jsx)(y,{variable:e,onToggle:T,onDelete:E,onUpdate:O,isDeletable:!0},e.key)):(0,t.jsx)("div",{className:"text-center text-muted-foreground text-sm py-4",children:"No environment variables"})]})]})}var T=e.i(63209);let E=["ANTHROPIC_API_KEY","CLAUDE_CODE_OAUTH_TOKEN"],O={ANTHROPIC_API_KEY:"API Key",CLAUDE_CODE_OAUTH_TOKEN:"OAuth Token"};function U(e){return e.startsWith("sk-ant-api")?"ANTHROPIC_API_KEY":e.startsWith("sk-ant-oat")?"CLAUDE_CODE_OAUTH_TOKEN":null}function z({selectedNode:e,onboardingStatus:a,onSwitchToGlobal:r}){let[n,o]=(0,s.useState)([]),[i,c]=(0,s.useState)(!0),[d,m]=(0,s.useState)(null),[x,h]=(0,s.useState)(null),[y,C]=(0,s.useState)(""),[S,P]=(0,s.useState)(""),[F,B]=(0,s.useState)(null),[_,L]=(0,s.useState)({}),[A,I]=(0,s.useState)(!1),[D,$]=(0,s.useState)(""),[R,H]=(0,s.useState)(""),[M,K]=(0,s.useState)(null);(0,s.useEffect)(()=>{W()},[e]);let W=async()=>{c(!0),m(null);try{let t=new URLSearchParams({scope:e.scope});e.owner&&t.set("owner",e.owner),e.repo&&t.set("repo",e.repo);let s=await fetch((0,l.apiUrl)(`/api/env/list?${t}`));if(!s.ok)throw Error("Failed to fetch tokens");let a=((await s.json()).data.envVars||[]).filter(e=>E.includes(e.key)).map(e=>({key:e.key,value:e.value,label:O[e.key]||e.key}));o(a)}catch(e){console.error("Failed to load tokens:",e),m("Failed to load tokens")}finally{c(!1)}},G=()=>{h(null),C(""),P(""),B(null)},J=async t=>{if(!y.trim())return void P("Token value is required");let s=U(y);if(!s)return void P("Invalid token format");try{if(s!==t){let a=new URLSearchParams({key:t,scope:e.scope});e.owner&&a.set("owner",e.owner),e.repo&&a.set("repo",e.repo),await fetch((0,l.apiUrl)(`/api/env?${a}`),{method:"DELETE"}),await fetch((0,l.apiUrl)("/api/env"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:s,value:y.trim(),scope:e.scope,owner:e.owner,repo:e.repo})})}else if(!(await fetch((0,l.apiUrl)("/api/env"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,value:y.trim(),scope:e.scope,owner:e.owner,repo:e.repo})})).ok)throw Error("Failed to update token");await W(),h(null),C(""),P(""),B(null)}catch(e){console.error("Failed to update token:",e),P("Failed to update token")}},V=async()=>{if(!D.trim())return void H("Token value is required");let t=U(D);if(!t)return void H("Invalid token format");if(n.length>0)return void H("Only one Claude token is allowed per scope. Please edit the existing token.");try{if(!(await fetch((0,l.apiUrl)("/api/env"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,value:D.trim(),scope:e.scope,owner:e.owner,repo:e.repo})})).ok)throw Error("Failed to add token");await W(),I(!1),$(""),K(null)}catch(e){console.error("Failed to add token:",e),H("Failed to add token")}},Y=async t=>{if(confirm("Are you sure you want to delete this token?"))try{let s=new URLSearchParams({key:t,scope:e.scope});if(e.owner&&s.set("owner",e.owner),e.repo&&s.set("repo",e.repo),!(await fetch((0,l.apiUrl)(`/api/env?${s}`),{method:"DELETE"})).ok)throw Error("Failed to delete token");await W()}catch(e){console.error("Failed to delete token:",e),alert("Failed to delete token")}};if(i)return(0,t.jsxs)("div",{className:"border-2 border-primary rounded-xl p-4 bg-card",children:[(0,t.jsx)("h2",{className:"text-lg font-bold text-foreground mb-4",children:"Claude Tokens"}),(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(k.LoadingSpinner,{size:"sm",message:"Loading tokens..."})})]});if(d)return(0,t.jsxs)("div",{className:"border-2 border-primary rounded-xl p-4 bg-card",children:[(0,t.jsx)("h2",{className:"text-lg font-bold text-foreground mb-4",children:"Claude Tokens"}),(0,t.jsx)("div",{className:"text-destructive text-sm",children:d})]});let q=a&&!a.completed&&"global"!==e.scope;return(0,t.jsxs)("div",{className:"border-2 border-primary rounded-xl p-4 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)("h2",{className:"text-lg font-bold text-foreground",children:"Claude Tokens"}),!A&&0===n.length&&(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>I(!0),className:"active:scale-95",children:[(0,t.jsx)(p.Plus,{className:"w-4 h-4"}),"Add Token"]})]}),q&&(0,t.jsxs)("div",{className:"mb-4 border-2 border-warning bg-warning/10 rounded-xl p-3 flex items-start gap-3",children:[(0,t.jsx)(T.AlertCircle,{className:"w-5 h-5 text-warning flex-shrink-0 mt-0.5"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm text-warning",children:"オンボーディングを完了するには、Globalスコープにトークンを追加してください"})}),r&&(0,t.jsx)(u.Button,{size:"sm",onClick:r,className:"bg-warning text-white hover:bg-warning/80 active:scale-95 whitespace-nowrap",children:"Switch to Global"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[A&&(0,t.jsxs)("div",{className:"border border-border rounded p-3 bg-accent",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground mb-2",children:"New Token"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.Input,{type:"password",value:D,onChange:e=>{var t;let s;return $(t=e.target.value),H(""),void(K(s=U(t)),t&&!s&&H("Invalid token format. Must start with sk-ant-api or sk-ant-oat"))},placeholder:"sk-ant-api... or sk-ant-oat...",className:"w-full font-mono",autoFocus:!0}),M&&!R&&(0,t.jsxs)("div",{className:"text-xs text-success",children:["→ Detected: ",O[M]]}),R&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:R}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(u.Button,{variant:"outline",size:"sm",onClick:()=>{I(!1),$(""),H(""),K(null)},className:"active:scale-95",children:(0,t.jsx)(f.X,{className:"w-4 h-4"})}),(0,t.jsx)(u.Button,{size:"sm",onClick:V,disabled:!M||!!R,className:"active:scale-95",children:(0,t.jsx)(j.Check,{className:"w-4 h-4"})})]})]})]}),0!==n.length||A?n.map(s=>(0,t.jsx)("div",{className:"border border-border rounded p-3 space-y-2",children:x===s.key?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground mb-2",children:"Edit Token"}),(0,t.jsx)(w.Input,{type:"password",value:y,onChange:e=>{var t;let s;return C(t=e.target.value),P(""),void(B(s=U(t)),t&&!s&&P("Invalid token format. Must start with sk-ant-api or sk-ant-oat"))},placeholder:"sk-ant-api... or sk-ant-oat...",className:"w-full font-mono",autoFocus:!0}),F&&!S&&(0,t.jsxs)("div",{className:"text-xs text-success",children:["→ Detected: ",O[F]]}),S&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(u.Button,{variant:"outline",size:"sm",onClick:G,className:"active:scale-95",children:(0,t.jsx)(f.X,{className:"w-4 h-4"})}),(0,t.jsx)(u.Button,{size:"sm",onClick:()=>J(s.key),disabled:!F||!!S,className:"active:scale-95",children:(0,t.jsx)(j.Check,{className:"w-4 h-4"})})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:s.label}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:()=>L(e=>({...e,[s.key]:!e[s.key]})),title:_[s.key]?"Hide value":"Show value",children:_[s.key]?(0,t.jsx)(v,{className:"w-4 h-4 text-muted-foreground"}):(0,t.jsx)(g.Eye,{className:"w-4 h-4 text-muted-foreground"})}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:()=>{h(s.key),C(""),P(""),B(null)},title:"Edit",children:(0,t.jsx)(b.Pencil,{className:"w-4 h-4 text-muted-foreground"})}),"global"!==e.scope&&(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-lg",onClick:()=>Y(s.key),className:"hover:bg-destructive/10",title:"Delete",children:(0,t.jsx)(N.Trash2,{className:"w-4 h-4 text-destructive"})})]})]}),(0,t.jsx)(w.Input,{type:_[s.key]?"text":"password",value:s.value,readOnly:!0,className:"w-full font-mono"})]})},s.key)):(0,t.jsx)("div",{className:"text-center text-muted-foreground text-sm py-4",children:"No Claude tokens configured"})]})]})}let P=(0,n.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var F=e.i(5352),B=e.i(68995);function _(){let[e,a]=(0,s.useState)([]),[r,n]=(0,s.useState)({}),[o,i]=(0,s.useState)(null),[c,d]=(0,s.useState)(!1),[x,h]=(0,s.useState)(!1),p=(0,s.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch((0,l.apiUrl)("/api/repos")).then(e=>e.json()),fetch((0,l.apiUrl)("/api/tasks")).then(e=>e.json())]);a(e.data??[]);let s={};for(let e of t.data?.tasks??[]){let t=`${e.owner}/${e.repo}`;s[t]=(s[t]??0)+1}n(s)}catch(e){console.error("Failed to load repositories:",e)}},[]);(0,s.useEffect)(()=>{p()},[p]);let f=async()=>{if(o){d(!0);try{if(!(await fetch((0,l.apiUrl)(`/api/repos/${o.owner}/${o.repo}`),{method:"DELETE"})).ok)throw Error("Failed to delete repository");await p()}catch(e){console.error("Failed to delete repository:",e)}finally{d(!1),i(null)}}},j=(0,s.useCallback)(async(t,s)=>{let r=t+s;if(r<0||r>=e.length)return;let n=[...e];[n[t],n[r]]=[n[r],n[t]],a(n.map((e,t)=>({...e,order:t}))),h(!0);try{if(!(await fetch((0,l.apiUrl)("/api/repos/reorder"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:n.map(e=>e.id)})})).ok)throw Error("Failed to reorder repositories")}catch(e){console.error("Failed to reorder repositories:",e),await p()}finally{h(!1)}},[e,p]);return 0===e.length?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"No repositories cloned yet."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.ConfirmDialog,{open:null!==o,onOpenChange:e=>{e.open||i(null)},title:"Delete Repository",message:o?`Delete ${o.owner}/${o.repo}? This will also delete ${r[`${o.owner}/${o.repo}`]??0} associated task(s), all worktrees, and the bare repository. This action cannot be undone.`:"",confirmLabel:c?"Deleting...":"Delete",cancelLabel:"Cancel",onConfirm:f,variant:"danger"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"この並び順がトップページの列の並び順になります"}),(0,t.jsx)("div",{className:"space-y-2",children:e.map((s,a)=>{let l=`${s.owner}/${s.repo}`,n=(0,F.getRepoColor)(s.owner,s.repo),o=r[l]??0;return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n.bg} ${n.text}`,children:l}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[o," task",1!==o?"s":""]})]}),(0,t.jsxs)("div",{className:"flex flex-shrink-0 items-center",children:[(0,t.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>j(a,-1),disabled:0===a||x,className:"text-muted-foreground",title:"Move up",children:(0,t.jsx)(P,{className:"size-4"})}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>j(a,1),disabled:a===e.length-1||x,className:"text-muted-foreground",title:"Move down",children:(0,t.jsx)(m,{className:"size-4"})}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>i(s),className:"text-muted-foreground hover:text-destructive",title:"Delete repository",children:(0,t.jsx)(N.Trash2,{className:"size-4"})})]})]},s.id)})})]})}var L=e.i(69068);function A({owner:e,repo:a,onDeleted:r}){let[n,o]=(0,s.useState)(!1),[i,c]=(0,s.useState)(""),[d,m]=(0,s.useState)(!1),x=`${e}/${a}`,h=i===x,p=async()=>{if(h){m(!0);try{if(!(await fetch((0,l.apiUrl)(`/api/repos/${e}/${a}`),{method:"DELETE"})).ok)throw Error("Failed to delete repository");r()}catch(e){console.error("Failed to delete repository:",e)}finally{m(!1),o(!1),c("")}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-destructive",children:"Remove Repository"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Remove this repository and all associated data including tasks, worktrees, and environment variables. This action cannot be undone."})]}),(0,t.jsxs)(u.Button,{variant:"destructive",size:"sm",onClick:()=>o(!0),children:[(0,t.jsx)(N.Trash2,{className:"size-4"}),"Remove Repository"]})]}),(0,t.jsx)(L.Dialog,{open:n,onOpenChange:o,children:(0,t.jsxs)(L.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(L.DialogHeader,{children:[(0,t.jsx)(L.DialogTitle,{children:"Remove Repository"}),(0,t.jsxs)(L.DialogDescription,{children:["This will permanently delete ",(0,t.jsx)("strong",{children:x})," and all associated tasks, worktrees, and environment variables."]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-xs text-muted-foreground",children:["Type ",(0,t.jsx)("strong",{children:x})," to confirm"]}),(0,t.jsx)(w.Input,{value:i,onChange:e=>c(e.target.value),placeholder:x,autoComplete:"off"})]}),(0,t.jsxs)(L.DialogFooter,{children:[(0,t.jsx)(u.Button,{variant:"outline",size:"sm",onClick:()=>{o(!1),c("")},disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"destructive",size:"sm",onClick:p,disabled:!h||d,children:d?"Removing...":"Remove"})]})]})})]})}var I=e.i(95468),D=e.i(58e3),$=e.i(31278),R=e.i(87951),H=e.i(52044),M=e.i(64036),K=e.i(77814),W=e.i(41247),G=e.i(57024),J=e.i(31449);let V="tsunagi:voice-input-enabled",Y={not_running:"停止中",installing_deps:"依存関係をインストール中...",downloading_model:"モデルをダウンロード中...",starting_server:"サーバーを起動中...",running:"実行中",running_external:"実行中 (tsunagi外で起動)",error:"エラー"},q=["installing_deps","downloading_model","starting_server"],X=["running","running_external"];function Z(e){let t=e/0x40000000;return t>=.1?`${t.toFixed(2)} GB`:`${(e/1048576).toFixed(0)} MB`}function Q(){let[e,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(!1),[o,i]=(0,s.useState)(null),[c,d]=(0,s.useState)(""),m=(0,s.useRef)(null),x=(0,s.useCallback)(e=>{a(e),localStorage.setItem(V,String(e))},[]),h=(0,s.useCallback)(e=>{d(e),localStorage.setItem(J.WHISPER_PROMPT_STORAGE_KEY,e)},[]),p=(0,s.useCallback)(async()=>{let e=await fetch((0,l.apiUrl)("/api/whisper/server/status")),t=await e.json();return i(t),t},[]);(0,s.useEffect)(()=>{a("true"===localStorage.getItem(V)),d(localStorage.getItem(J.WHISPER_PROMPT_STORAGE_KEY)??""),p()},[p]),(0,s.useEffect)(()=>{o&&X.includes(o.step)&&!e&&(x(!0),G.toaster.create({type:"success",title:"音声入力が有効化されました"}))},[o,e,x]),(0,s.useEffect)(()=>(o&&q.includes(o.step)&&!m.current&&(m.current=setInterval(()=>{p().then(e=>{!q.includes(e.step)&&m.current&&(clearInterval(m.current),m.current=null)})},1e3)),()=>{m.current&&(clearInterval(m.current),m.current=null)}),[o,p]);let f=(0,s.useCallback)(()=>{p(),n(!0)},[p]),j=(0,s.useCallback)(async()=>{try{let e=await fetch((0,l.apiUrl)("/api/whisper/server/start"),{method:"POST"});if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error||`HTTPエラー: ${e.status}`)}i(await e.json())}catch(e){G.toaster.create({type:"error",title:"サーバーの起動に失敗しました",description:e instanceof Error?e.message:String(e)})}},[]),g=(0,s.useCallback)(async()=>{try{let e=await fetch((0,l.apiUrl)("/api/whisper/server/stop"),{method:"POST"});if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error||`HTTPエラー: ${e.status}`)}i(await e.json())}catch(e){G.toaster.create({type:"error",title:"サーバーの停止に失敗しました",description:e instanceof Error?e.message:String(e)})}},[]),v=(0,s.useCallback)(()=>{x(!1),o&&X.includes(o.step)&&g()},[x,g,o]),N=o?.serverDir,b=o?.downloadProgress,w=b?b.downloadedBytes/b.totalBytes*100:0,y=null!==o,k=y&&X.includes(o.step);return(0,t.jsxs)(M.Card,{children:[(0,t.jsxs)(M.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.CardTitle,{children:"音声入力 (実験的機能)"}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-sm",onClick:f,title:"音声入力について",children:(0,t.jsx)(D.CircleHelp,{})})]}),(0,t.jsx)(M.CardDescription,{children:"ローカルで動作するWhisperを使って音声入力を行います。下記のローカルLLMも有効にすると、 文字起こし結果がLLMで自動整形されます(無効時は文字起こし結果をそのまま使用)。"})]}),(0,t.jsx)(M.CardContent,{className:"flex flex-col gap-3",children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[y?k?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-success",children:[(0,t.jsx)(I.CheckCircle2,{className:"size-4"}),"音声入力: 有効"]}):(0,t.jsxs)("span",{className:"flex items-center gap-2 text-warning",children:[(0,t.jsx)(T.AlertCircle,{className:"size-4"}),"音声入力: 有効化済み(サーバー停止中)"]}):(0,t.jsxs)("span",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)($.Loader2,{className:"size-4 animate-spin"}),"状態を確認中..."]}),o&&(0,t.jsxs)("span",{className:"text-xs/relaxed text-muted-foreground",children:["(",Y[o.step],")"]}),y&&!k&&(0,t.jsxs)(u.Button,{size:"default",onClick:f,children:[(0,t.jsx)(R.Mic,{}),"サーバーを起動"]}),(0,t.jsx)(u.Button,{size:"default",variant:"outline",onClick:v,children:"無効にする"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"文字起こしプロンプト (任意)"}),(0,t.jsx)(W.Textarea,{value:c,onChange:e=>h(e.target.value),placeholder:"例: 誤字、句読点、音声入力、Whisper、固有名詞や専門用語など",className:"min-h-16 text-xs"}),(0,t.jsx)("p",{className:"mt-1 text-[0.65rem] text-muted-foreground",children:"よく使う単語(固有名詞・専門用語・同音異義語で誤変換されやすい単語など)を列挙すると、 Whisperがその表記を優先しやすくなり誤変換が減ります。文章でなく単語の羅列でも構いません。空でも可。"})]})]}):(0,t.jsxs)(u.Button,{size:"default",onClick:f,children:[(0,t.jsx)(R.Mic,{}),"音声入力を有効化する"]})}),(0,t.jsx)(B.Dialog,{open:r,onOpenChange:({open:e})=>n(e),title:"音声入力について",maxWidth:"2xl",children:(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"実験的機能です"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"音声入力はローカルで動作するWhisper (mlx-whisper) を利用します。精度・速度は環境に依存し、今後変更される可能性があります。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"対応環境"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Apple Silicon Mac (M1/M2/M3/M4) のみ対応。Windows/Linuxでは利用できません。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"必要なもの(事前に手動でインストール)"}),(0,t.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:(0,t.jsx)("li",{children:"Python 3.9以降(Xcode Command Line Tools または Homebrew経由で入手可能)"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 font-medium text-foreground",children:"セットアップ・起動"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"下のボタンから、依存関係のインストール・モデルのダウンロード・サーバー起動まで自動で行われます(初回は数分かかります)。"}),o&&!N&&(0,t.jsx)("p",{className:"mt-1 text-destructive",children:"whisper-serverが見つかりませんでした。インストールが壊れている可能性があります。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 font-medium text-foreground",children:"アンインストール"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["音声入力のためにダウンロードされるもの(Pythonの依存関係・Whisperモデル、合計約2.6GB)は全て",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"~/.tsunagi/whisper"}),"に保存されます。不要になった場合はこのディレクトリを削除するだけで、関連リソースを完全に削除できます。"]})]}),(0,t.jsxs)("div",{className:"border-t border-border pt-4",children:[(!o||"not_running"===o.step||"error"===o.step)&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)(u.Button,{size:"default",onClick:()=>void j(),disabled:!o,children:[o?(0,t.jsx)(R.Mic,{}):(0,t.jsx)($.Loader2,{className:"animate-spin"}),"Whisperサーバーを起動"]}),o?.step==="error"&&o.error&&(0,t.jsx)("p",{className:"text-xs/relaxed text-destructive",children:o.error})]}),o?.step==="installing_deps"&&(0,t.jsxs)(u.Button,{size:"default",disabled:!0,children:[(0,t.jsx)($.Loader2,{className:"animate-spin"}),"依存関係をインストール中... (数分かかる場合があります)"]}),o?.step==="downloading_model"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs/relaxed text-muted-foreground",children:[(0,t.jsx)($.Loader2,{className:"size-4 animate-spin"}),"モデルをダウンロード中..."]}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K.Progress,{value:w}),(0,t.jsxs)("p",{className:"text-xs/relaxed text-muted-foreground",children:[Z(b.downloadedBytes)," / ",Z(b.totalBytes)," (",w.toFixed(0),"%) ・ ",function(e){if(null===e)return"残り時間を計算中...";if(e<60)return`残り約${e}秒`;let t=Math.floor(e/60);return`残り約${t}分${e%60}秒`}(b.etaSeconds)]})]})]}),o?.step==="starting_server"&&(0,t.jsxs)(u.Button,{size:"default",disabled:!0,children:[(0,t.jsx)($.Loader2,{className:"animate-spin"}),"サーバーを起動中..."]}),o&&X.includes(o.step)&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-success",children:[(0,t.jsx)(I.CheckCircle2,{className:"size-4"}),"サーバーは起動しています"]}),(0,t.jsxs)(u.Button,{size:"default",variant:"outline",onClick:()=>void g(),children:[(0,t.jsx)(H.Square,{}),"サーバーを停止"]})]})]})]})})]})}var ee=e.i(66961),et=e.i(78917),es=e.i(16715),ea=e.i(82458),ea=ea,er=e.i(93355),el=e.i(68285);let en="ollama-models";function eo(){let{settings:e,setSettings:a}=(0,el.useOllamaSettings)(),[r,n]=(0,s.useState)(null),[i,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),[x,h]=(0,s.useState)([]),[p,f]=(0,s.useState)(!1),[j,g]=(0,s.useState)(null),[v,N]=(0,s.useState)(null),[b,y]=(0,s.useState)(!1),[k,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{var t;e&&n({baseUrl:(t=e).baseUrl,model:t.model,contextTokens:String(t.contextTokens),extraEnvText:Object.entries(t.extraEnv).map(([e,t])=>`${e}=${t}`).join("\n")})},[e]);let S=(0,s.useCallback)(async e=>{c(!0);try{let t=await fetch((0,l.apiUrl)("/api/settings/ollama"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json().catch(()=>null);if(!t.ok||!s?.data)throw Error(s?.error||`HTTPエラー: ${t.status}`);return a(s.data),!0}catch(e){return G.toaster.create({type:"error",title:"Ollama の設定を保存できませんでした",description:e instanceof Error?e.message:String(e)}),!1}finally{c(!1)}},[a]),T=(0,s.useCallback)(async e=>{f(!0),g(null);try{let t=await fetch((0,l.apiUrl)(`/api/settings/ollama/models?baseUrl=${encodeURIComponent(e)}`)),s=await t.json().catch(()=>null);if(!t.ok||!s?.data)throw Error(s?.error||`HTTPエラー: ${t.status}`);h(s.data.models)}catch(e){h([]),g(e instanceof Error?e.message:String(e))}finally{f(!1)}},[]),E=(0,s.useCallback)(async e=>{y(!0),C(null);try{let t=await fetch((0,l.apiUrl)(`/api/settings/ollama/account?baseUrl=${encodeURIComponent(e)}`)),s=await t.json().catch(()=>null);if(!t.ok||!s?.data)throw Error(s?.error||`HTTPエラー: ${t.status}`);N(s.data)}catch(e){N(null),C(e instanceof Error?e.message:String(e))}finally{y(!1)}},[]),O=e?.enabled===!0,U=e?.baseUrl;(0,s.useEffect)(()=>{O&&U&&(T(U),E(U))},[O,U,T,E]);let z=(0,s.useCallback)(async()=>{e&&await S({...e,enabled:!0})&&G.toaster.create({type:"success",title:"Ollama を有効化しました"})},[e,S]),P=(0,s.useCallback)(()=>{e&&S({...e,enabled:!1})},[e,S]),F=(0,s.useCallback)(async()=>{!r||await S({enabled:!0,baseUrl:r.baseUrl,model:r.model,contextTokens:Number(r.contextTokens),extraEnv:function(e){let t={};for(let s of e.split("\n")){let e=s.trim();if(!e||e.startsWith("#"))continue;let a=e.indexOf("=");a<=0||(t[e.slice(0,a).trim()]=e.slice(a+1).trim())}return t}(r.extraEnvText)})&&G.toaster.create({type:"success",title:"Ollama の設定を保存しました"})},[r,S]),_=e=>n(t=>t?{...t,...e}:t);return(0,t.jsxs)(M.Card,{children:[(0,t.jsxs)(M.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.CardTitle,{children:"Ollama (実験的機能)"}),(0,t.jsx)(u.Button,{variant:"ghost",size:"icon-sm",onClick:()=>m(!0),title:"Ollama について",children:(0,t.jsx)(D.CircleHelp,{})})]}),(0,t.jsxs)(M.CardDescription,{children:["Ollama のローカルLLMで Claude Code を起動できるようにします。",(0,t.jsx)("strong",{className:"font-medium text-foreground",children:"有効にすると、タスク詳細画面に Ollama タブの作成ボタンが表示されます"}),"。Ollama のインストール・モデルの pull・起動はご自身で行ってください。"]})]}),(0,t.jsx)(M.CardContent,{className:"flex flex-col gap-3",children:e&&r?O?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-success",children:[(0,t.jsx)(I.CheckCircle2,{className:"size-4"}),"Ollama: 有効"]}),!e.model&&(0,t.jsx)("span",{className:"text-xs text-warning",children:"モデルを設定すると利用できます"}),(0,t.jsx)(u.Button,{size:"default",variant:"outline",onClick:P,disabled:i,children:"無効にする"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"Base URL"}),(0,t.jsx)(w.Input,{value:r.baseUrl,onChange:e=>_({baseUrl:e.target.value}),placeholder:"http://localhost:11434"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"モデル"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{value:r.model,onChange:e=>_({model:e.target.value}),placeholder:"qwen3.8:27b",list:en}),(0,t.jsx)("datalist",{id:en,children:x.map(e=>(0,t.jsx)("option",{value:e},e))}),(0,t.jsx)(u.Button,{variant:"outline",size:"icon",onClick:()=>void T(r.baseUrl),disabled:p,title:"pull 済みのモデル一覧を取得",children:(0,t.jsx)(es.RefreshCw,{className:p?"animate-spin":void 0})})]}),j?(0,t.jsx)("p",{className:"mt-1 text-[0.65rem] text-destructive",children:j}):(0,t.jsxs)("p",{className:"mt-1 text-[0.65rem] text-muted-foreground",children:["pull 済みのモデルは候補から選べます(",x.length,"件)。"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"WebSearch"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[b?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)($.Loader2,{className:"size-4 animate-spin"}),"確認中..."]}):v?.signedIn?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-success",children:[(0,t.jsx)(o,{className:"size-4"}),"利用可能(ollama.com: ",v.name,")"]}):v?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-warning",children:[(0,t.jsx)(ea.default,{className:"size-4"}),"ollama.com 未サインイン"]}),v.signinUrl&&(0,t.jsxs)("a",{href:v.signinUrl,target:"_blank",rel:"noreferrer",className:(0,u.buttonVariants)({variant:"outline",size:"sm"}),children:[(0,t.jsx)(et.ExternalLink,{}),"サインイン"]})]}):(0,t.jsx)("span",{className:"text-xs text-destructive",children:k}),(0,t.jsx)(u.Button,{variant:"outline",size:"icon",onClick:()=>void E(r.baseUrl),disabled:b,title:"サインイン状態を再確認",children:(0,t.jsx)(es.RefreshCw,{className:b?"animate-spin":void 0})})]}),(0,t.jsxs)("p",{className:"mt-1 text-[0.65rem] text-muted-foreground",children:["Ollama が ollama.com の Web 検索 API で代行します。Ollama を動かしているマシンで"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"ollama signin"})," ","を実行してください(無料アカウントで可、検索クエリは ollama.com に送信されます)。"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"コンテキスト長 (tokens)"}),(0,t.jsx)(w.Input,{type:"number",min:1,value:r.contextTokens,onChange:e=>_({contextTokens:e.target.value})}),(0,t.jsx)("p",{className:"mt-1 text-[0.65rem] text-muted-foreground",children:"Ollama 側のコンテキスト長と同じ値にしてください。Claude Code の自動compactの判定に使います(64k以上を推奨)。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-muted-foreground",children:"追加の環境変数 (任意)"}),(0,t.jsx)(W.Textarea,{value:r.extraEnvText,onChange:e=>_({extraEnvText:e.target.value}),placeholder:"KEY=VALUE(1行に1つ)",className:"min-h-16 font-mono text-xs"}),(0,t.jsx)("p",{className:"mt-1 text-[0.65rem] text-muted-foreground",children:"Ollama タブにのみ適用されます。同名の既定値より優先されます。"})]}),(0,t.jsx)("div",{children:(0,t.jsxs)(u.Button,{size:"default",onClick:()=>void F(),disabled:i,children:[i&&(0,t.jsx)($.Loader2,{className:"animate-spin"}),"保存"]})})]}):(0,t.jsxs)(u.Button,{size:"default",onClick:()=>void z(),disabled:i,children:[(0,t.jsx)(er.OllamaIcon,{className:"size-4"}),"Ollama を有効化する"]}):(0,t.jsxs)("span",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)($.Loader2,{className:"size-4 animate-spin"}),"読み込み中..."]})}),(0,t.jsx)(B.Dialog,{open:d,onOpenChange:({open:e})=>m(e),title:"Ollama について",maxWidth:"2xl",children:(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"実験的機能です"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Claude Code の接続先を Ollama の Anthropic 互換 API (Ollama v0.14.0以降) に切り替えて起動します。Anthropic はClaude以外のモデルへの接続をサポートしていないため、動作は保証されません。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"WebSearch / WebFetch"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["WebSearch は Ollama が ollama.com の Web 検索 API で代行するため、Ollama を動かしているマシンで ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"ollama signin"})," ","が必要です(未サインインだと「Web search error: unavailable」になります)。WebFetch はサインイン不要で、取得したページの要約も Ollama のモデルで行います。"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 font-medium text-foreground",children:"セットアップ"}),(0,t.jsxs)("ol",{className:"list-decimal space-y-1 pl-5 text-muted-foreground",children:[(0,t.jsxs)("li",{children:["Ollama をインストールする(",(0,t.jsx)("a",{href:"https://ollama.com/download",target:"_blank",rel:"noreferrer",className:"underline",children:"ollama.com"}),"のアプリ、または ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"brew install ollama"}),")"]}),(0,t.jsxs)("li",{children:["モデルを pull する(例:"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"ollama pull qwen3.8:27b"}),")"]}),(0,t.jsxs)("li",{children:["コンテキスト長を 64k 以上にする。アプリは設定画面のスライダー、CLI は"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"OLLAMA_CONTEXT_LENGTH=65536 ollama serve"})," ","で起動する。既定値(VRAM 24GiB 未満は 4k)のままだと tool call が壊れます"]}),(0,t.jsx)("li",{children:"ここで有効化し、モデルとコンテキスト長を設定して保存する"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Docker で tsunagi を動かしている場合"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["Base URL は"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"http://host.docker.internal:11434"})," ","を指定してください。"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"注意"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"~/.claude/settings.json"})," の"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"env"})," に"," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1",children:"ANTHROPIC_*"})," ","を設定している場合、そちらが優先され Ollama に接続されません。設定の変更は、新しく作成した Ollama タブから反映されます。"]})]})]})})]})}var ei=e.i(51846);e.s(["default",0,function(){let e=(0,a.useRouter)();(0,ei.useDocumentTitle)("settings");let n=()=>{{let e=localStorage.getItem("tsunagi:env-selected-node");if(e)try{return JSON.parse(e)}catch(e){console.error("Failed to parse selected node:",e)}}return{scope:"global",label:"Global"}},[o,i]=(0,s.useState)(null),[c,d]=(0,s.useState)(0),[m,x]=(0,s.useState)({completed:!0,hasGlobalToken:!0});return(0,s.useEffect)(()=>{fetch((0,l.apiUrl)("/api/onboarding/status")).then(e=>e.json()).then(e=>{let t=e.data;x(t),t.completed||t.hasGlobalToken?i(n()):i({scope:"global",label:"Global"})}).catch(e=>{console.error("Failed to fetch onboarding status:",e),i(n())})},[]),(0,s.useEffect)(()=>{o&&localStorage.setItem("tsunagi:env-selected-node",JSON.stringify(o))},[o]),(0,t.jsxs)("div",{className:"h-screen flex flex-col bg-background",children:[(0,t.jsx)("div",{className:"sticky top-0 z-50 p-4 border-b border-border bg-card",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(u.Button,{variant:"ghost",onClick:()=>e.push("/"),className:"text-primary font-medium hover:bg-primary/10 hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"w-4 h-4"}),"Back to Board"]}),(0,t.jsx)("h1",{className:"text-xl font-bold text-foreground absolute left-1/2 -translate-x-1/2",children:"Settings"})]})}),(0,t.jsxs)("div",{className:"flex-1 flex min-h-0",children:[(0,t.jsx)("div",{className:"w-64 border-r border-border bg-card",children:(0,t.jsx)(h,{selectedNode:o,onNodeSelect:e=>{i(e)},refreshKey:c})}),(0,t.jsx)("div",{className:"flex-1 bg-card p-4 overflow-y-auto",children:o?(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(z,{selectedNode:o,onboardingStatus:m,onSwitchToGlobal:()=>{i({scope:"global",label:"Global"})}}),(0,t.jsx)(S,{selectedNode:o}),"global"===o.scope&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Repositories"}),(0,t.jsx)(_,{})]}),"global"===o.scope&&(0,t.jsx)(Q,{}),"global"===o.scope&&(0,t.jsx)(ee.LocalLlmSection,{}),"global"===o.scope&&(0,t.jsx)(eo,{}),"repo"===o.scope&&o.owner&&o.repo&&(0,t.jsx)(A,{owner:o.owner,repo:o.repo,onDeleted:()=>{i({scope:"global",label:"Global"}),d(e=>e+1)}})]}):(0,t.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"Select a node from the left panel"})})]})]})}],82341)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41241,19556,9752,20486,e=>{"use strict";var t=e.i(49915),a=(0,e.i(65485).default)(Object.keys,Object),r=Object.prototype.hasOwnProperty;let i=function(e){if(!(0,t.default)(e))return a(e);var i=[];for(var s in Object(e))r.call(e,s)&&"constructor"!=s&&i.push(s);return i};e.s(["default",0,i],19556);var s=e.i(47244),n=e.i(56176),l=(0,s.default)(n.default,"DataView"),u=e.i(44483),o=(0,s.default)(n.default,"Promise"),d=(0,s.default)(n.default,"Set");e.s(["default",0,d],9752);var c=(0,s.default)(n.default,"WeakMap"),f=e.i(35287),v=e.i(66762),m="[object Map]",p="[object Promise]",h="[object Set]",g="[object WeakMap]",b="[object DataView]",k=(0,v.default)(l),y=(0,v.default)(u.default),j=(0,v.default)(o),x=(0,v.default)(d),w=(0,v.default)(c),P=f.default;(l&&P(new l(new ArrayBuffer(1)))!=b||u.default&&P(new u.default)!=m||o&&P(o.resolve())!=p||d&&P(new d)!=h||c&&P(new c)!=g)&&(P=function(e){var t=(0,f.default)(e),a="[object Object]"==t?e.constructor:void 0,r=a?(0,v.default)(a):"";if(r)switch(r){case k:return b;case y:return m;case j:return p;case x:return h;case w:return g}return t});let M=P;e.s(["default",0,M],20486);var C=e.i(15300),E=e.i(44071),R=e.i(41338),I=e.i(3745),O=e.i(1645),S=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,R.default)(e)&&((0,E.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,I.default)(e)||(0,O.default)(e)||(0,C.default)(e)))return!e.length;var a=M(e);if("[object Map]"==a||"[object Set]"==a)return!e.size;if((0,t.default)(e))return!i(e).length;for(var r in e)if(S.call(e,r))return!1;return!0}],41241)},44917,e=>{"use strict";var t=e.i(96977),a=e.i(71206);e.i(47716);var r=e.i(23685),i=(0,a.__name)(e=>{let{securityLevel:a}=(0,t.getConfig2)(),i=(0,r.select)("body");if("sandbox"===a){let t=(0,r.select)(`#i${e}`),a=t.node()?.contentDocument??document;i=(0,r.select)(a.body)}return i.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,i])},3262,e=>{"use strict";var t=e.i(31360),a=e.i(60884),r=e.i(29432),i=e.i(96977),s=e.i(71206),n={common:i.common_default,getConfig:i.getConfig,insertCluster:a.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:a.insertNode,interpolateToCurve:r.interpolateToCurve,labelHelper:a.labelHelper,log:s.log,positionEdgeLabel:t.positionEdgeLabel},l={},u=(0,s.__name)(e=>{for(let t of e)l[t.name]=t},"registerLayoutLoaders");(0,s.__name)(()=>{u([{name:"dagre",loader:(0,s.__name)(async()=>await e.A(92568),"loader")},{name:"cose-bilkent",loader:(0,s.__name)(async()=>await e.A(62369),"loader")}])},"registerDefaultLayoutLoaders")();var o=(0,s.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in l))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let a=t.domId||t.id;t.domId=`${e.diagramId}-${a}`}let a=l[e.layoutAlgorithm],r=await a.loader(),{theme:i,themeVariables:s}=e.config,{useGradient:u,gradientStart:o,gradientStop:d}=s,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),u){let e=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}return r.render(e,t,n,{algorithm:a.algorithm})},"render"),d=(0,s.__name)((e="",{fallback:t="dagre"}={})=>{if(e in l)return e;if(t in l)return s.log.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm");e.s(["getRegisteredLayoutAlgorithm",0,d,"registerLayoutLoaders",0,u,"render",0,o])},50160,e=>{e.q("/_next/static/media/icon.0fkix7.hkmsz4.png")},18566,(e,t,a)=>{t.exports=e.r(76562)},43531,78745,e=>{"use strict";let t=(0,e.i(75254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t],78745),e.s(["Check",0,t],43531)},78917,e=>{"use strict";let t=(0,e.i(75254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],78917)},37870,31278,e=>{"use strict";var t=e.i(18050),a=e.i(17521);e.s(["Loader2",()=>a.default],31278);var a=a;e.s(["LoadingSpinner",0,function({size:e="md",message:r}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3",children:[(0,t.jsx)(a.default,{className:`${{sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"}[e]} text-primary animate-spin`}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r})]})}],37870)},10012,24564,94349,e=>{"use strict";var t,a=e.i(18050);e.i(47167);var r=e.i(71645);e.s([],19485),e.i(19485);var i=e.i(76477),s=e.i(67805),n=e.i(17514);let l=((t={}).disabled="data-disabled",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),u={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},o={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},d={disabled:!1,...o},c={valid:e=>null===e?null:e?{[l.valid]:""}:{[l.invalid]:""}},f=r.createContext({invalid:void 0,name:void 0,validityData:{state:u,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,touched:o.touched,setTouched:n.NOOP,dirty:o.dirty,setDirty:n.NOOP,filled:o.filled,setFilled:n.NOOP,focused:o.focused,setFocused:n.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:d,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=n.EMPTY_OBJECT)=>e,getInputValidationProps:(e=n.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});function v(e=!0){let t=r.useContext(f);if(t.setValidityData===n.NOOP&&!e)throw Error((0,s.default)(28));return t}let m=r.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0}),p=r.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:n.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function h(){return r.useContext(p)}var g=e.i(30628),b=e.i(19805),k=e.i(89879);let y=r.createContext({controlId:void 0,registerControlId:n.NOOP,labelId:void 0,setLabelId:n.NOOP,messageIds:[],setMessageIds:n.NOOP,getDescriptionProps:e=>e});function j(){return r.useContext(y)}let x=function(e){let t=(0,k.useBaseUiId)(),s=void 0===e.controlId?t:e.controlId,[n,l]=r.useState(s),[u,o]=r.useState(e.labelId),[d,c]=r.useState([]),f=(0,g.useRefWithInit)(()=>new Map),{messageIds:v}=j(),m=(0,i.useStableCallback)((e,t)=>{let a=f.current;void 0===t?a.delete(e):(a.set(e,t),l(e=>{let t;if(0!==a.size){for(let r of a.values()){if(void 0!==e&&r===e)return e;void 0===t&&(t=r)}return t}}))}),p=r.useCallback(e=>(0,b.mergeProps)({"aria-describedby":v.concat(d).join(" ")||void 0},e),[v,d]),h=r.useMemo(()=>({controlId:n,registerControlId:m,labelId:u,setLabelId:o,messageIds:d,setMessageIds:c,getDescriptionProps:p}),[n,m,u,o,d,c,p]);return(0,a.jsx)(y.Provider,{value:h,children:e.children})};var w=e.i(27601),P=e.i(66745);function M(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let C=Object.keys(u),E=r.forwardRef(function(e,t){let{errors:l,validationMode:o,submitAttemptedRef:d}=h(),{render:v,className:p,validate:g,validationDebounceTime:k=0,validationMode:y=o,name:x,disabled:E=!1,invalid:R,dirty:I,touched:O,actionsRef:S,...L}=e,{disabled:q}=function(e=!1){let t=r.useContext(m);if(!t&&!e)throw Error((0,s.default)(86));return t}(),_=(0,i.useStableCallback)(g||(()=>null)),T=q||E,[V,A]=r.useState(!1),[N,D]=r.useState(!1),[z,F]=r.useState(!1),[$,B]=r.useState(!1),U=I??N,H=O??V,J=r.useRef(!1),W=(0,i.useStableCallback)(e=>{void 0===I&&(e&&(J.current=!0),D(e))}),K=(0,i.useStableCallback)(e=>{void 0===O&&A(e)}),Y=(0,i.useStableCallback)(()=>"onChange"===y||"onSubmit"===y&&d.current),G=!!x&&Object.hasOwn(l,x)&&void 0!==l[x],Q=!0===R||G,[X,Z]=r.useState({state:u,error:"",errors:[],value:null,initialValue:null}),ee=!Q&&X.state.valid,et=r.useMemo(()=>({disabled:T,touched:H,dirty:U,valid:ee,filled:z,focused:$}),[T,H,U,ee,z,$]),ea=function(e){let{formRef:t,clearErrors:a}=h(),{setValidityData:s,validate:l,validityData:o,validationDebounceTime:d,invalid:c,markedDirtyRef:f,state:v,name:m,shouldValidateOnChange:p}=e,{controlId:g,getDescriptionProps:k}=j(),y=(0,P.useTimeout)(),x=r.useRef(null),w=(0,i.useStableCallback)(async(e,a=!1)=>{let r,i=x.current;if(!i)return;if(a){if(!1!==v.valid)return;let a=i.validity;if(!a.valueMissing){let a={value:e,state:{...u,valid:!0},error:"",errors:[],initialValue:o.initialValue};if(i.setCustomValidity(""),g){let e=t.current.fields.get(g);e&&t.current.fields.set(g,{...e,...M(a,!1)})}s(a);return}let r=C.reduce((e,t)=>(e[t]=a[t],e),{});if(!r.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let a of C)"valid"!==a&&("valueMissing"===a&&(t=e[a]),e[a]&&(t=!1));return t}(r))return}y.clear();let n=null,d=[],m=function(e){let t=C.reduce((t,a)=>(t[a]=e.validity[a],t),{}),a=!1;for(let e of C)if("valid"!==e){if("valueMissing"===e&&t[e])a=!0;else if(t[e])return t}return a&&!f.current&&(t.valid=!0,t.valueMissing=!1),t}(i),h=p();if(i.validationMessage&&!h)r=i.validationMessage,d=[i.validationMessage];else{let a=l(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(n="object"==typeof a&&null!==a&&"then"in a?await a:a)?(m.valid=!1,m.customError=!0,Array.isArray(n)?(d=n,i.setCustomValidity(n.join("\n"))):n&&(d=[n],i.setCustomValidity(n))):h&&(i.setCustomValidity(""),m.customError=!1,i.validationMessage?(r=i.validationMessage,d=[i.validationMessage]):i.validity.valid&&!m.valid&&(m.valid=!0))}let b={value:e,state:m,error:r??(Array.isArray(n)?n[0]:n??""),errors:d,initialValue:o.initialValue};if(g){let e=t.current.fields.get(g);e&&t.current.fields.set(g,{...e,...M(b,c)})}s(b)}),E=r.useCallback((e={})=>(0,b.mergeProps)(k,!1===v.valid?{"aria-invalid":!0}:n.EMPTY_OBJECT,e),[k,v.valid]),R=r.useCallback((e={})=>(0,b.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(a(m),!p())return void w(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?w(t.value):(y.clear(),d?y.start(d,()=>{w(t.value)}):w(t.value))}},E(e)),[E,a,m,y,w,d,p]);return r.useMemo(()=>({getValidationProps:E,getInputValidationProps:R,inputRef:x,commit:w}),[E,R,w])}({setValidityData:Z,validate:_,validityData:X,validationDebounceTime:k,invalid:Q,markedDirtyRef:J,state:et,name:x,shouldValidateOnChange:Y}),er=r.useCallback(()=>{J.current=!0,ea.commit(X.value)},[ea,X]);r.useImperativeHandle(S,()=>({validate:er}),[er]);let ei=r.useMemo(()=>({invalid:Q,name:x,validityData:X,setValidityData:Z,disabled:T,touched:H,setTouched:K,dirty:U,setDirty:W,filled:z,setFilled:F,focused:$,setFocused:B,validate:_,validationMode:y,validationDebounceTime:k,shouldValidateOnChange:Y,state:et,markedDirtyRef:J,validation:ea}),[Q,x,X,T,H,K,U,W,z,F,$,B,_,y,k,Y,et,ea]),es=(0,w.useRenderElement)("div",e,{ref:t,state:et,props:L,stateAttributesMapping:c});return(0,a.jsx)(f.Provider,{value:ei,children:es})}),R=r.forwardRef(function(e,t){return(0,a.jsx)(x,{children:(0,a.jsx)(E,{...e,ref:t})})});var I=e.i(29315),O=e.i(90219),S=e.i(47857),L=e.i(977);function q(e,t){let a=(0,k.useBaseUiId)(e);return(0,L.useIsoLayoutEffect)(()=>(t(a),()=>{t(void 0)}),[a,t]),a}e.s(["useRegisteredLabelId",0,q],24564);let _=r.forwardRef(function(e,t){let{render:a,className:s,id:n,nativeLabel:l=!0,...u}=e,o=v(!1),{labelId:d}=j(),f=r.useRef(null),m=function(e={}){let{id:t,fallbackControlId:a,native:r=!1,setLabelId:s,focusControl:n}=e,{controlId:l,setLabelId:u}=j(),o=q(t,(0,i.useStableCallback)(e=>{u(e),s?.(e)})),d=l??a;function c(e){let t=(0,S.getTarget)(e.nativeEvent);t?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),r||function(e){if(n)return n(e,d);if(!d)return;let t=(0,O.ownerDocument)(e.currentTarget).getElementById(d);(0,I.isHTMLElement)(t)&&t.focus({focusVisible:!0})}(e))}return r?{id:o,htmlFor:d??void 0,onMouseDown:c}:{id:o,onClick:c,onPointerDown(e){e.preventDefault()}}}({id:d??n,native:l});return(0,w.useRenderElement)("label",e,{ref:[t,f],state:o.state,props:[m,u],stateAttributesMapping:c})});var T=e.i(89269),V=e.i(84759),A=e.i(88841);let N={...c,...V.transitionStatusMapping},D=r.forwardRef(function(e,t){let{render:i,id:s,className:n,match:l,...u}=e,o=(0,k.useBaseUiId)(s),{validityData:d,state:c,name:f}=v(!1),{setMessageIds:m}=j(),{errors:p}=h(),g=f?p[f]:null,b=!1;b=!!g||!0===l||(l?!!d.state[l]:!1===d.state.valid);let{mounted:y,transitionStatus:x,setMounted:P}=(0,A.useTransitionStatus)(b);(0,L.useIsoLayoutEffect)(()=>{if(b&&o)return m(e=>e.concat(o)),()=>{m(e=>e.filter(e=>e!==o))}},[b,o,m]);let M=r.useRef(null),[C,E]=r.useState(null),[R,I]=r.useState(null),O=g||(d.errors.length>1?(0,a.jsx)("ul",{children:d.errors.map(e=>(0,a.jsx)("li",{children:e},e))}):d.error),S=d.error;null!=g?S=Array.isArray(g)?JSON.stringify(g):g:d.errors.length>1&&(S=JSON.stringify(d.errors)),b&&S!==R&&(I(S),E(O)),(0,T.useOpenChangeComplete)({open:b,ref:M,onComplete(){b||P(!1)}});let q={...c,transitionStatus:x},_=(0,w.useRenderElement)("div",e,{ref:[t,M],state:q,props:[{id:o,children:b?O:C},u],stateAttributesMapping:N,enabled:y});return y?_:null}),z=r.forwardRef(function(e,t){let{render:a,id:r,className:i,...s}=e,n=(0,k.useBaseUiId)(r),l=v(!1),{setMessageIds:u}=j();return(0,L.useIsoLayoutEffect)(()=>{if(n)return u(e=>e.concat(n)),()=>{u(e=>e.filter(e=>e!==n))}},[n,u]),(0,w.useRenderElement)("p",e,{ref:t,state:l.state,props:[{id:n},s],stateAttributesMapping:c})});function F({controlled:e,default:t,name:a,state:i="value"}){let{current:s}=r.useRef(void 0!==e),[n,l]=r.useState(t),u=r.useCallback(e=>{s||l(e)},[]);return[s?e:n,u]}e.s(["useControlled",0,F],94349);var $=e.i(74080),B=e.i(5963),U=e.i(3404);let H=r.forwardRef(function(e,t){let{render:a,className:s,id:l,name:u,value:o,disabled:d=!1,onValueChange:f,defaultValue:m,autoFocus:p=!1,...b}=e,{state:y,name:x,disabled:P,setTouched:C,setDirty:E,validityData:R,setFocused:q,setFilled:_,validationMode:T,validation:V}=v(),A=P||d,N=x??u,D={...y,disabled:A},{labelId:z}=j(),H=function(e={}){let{id:t,implicit:a=!1,controlRef:s}=e,{controlId:l,registerControlId:u}=j(),o=(0,k.useBaseUiId)(t),d=a?l:void 0,c=(0,g.useRefWithInit)(()=>Symbol("labelable-control")),f=r.useRef(!1),v=r.useRef(null!=t),m=(0,i.useStableCallback)(()=>{f.current&&u!==n.NOOP&&(f.current=!1,u(c.current,void 0))});return(0,L.useIsoLayoutEffect)(()=>{let e;if(u!==n.NOOP){if(a){let a=s?.current;e=(0,I.isElement)(a)&&null!=a.closest("label")?t??null:d??o}else if(null!=t)v.current=!0,e=t;else{if(!v.current)return void m();e=o}if(void 0===e)return void m();f.current=!0,u(c.current,e)}},[t,s,d,u,a,o,c,m]),r.useEffect(()=>m,[m]),l??o}({id:l});(0,L.useIsoLayoutEffect)(()=>{let e=null!=o;V.inputRef.current?.value||e&&""!==o?_(!0):e&&""===o&&_(!1)},[V.inputRef,_,o]);let J=r.useRef(null);(0,L.useIsoLayoutEffect)(()=>{p&&J.current===(0,S.activeElement)((0,O.ownerDocument)(J.current))&&q(!0)},[p,q]);let[W]=F({controlled:o,default:m,name:"FieldControl",state:"value"}),K=void 0!==o,Y=K?W:void 0;return!function(e){let{enabled:t=!0,value:a,id:r,name:s,controlRef:n,commit:l}=e,{formRef:u}=h(),{invalid:o,markedDirtyRef:d,validityData:c,setValidityData:f}=v(),m=(0,i.useStableCallback)(e.getValue);(0,L.useIsoLayoutEffect)(()=>{if(!t)return;let e=a;void 0===e&&(e=m()),null===c.initialValue&&null!==e&&f(t=>({...t,initialValue:e}))},[t,f,a,c.initialValue,m]),(0,L.useIsoLayoutEffect)(()=>{t&&r&&u.current.fields.set(r,{getValue:m,name:s,controlRef:n,validityData:M(c,o),validate(e=!0){let t=a;void 0===t&&(t=m()),d.current=!0,e?$.flushSync(()=>l(t)):l(t)}})},[l,n,t,u,m,r,o,d,s,c,a]),(0,L.useIsoLayoutEffect)(()=>{let e=u.current.fields;return()=>{r&&e.delete(r)}},[u,r])}({id:H,name:N,commit:V.commit,value:Y,getValue:()=>V.inputRef.current?.value,controlRef:V.inputRef}),(0,w.useRenderElement)("input",e,{ref:[t,J],state:D,props:[{id:H,disabled:A,name:N,ref:V.inputRef,"aria-labelledby":z,autoFocus:p,...K?{value:Y}:{defaultValue:m},onChange(e){let t=e.currentTarget.value;f?.(t,(0,B.createChangeEventDetails)(U.REASONS.none,e.nativeEvent)),E(t!==R.initialValue),_(""!==t)},onFocus(){q(!0)},onBlur(e){C(!0),q(!1),"onBlur"===T&&V.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(C(!0),V.commit(e.currentTarget.value))}},V.getInputValidationProps(),b],stateAttributesMapping:c})}),J=r.createContext({disabled:!1}),W=r.createContext(void 0),K=r.forwardRef(function(e,t){let{render:i,className:n,disabled:l=!1,...u}=e,{state:o,disabled:d}=v(!1),f=d||l,m=function(e=!0){let t=r.useContext(W);if(void 0===t&&!e)throw Error((0,s.default)(3));return t}(),p=m?.parent.id,h=m?.allValues!==void 0,g=r.useMemo(()=>({disabled:f}),[f]),b=(0,w.useRenderElement)("div",e,{ref:t,state:o,props:u,stateAttributesMapping:c});return(0,a.jsx)(x,{controlId:h?p:void 0,children:(0,a.jsx)(J.Provider,{value:g,children:b})})});e.s(["Control",0,H,"Description",0,z,"Error",0,D,"Item",0,K,"Label",0,_,"Root",0,R,"Validity",0,function(e){let{children:t}=e,{validityData:i,invalid:s}=v(!1),n=r.useMemo(()=>M(i,s),[i,s]),l=!1===n.state.valid,{transitionStatus:u}=(0,A.useTransitionStatus)(l),o=r.useMemo(()=>({...n,validity:n.state,transitionStatus:u}),[n,u]);return(0,a.jsx)(r.Fragment,{children:t(o)})}],71975);var Y=e.i(71975),Y=Y;let G=r.forwardRef(function(e,t){return(0,a.jsx)(Y.Control,{ref:t,...e})});var Q=e.i(52088);e.s(["Input",0,function({className:e,type:t,...r}){return(0,a.jsx)(G,{type:t,"data-slot":"input",className:(0,Q.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-input/20 px-3 py-1 text-sm transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}],10012)},41247,e=>{"use strict";var t=e.i(18050),a=e.i(52088);e.s(["Textarea",0,function({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}])},86536,e=>{"use strict";let t=(0,e.i(75254).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],86536)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],27612)},95468,e=>{"use strict";var t=e.i(23287);e.s(["CheckCircle2",()=>t.default])},77814,e=>{"use strict";var t,a=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var r=e.i(71645),i=e.i(231),s=e.i(62372);let n=new Map;function l(e,t,a){return null==e?"":(function(e,t){let a=JSON.stringify({locale:e,options:t}),r=n.get(a);if(r)return r;let i=new Intl.NumberFormat(e,t);return n.set(a,i),i})(t,a).format(e)}var u=e.i(27601),o=e.i(67805);let d=r.createContext(void 0);function c(){let e=r.useContext(d);if(void 0===e)throw Error((0,o.default)(51));return e}let f=((t={}).complete="data-complete",t.indeterminate="data-indeterminate",t.progressing="data-progressing",t),v={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function m(e,t){return null==t?"indeterminate progress":e||`${t}%`}let p=r.forwardRef(function(e,t){var n;let{format:o,getAriaValueText:c=m,locale:f,max:p=100,min:h=0,value:g,render:b,className:k,children:y,...j}=e,[x,w]=r.useState(),P=(0,i.useValueAsRef)(o),M="indeterminate";Number.isFinite(g)&&(M=g===p?"complete":"progressing");let C=(n=P.current,null==g?"":n?l(g,f,n):l(g/100,f,{style:"percent"})),E=r.useMemo(()=>({status:M}),[M]),R={"aria-labelledby":x,"aria-valuemax":p,"aria-valuemin":h,"aria-valuenow":g??void 0,"aria-valuetext":c(C,g),role:"progressbar",children:(0,a.jsxs)(r.Fragment,{children:[y,(0,a.jsx)("span",{role:"presentation",style:s.visuallyHidden,children:"x"})]})},I=r.useMemo(()=>({formattedValue:C,max:p,min:h,setLabelId:w,state:E,status:M,value:g}),[C,p,h,w,E,M,g]),O=(0,u.useRenderElement)("div",e,{state:E,ref:t,props:[R,j],stateAttributesMapping:v});return(0,a.jsx)(d.Provider,{value:I,children:O})}),h=r.forwardRef(function(e,t){let{render:a,className:r,...i}=e,{state:s}=c();return(0,u.useRenderElement)("div",e,{state:s,ref:t,props:i,stateAttributesMapping:v})}),g=r.forwardRef(function(e,t){let{render:a,className:i,...s}=e,{max:n,min:l,value:o,state:d}=c(),f=Number.isFinite(o)&&null!==o?(o-l)*100/(n-l):null,m=r.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,u.useRenderElement)("div",e,{state:d,ref:t,props:[{style:m()},s],stateAttributesMapping:v})}),b=r.forwardRef(function(e,t){let{className:a,render:r,children:i,...s}=e,{value:n,formattedValue:l,state:o}=c(),d=null==n?"indeterminate":l,f=null==n?null:l;return(0,u.useRenderElement)("span",e,{state:o,ref:t,props:[{"aria-hidden":!0,children:"function"==typeof i?i(d,n):f},s],stateAttributesMapping:v})});var k=e.i(24564);let y=r.forwardRef(function(e,t){let{render:a,className:r,id:i,...s}=e,{setLabelId:n,state:l}=c(),o=(0,k.useRegisteredLabelId)(i,n);return(0,u.useRenderElement)("span",e,{state:l,ref:t,props:[{id:o,role:"presentation"},s],stateAttributesMapping:v})});e.s(["Indicator",0,g,"Label",0,y,"Root",0,p,"Track",0,h,"Value",0,b],45929);var j=e.i(45929),j=j,x=e.i(52088);function w({className:e,...t}){return(0,a.jsx)(j.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...t})}function P({className:e,...t}){return(0,a.jsx)(j.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary",e),style:{transition:"width 500ms ease-in-out"},...t})}e.s(["Progress",0,function({className:e,children:t,value:r,...i}){return(0,a.jsxs)(j.Root,{value:r,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...i,children:[t,(0,a.jsx)(w,{children:(0,a.jsx)(P,{})})]})}],77814)},51846,e=>{"use strict";var t=e.i(71645);e.s(["useDocumentTitle",0,function(e,a=0){(0,t.useEffect)(()=>{let t=a>0?`(${a}) 繋`:"繋",r=e?`${t} | ${e}`:t,i=document.title;return document.title=r,()=>{document.title=i}},[e,a])}])},57024,e=>{"use strict";var t=e.i(85699);function a(e){let{type:a,title:r,description:i,duration:s}=e,n=e.id??crypto.randomUUID(),l={id:n,description:i,duration:s};switch(a){case"loading":t.toast.loading(r,l);break;case"success":t.toast.success(r,l);break;case"error":t.toast.error(r,l);break;case"warning":t.toast.warning(r,l);break;case"info":t.toast.info(r,l);break;default:(0,t.toast)(r,l)}return n}e.s(["toaster",0,{create:e=>a(e),update:(e,t)=>{a({...t,id:e})},dismiss:e=>{t.toast.dismiss(e)}}])},16715,e=>{"use strict";let t=(0,e.i(75254).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],16715)},7233,5352,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],7233);let a=[{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-700 dark:text-blue-300"},{bg:"bg-emerald-100 dark:bg-emerald-900/30",text:"text-emerald-700 dark:text-emerald-300"},{bg:"bg-violet-100 dark:bg-violet-900/30",text:"text-violet-700 dark:text-violet-300"},{bg:"bg-amber-100 dark:bg-amber-900/30",text:"text-amber-700 dark:text-amber-300"},{bg:"bg-rose-100 dark:bg-rose-900/30",text:"text-rose-700 dark:text-rose-300"},{bg:"bg-cyan-100 dark:bg-cyan-900/30",text:"text-cyan-700 dark:text-cyan-300"},{bg:"bg-orange-100 dark:bg-orange-900/30",text:"text-orange-700 dark:text-orange-300"},{bg:"bg-teal-100 dark:bg-teal-900/30",text:"text-teal-700 dark:text-teal-300"},{bg:"bg-indigo-100 dark:bg-indigo-900/30",text:"text-indigo-700 dark:text-indigo-300"},{bg:"bg-pink-100 dark:bg-pink-900/30",text:"text-pink-700 dark:text-pink-300"},{bg:"bg-lime-100 dark:bg-lime-900/30",text:"text-lime-700 dark:text-lime-300"},{bg:"bg-fuchsia-100 dark:bg-fuchsia-900/30",text:"text-fuchsia-700 dark:text-fuchsia-300"}];e.s(["getRepoColor",0,function(e,t){let r=function(e){let t=5381;for(let a=0;a<e.length;a++)t=33*t^e.charCodeAt(a);return t>>>0}(`${e}/${t}`)%a.length;return a[r]}],5352)},55716,e=>{"use strict";let t=(0,e.i(75254).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",0,t],55716)},39484,e=>{e.v(t=>Promise.all(["static/chunks/002jt~~cq5_aa.js"].map(t=>e.l(t))).then(()=>t(16400)))},92568,e=>{e.v(t=>Promise.all(["static/chunks/0bew-tpzkv4a6.js","static/chunks/0hc31lz26e0bj.js","static/chunks/156lsa3n_7-g1.js"].map(t=>e.l(t))).then(()=>t(68053)))},62369,e=>{e.v(t=>Promise.all(["static/chunks/0t-ecot2ot8jq.js","static/chunks/0s2ei~z99yg.7.js"].map(t=>e.l(t))).then(()=>t(97810)))},78997,e=>{e.v(t=>Promise.all(["static/chunks/0w4h2u4jedq4..js","static/chunks/0v8zy131j2_sl.js"].map(t=>e.l(t))).then(()=>t(77010)))},28146,e=>{e.v(t=>Promise.all(["static/chunks/179i-blt6kp34.js","static/chunks/004q74ucr0rud.js"].map(t=>e.l(t))).then(()=>t(26067)))},80472,e=>{e.v(t=>Promise.all(["static/chunks/0-whcx~709zzu.js"].map(t=>e.l(t))).then(()=>t(50032)))},83305,e=>{e.v(t=>Promise.all(["static/chunks/00h5q76-kypod.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/0g7ov558axacn.js"].map(t=>e.l(t))).then(()=>t(8709)))},34606,e=>{e.v(t=>Promise.all(["static/chunks/0t-7~zw5_oj33.js","static/chunks/0t1nhjmm.2-8-.js"].map(t=>e.l(t))).then(()=>t(13976)))},23526,e=>{e.v(t=>Promise.all(["static/chunks/0zz1c.5ttlw75.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/00h5q76-kypod.js"].map(t=>e.l(t))).then(()=>t(60498)))},3931,e=>{e.v(t=>Promise.all(["static/chunks/0egss2l0vp3iv.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/00h5q76-kypod.js"].map(t=>e.l(t))).then(()=>t(79567)))},67051,e=>{e.v(t=>Promise.all(["static/chunks/0v~puv980n2mn.js"].map(t=>e.l(t))).then(()=>t(51778)))},36080,e=>{e.v(t=>Promise.all(["static/chunks/0_u58hj44ucg2.js","static/chunks/0coux02phyasu.js"].map(t=>e.l(t))).then(()=>t(79003)))},3156,e=>{e.v(t=>Promise.all(["static/chunks/0~fjlnit~fkey.js"].map(t=>e.l(t))).then(()=>t(91739)))},71209,e=>{e.v(t=>Promise.all(["static/chunks/0njmix7y_6miv.js","static/chunks/0z9df3ijvbr8h.js"].map(t=>e.l(t))).then(()=>t(94614)))},78922,e=>{e.v(t=>Promise.all(["static/chunks/0nt-wtu-~b7hv.js","static/chunks/0nwbvs~t8m~k6.js"].map(t=>e.l(t))).then(()=>t(99223)))},10404,e=>{e.v(t=>Promise.all(["static/chunks/0puq-xa16mucw.js","static/chunks/0nwbvs~t8m~k6.js"].map(t=>e.l(t))).then(()=>t(25730)))},81283,e=>{e.v(t=>Promise.all(["static/chunks/0bew-tpzkv4a6.js","static/chunks/104dsd7mk1jyt.js","static/chunks/0.fiftciismd2.js","static/chunks/0hc31lz26e0bj.js"].map(t=>e.l(t))).then(()=>t(24924)))},41605,e=>{e.v(t=>Promise.all(["static/chunks/0vj43fihkfmqz.js","static/chunks/0.fiftciismd2.js"].map(t=>e.l(t))).then(()=>t(32579)))},78877,e=>{e.v(t=>Promise.all(["static/chunks/0lmm~3cjla0c9.js"].map(t=>e.l(t))).then(()=>t(21392)))},27415,e=>{e.v(t=>Promise.all(["static/chunks/0rr4nl_auvf0b.js"].map(t=>e.l(t))).then(()=>t(92280)))},44319,e=>{e.v(t=>Promise.all(["static/chunks/0l_tj98f_5ot-.js"].map(t=>e.l(t))).then(()=>t(84201)))},31376,e=>{e.v(t=>Promise.all(["static/chunks/0-_x27yxy_uq_.js"].map(t=>e.l(t))).then(()=>t(3054)))},34215,e=>{e.v(t=>Promise.all(["static/chunks/0kx.ki.9u_0dy.js"].map(t=>e.l(t))).then(()=>t(30770)))},11980,e=>{e.v(t=>Promise.all(["static/chunks/0bb.y5mii27l0.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/00h5q76-kypod.js"].map(t=>e.l(t))).then(()=>t(39342)))},70234,e=>{e.v(t=>Promise.all(["static/chunks/0g8qw208n3i89.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/00h5q76-kypod.js"].map(t=>e.l(t))).then(()=>t(43020)))},44243,e=>{e.v(t=>Promise.all(["static/chunks/06x~dj4kp-z9f.js","static/chunks/11905-quym2vs.js","static/chunks/043yk9d-7bl43.js"].map(t=>e.l(t))).then(()=>t(15508)))},51365,e=>{e.v(t=>Promise.all(["static/chunks/0r4wgiv_kwiro.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/00h5q76-kypod.js"].map(t=>e.l(t))).then(()=>t(78730)))},46201,e=>{e.v(t=>Promise.all(["static/chunks/1158vq~dpuyl-.js","static/chunks/00h5q76-kypod.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/0s2ei~z99yg.7.js","static/chunks/0lr2ip~4h2o.z.js"].map(t=>e.l(t))).then(()=>t(38206)))},48926,e=>{e.v(t=>Promise.all(["static/chunks/0kl8vyx5367.j.js"].map(t=>e.l(t))).then(()=>t(90158)))},81291,e=>{e.v(t=>Promise.all(["static/chunks/17me7gnh4-..3.js"].map(t=>e.l(t))).then(()=>t(4447)))},31656,e=>{e.v(t=>Promise.all(["static/chunks/00h5q76-kypod.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/0_7ef.hja3s4s.js"].map(t=>e.l(t))).then(()=>t(68025)))},22654,e=>{e.v(t=>Promise.all(["static/chunks/00h5q76-kypod.js","static/chunks/0f6mqg1npiv.t.js","static/chunks/0oryo.isv4jwb.js"].map(t=>e.l(t))).then(()=>t(67933)))}]);