@alook/app 0.0.132 → 0.0.134

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 (104) hide show
  1. package/bundled/email-worker/index.js +36 -17
  2. package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
  3. package/bundled/web/.open-next/assets/BUILD_ID +1 -1
  4. package/bundled/web/.open-next/assets/_next/static/chunks/0vq-9me5zdpwe.js +1 -0
  5. package/bundled/web/.open-next/assets/_next/static/chunks/{3issuq6aouf1q.js → 1soxnit9hjz-0.js} +1 -1
  6. package/bundled/web/.open-next/assets/_next/static/chunks/{1iux65sajp19w.js → 25mf0rxvnm36s.js} +1 -1
  7. package/bundled/web/.open-next/assets/_next/static/chunks/29vahszwp_yzk.js +3 -0
  8. package/bundled/web/.open-next/assets/_next/static/chunks/2evdmhjrm4fp4.js +1 -0
  9. package/bundled/web/.open-next/assets/_next/static/chunks/2owkk0a9xurql.js +1 -0
  10. package/bundled/web/.open-next/assets/_next/static/chunks/{27vz1_55bn5h_.js → 2vvce1uli_yf3.js} +1 -1
  11. package/bundled/web/.open-next/assets/_next/static/chunks/3ad50t_oqhpk_.js +1 -0
  12. package/bundled/web/.open-next/assets/_next/static/chunks/3g9-r7m865tot.js +63 -0
  13. package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/_global-error.cache +1 -1
  14. package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/_not-found.cache +1 -1
  15. package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/device.cache +1 -1
  16. package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/privacy.cache +1 -1
  17. package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/sitemap.xml.cache +1 -1
  18. package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
  19. package/bundled/web/.open-next/cloudflare/init.js +1 -1
  20. package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
  21. package/bundled/web/.open-next/middleware/handler.mjs +6 -6
  22. package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
  23. package/bundled/web/.open-next/server-functions/default/src/web/.next/app-path-routes-manifest.json +1 -0
  24. package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
  25. package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
  26. package/bundled/web/.open-next/server-functions/default/src/web/.next/required-server-files.json +3 -1
  27. package/bundled/web/.open-next/server-functions/default/src/web/.next/routes-manifest.json +8 -0
  28. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
  29. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
  30. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
  31. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
  32. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
  33. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
  34. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
  35. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
  36. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
  37. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
  38. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
  39. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
  40. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
  41. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
  42. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
  43. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
  44. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/page_client-reference-manifest.js +1 -1
  45. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
  46. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
  47. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/[traceId]/page_client-reference-manifest.js +1 -1
  48. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/page_client-reference-manifest.js +1 -1
  49. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
  50. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/recruit/route.js +1 -1
  51. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/trust/route.js +15 -0
  52. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/trust/route_client-reference-manifest.js +3 -0
  53. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/notify/route.js +2 -2
  54. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/send/route.js +1 -1
  55. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page/react-loadable-manifest.json +1 -1
  56. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
  57. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app-paths-manifest.json +1 -0
  58. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0xdps2u._.js +1 -1
  59. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__12fz1lr._.js +1 -1
  60. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +7 -5
  61. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_1pt-oj4._.js → _0eu_mts._.js} +2 -2
  62. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0c6q0et._.js → _0kca2k0._.js} +2 -2
  63. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r2vuif._.js +3 -0
  64. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0v95a0y._.js +14 -14
  65. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_139j3zh._.js +14 -14
  66. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_14_8l-b._.js +2 -2
  67. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1cdibag._.js +1 -1
  68. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1fn4mxe._.js +1 -1
  69. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1iaevpj._.js +2 -2
  70. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1nfaney._.js +14 -14
  71. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1oeo-oa._.js +1 -1
  72. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1p90k-4._.js +3 -0
  73. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/src_web__next-internal_server_app_api_email_[id]_trust_route_actions_0rx9apz.js +3 -0
  74. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/1b4r_lucide-react_dist_esm_icons_0ci7b7p._.js +3 -0
  75. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +7 -5
  76. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0p54okk._.js +13 -13
  77. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0qgcnj5._.js +1 -1
  78. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0t5ob43._.js +3 -0
  79. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1vs9m39._.js +1 -1
  80. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1xvbchf._.js +1 -1
  81. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_email_page_tsx_0gv3qni._.js +1 -1
  82. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_lib_api_ts_1ffelwp._.js +1 -1
  83. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
  84. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
  85. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
  86. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
  87. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +106 -104
  88. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +173 -105
  89. package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +6 -6
  90. package/bundled/ws-do/index.js +36 -17
  91. package/package.json +1 -1
  92. package/bundled/web/.open-next/assets/_next/static/chunks/0pd5shecdv7w3.js +0 -1
  93. package/bundled/web/.open-next/assets/_next/static/chunks/168g60th5ox02.js +0 -63
  94. package/bundled/web/.open-next/assets/_next/static/chunks/184t7di0k1wt-.js +0 -3
  95. package/bundled/web/.open-next/assets/_next/static/chunks/1ox78wqeeqant.js +0 -1
  96. package/bundled/web/.open-next/assets/_next/static/chunks/38j_4uwfj09mb.js +0 -1
  97. package/bundled/web/.open-next/assets/_next/static/chunks/3bfk44a51kg4q.js +0 -1
  98. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0qy7lt2._.js +0 -3
  99. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/1b4r_lucide-react_dist_esm_icons_0u7bkx8._.js +0 -3
  100. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_meetings_page_tsx_0ciapb3._.js +0 -3
  101. /package/bundled/web/.open-next/assets/_next/static/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/_buildManifest.js +0 -0
  102. /package/bundled/web/.open-next/assets/_next/static/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/_clientMiddlewareManifest.js +0 -0
  103. /package/bundled/web/.open-next/assets/_next/static/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/_ssgManifest.js +0 -0
  104. /package/bundled/web/.open-next/cache/{LwRrk9IiQO-kR73n2jKLg → VmFOnIGsnimmwjDQLrNlX}/robots.txt.cache +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,129396,e=>{"use strict";var t=e.i(653772),s=e.i(511043),n=e.i(126942),i=e.i(500324),a=e.i(355578),l=e.i(222862);e.i(954194);var r=e.i(439769),o=e.i(186339),d=e.i(393153),c=e.i(720115),u=e.i(941693),m=e.i(37476),x=e.i(16770),h=e.i(928059),p=e.i(729432),f=p.Extension.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(s=>t.updateAttributes(s,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:s})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?s.unsetTextAlign():s.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),g=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,j=p.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,p.mergeAttributes)(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,s,n,i,a,l;let r=null!=(s=null==(t=e.attrs)?void 0:t.src)?s:"",o=null!=(i=null==(n=e.attrs)?void 0:n.alt)?i:"",d=null!=(l=null==(a=e.attrs)?void 0:a.title)?l:"";return d?`![${o}](${r} "${d}")`:`![${o}](${r})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:e,minWidth:t,minHeight:s,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:l,editor:r})=>{let o=document.createElement("img");o.draggable=!1;let d=(0,p.mergeAttributes)(this.options.HTMLAttributes,l);Object.entries(d).forEach(([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:o.setAttribute(e,t)}}),null!==d.src&&(o.src=d.src);let c=new p.ResizableNodeView({element:o,editor:r,node:i,getPos:a,onResize:(e,t)=>{o.style.width=`${e}px`,o.style.height=`${t}px`},onCommit:(e,t)=>{let s=a();void 0!==s&&this.editor.chain().setNodeSelection(s).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,s)=>e.type===i.type,options:{directions:e,min:{width:t,height:s},preserveAspectRatio:!0===n}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",o.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,p.nodeInputRule)({find:g,type:this.type,getAttributes:e=>{let[,,t,s,n]=e;return{src:s,alt:t,title:n}}})]}}),b=e.i(613349),y=e.i(329686),v=e.i(779646),N=e.i(903477),k=e.i(419412);let w=(0,k.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),z=(0,k.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),A=(0,k.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),T=(0,k.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),C=(0,k.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"}]]),M=(0,k.default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]),S=(0,k.default)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),H=(0,k.default)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]]),B=(0,k.default)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]]),R=(0,k.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=(0,k.default)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),L=(0,k.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"}]]),_=(0,k.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),$=(0,k.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);var D=e.i(573404),D=D;function I({active:e,disabled:s,onAction:n,title:i,children:a}){return(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",disabled:s,onMouseDown:e=>e.preventDefault(),onClick:n,className:(0,b.cn)("text-muted-foreground/70",e&&"bg-accent text-foreground")}),children:a}),(0,t.jsx)(y.TooltipContent,{children:i})]})}function F(){return(0,t.jsx)("div",{className:"w-px h-4 bg-border/60 mx-0.5 shrink-0"})}function P({editor:e}){let[,n]=(0,s.useReducer)(e=>e+1,0),[i,a]=(0,s.useState)(!1),[l,r]=(0,s.useState)("link"),[d,c]=(0,s.useState)(""),[u,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(""),[p,f]=(0,s.useState)(!1),g=(0,s.useRef)(null),j=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{if(!e)return;let t=()=>n();return e.on("transaction",t),()=>{e.off("transaction",t)}},[e]),(0,s.useEffect)(()=>{i&&setTimeout(()=>g.current?.focus(),0)},[i]),!e)return null;let k="size-3.5",O=()=>{let t=d.trim();if(t){try{new URL(t)}catch{m("Please enter a valid URL");return}if(m(""),"link"===l)if(p){let s=x.trim()||t;e.chain().focus().insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:t}}]}).run()}else e.chain().focus().extendMarkRange("link").setLink({href:t}).run();else e.chain().focus().setImage({src:t}).run();a(!1)}};return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1 overflow-x-auto",children:[(0,t.jsx)(I,{title:"Bold",active:e.isActive("bold"),onAction:()=>e.chain().focus().toggleBold().run(),children:(0,t.jsx)(w,{className:k})}),(0,t.jsx)(I,{title:"Italic",active:e.isActive("italic"),onAction:()=>e.chain().focus().toggleItalic().run(),children:(0,t.jsx)(z,{className:k})}),(0,t.jsx)(I,{title:"Underline",active:e.isActive("underline"),onAction:()=>e.chain().focus().toggleUnderline().run(),children:(0,t.jsx)(A,{className:k})}),(0,t.jsx)(I,{title:"Strikethrough",active:e.isActive("strike"),onAction:()=>e.chain().focus().toggleStrike().run(),children:(0,t.jsx)(T,{className:k})}),(0,t.jsx)(F,{}),(0,t.jsx)(I,{title:"Heading 1",active:e.isActive("heading",{level:1}),onAction:()=>e.chain().focus().toggleHeading({level:1}).run(),children:(0,t.jsx)(_,{className:k})}),(0,t.jsx)(I,{title:"Heading 2",active:e.isActive("heading",{level:2}),onAction:()=>e.chain().focus().toggleHeading({level:2}).run(),children:(0,t.jsx)($,{className:k})}),(0,t.jsx)(F,{}),(0,t.jsx)(I,{title:"Bullet List",active:e.isActive("bulletList"),onAction:()=>e.chain().focus().toggleBulletList().run(),children:(0,t.jsx)(C,{className:k})}),(0,t.jsx)(I,{title:"Ordered List",active:e.isActive("orderedList"),onAction:()=>e.chain().focus().toggleOrderedList().run(),children:(0,t.jsx)(M,{className:k})}),(0,t.jsx)(F,{}),(0,t.jsx)(I,{title:"Align Left",active:e.isActive({textAlign:"left"}),onAction:()=>e.chain().focus().setTextAlign("left").run(),children:(0,t.jsx)(S,{className:k})}),(0,t.jsx)(I,{title:"Align Center",active:e.isActive({textAlign:"center"}),onAction:()=>e.chain().focus().setTextAlign("center").run(),children:(0,t.jsx)(H,{className:k})}),(0,t.jsx)(I,{title:"Align Right",active:e.isActive({textAlign:"right"}),onAction:()=>e.chain().focus().setTextAlign("right").run(),children:(0,t.jsx)(B,{className:k})}),(0,t.jsx)(F,{}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onMouseDown:t=>{t.preventDefault(),j.current=e.isActive("link")},onClick:()=>{j.current?e.chain().focus().unsetLink().run():(r("link"),c(""),m(""),h(""),f(e.state.selection.empty),a(!0))},className:(0,b.cn)("text-muted-foreground/70",e.isActive("link")&&"bg-accent text-foreground")}),children:e.isActive("link")?(0,t.jsx)(E,{className:k}):(0,t.jsx)(R,{className:k})}),(0,t.jsx)(y.TooltipContent,{children:e.isActive("link")?"Remove Link":"Insert Link"})]}),(0,t.jsx)(I,{title:"Insert Image",onAction:()=>{r("image"),c(""),m(""),a(!0)},children:(0,t.jsx)(L,{className:k})}),(0,t.jsx)(F,{}),(0,t.jsx)(I,{title:"Horizontal Rule",onAction:()=>e.chain().focus().setHorizontalRule().run(),children:(0,t.jsx)(D.default,{className:k})}),(0,t.jsx)(v.Dialog,{open:i,onOpenChange:a,children:(0,t.jsxs)(v.DialogContent,{children:[(0,t.jsx)(v.DialogHeader,{children:(0,t.jsx)(v.DialogTitle,{children:"link"===l?"Insert Link":"Insert Image"})}),"link"===l&&p&&(0,t.jsx)(N.Input,{ref:g,value:x,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O()},placeholder:"Display text"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(N.Input,{ref:"image"!==l&&p?void 0:g,value:d,onChange:e=>{c(e.target.value),m("")},onKeyDown:e=>{"Enter"===e.key&&O()},placeholder:"link"===l?"https://example.com":"https://example.com/image.png",type:"url","aria-invalid":!!u}),u&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:u})]}),(0,t.jsx)(v.DialogFooter,{children:(0,t.jsx)(o.Button,{onClick:O,disabled:!d.trim(),children:"Insert"})})]})})]})}var O=e.i(516266),U=e.i(392277),q=e.i(692670),V=e.i(945074),K=e.i(966662),W=e.i(492451);function G({fromAddress:n,onSend:i,onDiscard:a,initialTo:l="",initialSubject:r="",initialBody:d="",initialAttachments:p=[],inReplyTo:g,references:b}){let[v,k]=(0,s.useState)(l),[w,z]=(0,s.useState)(r),[A,T]=(0,s.useState)(!1),[C,M]=(0,s.useState)(p),[S,H]=(0,s.useState)(!1),B=(0,s.useRef)(null),R=(0,c.useEditor)({immediatelyRender:!1,content:d||void 0,extensions:[u.default.configure({link:!1,underline:!1}),m.default.configure({placeholder:"Write your email..."}),x.default,h.default.configure({autolink:!0,openOnClick:!1,linkOnPaste:!0}),f.configure({types:["heading","paragraph"]}),j.configure({inline:!0,allowBase64:!0})],editorProps:{attributes:{class:"text-sm max-w-none focus:outline-none min-h-50 px-4 py-3"}}}),E=async()=>{if(v.trim()&&w.trim()&&R){T(!0);try{let e=R.getHTML();await i(v.trim(),w.trim(),e,C,g||b?{inReplyTo:g,references:b}:void 0)&&(k(""),z(""),M([]),R.commands.clearContent())}finally{T(!1)}}},L=async t=>{let s=t.target.files;if(s&&0!==s.length){H(!0);try{let{uploadEmailAttachment:t}=await e.A(302482);for(let e of Array.from(s)){if(e.size>0xa00000){O.toast.error(`${e.name} exceeds 10 MB limit`);continue}let s=new URLSearchParams(window.location.search).get("workspace_id")??"",n=await t(e,s);M(e=>[...e,n])}}catch{O.toast.error("Failed to upload attachment")}finally{H(!1),B.current&&(B.current.value="")}}};return(0,t.jsxs)("div",{className:"flex flex-col h-full w-full min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border/40 px-4 py-2",children:[(0,t.jsx)("h3",{className:"text-sm font-heading font-medium tracking-tight",children:"New Email"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(o.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-7 px-2",onClick:a,disabled:A,children:[(0,t.jsx)(q.X,{className:"size-3 mr-1"}),"Discard"]}),(0,t.jsxs)(o.Button,{size:"sm",className:"text-xs h-7 px-3",onClick:E,disabled:A||!v.trim()||!w.trim(),children:[A?(0,t.jsx)(V.Loader2,{className:"size-3 mr-1 animate-spin"}):(0,t.jsx)(U.Send,{className:"size-3 mr-1"}),"Send"]})]})]}),(0,t.jsxs)("div",{className:"border-b border-border/30 px-4 py-2.5 space-y-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,t.jsx)("span",{className:"text-muted-foreground truncate min-w-0",children:n})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,t.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,t.jsx)(N.Input,{type:"email",value:v,onChange:e=>k(e.target.value),placeholder:"recipient@example.com",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"Subject"}),(0,t.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,t.jsx)(N.Input,{value:w,onChange:e=>z(e.target.value),placeholder:"Email subject",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]})]}),(0,t.jsxs)("div",{className:"flex items-center border-b border-border/30",children:[(0,t.jsx)(P,{editor:R}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 border-l border-border/30",children:[(0,t.jsx)("input",{ref:B,type:"file",multiple:!0,className:"hidden",onChange:L}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",disabled:S,onMouseDown:e=>e.preventDefault(),onClick:()=>B.current?.click(),className:"text-muted-foreground/70"}),children:S?(0,t.jsx)(V.Loader2,{className:"size-3.5 animate-spin"}):(0,t.jsx)(K.Paperclip,{className:"size-3.5"})}),(0,t.jsx)(y.TooltipContent,{children:"Attach file"})]})]})]}),C.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 py-2 border-b border-border/30",children:C.map(e=>{var s;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs",children:[(0,t.jsx)(W.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"truncate max-w-37.5",children:e.filename}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0",children:(s=e.size)<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}),(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.key,void M(e=>e.filter(e=>e.key!==t))},className:"text-muted-foreground hover:text-foreground ml-0.5 cursor-pointer",children:(0,t.jsx)(q.X,{className:"size-3"})})]},e.key)})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto thin-scrollbar",children:(0,t.jsx)(c.EditorContent,{editor:R})})]})}var X=e.i(728886),J=e.i(967723),Q=e.i(896210),Y=e.i(46464),Z=e.i(947308),ee=e.i(813141);let et=(0,k.default)("forward",[["path",{d:"m15 17 5-5-5-5",key:"nf172w"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]),es=(0,k.default)("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);var en=e.i(330746),ei=e.i(353155);let ea=(0,k.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var el=e.i(584761),er=e.i(205189),eo=e.i(996718),ed=e.i(888917),ec=e.i(940931);function eu(e){let t=new Date(e),s=Math.floor((new Date().getTime()-t.getTime())/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let n=Math.floor(s/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return i<7?`${i}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}e.s(["default",0,function(){let e=(0,n.useParams)().id,{workspaceId:c}=(0,i.useWorkspace)(),{agents:u,subscribeWs:m}=(0,a.useAgentContext)(),x=u.find(t=>t.id===e),h=(0,eo.useIsMobile)(),[p,f]=(0,s.useState)("inbox"),[g,j]=(0,s.useState)([]),v=(0,s.useMemo)(()=>g.filter(e=>"unread"===e.status).length,[g]),[N,k]=(0,s.useState)(!0),[w,z]=(0,s.useState)(null),[A,T]=(0,s.useState)(null),[C,M]=(0,s.useState)(!1),[S,H]=(0,s.useState)(!1),[B,R]=(0,s.useState)({}),[E,L]=(0,s.useState)([]),[_,$]=(0,s.useState)(null),[D,I]=(0,s.useState)({}),[F,P]=(0,s.useState)(!1),[q,em]=(0,s.useState)(null),[ex,eh]=(0,s.useState)(!1),[ep,ef]=(0,s.useState)([]),[eg,ej]=(0,s.useState)(!1),eb=(0,s.useCallback)(e=>{f(e),j([]),z(null),T(null),H(!1)},[]),ey=x?.email_handle?(0,r.toAlookAddress)(x.email_handle):"",ev=[...ey?[{type:"alook",address:ey}]:[],...ep.map(e=>({type:"custom",address:e.email_address,accountId:e.id}))],[eN,ek]=(0,s.useState)(0),ew=ev[eN]??ev[0]??null,ez=ew?.address??"",eA=ew?.type==="custom"?ew.accountId:void 0,eT=g.find(e=>e.id===w)??null,eC=(0,s.useCallback)(async(t,s)=>{k(!0);try{let n=await (0,l.listEmails)(e,c,t,s);j(n)}catch{O.toast.error("Failed to load emails")}finally{k(!1)}},[e,c]);(0,s.useEffect)(()=>{(0,l.listEmailAccounts)(e,c).then(ef).catch(()=>{})},[e,c]),(0,s.useEffect)(()=>{eC(p,ez)},[p,ez,eC]),(0,s.useEffect)(()=>m(t=>{"email.received"===t.type&&t.agentId===e?((0,er.trackEmailReceived)({agent_id:e,mailbox_type:ew?.type==="custom"?"imap":"alook"}),eC(p,ez)):"email.sent"===t.type&&t.agentId===e&&eC(p,ez)}),[m,e,p,ez,eC,ew?.type]);let eM=async e=>{H(!1),z(e),T(null),M(!0),L([]),$(null),I({});try{let[t,s]=await Promise.all([(0,l.getEmailBody)(e,c),(0,l.getEmailThread)(e,c).catch(()=>[])]);T(t),L(s);let n=g.find(t=>t.id===e);n&&"unread"===n.status&&(0,l.updateEmailStatus)(e,c,"read").then(()=>{j(t=>t.map(t=>t.id===e?{...t,status:"read"}:t))}).catch(()=>{j(t=>t.map(t=>t.id===e?{...t,status:"unread"}:t))})}catch{T({content:"(body not available)",isHtml:!1})}finally{M(!1)}},eS=async e=>{if(_===e)return void $(null);if($(e),!D[e])try{let t=await (0,l.getEmailBody)(e,c);I(s=>({...s,[e]:t}))}catch{I(t=>({...t,[e]:{content:"(body not available)",isHtml:!1}}))}},eH=async()=>{if(q){eh(!0);try{await (0,l.deleteEmail)(q,c),j(e=>e.filter(e=>e.id!==q)),w===q&&(z(null),T(null)),O.toast.success("Email deleted")}catch{O.toast.error("Failed to delete email")}finally{eh(!1),P(!1),em(null)}}},eB=async(t,s,n,i,a)=>{try{return await (0,l.sendEmail)(e,t,s,n,c,i.length>0?i:void 0,a,eA),(0,er.trackEmailComposed)({agent_id:e,has_attachments:i.length>0}),O.toast.success("Email sent"),H(!1),eb("sent"),!0}catch{return O.toast.error("Failed to send email"),!1}},eR=e=>`<br/><br/><div style="border-left: 2px solid #ccc; padding-left: 12px; margin-left: 0; color: #666;"><p><strong>From:</strong> ${e.from_email}<br/><strong>To:</strong> ${e.to_email}<br/><strong>Date:</strong> ${new Date(e.created_at).toLocaleString()}<br/><strong>Subject:</strong> ${e.subject}</p>`+(e.html_body?e.html_body:A?.isHtml?A.content:`<pre>${A?.content??""}</pre>`)+"</div>",eE=e=>({inReplyTo:e.message_id||void 0,references:[e.references,e.message_id].filter(Boolean).join(" ").trim()||void 0}),[eL,e_]=(0,s.useState)(!1),e$=async()=>{if(ez)try{await navigator.clipboard.writeText(ez),e_(!0),setTimeout(()=>e_(!1),1500)}catch{O.toast.error("Failed to copy")}},eD=(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[ev.length>0?(0,t.jsx)("div",{className:"px-3 pt-3 pb-1 relative",children:1===ev.length?(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsxs)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:e$,className:"group flex items-center gap-1.5 text-left cursor-pointer w-full"}),children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ez}),eL?(0,t.jsx)(ei.Check,{className:"size-2.5 text-green-500 shrink-0"}):(0,t.jsx)(en.Copy,{className:"size-2.5 text-muted-foreground/0 group-hover:text-muted-foreground/60 shrink-0 transition-colors"})]}),(0,t.jsx)(y.TooltipContent,{children:"Click to copy"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 w-full",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>ej(!eg),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ez}),(0,t.jsx)(el.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:e$,className:"shrink-0 p-0.5"}),children:eL?(0,t.jsx)(ei.Check,{className:"size-2.5 text-green-500"}):(0,t.jsx)(en.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,t.jsx)(y.TooltipContent,{children:"Copy address"})]})]}),eg&&(0,t.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:ev.map((e,s)=>(0,t.jsxs)("button",{type:"button",onClick:()=>{ek(s),ej(!1)},className:(0,b.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",s===eN?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,t.jsx)(Q.Mail,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.address}),"custom"===e.type&&(0,t.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},e.address))})]})}):(0,t.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"No email configured"})}),(0,t.jsx)("div",{className:"p-2",children:(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsxs)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{size:"sm",className:"w-full justify-start text-xs h-8 gap-1.5",onClick:()=>{R({}),H(!0),z(null)},disabled:0===ev.length}),children:[(0,t.jsx)(Z.Plus,{className:"size-3.5"}),"New Email"]}),(0,t.jsx)(y.TooltipContent,{children:0===ev.length?"Configure an email in agent settings to send emails":"Compose new email"})]})}),(0,t.jsxs)("nav",{className:"flex flex-col gap-0.5 px-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>eb("inbox"),className:(0,b.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","inbox"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,t.jsx)(Y.Inbox,{className:"size-4 shrink-0"}),"Inbox","inbox"===p&&v>0&&(0,t.jsx)("span",{className:"ml-auto text-xs bg-blue-500 text-white rounded-full px-1.5 py-0.5 leading-none min-w-5 text-center",children:v})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>eb("sent"),className:(0,b.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","sent"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,t.jsx)(U.Send,{className:"size-4 shrink-0"}),"Sent"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>eb("untrust"),className:(0,b.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","untrust"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,t.jsx)(ea,{className:"size-4 shrink-0"}),"Untrust"]})]})]}),eI=(0,t.jsx)("div",{className:(0,b.cn)("h-full thin-scrollbar",g.length>0&&!N?"overflow-y-auto":"overflow-hidden"),children:N?(0,t.jsx)(t.Fragment,{children:Array.from({length:3}).map((e,s)=>(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-border/30",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[(0,t.jsx)(X.Skeleton,{className:"h-3.5 w-32"}),(0,t.jsx)(X.Skeleton,{className:"h-2.5 w-10"})]}),(0,t.jsx)(X.Skeleton,{className:"h-3.5 w-48 mb-1.5"}),(0,t.jsx)(X.Skeleton,{className:"h-4 w-16 rounded-full"})]},s))}):0===g.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full animate-[fade-up_400ms_ease-out_both]",children:[(0,t.jsx)(Q.Mail,{className:"size-8 text-muted-foreground mb-3"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"inbox"===p?"No emails from trusted senders":"sent"===p?"No emails sent yet":"No untrusted emails"})]}):g.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>eM(e.id),className:(0,b.cn)("w-full text-left px-4 py-3 border-b border-border/30 transition-colors duration-150 cursor-pointer",w===e.id?"bg-accent/60":"hover:bg-accent/30"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[(0,t.jsx)("p",{className:(0,b.cn)("text-sm truncate","unread"===e.status?"font-semibold":"font-medium text-muted-foreground"),children:"sent"===p?e.to_email:e.from_email}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:["sent"!==p&&(0,t.jsx)("span",{className:(0,b.cn)("text-[10px] rounded-full px-1.5 py-0.5 leading-none font-medium","unread"===e.status?"bg-blue-500/15 text-blue-600 dark:text-blue-400":"bg-muted text-muted-foreground"),children:"unread"===e.status?"unread":"read"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:eu(e.created_at)})]})]}),(0,t.jsx)("p",{className:(0,b.cn)("text-[13px] truncate","unread"===e.status?"text-foreground":"text-muted-foreground"),children:e.subject||"(no subject)"})]},e.id))}),eF=(0,t.jsx)("div",{className:"h-full overflow-auto flex flex-col min-w-0 thin-scrollbar",children:S?(0,t.jsx)(G,{fromAddress:ez,onSend:eB,onDiscard:()=>{H(!1),R({})},initialTo:B.to,initialSubject:B.subject,initialBody:B.body,initialAttachments:B.attachments,inReplyTo:B.inReplyTo,references:B.references},JSON.stringify(B)):eT?(0,t.jsxs)("div",{className:"flex flex-col h-full md:min-w-100 max-w-3xl mx-auto w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5 border-b border-border/40 px-4 py-1.5",children:["sent"!==p&&(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let e;return e=eT.subject.startsWith("Re:")?eT.subject:`Re: ${eT.subject}`,void(z(null),R({to:eT.from_email,subject:e,body:eR(eT),...eE(eT)}),H(!0))}}),children:(0,t.jsx)(es,{className:"size-3.5"})}),(0,t.jsx)(y.TooltipContent,{children:"Reply"})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let e;return e=eT.subject.startsWith("Fwd:")?eT.subject:`Fwd: ${eT.subject}`,void(z(null),R({subject:e,body:eR(eT),attachments:eT.attachments??[],...eE(eT)}),H(!0))}}),children:(0,t.jsx)(et,{className:"size-3.5"})}),(0,t.jsx)(y.TooltipContent,{children:"Forward"})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-destructive",onClick:()=>{em(eT.id),P(!0)}}),children:(0,t.jsx)(ee.Trash2,{className:"size-3.5"})}),(0,t.jsx)(y.TooltipContent,{children:"Delete"})]})]}),E.length>0&&(0,t.jsx)("div",{className:"border-b border-border/30",children:E.map(e=>(0,t.jsxs)("div",{className:"border-b border-border/20 last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>eS(e.id),className:"w-full flex items-center gap-2 px-5 py-2.5 text-left hover:bg-accent/30 transition-colors cursor-pointer",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:_===e.id?"▾":"▸"}),(0,t.jsx)("span",{className:"text-sm font-medium truncate flex-1",children:e.from_email}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:eu(e.created_at)})]}),_===e.id&&(0,t.jsxs)("div",{className:"px-5 pb-3",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:e.subject}),D[e.id]?D[e.id].isHtml?(0,t.jsx)(ec.EmailBodyFrame,{html:D[e.id].content,className:"max-w-full text-sm"}):(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:D[e.id].content}):(0,t.jsx)(V.Loader2,{className:"size-3 animate-spin text-muted-foreground"})]})]},e.id))}),(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsx)("h2",{className:"text-lg font-heading font-semibold tracking-tight mb-1",children:eT.subject||"(no subject)"}),(0,t.jsxs)("div",{className:"text-sm space-y-1 mb-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,t.jsx)("span",{children:eT.from_email})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,t.jsx)("span",{children:eT.to_email})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"sent"===p?"Sent":"Received"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:new Date(eT.created_at).toLocaleString()})]})]}),C?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(V.Loader2,{className:"size-4 animate-spin text-muted-foreground"})}):eT.html_body?(0,t.jsx)(ec.EmailBodyFrame,{html:eT.html_body,className:"max-w-full"}):A?.isHtml?(0,t.jsx)(ec.EmailBodyFrame,{html:A.content,className:"max-w-full"}):(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:A?.content}),eT.attachments&&eT.attachments.length>0&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-muted-foreground",children:[(0,t.jsx)(K.Paperclip,{className:"size-3"}),eT.attachments.length," attachment",eT.attachments.length>1?"s":""]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eT.attachments.map((e,s)=>(0,t.jsxs)("a",{href:`/api/email/${eT.id}/attachment/${s}?workspace_id=${c}`,target:"_blank",rel:"noopener noreferrer",download:e.filename,className:"flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/50 px-2.5 py-1.5 text-xs hover:bg-muted transition-colors cursor-pointer",children:[(0,t.jsx)(W.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"truncate max-w-45",children:e.filename}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0",children:e.size<1024?`${e.size} B`:e.size<1048576?`${(e.size/1024).toFixed(1)} KB`:`${(e.size/1048576).toFixed(1)} MB`})]},e.key))})]})]})]}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select an email to view"})}),eP=S?(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{H(!1),R({})},children:(0,t.jsx)(J.ArrowLeft,{className:"size-4"})}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"New Email"})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:eF})]}):w&&eT?(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{z(null),T(null)},children:(0,t.jsx)(J.ArrowLeft,{className:"size-4"})}),(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:eT.subject||"(no subject)"})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:eF})]}):(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[ev.length>1&&(0,t.jsxs)("div",{className:"relative px-3 pt-2 pb-1 border-b border-border/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>ej(!eg),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ez}),(0,t.jsx)(el.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:e$,className:"shrink-0 p-0.5"}),children:eL?(0,t.jsx)(ei.Check,{className:"size-2.5 text-green-500"}):(0,t.jsx)(en.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,t.jsx)(y.TooltipContent,{children:"Copy address"})]})]}),eg&&(0,t.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:ev.map((e,s)=>(0,t.jsxs)("button",{type:"button",onClick:()=>{ek(s),ej(!1)},className:(0,b.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",s===eN?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,t.jsx)(Q.Mail,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.address}),"custom"===e.type&&(0,t.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},e.address))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 border-b border-border/50 px-3 py-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-0.5 flex-1 min-w-0",children:[{id:"inbox",label:"Inbox"},{id:"sent",label:"Sent"},{id:"untrust",label:"Untrust"}].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>eb(e.id),className:(0,b.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",p===e.id?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,"inbox"===e.id&&"inbox"===p&&v>0&&(0,t.jsx)("span",{className:"ml-0.5 text-[10px] bg-blue-500 text-white rounded-full px-1 leading-none min-w-4 text-center",children:v})]},e.id))}),(0,t.jsx)(o.Button,{size:"icon-sm",variant:"ghost",onClick:()=>{R({}),H(!0),z(null)},disabled:0===ev.length,children:(0,t.jsx)(Z.Plus,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:eI})]});return(0,t.jsxs)(t.Fragment,{children:[h?eP:(0,t.jsxs)(ed.ResizablePanelGroup,{orientation:"horizontal",children:[(0,t.jsx)(ed.ResizablePanel,{defaultSize:"15%",minSize:"10%",maxSize:"20%",children:eD}),(0,t.jsx)(ed.ResizableHandle,{withHandle:!0}),(0,t.jsx)(ed.ResizablePanel,{defaultSize:"30%",minSize:"15%",maxSize:"40%",children:eI}),(0,t.jsx)(ed.ResizableHandle,{withHandle:!0}),(0,t.jsx)(ed.ResizablePanel,{defaultSize:"55%",minSize:"25%",children:eF})]}),(0,t.jsx)(d.ConfirmDialog,{open:F,onOpenChange:P,title:"Delete email",description:"This will permanently delete this email.",loading:ex,onConfirm:eH})]})}],129396)}]);
@@ -1,63 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,275351,e=>{"use strict";let t,a,r,n,i=(e,t)=>t.some(t=>e instanceof t),s=new WeakMap,o=new WeakMap,l=new WeakMap,c={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return d(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("success",n),e.removeEventListener("error",i)},n=()=>{t(d(e.result)),r()},i=()=>{a(e.error),r()};e.addEventListener("success",n),e.addEventListener("error",i)}),l.set(t,e),t}if(o.has(e))return o.get(e);let t=function(e){if("function"==typeof e)return(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(u(this),t),d(this.request)}:function(...t){return d(e.apply(u(this),t))};return(e instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,a)=>{let r=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",i),e.removeEventListener("abort",i)},n=()=>{t(),r()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",n),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(e),i(e,r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,c):e}(e);return t!==e&&(o.set(e,t),l.set(t,e)),t}let u=e=>l.get(e),p=["get","getKey","getAll","getAllKeys","count"],m=["put","add","delete","clear"],g=new Map;function f(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(g.get(t))return g.get(t);let a=t.replace(/FromIndex$/,""),r=t!==a,n=m.includes(a);if(!(a in(r?IDBIndex:IDBObjectStore).prototype)||!(n||p.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,n?"readwrite":"readonly"),s=i.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[a](...t),n&&i.done]))[0]};return g.set(t,i),i}c={...t=c,get:(e,a,r)=>f(e,a)||t.get(e,a,r),has:(e,a)=>!!f(e,a)||t.has(e,a)};let h=["continue","continuePrimaryKey","advance"],y={},b=new WeakMap,w=new WeakMap,v={get(e,t){if(!h.includes(t))return e[t];let a=y[t];return a||(a=y[t]=function(...e){b.set(this,w.get(this)[t](...e))}),a}};async function*$(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,v);for(w.set(a,t),l.set(a,u(t));t;)yield a,t=await (b.get(a)||t.continue()),b.delete(a)}function k(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}c={...a=c,get:(e,t,r)=>k(e,t)?$:a.get(e,t,r),has:(e,t)=>k(e,t)||a.has(e,t)};let x=null,S=null;function E(e){return"u"<typeof indexedDB?null:x&&S===e?x:(S=e,x=function(e,{blocked:t,upgrade:a,blocking:r,terminated:n}={}){let i=indexedDB.open(e,4),s=d(i);return a&&i.addEventListener("upgradeneeded",e=>{a(d(i.result),e.oldVersion,e.newVersion,d(i.transaction),e)}),t&&i.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),s.then(e=>{n&&e.addEventListener("close",()=>n()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(`alook-chat-cache-${e}`,{upgrade(e,t){if(t<1){let t=e.createObjectStore("messages",{keyPath:["conversation_id","id"]});t.createIndex("by-conversation","conversation_id",{unique:!1}),t.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),e.createObjectStore("cache_meta",{keyPath:"conversation_id"})}t<3&&e.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),t<4&&e.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function _(e){return e?E(e):x}async function C(e,t){let a=_(t);if(!a)return null;try{let t=await a,r=await t.getAllFromIndex("messages","by-conversation",e);if(0===r.length)return null;let n=r.filter(e=>!e.id.startsWith("temp-"));n.sort((e,t)=>{let a=e.created_at.localeCompare(t.created_at);return 0!==a?a:e.id.localeCompare(t.id)});let i=await t.get("cache_meta",e);return i&&await t.put("cache_meta",{...i,lastAccessedAt:Date.now()}),n}catch{return null}}async function T(e,t,a,r,n){let i=_(n);if(!i)return null;try{let n=await i,s=await n.get("cache_meta",e);if(!s)return null;let o=IDBKeyRange.bound([e,""],[e,t],!1,!1),l=(await n.getAllFromIndex("messages","by-created",o)).filter(e=>!e.id.startsWith("temp-")&&(e.created_at!==t||!(e.id>=a)));l.sort((e,t)=>{let a=t.created_at.localeCompare(e.created_at);return 0!==a?a:t.id.localeCompare(e.id)});let c=l.slice(0,r);if(c.length<r&&s.hasMore)return null;return await n.put("cache_meta",{...s,lastAccessedAt:Date.now()}),{messages:c.reverse(),hasMore:l.length>r||s.hasMore}}catch{return null}}async function I(e,t,a,r,n){let i=_(r);if(i)try{let r=await i,s=t.filter(e=>!e.id.startsWith("temp-"));if(0===s.length)return;let o=r.transaction(["messages","cache_meta"],"readwrite"),l=o.objectStore("messages"),c=o.objectStore("cache_meta");for(let e of s)await l.put(e);let d=await l.index("by-conversation").getAllKeys(e),u=Date.now(),p=s.reduce((e,t)=>e.created_at>t.created_at?e:t),m=await c.get(e),g=a??m?.hasMore??!0,f=m?.newestMessageId&&m.newestMessageId!==p.id?await (async()=>{let t=await l.get([e,m.newestMessageId]);return t&&t.created_at>p.created_at?t.id:p.id})():p.id,h={conversation_id:e,lastFetchedAt:u,lastAccessedAt:u,messageCount:d.length,newestMessageId:f,hasMore:g,serverMessageCount:n??m?.serverMessageCount??0};await c.put(h),await o.done,L().catch(()=>{})}catch{}}async function j(e,t,a){let r=_(a);if(r&&!t.id.startsWith("temp-"))try{let a=await r,n=await a.get("cache_meta",e);if(!n)return;let i=await a.get("messages",[e,t.id]);await a.put("messages",t),await a.put("cache_meta",{...n,lastAccessedAt:Date.now(),messageCount:i?n.messageCount:n.messageCount+1,newestMessageId:t.id})}catch{}}async function M(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("cache_meta",e)??null}catch{return null}}function A(e,t){return`${e}::${null==t?"":t}`}async function N(e,t,a){let r=_(a);if(!r)return null;try{let a=await r;return await a.get("last_open",A(e,t))??null}catch{return null}}async function O(e,t,a,r){let n=_(r);if(n)try{let r=await n;await r.put("last_open",{key:A(e,t),conversation_id:a.conversation_id,newestMessageId:a.newestMessageId,serverMessageCount:a.serverMessageCount,updatedAt:Date.now()})}catch{}}async function P(e,t){let a=_(t);if(!a)return null;try{let t=await a;return await t.get("conv_extras",e)??null}catch{return null}}async function D(e,t,a){let r=_(a);if(r)try{let a=await r;await a.put("conv_extras",{conversation_id:e,...t,updatedAt:Date.now()})}catch{}}async function L(e=50){let t=_();if(t)try{let a=await t,r=await a.getAll("cache_meta");if(r.length<=e)return;r.sort((e,t)=>e.lastAccessedAt-t.lastAccessedAt);let n=r.slice(0,r.length-e),i=a.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),s=i.objectStore("messages"),o=i.objectStore("cache_meta"),l=i.objectStore("last_open"),c=i.objectStore("conv_extras");for(let e of n){for(let t of(await s.index("by-conversation").getAllKeys(e.conversation_id)))await s.delete(t);for(let t of(await o.delete(e.conversation_id),await l.index("by-conversation").getAllKeys(e.conversation_id)))await l.delete(t);await c.delete(e.conversation_id)}await i.done}catch{}}async function B(){if("u">typeof indexedDB)try{x&&((await x).close(),x=null),S&&(await R(`alook-chat-cache-${S}`),S=null)}catch{}}async function R(e){return new Promise((t,a)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>a(r.error),r.onblocked=()=>t()})}e.s(["appendCachedMessage",0,j,"clearAllCache",0,B,"getCacheMeta",0,M,"getCachedMessages",0,C,"getCachedMessagesBefore",0,T,"getConvExtras",0,P,"getLastOpenConversation",0,N,"mergeCachedMessages",0,I,"openCacheDB",0,E,"setConvExtras",0,D,"setLastOpenConversation",0,O],275351)},345262,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["ArrowUpRight",0,t],345262)},500324,e=>{"use strict";var t=e.i(653772),a=e.i(511043);let r=(0,a.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:n,children:i}){return(0,a.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",n)}catch{}},[n]),(0,t.jsx)(r.Provider,{value:{workspaceId:e,slug:n},children:i})},"useWorkspace",0,function(){let e=(0,a.useContext)(r);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},126942,(e,t,a)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class a extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function r(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),r=a.join(":").trim();if(!r)return e;let n=t.trim(),i=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=r.replace(/^required$/i,"is required"),o=s.toLowerCase().replace(/[_-]+/g," "),l=n.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(s=s.slice(n.length).trimStart()),i?`${i} ${s}`:s}(t[0]):e}async function n(e,t){let n;try{n=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!n.ok){let e,t;try{let a=await n.json();e=a.error,t=a.details}catch{}if(429===n.status)throw new a("Please wait a moment before trying again",429);if(n.status>=500)throw new a(r(e,t)||"Something went wrong — please try again",n.status,t);throw new a(r(e,t)||"Something went wrong",n.status,t)}if(204!==n.status)return n.json()}function i(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,a],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,r,s,o)=>{let l;if(!s||0===s.length)return n(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let c=new FormData;for(let e of(c.append("content",t),o&&c.append("metadata",JSON.stringify(o)),s))c.append("file",e);try{l=await fetch(`/api/conversations/${e}/messages${i(r)}`,{method:"POST",credentials:"include",body:c})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===l.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!l.ok){let e,t;try{let a=await l.json();e=a.error,t=a.details}catch{}if(429===l.status)throw new a("Please wait a moment before trying again",429);if(l.status>=500)throw new a(e||"Something went wrong — please try again",l.status,t);throw new a(e||"Something went wrong",l.status,t)}return l.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!r.ok)return{content:"(body not available)",isHtml:!1};let n=r.headers.get("Content-Type")??"";return{content:await r.text(),isHtml:n.includes("text/html")}},l=async(e,t)=>{let r=new FormData;r.append("file",e);let n=await fetch(`/api/email/upload${i(t)}`,{method:"POST",credentials:"include",body:r});if(!n.ok)throw new a(await n.text().catch(()=>"Upload failed"),n.status);return n.json()},c=async(e,t)=>{let r;if(!t.files||0===t.files.length)return n(`/api/issues${i(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{r=await fetch(`/api/issues${i(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new a("Unable to connect — check your network",0);throw e}if(401===r.status)throw window.location.href="/sign-in",new a("Unauthorized",401);if(!r.ok){let e,t;try{let a=await r.json();e=a.error,t=a.details}catch{}if(429===r.status)throw new a("Please wait a moment before trying again",429);if(r.status>=500)throw new a(e||"Something went wrong — please try again",r.status,t);throw new a(e||"Something went wrong",r.status,t)}return r.json()},d=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return r.ok?r.text():"(content not available)"};e.s(["acceptInvite",0,e=>n(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist${i(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/approve${i(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>n(`/api/agents/${e}/chat-init${i(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"checkFreshness",0,(e,t)=>{let a={};return e.conversationId&&(a.conversation_id=e.conversationId),e.agentId&&(a.agent_id=e.agentId),e.channel&&(a.channel=e.channel),n(`/api/conversations/check-fresh${i(t,a)}`)},"conversationInit",0,(e,t,a)=>{let r={};return a?.newestMessageId&&(r.newest_message_id=a.newestMessageId),a?.messageCount&&(r.message_count=String(a.messageCount)),n(`/api/conversations/${e}/init${i(t,r)}`)},"createAgent",0,(e,t)=>n(`/api/agents${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>n(`/api/agent-links${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>n(`/api/calendar${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>n(`/api/channels${i(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>n(`/api/conversations${i(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts${i(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>n(`/api/machine-tokens${t?i(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings${i(t)}`,{method:"POST",body:JSON.stringify(a)}),"createThread",0,(e,t,a,r)=>n(`/api/conversations/${e}/threads${i(r)}`,{method:"POST",body:JSON.stringify({parent_message_id:t,content:a})}),"deleteAgent",0,(e,t)=>n(`/api/agents/${e}${i(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>n(`/api/agent-links/${e}${i(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>n(`/api/channels/${e}${i(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}${i(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>n(`/api/runtimes/machine${i(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}${i(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>n("/api/cli/latest-version"),"fetchModelOptions",0,()=>n("/api/config/model-options"),"flagMessage",0,(e,t)=>n(`/api/flags${i(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>n(`/api/conversations/${e}/active-task${i(t)}`),"getAgentSkills",0,(e,t)=>n(`/api/agents/${e}/skills${i(t)}`),"getArtifactContent",0,d,"getCalendarEvent",0,(e,t)=>n(`/api/calendar/${e}${i(t)}`),"getEmail",0,(e,t)=>n(`/api/email/${e}${i(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>n(`/api/email/${e}/thread${i(t)}`),"getFlaggedCount",0,e=>n(`/api/flags/count${i(e)}`),"getInboxCount",0,(e,t)=>{let a={};return t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox/count${i(e,a)}`)},"getInviteInfo",0,e=>n(`/api/invite/${e}`),"getIssue",0,(e,t)=>n(`/api/issues/${t}${i(e)}`),"getMachineTokenStatus",0,()=>n("/api/machine-tokens/status"),"getMemberMe",0,e=>n(`/api/members/me${i(e)}`),"getMinCliVersion",0,()=>n("/api/config/min-version"),"getTask",0,(e,t)=>n(`/api/tasks/${e}${i(t)}`),"getTaskMessages",0,(e,t,a)=>n(`/api/tasks/${e}/messages${i(t,a?{since:String(a)}:void 0)}`),"getThreadSummaries",0,(e,t)=>n(`/api/conversations/${e}/threads${i(t)}`),"getTrace",0,(e,t)=>n(`/api/traces/${e}${i(t)}`),"getWorkspaceOverview",0,e=>n(`/api/workspaces/${e}/overview${i(e)}`),"grantAgentAccess",0,(e,t,a)=>n(`/api/agents/${t}/access${i(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>n(`/api/agents/${t}/access${i(e)}`),"listAgentActiveTaskCounts",0,e=>n(`/api/agents/active-task-counts${i(e)}`),"listAgentActivity",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),a?.status&&(r.status=a.status),a?.type&&(r.type=a.type),n(`/api/agents/${e}/activity${i(t,r)}`)},"listAgentLinks",0,e=>n(`/api/agent-links${i(e)}`),"listAgentPins",0,e=>n(`/api/agents/pins${i(e)}`),"listAgents",0,e=>n(`/api/agents${i(e)}`),"listArtifacts",0,(e,t)=>n(`/api/artifacts${i(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),n(`/api/calendar${i(e,a)}`)},"listChannels",0,e=>n(`/api/channels${i(e)}`),"listEmailAccounts",0,(e,t)=>n(`/api/agents/${e}/email-accounts${i(t)}`),"listEmails",0,(e,t,a,r)=>n(`/api/email${i(t,{agentId:e,...a?{folder:a}:{},...r?{address:r}:{}})}`),"listFlaggedItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),n(`/api/flags${i(e,a)}`)},"listFlaggedMessageIds",0,(e,t)=>n(`/api/flags${i(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.types?.length&&(a.types=t.types.join(",")),n(`/api/inbox${i(e,a)}`)},"listInvites",0,e=>n(`/api/workspaces/${e}/invites${i(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),n(`/api/issues${i(e,a)}`)},"listMeetings",0,(e,t)=>n(`/api/agents/${e}/meetings${i(t)}`),"listMembers",0,e=>n(`/api/workspaces/${e}/members${i(e)}`),"listMessages",0,(e,t,a)=>{let r={};return a?.limit&&(r.limit=String(a.limit)),a?.before&&(r.before=a.before),a?.beforeId&&(r.before_id=a.beforeId),n(`/api/conversations/${e}/messages${i(t,r)}`)},"listMessagesAroundTask",0,(e,t,a)=>n(`/api/conversations/${e}/messages${i(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let r={exclude:a.exclude,before:a.before};return a.channel&&(r.channel=a.channel),a.limit&&(r.limit=String(a.limit)),n(`/api/agents/${e}/conversations${i(t,r)}`)},"listRuntimes",0,e=>n(`/api/runtimes${i(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),n(`/api/traces${i(e,a)}`)},"listWhitelist",0,(e,t)=>n(`/api/agents/${e}/whitelist${i(t)}`),"listWorkspaceActiveTasks",0,e=>n(`/api/agents/active-tasks${i(e)}`),"listWorkspaces",0,()=>n("/api/workspaces"),"markAllInboxRead",0,e=>n(`/api/inbox/read-all${i(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>n(`/api/inbox/read${i(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>n(`/api/workspaces/${e}/members/${t}${i(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>n(`/api/agents/${e}/whitelist/${t}${i(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>n(`/api/channels/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>n(`/api/agents/pins/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>n(`/api/channels/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>n(`/api/agents/sidebar/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,r)=>n(`/api/agents/${e}/workspace/browse${i(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:r})}),"retryTask",0,(e,t)=>n(`/api/tasks/${e}/retry${i(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,r=!1)=>n(`/api/agents/${t}/access/${a}${i(e)}${r?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>n(`/api/workspaces/${e}/invites/${t}${i(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,r,s,o,l,c)=>n(`/api/email/send${i(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:r,attachments:o,...l,customAccountId:c})}),"sendMessage",0,s,"stopMeeting",0,(e,t,a)=>n(`/api/agents/${e}/meetings/${t}/stop${i(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>n(`/api/agents/${e}/email-accounts/${t}/sync${i(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>n(`/api/runtimes/${e}/rescan${i(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>n(`/api/runtimes/${e}/update${i(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>n(`/api/flags/${t}${i(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>n(`/api/agents/${t}/pin${i(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>n(`/api/agents/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>n(`/api/agent-links/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>n(`/api/calendar/${e}${i(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>n(`/api/email/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>n(`/api/issues/${t}${i(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>n(`/api/members/me${i(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>n(`/api/workspaces/${e}${i(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(653772),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...r})}])},896210,e=>{"use strict";let t=(0,e.i(419412).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,t],896210)},330746,e=>{"use strict";let t=(0,e.i(419412).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],330746)},966662,940931,e=>{"use strict";let t=(0,e.i(419412).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],966662);var a=e.i(653772),r=e.i(511043),n=e.i(111114);let i=`
2
- html, body {
3
- overflow: hidden;
4
- }
5
- `,s=`
6
- html, body {
7
- --sb-thumb: rgba(0,0,0,0.15);
8
- --sb-hover: rgba(0,0,0,0.3);
9
- margin: 0;
10
- padding: 0;
11
- background: transparent;
12
- color: #1a1a1a;
13
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
14
- font-size: 15px;
15
- line-height: 1.6;
16
- word-wrap: break-word;
17
- overflow-wrap: break-word;
18
- overflow: hidden;
19
- }
20
- a { color: inherit; }
21
- img { max-width: 100%; height: auto; }
22
- `,o=`
23
- html, body {
24
- --sb-thumb: rgba(255,255,255,0.1);
25
- --sb-hover: rgba(255,255,255,0.25);
26
- margin: 0;
27
- padding: 0;
28
- background: transparent;
29
- color: #e8e5e0;
30
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
31
- font-size: 15px;
32
- line-height: 1.6;
33
- word-wrap: break-word;
34
- overflow-wrap: break-word;
35
- overflow: hidden;
36
- color-scheme: dark;
37
- }
38
- a { color: inherit; }
39
- img { max-width: 100%; height: auto; }
40
- /* Force dark-friendly defaults on common email patterns */
41
- body, div, td, th, p, span, li {
42
- color: #e8e5e0 !important;
43
- }
44
- table, tr, td, th, div, section, article, header, footer, main {
45
- background-color: transparent !important;
46
- border-color: rgba(255, 255, 255, 0.1) !important;
47
- }
48
- /* Preserve image backgrounds (logos, etc) */
49
- img { background-color: transparent !important; }
50
- h1, h2, h3, h4, h5, h6 {
51
- color: #f0ede8 !important;
52
- }
53
- a { color: #93b5ff !important; }
54
- `;e.s(["EmailBodyFrame",0,function({html:e,className:t}){let l=(0,r.useRef)(null),{resolvedTheme:c}=(0,n.useTheme)(),[d,u]=(0,r.useState)(200),p="dark"===c;return(0,r.useEffect)(()=>{let t=l.current;if(!t)return;let a=null;t.srcdoc=`<!DOCTYPE html>
55
- <html>
56
- <head>
57
- <meta charset="utf-8">
58
- <meta name="viewport" content="width=device-width, initial-scale=1">
59
- <meta name="color-scheme" content="${p?"dark":"light"}">
60
- <style>${i}${p?o:s}</style>
61
- </head>
62
- <body>${e}</body>
63
- </html>`;let r=()=>{let e=t.contentDocument;if(!e)return;let r=()=>{let t=e.documentElement.scrollHeight;t>0&&u(t)};r(),(a=new ResizeObserver(r)).observe(e.documentElement)};return t.addEventListener("load",r),()=>{t.removeEventListener("load",r),a?.disconnect()}},[e,p]),(0,a.jsx)("iframe",{ref:l,sandbox:"allow-same-origin",className:t,style:{width:"100%",height:`${d}px`,border:"none",display:"block"},title:"Email content"})}],940931)},481282,731316,657587,385745,e=>{"use strict";var t=e.i(127677),a=(0,e.i(995292).default)(Object.keys,Object),r=Object.prototype.hasOwnProperty;let n=function(e){if(!(0,t.default)(e))return a(e);var n=[];for(var i in Object(e))r.call(e,i)&&"constructor"!=i&&n.push(i);return n};e.s(["default",0,n],731316);var i=e.i(130636),s=e.i(659173),o=(0,i.default)(s.default,"DataView"),l=e.i(121200),c=(0,i.default)(s.default,"Promise"),d=(0,i.default)(s.default,"Set");e.s(["default",0,d],657587);var u=(0,i.default)(s.default,"WeakMap"),p=e.i(706462),m=e.i(882148),g="[object Map]",f="[object Promise]",h="[object Set]",y="[object WeakMap]",b="[object DataView]",w=(0,m.default)(o),v=(0,m.default)(l.default),$=(0,m.default)(c),k=(0,m.default)(d),x=(0,m.default)(u),S=p.default;(o&&S(new o(new ArrayBuffer(1)))!=b||l.default&&S(new l.default)!=g||c&&S(c.resolve())!=f||d&&S(new d)!=h||u&&S(new u)!=y)&&(S=function(e){var t=(0,p.default)(e),a="[object Object]"==t?e.constructor:void 0,r=a?(0,m.default)(a):"";if(r)switch(r){case w:return b;case v:return g;case $:return f;case k:return h;case x:return y}return t});let E=S;e.s(["default",0,E],385745);var _=e.i(530194),C=e.i(764843),T=e.i(750244),I=e.i(330772),j=e.i(400745),M=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,T.default)(e)&&((0,C.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,I.default)(e)||(0,j.default)(e)||(0,_.default)(e)))return!e.length;var a=E(e);if("[object Map]"==a||"[object Set]"==a)return!e.size;if((0,t.default)(e))return!n(e).length;for(var r in e)if(M.call(e,r))return!1;return!0}],481282)},505494,e=>{"use strict";var t=e.i(752872),a=e.i(351359);e.i(991577);var r=e.i(692423),n=(0,a.__name)(e=>{let{securityLevel:a}=(0,t.getConfig2)(),n=(0,r.select)("body");if("sandbox"===a){let t=(0,r.select)(`#i${e}`),a=t.node()?.contentDocument??document;n=(0,r.select)(a.body)}return n.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,n])},489368,e=>{"use strict";var t=e.i(102198),a=e.i(103274),r=e.i(595995),n=e.i(752872),i=e.i(351359),s={common:n.common_default,getConfig:n.getConfig,insertCluster:a.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:a.insertNode,interpolateToCurve:r.interpolateToCurve,labelHelper:a.labelHelper,log:i.log,positionEdgeLabel:t.positionEdgeLabel},o={},l=(0,i.__name)(e=>{for(let t of e)o[t.name]=t},"registerLayoutLoaders");(0,i.__name)(()=>{l([{name:"dagre",loader:(0,i.__name)(async()=>await e.A(274989),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await e.A(619639),"loader")}])},"registerDefaultLayoutLoaders")();var c=(0,i.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in o))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=o[e.layoutAlgorithm],r=await a.loader(),{theme:n,themeVariables:i}=e.config,{useGradient:l,gradientStart:c,gradientStop:d}=i,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-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",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-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",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),l){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",c).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}return r.render(e,t,s,{algorithm:a.algorithm})},"render"),d=(0,i.__name)((e="",{fallback:t="dagre"}={})=>{if(e in o)return e;if(t in o)return i.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,l,"render",0,c])},967723,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],967723)},492451,e=>{"use strict";let t=(0,e.i(419412).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,t],492451)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],80137)},68322,522281,e=>{"use strict";var t=e.i(566710);e.s([],68322),e.s(["Streamdown",()=>t.C],522281)},288329,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(613349);e.s(["SheetResizeHandle",0,function({onPointerDown:e,onPointerMove:a,onPointerUp:n,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:a,onPointerUp:n,onLostPointerCapture:n,className:(0,r.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:r=.8}={}){let[n,i]=(0,a.useState)(e),s=(0,a.useRef)(!1),o=(0,a.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),s.current=!0},[]);return{width:n,onPointerDown:o,onPointerMove:(0,a.useCallback)(e=>{s.current&&i(Math.min(window.innerWidth*r,Math.max(t,window.innerWidth-e.clientX)))},[t,r]),onPointerUp:(0,a.useCallback)(e=>{s.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}])},998771,e=>{"use strict";let t=(0,e.i(419412).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,t],998771)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},131890,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],131890)},450463,e=>{"use strict";e.s(["relativeTime",0,function(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let a=Math.floor((new Date().getTime()-t.getTime())/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<7?`${n}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}])},465368,648632,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(450463);e.i(400175);var n=e.i(819748),i=e.i(126366),s=e.i(496673),o=e.i(758956),l=e.i(332680);function c(e,{delay:t=450,moveThreshold:r=10}={}){let n=a.useRef(null),i=a.useRef(null),s=a.useRef(!1),o=a.useRef(e);a.useEffect(()=>{o.current=e});let l=a.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null),i.current=null},[]),d=a.useCallback(e=>{"mouse"!==e.pointerType&&(l(),s.current=!1,i.current={x:e.clientX,y:e.clientY},n.current=setTimeout(()=>{s.current=!0,i.current=null,n.current=null,o.current()},t))},[l,t]),u=a.useCallback(e=>{let t=i.current;if(!t)return;let a=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);(a>r||n>r)&&l()},[l,r]),p=a.useCallback(e=>{s.current&&(e.preventDefault(),e.stopPropagation(),s.current=!1)},[]);return a.useEffect(()=>l,[l]),{onPointerDown:d,onPointerMove:u,onPointerUp:l,onPointerCancel:l,onPointerLeave:l,onClick:p}}e.s(["useLongPress",0,c],648632),e.s(["EmailCard",0,function({subject:e,address:d,direction:u,onClick:p,timestamp:m,isInternal:g,internalHandle:f,targetConvId:h,targetAgentId:y,agents:b,onAgentChatOpen:w,touchAction:v}){let[$,k]=(0,a.useState)(null),[x,S]=(0,a.useState)(!1),[E,_]=(0,a.useState)(!1),C=c(()=>{v&&_(!0)}),T=(0,a.useCallback)(()=>{if(!g||x)return;S(!0);let e=b?.find(e=>e.email_handle===f);e&&k({name:e.name,avatarConfig:(0,i.parseAvatarUrl)(e.avatar_url)})},[g,x,b,f]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:p,disabled:!p,onPointerEnter:T,...v?C:{},className:`card-grain w-104 max-w-full rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer [transition:translate_.2s_cubic-bezier(.2,.8,.2,1),box-shadow_.2s_ease] hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)] ${g&&h?"overflow-visible group/ecard":"overflow-hidden"}`,children:[(0,t.jsx)("span",{className:"h-2.5 relative block",children:(0,t.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,t.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,t.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,t.jsxs)("span",{className:"flex items-start gap-1 mb-1",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===u?"from ":"to ",d]}),(0,t.jsxs)("span",{className:"shrink-0 flex flex-col items-end gap-0.5",children:[m&&(0,t.jsx)("span",{className:"text-[0.62rem] font-mono text-muted-foreground/65",children:(0,r.relativeTime)(m)}),(0,t.jsx)("span",{className:"text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===u?"Inbound":"Sent"})]})]}),(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:e})]}),g&&$&&h&&(0,t.jsx)("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 translate-y-1 opacity-0 group-hover/ecard:opacity-100 group-hover/ecard:translate-y-0 transition-all duration-200 ease-out pointer-events-none group-hover/ecard:pointer-events-auto z-10",children:(0,t.jsxs)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),h&&y&&w?.(y,h)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),h&&y&&w?.(y,h))},className:"flex items-center gap-1.5 py-0.5 pl-0.5 pr-2 bg-(--paper) border border-(--border) rounded-full shadow-md hover:bg-(--secondary) cursor-pointer whitespace-nowrap",children:[$.avatarConfig&&(0,t.jsx)(n.AnimatedAvatar,{config:$.avatarConfig,size:20,isHovered:!1,className:"rounded-full"}),(0,t.jsx)("span",{className:"text-[0.62rem] font-semibold opacity-80",children:$.name}),(0,t.jsx)(s.ChevronRight,{className:"w-2.5 h-2.5 text-muted-foreground/45 -ml-0.5"})]})})]}),v&&(0,t.jsx)(l.Sheet,{open:E,onOpenChange:_,children:(0,t.jsx)(l.SheetContent,{side:"bottom",showCloseButton:!1,className:"rounded-t-2xl p-2",children:(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{v.onClick(),_(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-left text-[0.95rem] active:bg-muted text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:(0,t.jsx)(o.MessageSquare,{className:"w-5 h-5"})}),v.label]})})})})]})}],465368)},754902,855351,157349,e=>{"use strict";var t=e.i(653772),a=e.i(613349);let r={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},n={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function i(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}e.s(["MessageBubble",0,function({variant:e,position:i,children:s,className:o,...l}){let c="user"===e?r[i]:n[i];return(0,t.jsx)("div",{className:(0,a.cn)("px-3 py-1.5 text-base",c,"user"===e?"bg-primary text-primary-foreground":"bg-muted text-foreground",o),...l,children:s})}],754902),e.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:e,name:r,children:n,position:i,className:s}){let o="first"===i||"solo"===i;return(0,t.jsxs)("div",{className:(0,a.cn)("flex justify-start items-start gap-2 min-w-0",s),children:[(0,t.jsx)("div",{className:(0,a.cn)("w-[30px]","shrink-0"),"aria-hidden":!o,children:o&&e}),(0,t.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[o&&(0,t.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:r}),n]})]})}],855351),e.s(["PresenceLine",0,function({agentFirstName:e,taskStatus:r}){let n="running"===r?"typing":"queued"===r||"dispatched"===r?"reading":"idle";return(0,t.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,t.jsx)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==n&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"reading"===n?`${e} is reading`:`${e} is typing`}),(0,t.jsx)(i,{})]})},n)})}],157349)},899746,e=>{"use strict";let t="browser-notification-enabled",a="browser-notification-events",r=["completed","failed"],n={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function s(){return"true"===localStorage.getItem(t)}function o(){try{let e=localStorage.getItem(a);if(e)return JSON.parse(e)}catch{}return[...r]}async function l(){return!!i()&&("granted"===Notification.permission||"denied"!==Notification.permission&&"granted"===await Notification.requestPermission())}e.s(["NOTIFICATION_EVENTS",0,r,"NOTIFICATION_EVENT_LABELS",0,n,"getNotificationEnabled",0,s,"getNotificationEvents",0,o,"isNotificationSupported",0,i,"requestNotificationPermission",0,l,"sendTaskNotification",0,function(e,t,a){if(!i()||"granted"!==Notification.permission||!s()||!o().includes(e))return;let r=n[e]??`Task ${e}`;new Notification(t?`${t} — ${r}`:r,{body:a??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(a,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(653772),a=e.i(511043),r=e.i(222862),n=e.i(355578),i=e.i(500324),s=e.i(899746);let o="inbox-filter-types",l=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],d=["user_dm_message"];function u(){try{let e=localStorage.getItem(o);if(!e)return c;let t=JSON.parse(e).filter(e=>l.includes(e));if(0===t.length)return c;for(let e of d)t.includes(e)||t.unshift(e);return t}catch{return c}}e.s(["INBOX_FILTER_LABELS",0,{user_dm_message:"DM",calendar_event:"Calendar",email_notification:"Email"},"INBOX_FILTER_TYPES",0,l,"MANDATORY_INBOX_TYPES",0,d,"getInboxFilterTypes",0,u,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of d)t.includes(e)||t.unshift(e);localStorage.setItem(o,JSON.stringify(t))}],685835);let p=(0,a.createContext)(null),m={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:o}=(0,i.useWorkspace)(),{subscribeWs:l,agents:c}=(0,n.useAgentContext)(),[d,m]=(0,a.useState)(0),[g,f]=(0,a.useState)(0),h=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(c);(0,a.useEffect)(()=>{b.current=c});let w=(0,a.useCallback)(()=>{let e=u();(0,r.getInboxCount)(o,{types:e}).then(e=>{let t=h.current;if(h.current=e.count,m(e.count),null!==t&&e.count>t){f(e=>e+1);let e=y.current?b.current.find(e=>e.id===y.current):void 0;(0,s.sendTaskNotification)("completed",e?.name)}y.current=null}).catch(()=>{})},[o]),v=(0,a.useCallback)(()=>{m(e=>Math.max(0,e-1))},[]);return(0,a.useEffect)(()=>{w()},[w]),(0,a.useEffect)(()=>l(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(y.current=e.agentId,w())}),[l,w]),(0,a.useEffect)(()=>{let e=setInterval(w,6e4);return()=>clearInterval(e)},[w]),(0,t.jsx)(p.Provider,{value:{count:d,notificationToken:g,refresh:w,decrement:v},children:e})},"useInboxCount",0,function(){return(0,a.useContext)(p)??m}],875494)},353155,e=>{"use strict";var t=e.i(452691);e.s(["Check",()=>t.default])},813141,e=>{"use strict";let t=(0,e.i(419412).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],813141)},393153,e=>{"use strict";var t=e.i(653772),a=e.i(779646),r=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:i,description:s,confirmLabel:o="Remove",loadingLabel:l,confirmVariant:c="destructive",loading:d=!1,onConfirm:u}){return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(a.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:i}),(0,t.jsx)(a.DialogDescription,{children:s})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(r.Button,{variant:c,size:"sm",onClick:u,disabled:d,children:d?l??`${o}...`:o})]})]})})}])},82970,e=>{"use strict";let t=(0,e.i(419412).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],82970)},294518,e=>{"use strict";let t=(0,e.i(419412).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,t],294518)},267007,e=>{"use strict";let t=(0,e.i(419412).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],267007)},41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},896315,219658,e=>{"use strict";var t=e.i(419412);let a=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,a],896315);var r=e.i(653772),n=e.i(511043),i=e.i(186339),s=e.i(329686);let o=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var l=e.i(613349);e.s(["ScrollToBottomButton",0,function({scrollRef:e,threshold:t=100}){let[a,c]=(0,n.useState)(!1),d=(0,n.useCallback)(()=>{let a=e.current;if(!a)return;let r=a.scrollHeight-a.scrollTop-a.clientHeight<t;c(a.scrollHeight>a.clientHeight&&!r)},[e,t]);return(0,n.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",d,{passive:!0}),d();let a=new ResizeObserver(d);return a.observe(t),()=>{t.removeEventListener("scroll",d),a.disconnect()}},[e,d]),(0,r.jsx)("div",{className:(0,l.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",a?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,r.jsxs)(s.Tooltip,{children:[(0,r.jsx)(s.TooltipTrigger,{render:(0,r.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t=e.current;t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,r.jsx)(o,{})}),(0,r.jsx)(s.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],219658)}]);
@@ -1,3 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],80137)},131890,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],131890)},450463,e=>{"use strict";e.s(["relativeTime",0,function(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let r=Math.floor((new Date().getTime()-t.getTime())/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let a=Math.floor(n/24);return a<7?`${a}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}])},754902,855351,157349,e=>{"use strict";var t=e.i(653772),r=e.i(613349);let n={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},a={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function s(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}e.s(["MessageBubble",0,function({variant:e,position:s,children:i,className:l,...o}){let u="user"===e?n[s]:a[s];return(0,t.jsx)("div",{className:(0,r.cn)("px-3 py-1.5 text-base",u,"user"===e?"bg-primary text-primary-foreground":"bg-muted text-foreground",l),...o,children:i})}],754902),e.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:e,name:n,children:a,position:s,className:i}){let l="first"===s||"solo"===s;return(0,t.jsxs)("div",{className:(0,r.cn)("flex justify-start items-start gap-2 min-w-0",i),children:[(0,t.jsx)("div",{className:(0,r.cn)("w-[30px]","shrink-0"),"aria-hidden":!l,children:l&&e}),(0,t.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[l&&(0,t.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:n}),a]})]})}],855351),e.s(["PresenceLine",0,function({agentFirstName:e,taskStatus:n}){let a="running"===n?"typing":"queued"===n||"dispatched"===n?"reading":"idle";return(0,t.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,t.jsx)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==a&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"reading"===a?`${e} is reading`:`${e} is typing`}),(0,t.jsx)(s,{})]})},a)})}],157349)},465368,648632,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(450463);e.i(400175);var a=e.i(819748),s=e.i(126366),i=e.i(496673),l=e.i(758956),o=e.i(332680);function u(e,{delay:t=450,moveThreshold:n=10}={}){let a=r.useRef(null),s=r.useRef(null),i=r.useRef(!1),l=r.useRef(e);r.useEffect(()=>{l.current=e});let o=r.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),s.current=null},[]),d=r.useCallback(e=>{"mouse"!==e.pointerType&&(o(),i.current=!1,s.current={x:e.clientX,y:e.clientY},a.current=setTimeout(()=>{i.current=!0,s.current=null,a.current=null,l.current()},t))},[o,t]),c=r.useCallback(e=>{let t=s.current;if(!t)return;let r=Math.abs(e.clientX-t.x),a=Math.abs(e.clientY-t.y);(r>n||a>n)&&o()},[o,n]),f=r.useCallback(e=>{i.current&&(e.preventDefault(),e.stopPropagation(),i.current=!1)},[]);return r.useEffect(()=>o,[o]),{onPointerDown:d,onPointerMove:c,onPointerUp:o,onPointerCancel:o,onPointerLeave:o,onClick:f}}e.s(["useLongPress",0,u],648632),e.s(["EmailCard",0,function({subject:e,address:d,direction:c,onClick:f,timestamp:m,isInternal:p,internalHandle:h,targetConvId:g,targetAgentId:x,agents:y,onAgentChatOpen:b,touchAction:v}){let[C,j]=(0,r.useState)(null),[w,_]=(0,r.useState)(!1),[P,k]=(0,r.useState)(!1),M=u(()=>{v&&k(!0)}),S=(0,r.useCallback)(()=>{if(!p||w)return;_(!0);let e=y?.find(e=>e.email_handle===h);e&&j({name:e.name,avatarConfig:(0,s.parseAvatarUrl)(e.avatar_url)})},[p,w,y,h]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:f,disabled:!f,onPointerEnter:S,...v?M:{},className:`card-grain w-104 max-w-full rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer [transition:translate_.2s_cubic-bezier(.2,.8,.2,1),box-shadow_.2s_ease] hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)] ${p&&g?"overflow-visible group/ecard":"overflow-hidden"}`,children:[(0,t.jsx)("span",{className:"h-2.5 relative block",children:(0,t.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,t.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,t.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,t.jsxs)("span",{className:"flex items-start gap-1 mb-1",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===c?"from ":"to ",d]}),(0,t.jsxs)("span",{className:"shrink-0 flex flex-col items-end gap-0.5",children:[m&&(0,t.jsx)("span",{className:"text-[0.62rem] font-mono text-muted-foreground/65",children:(0,n.relativeTime)(m)}),(0,t.jsx)("span",{className:"text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===c?"Inbound":"Sent"})]})]}),(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:e})]}),p&&C&&g&&(0,t.jsx)("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 translate-y-1 opacity-0 group-hover/ecard:opacity-100 group-hover/ecard:translate-y-0 transition-all duration-200 ease-out pointer-events-none group-hover/ecard:pointer-events-auto z-10",children:(0,t.jsxs)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),g&&x&&b?.(x,g)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),g&&x&&b?.(x,g))},className:"flex items-center gap-1.5 py-0.5 pl-0.5 pr-2 bg-(--paper) border border-(--border) rounded-full shadow-md hover:bg-(--secondary) cursor-pointer whitespace-nowrap",children:[C.avatarConfig&&(0,t.jsx)(a.AnimatedAvatar,{config:C.avatarConfig,size:20,isHovered:!1,className:"rounded-full"}),(0,t.jsx)("span",{className:"text-[0.62rem] font-semibold opacity-80",children:C.name}),(0,t.jsx)(i.ChevronRight,{className:"w-2.5 h-2.5 text-muted-foreground/45 -ml-0.5"})]})})]}),v&&(0,t.jsx)(o.Sheet,{open:P,onOpenChange:k,children:(0,t.jsx)(o.SheetContent,{side:"bottom",showCloseButton:!1,className:"rounded-t-2xl p-2",children:(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{v.onClick(),k(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-left text-[0.95rem] active:bg-muted text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:(0,t.jsx)(l.MessageSquare,{className:"w-5 h-5"})}),v.label]})})})})]})}],465368)},855062,e=>{"use strict";var t=e.i(511043);e.s(["useLocalStorage",0,function(e,r){let[n,a]=(0,t.useState)(r);return(0,t.useLayoutEffect)(()=>{try{let t=localStorage.getItem(e);t&&a(JSON.parse(t))}catch{}},[e]),[n,(0,t.useCallback)(t=>{a(r=>{let n=t instanceof Function?t(r):t;try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])]}])},646769,e=>{"use strict";let t=(0,e.i(419412).default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",0,t],646769)},855372,e=>{"use strict";var t=e.i(653772),r=e.i(646769);function n({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:e,children:(0,t.jsx)("path",{d:"m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"})})}function a({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,children:(0,t.jsx)("path",{d:"M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"})})}function s({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,t.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function i({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M8 2C5.5 2 3.5 4 3.5 6.5S5 10.5 6.5 11v1.5H8V11c.3.1.7.1 1 0v1.5h1.5V11c1.5-.5 3-2.5 3-4.5S10.5 2 8 2Z",fill:"#E8453A"}),(0,t.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,t.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function l({className:e}){return(0,t.jsx)("img",{src:"data:image/webp;base64,UklGRuYDAABXRUJQVlA4INoDAADQEwCdASowADAAPm0uk0ckIiGhKrqpWIANiWkAEyQea/fD8IewvGL5V7Nb3H8u/MA8G9rT+4flL+UfIe42/23GB8zPqF/o3E0UAP5h/h/+F6ZX+x5evnX/r+4T/K/67/u/zg7znogfrusMANZLkn1gvlY/vNsKubtj/9xLSzxTsLr7K9GLdFNs5rwtISRcPXvH4z57n2fg0XR3aQ2D+pPpycwyl7TwAAD+/2DbjivnePzfyHCsdOgJXKlUR/OgAkofD7K4AdmsPKyP5Ml4/4HBYmIm5/efn/H+X3IZtngyaUOvwbFuRS/1yODFYO3vf3qeXGgPdfgIROXd/EPT7K2jysfvY9N71+w6g2gBPs+P6lxYkPf6S9QfpvH/7Pp7i8xRh0nVDBTEQyczSz7V9hoqo4nDJuii+SfibZRR/d5zB+9jkcb1DNN7YnC5Y7+WfGrE3eseXt3hSm+NS5++m1MHbjsrd9z/Q4HPRP/C85Po41XObalGyIUcFUL2j2n3uI/Yh6U8r6trCUJFB4kT3fsv6+8ylX/d96y2hq869FCXLjq4YqEO8vs5BtT52sf7KyDxPAWkH/b06YbfVXf4/7y5THL6Sr/4mOrrY9P2LW81f05HHFN8n0jcyqKOH7AluMm0AHPgFyz8RVrfBdmnPiC2FLMQfNDte5yGFzGC3fMlDed/tS/PO3Q/hjsNLvAXUUjqHyCo3JeN69jyNgWjjf8iUqoBsXT+lJyp2r8p60ad1jxhNyTblyJwda8aWEw1hFDeGjpMGguDF66RL4c+ZO+PhculC6WxvCsZ7IPAsdD7/ywx3w3AowJ66hAAK7k+m6X2QV06OVOCwyIGERex/AUyuBbLUK93X58+M+Si7YfYjVYGpoJ7JvSgD8ExaA21z9OY+si+1wreacDanKnFDmhwBQC3t6MLeXCOGp3VURDKl10K7tdKHQcb4hr48ba+1x/MrMRwHfq3IQrDIXPYCg4b0OLnVN9JyXttKGM63B5imIdKuU0r6hhSslT10lGLjnIJuwO5WKR0RHs+BX5vs6H63y3K7IuuZ1eRN+Aczvbs4QuDs6ZRuzjJ/1DJ5R/3ZrFPrtxvMwT06vAXIgcbhLGNLhOQUYRPdUN5MgyCtL5NH71ArTPLRRkIjhGwoCYXKKqlqIKKT9NX3vwp/nlh4SX71dlYg/mPXbJ9bMeVugyjqFahjFTJ/rT3HtBCWG8h+OvvbOFDFKurCG9BOhO9B719OS7zsP0KPqoymnv7hVvoJyZp0iziCbBvaJpmF9Cvfs8/vWqWr7TUo616WfMW+X9nkgpuqtnfAAAAAA==",alt:"Hermes",className:`${e} rounded-sm`})}function o({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:e,children:[(0,t.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,t.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,t.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function u({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,children:(0,t.jsx)("path",{d:"M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"})})}function d({className:e}){return(0,t.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:e,children:[(0,t.jsx)("path",{fill:"#14120B",d:"M999.994 554.294C999.994 559.859 999.994 565.419 999.962 570.984C999.935 575.67 999.882 580.357 999.753 585.038C999.475 595.247 998.875 605.542 997.059 615.639C995.217 625.88 992.212 635.409 987.477 644.718C982.822 653.861 976.738 662.233 969.485 669.491C962.227 676.748 953.861 682.828 944.712 687.482C935.409 692.217 925.875 695.222 915.633 697.065C905.537 698.88 895.242 699.48 885.033 699.759C880.346 699.887 875.665 699.941 870.978 699.968C865.413 700.005 859.853 700 854.288 700H745.695C740.13 700 734.571 700 729.005 699.968C724.319 699.941 719.632 699.887 714.951 699.759C704.742 699.48 694.447 698.88 684.35 697.065C674.109 695.222 664.58 692.217 655.271 687.482C646.128 682.828 637.756 676.743 630.499 669.491C623.241 662.233 617.161 653.866 612.507 644.718C607.772 635.414 604.767 625.88 602.925 615.639C601.109 605.542 600.509 595.247 600.23 585.038C600.102 580.352 600.048 575.67 600.021 570.984C600 565.419 600 559.859 600 554.294V445.701C600 440.136 600 434.576 600.032 429.011C600.059 424.324 600.112 419.637 600.241 414.956C600.52 404.747 601.119 394.452 602.935 384.356C604.778 374.115 607.783 364.586 612.518 355.277C617.172 346.133 623.257 337.762 630.509 330.504C637.767 323.246 646.133 317.167 655.282 312.512C664.586 307.777 674.12 304.772 684.361 302.93C694.458 301.114 704.752 300.514 714.961 300.236C719.648 300.107 724.329 300.054 729.016 300.027C734.576 300 740.136 300 745.701 300H854.294C859.859 300 865.419 300 870.984 300.032C875.67 300.059 880.357 300.112 885.038 300.241C895.247 300.52 905.542 301.119 915.639 302.935C925.88 304.778 935.409 307.783 944.718 312.518C953.861 317.172 962.233 323.257 969.491 330.509C976.748 337.767 982.828 346.133 987.482 355.282C992.217 364.586 995.222 374.12 997.065 384.361C998.88 394.458 999.48 404.752 999.759 414.961C999.887 419.648 999.941 424.329 999.968 429.016C1000.01 434.581 1000 440.141 1000 445.706V554.299L999.994 554.294Z"}),(0,t.jsx)("path",{fill:"#72716D",d:"M800.004 500L923.821 571.486C923.061 572.804 921.957 573.929 920.591 574.716L804.863 641.531C801.858 643.266 798.151 643.266 795.146 641.531L679.417 574.716C678.052 573.929 676.948 572.804 676.188 571.486L800.004 500Z"}),(0,t.jsx)("path",{fill:"#55544F",d:"M800.005 357.168V500L676.188 571.486C675.427 570.168 675.004 568.647 675.004 567.072V432.928C675.004 429.774 676.686 426.865 679.418 425.285L795.141 358.47C796.646 357.602 798.323 357.168 799.999 357.168H800.005Z"}),(0,t.jsx)("path",{fill:"#43413C",d:"M923.815 428.515C923.055 427.197 921.951 426.072 920.586 425.285L804.857 358.47C803.357 357.602 801.68 357.168 800.004 357.168V500L923.821 571.486C924.581 570.168 925.005 568.647 925.005 567.072V432.928C925.005 431.348 924.587 429.838 923.821 428.515H923.815Z"}),(0,t.jsx)("path",{fill:"#D6D5D2",d:"M915.156 433.518C915.857 434.728 915.954 436.281 915.156 437.663L802.764 632.323C802.008 633.641 800 633.1 800 631.584V503.311C800 502.287 799.727 501.302 799.229 500.44L915.15 433.512H915.156V433.518Z"}),(0,t.jsx)("path",{fill:"white",d:"M915.155 433.518L799.233 500.445C798.741 499.588 798.023 498.86 797.134 498.345L686.049 434.209C684.731 433.453 685.272 431.445 686.788 431.445H911.566C913.162 431.445 914.459 432.307 915.155 433.518Z"})]})}function c({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M12 24C12 18.2 12 15.5 10.1 13.9C8.5 12 5.8 12 0 12C5.8 12 8.5 12 10.1 10.1C12 8.5 12 5.8 12 0C12 5.8 12 8.5 13.9 10.1C15.5 12 18.2 12 24 12C18.2 12 15.5 12 13.9 13.9C12 15.5 12 18.2 12 24Z",fill:"url(#gemini-gradient)"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{stopColor:"#4285F4"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#886FBF"})]})})]})}e.s(["ProviderLogo",0,function({provider:e,className:f="h-4 w-4"}){switch(e){case"claude":return(0,t.jsx)(n,{className:f});case"codex":return(0,t.jsx)(a,{className:f});case"opencode":return(0,t.jsx)(s,{className:f});case"openclaw":return(0,t.jsx)(i,{className:f});case"hermes":return(0,t.jsx)(l,{className:f});case"pi":return(0,t.jsx)(o,{className:f});case"copilot":return(0,t.jsx)(u,{className:f});case"cursor":return(0,t.jsx)(d,{className:f});case"gemini":return(0,t.jsx)(c,{className:f});default:return(0,t.jsx)(r.Monitor,{className:f})}}])},860150,(e,t,r)=>{"use strict";function n({widthInt:e,heightInt:t,blurWidth:r,blurHeight:a,blurDataURL:s,objectFit:i}){let l=r?40*r:e,o=a?40*a:t,u=l&&o?`viewBox='0 0 ${l} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},495703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return s},imageConfigDefault:function(){return i}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},715596,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return u}}),e.r(519990);let n=e.r(66960),a=e.r(860150),s=e.r(495703),i=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:r=!1,priority:d=!1,preload:c=!1,loading:f,className:m,quality:p,width:h,height:g,fill:x=!1,style:y,overrideSrc:b,onLoad:v,onLoadingComplete:C,placeholder:j="empty",blurDataURL:w,fetchPriority:_,decoding:P="async",layout:k,objectFit:M,objectPosition:S,lazyBoundary:O,lazyRoot:N,...E},R){var A;let L,z,D,{imgConf:I,showAltText:H,blurComplete:F,defaultLoader:T}=R,B=I||s.imageConfigDefault;if("allSizes"in B)L=B;else{let e=[...B.deviceSizes,...B.imageSizes].sort((e,t)=>e-t),t=B.deviceSizes.sort((e,t)=>e-t),r=B.qualities?.sort((e,t)=>e-t);L={...B,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===T)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let V=E.loader||T;delete E.loader,delete E.srcSet;let U="__next_img_default"in V;if(U){if("custom"===L.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2
- Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=V;V=t=>{let{config:r,...n}=t;return e(n)}}if(k){"fill"===k&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[k];e&&(y={...y,...e});let r={responsive:"100vw",fill:"100vw"}[k];r&&!t&&(t=r)}let q="",X=o(h),$=o(g);if((A=e)&&"object"==typeof A&&(l(A)||void 0!==A.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(z=t.blurWidth,D=t.blurHeight,w=w||t.blurDataURL,q=t.src,!x)if(X||$){if(X&&!$){let e=X/t.width;$=Math.round(t.height*e)}else if(!X&&$){let e=$/t.height;X=Math.round(t.width*e)}}else X=t.width,$=t.height}let G=!d&&!c&&("lazy"===f||void 0===f);(!(e="string"==typeof e?e:q)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,G=!1),L.unoptimized&&(r=!0),U&&!L.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let K=o(p),W=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:M,objectPosition:S}:{},H?{}:{color:"transparent"},y),Z=F||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:X,heightInt:$,blurWidth:z,blurHeight:D,blurDataURL:w||"",objectFit:W.objectFit})}")`:`url("${j}")`,Y=i.includes(W.objectFit)?"fill"===W.objectFit?"100% 100%":"cover":W.objectFit,J=Z?{backgroundSize:Y,backgroundPosition:W.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:Z}:{},Q=function({config:e,src:t,unoptimized:r,width:a,quality:s,sizes:i,loader:l}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,n.getDeploymentId)();if(e){let r=t.indexOf("?");if(-1!==r){let n=new URLSearchParams(t.slice(r+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,r)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:u}=function({deviceSizes:e,allSizes:t},r,n){if(n){let r=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=r.exec(n);)a.push(parseInt(e[2]));if(a.length){let r=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,i),d=o.length-1;return{sizes:i||"w"!==u?i:"100vw",srcSet:o.map((r,n)=>`${l({config:e,src:t,quality:s,width:r})} ${"w"===u?r:n+1}${u}`).join(", "),src:l({config:e,src:t,quality:s,width:o[d]})}}({config:L,src:e,unoptimized:r,width:X,quality:K,sizes:t,loader:V}),ee=G?"lazy":f;return{props:{...E,loading:ee,fetchPriority:_,width:X,height:$,decoding:P,className:m,style:{...W,...J},sizes:Q.sizes,srcSet:Q.srcSet,src:b||Q.src},meta:{unoptimized:r,preload:c||d,placeholder:j,fill:x}}}},948147,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(511043),a="u"<typeof window,s=a?()=>{}:n.useLayoutEffect,i=a?()=>{}:n.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return a&&(t?.mountedInstances?.add(e.children),l()),s(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),s(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},818757,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return h},defaultHead:function(){return c}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(481258),i=e.r(744066),l=e.r(653772),o=i._(e.r(511043)),u=s._(e.r(948147)),d=e.r(477441);function c(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(519990);let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,r,n,a;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,r=new Set,n=new Set,a={},e=>{let s=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?s=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?s=!1:r.add(e.type);break;case"meta":for(let t=0,r=m.length;t<r;t++){let r=m[t];if(e.props.hasOwnProperty(r))if("charSet"===r)n.has(r)?s=!1:n.add(r);else{let t=e.props[r],n=a[r]||new Set;("name"!==r||!i)&&n.has(t)?s=!1:(n.add(t),a[r]=n)}}}return s})).reverse().map((e,t)=>{let r=e.key||t;return o.default.cloneElement(e,{key:r})})}let h=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,l.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},660272,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let n=e.r(481258)._(e.r(511043)),a=e.r(495703),s=n.default.createContext(a.imageConfigDefault)},738821,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(481258)._(e.r(511043)).default.createContext(null)},800643,(e,t,r)=>{"use strict";function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},179871,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(800643),a=e.r(66960);function s({config:e,src:t,width:r,quality:i}){let l=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),n=r.get("dpl");if(n){l=n,r.delete("dpl");let a=r.toString();t=t.slice(0,e)+(a?"?"+a:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3
- Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,n.findClosestQuality)(i,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${o}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}s.__next_img_default=!0;let i=s},348935,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return v}});let n=e.r(481258),a=e.r(744066),s=e.r(653772),i=a._(e.r(511043)),l=n._(e.r(280115)),o=n._(e.r(818757)),u=e.r(715596),d=e.r(495703),c=e.r(660272);e.r(519990);let f=e.r(738821),m=n._(e.r(179871)),p=e.r(842781),h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,r,n,a,s,i){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,a=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function x(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y=(0,i.forwardRef)(({src:e,srcSet:t,sizes:r,height:n,width:a,decoding:l,className:o,style:u,fetchPriority:d,placeholder:c,loading:f,unoptimized:m,fill:h,onLoadRef:y,onLoadingCompleteRef:b,setBlurComplete:v,setShowAltText:C,sizesInput:j,onLoad:w,onError:_,...P},k)=>{let M=(0,i.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&g(e,c,y,b,v,m,j))},[e,c,y,b,v,_,m,j]),S=(0,p.useMergedRef)(k,M);return(0,s.jsx)("img",{...P,...x(d),loading:f,width:a,height:n,decoding:l,"data-nimg":h?"fill":"1",className:o,style:u,sizes:r,srcSet:t,src:e,ref:S,onLoad:e=>{g(e.currentTarget,c,y,b,v,m,j)},onError:e=>{C(!0),"empty"!==c&&v(!0),_&&_(e)}})});function b({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,s.jsx)(o.default,{children:(0,s.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,i.forwardRef)((e,t)=>{let r=(0,i.useContext)(f.RouterContext),n=(0,i.useContext)(c.ImageConfigContext),a=(0,i.useMemo)(()=>{let e=h||n||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:a,localPatterns:"u"<typeof window?n?.localPatterns:e.localPatterns}},[n]),{onLoad:l,onLoadingComplete:o}=e,p=(0,i.useRef)(l);(0,i.useEffect)(()=>{p.current=l},[l]);let g=(0,i.useRef)(o);(0,i.useEffect)(()=>{g.current=o},[o]);let[x,v]=(0,i.useState)(!1),[C,j]=(0,i.useState)(!1),{props:w,meta:_}=(0,u.getImgProps)(e,{defaultLoader:m.default,imgConf:a,blurComplete:x,showAltText:C});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y,{...w,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:v,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.preload?(0,s.jsx)(b,{isAppRouter:!r,imgAttributes:w}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},121649,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return d},getImageProps:function(){return u}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(481258),i=e.r(715596),l=e.r(348935),o=s._(e.r(179871));function u(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let d=l.Image},837002,(e,t,r)=>{t.exports=e.r(121649)},643486,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(111114),a=e.i(837002),s=e.i(613349);let i={sm:{icon:28,text:"text-2xl"},lg:{icon:36,text:"text-4xl"}};e.s(["Logo",0,function({size:e="sm",className:l,iconOnly:o=!1}){let{icon:u,text:d}=i[e],{resolvedTheme:c,setTheme:f}=(0,n.useTheme)(),[m,p]=(0,r.useState)(!1),h=(0,r.useRef)(p);return(0,r.useEffect)(()=>{h.current(!0)},[]),(0,t.jsxs)("button",{type:"button",onClick:()=>{f("dark"===c?"light":"dark")},"aria-label":"Toggle theme",className:(0,s.cn)("flex items-center gap-1.5 cursor-pointer select-none transition-opacity hover:opacity-70",l),children:[m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.default,{src:"/alook.svg",alt:"Alook",width:u,height:u,className:"dark:hidden"}),(0,t.jsx)(a.default,{src:"/alook-dark.svg",alt:"Alook",width:u,height:u,className:"hidden dark:block"})]}):(0,t.jsx)("span",{style:{width:u,height:u}}),!o&&(0,t.jsx)("span",{className:(0,s.cn)(d,"font-black tracking-tight"),style:{fontFamily:"var(--font-brand)"},children:"Alook"})]})}])},444951,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=e.r(953041);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},868822,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},105815,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return o}});let n=e.r(653772),a=e.r(280115),s=e.r(860598),i=e.r(868822),l=e.r(66960);function o({moduleIds:e}){if("u">typeof window)return null;let t=s.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let u=(0,l.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},790961,e=>{"use strict";var t=e.i(511043);let r="alook-home-pet-settings-changed",n="alook-home-pet-enabled-v1",a={enabled:!1};function s(){let e=window.localStorage.getItem(n);return{enabled:null===e?a.enabled:"true"===e}}e.s(["readHomePetSettings",0,s,"useHomePetSettings",0,function(){let[e,i]=(0,t.useState)(a);return(0,t.useEffect)(()=>{i(s());let e=e=>{i(e.detail??s())},t=e=>{e.key===n&&i(s())};return window.addEventListener(r,e),window.addEventListener("storage",t),()=>{window.removeEventListener(r,e),window.removeEventListener("storage",t)}},[]),e},"writeHomePetSettings",0,function(e){let t={...s(),...e};return window.localStorage.setItem(n,String(t.enabled)),window.dispatchEvent(new CustomEvent(r,{detail:t})),t}])},864048,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(653772),a=e.r(511043),s=e.r(444951),i=e.r(105815);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},u=function(e){let t={...o,...e},r=(0,a.lazy)(()=>t.loader().then(l)),u=t.loading;function d(e){let l=u?(0,n.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...o?{fallback:l}:{},children:c})}return d.displayName="LoadableComponent",d}},23382,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let n=e.r(481258)._(e.r(864048));function a(e,t){let r={};"function"==typeof e&&(r.loader=e);let a={...r,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},383297,e=>{"use strict";let t=(0,e.i(419412).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,t],383297)},967422,e=>{e.v(t=>Promise.all(["static/chunks/3bfk44a51kg4q.js","static/chunks/08ry13eaw_kkf.js","static/chunks/43o2ye26rg7v8.js","static/chunks/0lq1yjb3t23ab.css"].map(t=>e.l(t))).then(()=>t(928210)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,716032,e=>{"use strict";var s=e.i(653772),t=e.i(511043),a=e.i(255334),r=e.i(613349),i=e.i(516266),n=e.i(126942),l=e.i(500324),c=e.i(23055),d=e.i(222862),o=e.i(186339),m=e.i(903477),u=e.i(473131),x=e.i(728886),h=e.i(553617),p=e.i(205189);function f(){let{workspaceId:e,slug:a}=(0,l.useWorkspace)(),r=(0,c.useSession)(),f=(0,n.useRouter)(),[g,j]=(0,t.useState)(""),[v,N]=(0,t.useState)(!0),[b,y]=(0,t.useState)(""),[k,w]=(0,t.useState)(""),[C,T]=(0,t.useState)(""),[S,E]=(0,t.useState)(""),[_,M]=(0,t.useState)(!1),[P,z]=(0,t.useState)({}),[I,O]=(0,t.useState)(""),[R,$]=(0,t.useState)(!1),F=(0,t.useCallback)(async()=>{N(!0);try{let s=r.data?.user?.id,[t,a]=await Promise.all([(0,d.listMembers)(e),(0,d.listWorkspaces)()]),i=t.find(e=>e.user_id===s);j(i?.role??"");let n=a.find(s=>s.id===e);n&&(y(n.name),w(n.slug),T(n.name),E(n.slug))}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load workspace info")}finally{N(!1)}},[e,r.data?.user?.id]);(0,t.useEffect)(()=>{r.data&&F()},[F,r.data]);let A=b!==C||k!==S,D=async()=>{let s=(0,h.validateWorkspaceForm)({name:b,slug:k});if(z(s),!(0,h.hasWorkspaceFormErrors)(s)){M(!0);try{let s=await (0,d.updateWorkspace)(e,{name:b.trim(),slug:k.trim()});(0,p.trackSettingsUpdated)({setting_tab:"general"}),T(s.name),E(s.slug),i.toast.success("Workspace updated"),s.slug!==a&&f.replace(`/w/${s.slug}/settings`)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to update workspace")}finally{M(!1)}}},L=async()=>{if(I===C){$(!0);try{await (0,d.deleteWorkspace)(e,C),i.toast.success("Workspace deleted"),f.replace("/workspaces")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to delete workspace")}finally{$(!1)}}};return v?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-32"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):"owner"!==g?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Only workspace owners can edit workspace settings."}):(0,s.jsxs)("div",{className:"space-y-10",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Workspace"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-name",children:"Name"}),(0,s.jsx)(m.Input,{id:"workspace-name",value:b,onChange:e=>{let s=e.target.value;y(s),P.name&&s.trim()&&z(e=>({...e,name:void 0}))},placeholder:"Workspace name","aria-invalid":!!P.name,"aria-describedby":P.name?"workspace-name-error":void 0}),P.name&&(0,s.jsx)("p",{id:"workspace-name-error",className:"text-xs text-destructive",children:P.name})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-slug",children:"Slug"}),(0,s.jsx)(m.Input,{id:"workspace-slug",value:k,onChange:e=>{let s=e.target.value;w(s),P.slug&&s.trim()&&z(e=>({...e,slug:void 0}))},placeholder:"workspace-slug","aria-invalid":!!P.slug,"aria-describedby":P.slug?"workspace-slug-error":void 0}),P.slug&&(0,s.jsx)("p",{id:"workspace-slug-error",className:"text-xs text-destructive",children:P.slug}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:["Used in URLs: /w/",k,"/"]})]})]}),(0,s.jsx)(o.Button,{size:"sm",onClick:D,disabled:!A||_,children:_?"Saving…":"Save"})]}),(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,s.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Deleting this workspace is permanent and cannot be undone. All agents, conversations, and data will be lost."}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(u.Label,{htmlFor:"delete-confirm",className:"text-xs",children:["Type ",(0,s.jsx)("span",{className:"font-medium text-foreground",children:C})," to confirm"]}),(0,s.jsx)(m.Input,{id:"delete-confirm",value:I,onChange:e=>O(e.target.value),placeholder:C})]}),(0,s.jsx)(o.Button,{size:"sm",variant:"destructive",onClick:L,disabled:I!==C||R,children:R?"Deleting…":"Delete Workspace"})]})]})]})}var g=e.i(740513);function j({ratio:e,size:t=16,stroke:a=1.5}){let i=(t-a)/2,n=2*Math.PI*i,l=(e<=0?0:e>=1?1:Math.log1p(99*e)/Math.log(100))*n;return(0,s.jsxs)("svg",{width:t,height:t,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-border"}),(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,strokeDasharray:`${l} ${n-l}`,strokeLinecap:"round",className:(0,r.cn)("transition-all duration-300",e>.9?"text-destructive/70":e>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}function v(){let{workspaceId:e}=(0,l.useWorkspace)(),[a,r]=(0,t.useState)(""),[n,c]=(0,t.useState)(""),[o,m]=(0,t.useState)(!0),u=(0,t.useRef)(a);(0,t.useEffect)(()=>{u.current=a},[a]);let h=(0,t.useRef)(n);(0,t.useEffect)(()=>{h.current=n},[n]);let p=(0,t.useRef)(null),f=(0,t.useRef)(!1),v=(0,t.useCallback)(async()=>{m(!0);try{let s=await (0,d.getMemberMe)(e);r(s.global_instruction),c(s.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load settings")}finally{m(!1)}},[e]);(0,t.useEffect)(()=>{v()},[v]);let N=(0,t.useRef)(()=>{}),b=(0,t.useCallback)(async()=>{if(f.current)return;let s=u.current;if(s!==h.current){f.current=!0;try{let t=await (0,d.updateMemberMe)(e,s);c(t.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to save")}finally{f.current=!1,u.current!==h.current&&N.current()}}},[e]),y=(0,t.useCallback)(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(b,500)},[b]);(0,t.useEffect)(()=>{N.current=y},[y]);let k=(0,t.useCallback)(e=>{r(e),y()},[y]);(0,t.useEffect)(()=>{let s=()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e]),(0,t.useEffect)(()=>()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}},[e]);let w=a.length/5e4;return o?(0,s.jsxs)("div",{className:"px-6 py-6 space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-48"}),(0,s.jsx)(x.Skeleton,{className:"h-40 w-full"})]}):(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4",children:(0,s.jsx)(g.MarkdownEditor,{value:a,onChange:k,placeholder:"Write instructions that every agent you own will follow...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3",children:[(0,s.jsx)(j,{ratio:w}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"This instruction is prepended to every agent's individual instruction."})]})]})}var N=e.i(330746),b=e.i(813141),y=e.i(947308),k=e.i(419412);let w=(0,k.default)("user-minus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);var C=e.i(329686);function T(e){return`${window.location.origin}/invite/${e}`}function S(){let{workspaceId:e}=(0,l.useWorkspace)(),a=(0,c.useSession)(),n=a.data?.user?.id,[m,u]=(0,t.useState)([]),[h,f]=(0,t.useState)([]),[g,j]=(0,t.useState)(!0),[v,k]=(0,t.useState)(!1),S=m.find(e=>e.user_id===n)?.role==="owner",E=(0,t.useCallback)(async()=>{j(!0);try{let[s,t]=await Promise.all([(0,d.listMembers)(e),(0,d.listInvites)(e).catch(()=>[])]);u(s),f(t)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load members")}finally{j(!1)}},[e]);(0,t.useEffect)(()=>{E()},[E]);let _=async()=>{k(!0);try{let s=await (0,d.createInvite)(e);(0,p.trackTeamMemberInvited)({workspace_id:e}),f(e=>[...e,s]);let t=T(s.token);await navigator.clipboard.writeText(t),i.toast.success("Invite link copied to clipboard")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to generate invite")}finally{k(!1)}},M=async e=>{let s=T(e);try{await navigator.clipboard.writeText(s),i.toast.success("Invite link copied")}catch{i.toast.error("Failed to copy link")}},P=async s=>{try{await (0,d.revokeInvite)(e,s),f(e=>e.filter(e=>e.id!==s)),i.toast.success("Invite revoked")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to revoke invite")}},z=async s=>{try{await (0,d.removeMember)(e,s),u(e=>e.filter(e=>e.id!==s)),i.toast.success("Member removed")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to remove member")}};return g?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-24"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-4 w-24 mt-6"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):(0,s.jsxs)("div",{className:"space-y-8",children:[S&&(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pending Invites"}),(0,s.jsxs)(o.Button,{size:"sm",variant:"outline",onClick:_,disabled:v,children:[(0,s.jsx)(y.Plus,{className:"size-3.5 mr-1"}),v?"Generating…":"Generate invite link"]})]}),0===h.length?(0,s.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:"No active invite links. Generate one to invite someone to this workspace."}):(0,s.jsx)("div",{className:"space-y-1.5",children:h.map(e=>{let t=new Date(e.expires_at),a=t<new Date;return(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-xs",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:(0,r.cn)("font-mono truncate",a&&"text-muted-foreground line-through"),children:["/invite/",e.token.slice(0,12),"…"]}),(0,s.jsx)("p",{className:(0,r.cn)("text-muted-foreground/70 mt-0.5",a&&"text-destructive/70"),children:a?"Expired":`Expires ${t.toLocaleDateString()}`})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 ml-2 shrink-0",children:[!a&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>M(e.token)}),children:(0,s.jsx)(N.Copy,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Copy invite link"})]}),(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-destructive hover:text-destructive",onClick:()=>P(e.id)}),children:(0,s.jsx)(b.Trash2,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Revoke invite"})]})]})]},e.id)})})]}),(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Members"}),(0,s.jsx)("div",{className:"space-y-1.5",children:m.map(e=>{let t=e.user_id===n,a=e.name?e.name.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():e.email.slice(0,2).toUpperCase();return(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border/50 px-3 py-2",children:[(0,s.jsx)("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground shrink-0 overflow-hidden",children:e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-full object-cover"}):a}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-sm font-medium truncate leading-tight",children:[e.name||e.email,t&&(0,s.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),e.name&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email})]}),(0,s.jsx)("span",{className:(0,r.cn)("text-xs px-1.5 py-0.5 rounded shrink-0","owner"===e.role?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.role}),S&&!t&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>z(e.id)}),children:(0,s.jsx)(w,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Remove member"})]})]},e.id)})})]})]})}var E=e.i(885515),_=e.i(254618),M=e.i(899746);function P(){let[e,a]=(0,t.useState)(!1),[r,n]=(0,t.useState)([...M.NOTIFICATION_EVENTS]),[l,c]=(0,t.useState)(!0),[d,o]=(0,t.useState)(!1);(0,t.useEffect)(()=>{c((0,M.isNotificationSupported)()),a((0,M.getNotificationEnabled)()),n((0,M.getNotificationEvents)()),(0,M.isNotificationSupported)()&&o("denied"===Notification.permission)},[]);let m=async e=>{if(!e){a(!1),(0,M.setNotificationEnabled)(!1);return}await (0,M.requestNotificationPermission)()?(a(!0),(0,M.setNotificationEnabled)(!0)):(o(!0),i.toast.error("Notification permission denied. Please enable it in browser settings."))};return l?(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Browser Notifications"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)("p",{className:"text-sm",children:"Enable notifications"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Get notified when tasks finish while the tab is in the background"})]}),(0,s.jsx)(_.Switch,{checked:e,onCheckedChange:m,disabled:d&&!e})]}),d&&!e&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:"Notification permission was denied. Please allow it in your browser settings."}),e&&(0,s.jsxs)("div",{className:"space-y-2 pl-0.5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Notify me when:"}),M.NOTIFICATION_EVENTS.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[(0,s.jsx)(E.Checkbox,{checked:r.includes(e),onCheckedChange:()=>{n(s=>{let t=s.includes(e)?s.filter(s=>s!==e):[...s,e];return(0,M.setNotificationEvents)(t),t})}}),M.NOTIFICATION_EVENT_LABELS[e]]},e))]})]})]})}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your browser does not support notifications."})}let z=(0,k.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"}]]);var I=e.i(399561),O=e.i(460520),R=e.i(961909),$=e.i(790961);function F(){let[e,a]=(0,t.useState)(!1),[i,n]=(0,t.useState)(I.CLOUD_CODE_MONSTER_PET_PRESETS[0].id),l=(0,I.getCloudCodeMonsterPreset)(i);return(0,t.useEffect)(()=>{a((0,$.readHomePetSettings)().enabled),n((0,I.readCloudCodeMonsterPetPresetId)());let e=e=>{let s=e.detail?.presetId;n(s?(0,I.getCloudCodeMonsterPreset)(s).id:(0,I.readCloudCodeMonsterPetPresetId)())};return window.addEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e),()=>{window.removeEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e)}},[]),(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pet"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(u.Label,{htmlFor:"pet-enabled",className:"text-sm",children:"Enable pet"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off by default. Turn it on when you want the workspace companion."})]}),(0,s.jsx)(_.Switch,{id:"pet-enabled",checked:e,onCheckedChange:e=>{a(e),(0,$.writeHomePetSettings)({enabled:e})}})]})})]}),e?(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Preset"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l.name})]}),(0,s.jsx)("div",{className:"grid size-14 place-items-center rounded-md bg-card ring-1 ring-border/60",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:l,className:"size-11"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:I.CLOUD_CODE_MONSTER_PET_PRESETS.map(e=>{let t=e.id===l.id;return(0,s.jsxs)("button",{type:"button","aria-pressed":t,onClick:()=>{n((0,I.writeCloudCodeMonsterPetPresetId)(e.id))},className:(0,r.cn)("group grid h-28 min-w-0 grid-rows-[1fr_auto] rounded-md border bg-card/60 p-2 text-left transition-all hover:border-foreground/20 hover:bg-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",t?"border-primary/50 bg-accent text-foreground":"border-border/50 text-muted-foreground"),children:[(0,s.jsx)("div",{className:"grid place-items-center rounded bg-background/70 ring-1 ring-border/35",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:e,className:"size-14 transition-transform duration-200 group-hover:scale-105"})}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center justify-between gap-1 text-[10px] leading-none",children:[(0,s.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),t?(0,s.jsx)(z,{className:"size-3 shrink-0 text-primary"}):(0,s.jsx)("span",{className:"shrink-0 text-muted-foreground",children:e.id.replace("pet-","#")})]})]},e.id)})})]}):null]})}var A=e.i(355578),D=e.i(934351),L=e.i(875061);let W=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var U=e.i(896210),B=e.i(392277);let H=(0,k.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var q=e.i(646769);let G=(0,k.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function V({icon:e,label:t,value:a,sub:r}){return(0,s.jsx)(D.Card,{size:"sm",children:(0,s.jsxs)(D.CardContent,{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,s.jsx)("p",{className:"text-2xl font-semibold leading-none tracking-tight",children:a}),r&&(0,s.jsx)(L.Badge,{variant:"secondary",className:"text-[10px] px-1.5 h-4 font-normal",children:r})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground truncate",children:t})]})]})})}function J({agents:e,runtimes:t,activeTaskCounts:a,overview:r}){let i=new Map;for(let e of t){let s=e.daemon_id??e.id;i.set(s,i.get(s)||"online"===e.status)}let n=i.size,l=[...i.values()].filter(Boolean).length,c=Object.values(a).reduce((e,s)=>e+s,0),d=e.filter(e=>{let s=t.find(s=>s.id===e.runtime_id);return s?.status==="online"}).length;return(0,s.jsxs)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,s.jsx)(V,{icon:q.Monitor,label:"Machines",value:`${l}/${n}`,sub:"online"}),(0,s.jsx)(V,{icon:W,label:"Agents",value:e.length,sub:`${d} online`}),(0,s.jsx)(V,{icon:H,label:"Members",value:r.members.length,sub:r.pending_invites>0?`${r.pending_invites} pending`:void 0}),(0,s.jsx)(V,{icon:G,label:"Active Tasks",value:c,sub:r.task_stats.queued>0?`${r.task_stats.queued} queued`:void 0}),(0,s.jsx)(V,{icon:B.Send,label:"Emails Sent",value:r.email_stats.outbound,sub:`${r.email_stats.unread} unread`}),(0,s.jsx)(V,{icon:U.Mail,label:"Custom Emails",value:r.email_accounts.length})]})}function K({overview:e}){let{completed:t,failed:a,cancelled:r,queued:i,stale:n}=e.task_stats,l=t+a,c=l>0?(a/l*100).toFixed(1):"0";return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Task Health (Today)"})}),(0,s.jsx)(D.CardContent,{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(Q,{label:"Completed",value:t}),(0,s.jsx)(Q,{label:"Failed",value:a,className:a>0?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Cancelled",value:r}),(0,s.jsx)(Q,{label:"Failure Rate",value:`${c}%`,className:Number(c)>10?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Queue Backlog",value:i,className:i>10?"text-amber-500":void 0}),(0,s.jsx)(Q,{label:"Stale Tasks",value:n,className:n>0?"text-destructive":void 0})]})})]})}function Q({label:e,value:t,className:a}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${a??""}`,children:t}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function Y({overview:e,agents:t}){let{inbound:a,outbound:r,unread:i,rejected:n}=e.email_stats,l=new Map(t.map(e=>[e.id,e.name]));return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Email Summary"})}),(0,s.jsxs)(D.CardContent,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:a}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Received"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:r}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Sent"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${i>0?"text-primary":""}`,children:i}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unread"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${n>0?"text-amber-500":""}`,children:n}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Untrust"})]})]}),e.email_accounts.length>0&&(0,s.jsxs)("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Custom Mailboxes"}),e.email_accounts.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`size-1.5 shrink-0 rounded-full ${"active"===e.status?"bg-emerald-500":"bg-destructive"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:"active"===e.status?"Active":`Error: ${e.error_message||"inactive"}`})]}),(0,s.jsx)("span",{className:"truncate",children:e.email_address})]}),(0,s.jsx)("span",{className:"text-muted-foreground shrink-0",children:l.get(e.agent_id)??"—"})]},e.id))]})]})]})}var Z=e.i(345262);function X({runtimes:e,agents:t}){let a=(0,n.useRouter)(),{slug:r}=(0,l.useWorkspace)(),i=new Map;for(let s of e){let e=s.daemon_id??s.id;i.has(e)||i.set(e,{runtimes:[],deviceInfo:s.device_info??""}),i.get(e).runtimes.push(s)}let c=[...i.entries()];return 0===c.length?(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardTitle,{children:"Machines"}),(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>a.push(`/w/${r}/runtimes`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})})]}),(0,s.jsx)(D.CardContent,{children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No machines connected."})})]}):(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Machines"})}),(0,s.jsx)(D.CardContent,{className:"space-y-3",children:c.map(([e,a])=>{let r=a.runtimes.some(e=>"online"===e.status),i=a.runtimes.map(e=>e.last_seen_at).filter(Boolean).sort().reverse()[0],n=t.filter(e=>a.runtimes.some(s=>s.id===e.runtime_id)),l=a.runtimes.some(e=>e.pending_update_version),c=a.runtimes.find(e=>e.pending_update_version)?.pending_update_version;return(0,s.jsxs)("div",{className:"flex items-start gap-3 text-xs",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:r?"Online":"Offline"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium truncate",children:a.deviceInfo||e.slice(0,12)}),l&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{children:(0,s.jsx)(L.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-amber-500 border-amber-500/30",children:"update"})})}),(0,s.jsxs)(C.TooltipContent,{side:"top",children:["Pending update to v",c]})]})]}),(0,s.jsxs)("div",{className:"text-muted-foreground mt-0.5",children:[n.length>0?n.map(e=>e.name).join(", "):"No agents"," · ",function(e){if(!e)return"never";let s=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(s<60)return`${s}s ago`;let t=Math.floor(s/60);if(t<60)return`${t}m ago`;let a=Math.floor(t/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}(i??null)]})]})]},e)})})]})}function ee({overview:e}){let t=(0,n.useRouter)(),{slug:a}=(0,l.useWorkspace)(),{members:r,pending_invites:i}=e;return(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>t.push(`/w/${a}/settings`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})}),(0,s.jsxs)(D.CardTitle,{children:["Team",i>0&&(0,s.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:["(",i," pending invite",i>1?"s":"",")"]})]})]}),(0,s.jsx)(D.CardContent,{className:"p-0",children:(0,s.jsx)("div",{className:"divide-y divide-border/50",children:[...r].sort((e,s)=>"owner"===e.role?-1:+("owner"===s.role)).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-7 rounded-full shrink-0"}):(0,s.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-secondary text-xs font-medium",children:(e.name||e.email).charAt(0).toUpperCase()}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"text-sm font-medium truncate block",children:e.name||e.email}),e.name&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate block",children:e.email})]}),(0,s.jsx)(L.Badge,{variant:"owner"===e.role?"default":"secondary",className:"text-[10px] px-1.5 py-0 shrink-0",children:e.role})]},e.id))})})]})}function es(){let{agents:e,runtimes:a,loading:r,activeTaskCounts:i}=(0,A.useAgentContext)(),{workspaceId:n}=(0,l.useWorkspace)(),[c,o]=(0,t.useState)(null),[m,u]=(0,t.useState)(!1);return((0,t.useEffect)(()=>{if(r)return;let e=!1;return u(!0),(0,d.getWorkspaceOverview)(n).then(s=>{e||o(s)}).catch(()=>{}).finally(()=>{e||u(!1)}),()=>{e=!0}},[r,n]),m||!c)?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(J,{agents:e,runtimes:a,activeTaskCounts:i,overview:c}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(K,{overview:c}),(0,s.jsx)(Y,{overview:c,agents:e})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(X,{runtimes:a,agents:e}),(0,s.jsx)(ee,{overview:c})]})]})}let et=[{id:"general",label:"General"},{id:"pet",label:"Pet"},{id:"instruction",label:"Global Instruction"},{id:"notifications",label:"Notifications"},{id:"members",label:"Members"},{id:"usages",label:"Usages"}];e.s(["default",0,function(){let[e,i]=(0,t.useState)("general");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5 gap-3",children:(0,s.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,s.jsx)("h1",{className:"text-sm font-medium",children:"Settings"})})}),(0,s.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,s.jsx)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:block",children:et.map(t=>(0,s.jsx)("button",{onClick:()=>i(t.id),className:(0,r.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",e===t.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:t.label},t.id))}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,s.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,s.jsx)(a.Tabs,{className:"items-center",value:e,onValueChange:e=>i(e),children:(0,s.jsx)(a.TabsList,{className:"h-auto gap-1",children:et.map(e=>(0,s.jsx)(a.TabsTrigger,{value:e.id,children:e.label},e.id))})})}),(0,s.jsx)("div",{className:(0,r.cn)("flex-1 overflow-y-auto thin-scrollbar","instruction"!==e&&"px-5 py-5"),children:"instruction"===e?(0,s.jsx)(v,{}):"usages"===e?(0,s.jsx)(es,{}):(0,s.jsxs)("div",{className:"mx-auto max-w-md",children:["general"===e&&(0,s.jsx)(f,{}),"pet"===e&&(0,s.jsx)(F,{}),"notifications"===e&&(0,s.jsx)(P,{}),"members"===e&&(0,s.jsx)(S,{})]})})]})]})]})}],716032)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,573404,e=>{"use strict";let t=(0,e.i(419412).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",0,t])},392277,e=>{"use strict";let t=(0,e.i(419412).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],392277)},888917,e=>{"use strict";let t,n;var r=e.i(653772),a=e.i(511043);function i({groupSize:e,panelElement:t,styleProp:n}){let r,[a,o]=function(e){switch(typeof e){case"number":return[e,"px"];case"string":{let t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}(n);switch(o){case"%":r=a/100*e;break;case"px":r=a;break;case"rem":r=a*parseFloat(getComputedStyle(t.ownerDocument.documentElement).fontSize);break;case"em":r=a*parseFloat(getComputedStyle(t).fontSize);break;case"vh":r=a/100*window.innerHeight;break;case"vw":r=a/100*window.innerWidth}return r}function o(e){return parseFloat(e.toFixed(3))}function l({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>e+="horizontal"===t?n.element.offsetWidth:n.element.offsetHeight,0)}function s(e){let{panels:t}=e,n=l({group:e});return 0===n?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:!0===e.panelConstraints.collapsible,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let t,{element:r,panelConstraints:a}=e,l=0;void 0!==a.collapsedSize&&(l=o(i({groupSize:n,panelElement:r,styleProp:a.collapsedSize})/n*100)),void 0!==a.defaultSize&&(t=o(i({groupSize:n,panelElement:r,styleProp:a.defaultSize})/n*100));let s=0;void 0!==a.minSize&&(s=o(i({groupSize:n,panelElement:r,styleProp:a.minSize})/n*100));let u=100;return void 0!==a.maxSize&&(u=o(i({groupSize:n,panelElement:r,styleProp:a.maxSize})/n*100)),{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:!0===a.collapsible,defaultSize:t,disabled:a.disabled,minSize:s,maxSize:u,panelId:e.id}})}function u(e,t="Assertion error"){if(!e)throw Error(t)}function d(e,t){return Array.from(t).sort("horizontal"===e?f:p)}function f(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return 0!==n?n:e.element.offsetWidth-t.element.offsetWidth}function p(e,t){let n=e.element.offsetTop-t.element.offsetTop;return 0!==n?n:e.element.offsetHeight-t.element.offsetHeight}function c(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function h(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function g(e){let{element:n,orientation:r,panels:a,separators:i}=e,o=d(r,Array.from(n.children).filter(c).map(e=>({element:e}))).map(({element:e})=>e),s=[],f=!1,p=!1,g=-1,v=-1,m=0,b,y=[];{let e=-1;for(let t of o)t.hasAttribute("data-panel")&&(e++,t.hasAttribute("data-disabled")||(m++,-1===g&&(g=e),v=e))}if(m>1){let n=-1;for(let d of o)if(d.hasAttribute("data-panel")){n++;let i=a.find(e=>e.element===d);if(i){if(b){let a,o=b.element.getBoundingClientRect(),c=d.getBoundingClientRect();if(p){let e="horizontal"===r?new DOMRect(o.right,o.top,0,o.height):new DOMRect(o.left,o.bottom,o.width,0),t="horizontal"===r?new DOMRect(c.left,c.top,0,c.height):new DOMRect(c.left,c.top,c.width,0);switch(y.length){case 0:a=[e,t];break;case 1:{let n=y[0],i=function({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},a,i=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=h(r,n),l="horizontal"===e?t:o;l<i&&(i=l,a=n)}return u(a,"No rect found"),a}({orientation:r,rects:[o,c],targetRect:n.element.getBoundingClientRect()});a=[n,i===o?t:e];break}default:a=y}}else a=y.length?y:["horizontal"===r?new DOMRect(o.right,c.top,c.left-o.right,c.height):new DOMRect(c.left,o.bottom,c.width,c.top-o.bottom)];for(let r of a){let a="width"in r?r:r.element.getBoundingClientRect(),o=(void 0===t&&(t="function"==typeof matchMedia&&!!matchMedia("(pointer:coarse)").matches),t)?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(a.width<o){let e=o-a.width;a=new DOMRect(a.x-e/2,a.y,a.width+e,a.height)}if(a.height<o){let e=o-a.height;a=new DOMRect(a.x,a.y-e/2,a.width,a.height+e)}let u=n<=g||n>v;f||u||s.push({group:e,groupSize:l({group:e}),panels:[b,i],separator:"width"in r?void 0:r,rect:a}),f=!1}}p=!1,b=i,y=[]}}else if(d.hasAttribute("data-separator")){null!==d.ariaDisabled&&(f=!0);let e=i.find(e=>e.element===d);e?y.push(e):(b=void 0,y=[])}else p=!0}return s}class v{#e={};addListener(e,t){let n=this.#e[e];return void 0===n?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(void 0!==n)if(1===n.length)n[0].call(null,t);else{let e=!1,r=null,a=Array.from(n);for(let n=0;n<a.length;n++){let i=a[n];try{i.call(null,t)}catch(t){null===r&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(void 0!==n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}}let m=new Map,b=new v;function y(e,t){for(let[t]of m)if(t.id===e)return t}function z(e,t){for(let[t,n]of m)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function S(e,t){return b.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function x(e,t){let n=m.get(e);(m=new Map(m)).set(e,t),b.emit("groupChange",{group:e,prev:n,next:t})}let w=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function C(e){let t=e.length;for(;t--;){let n=e[t];if(u(n,"Missing node"),function(e){let t,n=getComputedStyle(e);return!!("fixed"===n.position||"auto"!==n.zIndex&&("static"!==n.position||"flex"===(t=getComputedStyle(R(e)??e).display)||"inline-flex"===t)||1>+n.opacity||"transform"in n&&"none"!==n.transform||"webkitTransform"in n&&"none"!==n.webkitTransform||"mixBlendMode"in n&&"normal"!==n.mixBlendMode||"filter"in n&&"none"!==n.filter||"webkitFilter"in n&&"none"!==n.webkitFilter||"isolation"in n&&"isolate"===n.isolation||w.test(n.willChange)||"touch"===n.webkitOverflowScrolling)}(n))return n}return null}function P(e){return e&&Number(getComputedStyle(e).zIndex)||0}function L(e){let t=[];for(;e;)t.push(e),e=R(e);return t}function R(e){let{parentNode:t}=e;return null!==t&&"object"==typeof t&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?t.host:t}function E(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let a=g(r),i=function(e,t,n){let r,a={x:1/0,y:1/0};for(let i of t){let t=h(n,i.rect);switch(e){case"horizontal":t.x<=a.x&&(r=i,a=t);break;case"vertical":t.y<=a.y&&(r=i,a=t)}}return r?{distance:a,hitRegion:r}:void 0}(r.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&function({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!c(n)||n.contains(e)||e.contains(n))return!0;if(function(e,t){let n;if(e===t)throw Error("Cannot compare node with itself");let r={a:L(e),b:L(t)};for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();u(n,"Stacking order can only be calculated for elements with a common ancestor");let a={a:P(C(r.a)),b:P(C(r.b))};if(a.a===a.b){let e=n.childNodes,t={a:r.a.at(-1),b:r.b.at(-1)},a=e.length;for(;a--;){let n=e[a];if(n===t.a)return 1;if(n===t.b)return -1}}return Math.sign(a.a-a.b)}(n,e)>0){let a=n;for(;a;){var r;if(a.contains(e))break;if(r=a.getBoundingClientRect(),r.x<t.x+t.width&&r.x+r.width>t.x&&r.y<t.y+t.height&&r.y+r.height>t.y)return!1;a=a.parentElement}}return!0}({groupElement:r.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function M(e,t,n=0){return Math.abs(o(e)-o(t))<=n}function k(e,t){return M(e,t)?0:e>t?1:-1}function D({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:a=0,collapsible:i,disabled:l,maxSize:s=100,minSize:u=0}=t;return l&&!e?n:(0>k(r,u)&&(r=i&&0>k(r,(a+u)/2)?a:u),o(r=Math.min(s,r)))}function T({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:a,trigger:i}){if(M(e,0))return t;let o="imperative-api"===i,l=Object.values(t),s=Object.values(a),d=[...l],[f,p]=r;u(null!=f,"Invalid first pivot index"),u(null!=p,"Invalid second pivot index");let c=0;if("keyboard"===i){{let t=e<0?p:f,r=n[t];u(r,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,minSize:o=0}=r;if(i){let n=l[t];if(u(null!=n,`Previous layout not found for panel index ${t}`),M(n,a)){let t=o-n;k(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?f:p,r=n[t];u(r,`No panel constraints found for index ${t}`);let{collapsedSize:a=0,collapsible:i,minSize:o=0}=r;if(i){let n=l[t];if(u(null!=n,`Previous layout not found for panel index ${t}`),M(n,o)){let t=n-a;k(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}else{let t=e<0?p:f,r=n[t];u(r,`Panel constraints not found for index ${t}`);let a=l[t],{collapsible:i,collapsedSize:o,minSize:s}=r;if(i&&0>k(a,s))if(e>0){let t=s-o;0>k(a+e,s)&&(e=0>=k(e,t/2)?0:t)}else{let t=s-o;0>k(a-e,s)&&(e=k(100+e,100-t/2)>0?0:-t)}}{let t=e<0?1:-1,r=e<0?p:f,a=0;for(;;){let e=l[r];if(u(null!=e,`Previous layout not found for panel index ${r}`),a+=D({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e,(r+=t)<0||r>=n.length)break}let i=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-i:i}{let t=e<0?f:p;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(c),a=l[t];u(null!=a,`Previous layout not found for panel index ${t}`);let i=a-r,s=D({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:a,size:i});if(!M(a,s)&&(c+=a-s,d[t]=s,c.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}(s,d))return a;{let t=e<0?p:f,r=l[t];u(null!=r,`Previous layout not found for panel index ${t}`);let a=r+c,i=D({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:a});if(d[t]=i,!M(i,a)){let t=a-i,r=e<0?p:f;for(;r>=0&&r<n.length;){let a=d[r];u(null!=a,`Previous layout not found for panel index ${r}`);let i=a+t,l=D({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:a,size:i});if(M(a,l)||(t-=l-a,d[r]=l),M(t,0))break;e>0?r--:r++}}}if(!M(Object.values(d).reduce((e,t)=>t+e,0),100,.1))return a;let h=Object.keys(a);return d.reduce((e,t,n)=>(e[h[n]]=t,e),{})}function I(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(void 0===t[n]||0!==k(e[n],t[n]))return!1;return!0}function O({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],a=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!M(a,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];u(null!=t,`No layout data found for index ${e}`);let n=100/a*t;r[e]=n}let i=0;for(let e=0;e<t.length;e++){let a=n[e];u(null!=a,`No layout data found for index ${e}`);let o=r[e];u(null!=o,`No layout data found for index ${e}`);let l=D({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:a,size:o});o!=l&&(i+=o-l,r[e]=l)}if(!M(i,0))for(let e=0;e<t.length;e++){let n=r[e];u(null!=n,`No layout data found for index ${e}`);let a=n+i,o=D({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:a});if(n!==o&&(i-=o-n,r[e]=o,M(i,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function j({groupId:e,panelId:t}){let n=()=>{for(let[t,{defaultLayoutDeferred:n,derivedPanelConstraints:r,layout:a,groupSize:i,separatorToPanels:o}]of m)if(t.id===e)return{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:t,groupSize:i,layout:a,separatorToPanels:o};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(void 0!==e)return e;throw Error(`Panel constraints not found for Panel ${t}`)},a=()=>{let e=n().group.panels.find(e=>e.id===t);if(void 0!==e)return e;throw Error(`Layout not found for Panel ${t}`)},s=()=>{let e=n().layout[t];if(void 0!==e)return e;throw Error(`Layout not found for Panel ${t}`)},u=e=>{if(e===s())return;let{defaultLayoutDeferred:r,derivedPanelConstraints:a,group:i,groupSize:l,layout:u,separatorToPanels:d}=n(),f=O({layout:(({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:a})=>{let i=s(),l=n.findIndex(e=>e.id===t),u=0===l,d=l===n.length-1;if(d&&e<i&&(u||n.slice(0,l).every((e,t)=>{let n=a[t];return n?.collapsible&&M(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,l).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:o(100-e)}}return T({delta:d?i-e:e-i,initialLayout:r,panelConstraints:a,pivotIndices:d?[l-1,l]:[l,l+1],prevLayout:r,trigger:"imperative-api"})})({nextSize:e,panels:i.panels,prevLayout:u,derivedPanelConstraints:a}),panelConstraints:a});I(u,f)||x(i,{defaultLayoutDeferred:r,derivedPanelConstraints:a,groupSize:l,layout:f,separatorToPanels:d})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=a(),i=s();e&&i!==t&&(n.expandToSize=i,u(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:i}=a(),o=s();if(e&&o===t){let e=i.expandToSize??n;0===e&&(e=1),u(e)}},getSize:()=>{let{group:e}=n(),t=s(),{element:r}=a();return{asPercentage:t,inPixels:"horizontal"===e.orientation?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=s();return e&&M(t,n)},resize:e=>{let{group:t}=n(),{element:r}=a(),s=l({group:t});u(o(i({groupSize:s,panelElement:r,styleProp:e})/s*100))}}}function N(e){e.defaultPrevented||E(e,m).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>void 0!==e.panelConstraints.defaultSize);if(n){let r=n.panelConstraints.defaultSize,a=j({groupId:t.group.id,panelId:n.id});a&&void 0!==r&&(a.resize(r),e.preventDefault())}}})}function F(e){for(let[t]of m)if(t.separators.some(t=>t.element===e))return t;throw Error("Could not find parent Group for separator element")}function A({groupId:e}){let t=()=>{for(let[t,n]of m)if(t.id===e)return{group:t,...n};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:a,groupSize:i,layout:o,separatorToPanels:l}=t(),s=O({layout:e,panelConstraints:r});return n?o:(I(o,s)||x(a,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:i,layout:s,separatorToPanels:l}),s)}}}function $(e,t){let n=F(e),r=z(n.id,!0),a=n.separators.find(t=>t.element===e);u(a,"Matching separator not found");let i=r.separatorToPanels.get(a);u(i,"Matching panels not found");let o=i.map(e=>n.panels.indexOf(e)),l=A({groupId:n.id}).getLayout(),s=O({layout:T({delta:t,initialLayout:l,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:l,trigger:"keyboard"}),panelConstraints:r.derivedPanelConstraints});I(l,s)||x(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:s,separatorToPanels:r.separatorToPanels})}function G(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=F(t);if(!n.disabled)switch(e.key){case"ArrowDown":e.preventDefault(),"vertical"===n.orientation&&$(t,5);break;case"ArrowLeft":e.preventDefault(),"horizontal"===n.orientation&&$(t,-5);break;case"ArrowRight":e.preventDefault(),"horizontal"===n.orientation&&$(t,5);break;case"ArrowUp":e.preventDefault(),"vertical"===n.orientation&&$(t,-5);break;case"End":e.preventDefault(),$(t,100);break;case"Enter":{e.preventDefault();let n=F(t),{derivedPanelConstraints:r,layout:a,separatorToPanels:i}=z(n.id,!0),o=n.separators.find(e=>e.element===t);u(o,"Matching separator not found");let l=i.get(o);u(l,"Matching panels not found");let s=l[0],d=r.find(e=>e.panelId===s.id);if(u(d,"Panel metadata not found"),d.collapsible){let e=a[s.id];$(t,(d.collapsedSize===e?n.mutableState.expandedPanelSizes[s.id]??d.minSize:d.collapsedSize)-e)}break}case"F6":{e.preventDefault();let n=F(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);u(null!==r,"Index not found");let a=e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0;n[a].focus({preventScroll:!0});break}case"Home":e.preventDefault(),$(t,-100)}}let B={cursorFlags:0,state:"inactive"},W=new v;function H(e){let t=B;B=e,W.emit("change",{prev:t,next:e})}function V(e){if(e.defaultPrevented||"mouse"===e.pointerType&&e.button>0)return;let t=m,n=E(e,t),r=new Map,a=!1;n.forEach(e=>{e.separator&&(a||(a=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),H({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}let X=e=>e,U=()=>{};function Y(){return void 0===n&&(n=!1,"u">typeof window&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(n=!0)),n}let _=new WeakMap;function K(e){if(null===e.defaultView||void 0===e.defaultView)return;let{prevStyle:t,styleSheet:n}=_.get(e)??{};void 0===n&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=B;switch(r.state){case"active":case"hover":{let e=function({cursorFlags:e,groups:t,state:n}){let r=0,a=0;switch(n){case"active":case"hover":t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case"horizontal":r++;break;case"vertical":a++}})}if(0!==r||0!==a){if("active"===n&&e&&Y()){let t=(4&e)!=0,n=(8&e)!=0;if((1&e)!=0)return t?"se-resize":n?"ne-resize":"e-resize";if((2&e)!=0)return t?"sw-resize":n?"nw-resize":"w-resize";if(t)return"s-resize";if(n)return"n-resize"}return Y()?r>0&&a>0?"move":r>0?"ew-resize":"ns-resize":r>0&&a>0?"grab":r>0?"col-resize":"row-resize"}}({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),a=`*, *:hover {cursor: ${e} !important; }`;if(t===a)return;t=a,e?0===n.cssRules.length?n.insertRule(a):n.replaceSync(a):1===n.cssRules.length&&n.deleteRule(0);break}case"inactive":t=void 0,1===n.cssRules.length&&n.deleteRule(0)}_.set(e,{prevStyle:t,styleSheet:n})}function q({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:a,pointerDownAtPoint:i,prevCursorFlags:o}){var l;let s,u,d=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:l,panels:s}=n,{disableCursor:u}=n.mutableState,f=0;f=i?"horizontal"===l?(t.clientX-i.x)/o*100:(t.clientY-i.y)/o*100:"horizontal"===l?t.clientX<0?-100:100:t.clientY<0?-100:100;let p=r.get(n),c=a.get(n);if(!p||!c)return;let{defaultLayoutDeferred:h,derivedPanelConstraints:g,groupSize:v,layout:m,separatorToPanels:b}=c;if(g&&m&&b){let t=T({delta:f,initialLayout:p,panelConstraints:g,pivotIndices:e.panels.map(e=>s.indexOf(e)),prevLayout:m,trigger:"mouse-or-touch"});if(I(t,m)){if(0!==f&&!u)switch(l){case"horizontal":d|=f<0?1:2;break;case"vertical":d|=f<0?4:8}}else x(e.group,{defaultLayoutDeferred:h,derivedPanelConstraints:g,groupSize:v,layout:t,separatorToPanels:b})}});let f=0;0===t.movementX?f|=3&o:f|=3&d,0===t.movementY?f|=12&o:f|=12&d,l=f,s=B,(u={...B}).cursorFlags=l,B=u,W.emit("change",{prev:s,next:u}),K(e)}function J(e){let t=m,n=B;"active"===n.state&&q({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Q(e){if(e.defaultPrevented)return;let t=B,n=m;if("active"===t.state){if(0===e.buttons){H({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(e=>{let t=z(e.group.id,!0);x(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}q({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags})}else{let r=E(e,n);0===r.length?"inactive"!==t.state&&H({cursorFlags:0,state:"inactive"}):H({cursorFlags:0,hitRegions:r,state:"hover"}),K(e.currentTarget)}}function Z(e){e.relatedTarget instanceof HTMLIFrameElement&&"hover"===B.state&&H({cursorFlags:0,state:"inactive"})}function ee(e){if(e.defaultPrevented||"mouse"===e.pointerType&&e.button>0)return;let t=B;"active"===t.state&&(H({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(K(e.currentTarget),t.hitRegions.forEach(e=>{let t=z(e.group.id,!0);x(e.group,t)}),e.preventDefault()))}function et(e){let t=0,n=0,r={};for(let a of e)if(void 0!==a.defaultSize){t++;let e=o(a.defaultSize);n+=e,r[a.panelId]=e}else r[a.panelId]=void 0;let a=e.length-t;if(0!==a){let t=o((100-n)/a);for(let n of e)void 0===n.defaultSize&&(r[n.panelId]=t)}return r}let en=new Map;function er(e){let t=(0,a.useId)();return`${e??t}`}let ea="u">typeof window?a.useLayoutEffect:a.useEffect;function ei(e){let t=(0,a.useRef)(e);return ea(()=>{t.current=e},[e]),(0,a.useCallback)((...e)=>t.current?.(...e),[t])}function eo(...e){return ei(t=>{e.forEach(e=>{if(e)switch(typeof e){case"function":e(t);break;case"object":e.current=t}})})}function el(e){let t=(0,a.useRef)({...e});return ea(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}let es=(0,a.createContext)(null);function eu({children:e,className:t,defaultLayout:n,disableCursor:i,disabled:f,elementRef:p,groupRef:c,id:h,onLayoutChange:v,onLayoutChanged:b,orientation:w="horizontal",resizeTargetMinimumSize:C={coarse:20,fine:10},style:P,...L}){let R,E=(0,a.useRef)({onLayoutChange:{},onLayoutChanged:{}}),k=ei(e=>{I(E.current.onLayoutChange,e)||(E.current.onLayoutChange=e,v?.(e))}),D=ei(e=>{I(E.current.onLayoutChanged,e)||(E.current.onLayoutChanged=e,b?.(e))}),T=er(h),j=(0,a.useRef)(null),[F,$]=function(){let[e,t]=(0,a.useState)({});return[e,(0,a.useCallback)(()=>t({}),[])]}(),W=(0,a.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:C,separators:[]}),H=eo(j,p);R=(0,a.useRef)({getLayout:()=>({}),setLayout:X}),(0,a.useImperativeHandle)(c,()=>R.current,[]),ea(()=>{Object.assign(R.current,A({groupId:T}))});let U=ei((e,t)=>{let r=B,a=y(e),i=z(e);if(i){let e=!1;return"active"===r.state&&(e=r.hitRegions.some(e=>e.group===a)),{flexGrow:i.layout[t]??1,pointerEvents:e?"none":void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),Y=el({defaultLayout:n,disableCursor:i}),_=(0,a.useMemo)(()=>({get disableCursor(){return!!Y.disableCursor},getPanelStyles:U,id:T,orientation:w,registerPanel:e=>{let t=W.current;return t.panels=d(w,[...t.panels,e]),$(),()=>{t.panels=t.panels.filter(t=>t!==e),$()}},registerSeparator:e=>{let t=W.current;return t.separators=d(w,[...t.separators,e]),$(),()=>{t.separators=t.separators.filter(t=>t!==e),$()}},updatePanelProps:(e,{disabled:t})=>{let n=W.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=y(T),a=z(T);r&&a&&x(r,{...a,derivedPanelConstraints:s(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=W.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[U,T,$,w,Y]),K=(0,a.useRef)(null);return ea(()=>{let e,t,n,r,a,i,d,p,c,h,v,b,y,C=j.current;if(null===C)return;let P=W.current;if(void 0!==Y.defaultLayout&&Object.keys(Y.defaultLayout).length===P.panels.length)for(let t of(e={},P.panels)){let n=Y.defaultLayout[t.id];void 0!==n&&(e[t.id]=n)}let L={disabled:!!f,element:C,id:T,mutableState:{defaultLayout:e,disableCursor:!!Y.disableCursor,expandedPanelSizes:W.current.lastExpandedPanelSizes,layouts:W.current.layouts},orientation:w,panels:P.panels,resizeTargetMinimumSize:P.resizeTargetMinimumSize,separators:P.separators};K.current=L;let R=(t=!0,u(L.element.ownerDocument.defaultView,"Cannot register an unmounted Group"),n=L.element.ownerDocument.defaultView.ResizeObserver,r=new Set,a=new Set,(i=new n(e=>{for(let n of e){let{borderBoxSize:e,target:r}=n;if(r===L.element){if(t){let e=l({group:L});if(0===e)return;let t=z(L.id);if(!t)return;let n=s(L),r=t.defaultLayoutDeferred?et(n):t.layout,a=O({layout:function({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let a=0,i=0,l=!1,s=new Map,u=[];for(let d of e.panels){let e=r[d.id]??0;if("preserve-pixel-size"===d.panelConstraints.groupResizeBehavior){l=!0;let r=o(e/100*n/t*100);s.set(d.id,r),a+=r}else u.push(d.id),i+=e}if(!l||0===u.length)return r;let d=100-a,f={...r};if(s.forEach((e,t)=>{f[t]=e}),i>0)for(let e of u){let t=r[e]??0;f[e]=o(t/i*d)}else{let e=o(d/u.length);for(let t of u)f[t]=e}return f}({group:L,nextGroupSize:e,prevGroupSize:t.groupSize,prevLayout:r}),panelConstraints:n});if(!t.defaultLayoutDeferred&&I(t.layout,a)&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}(t.derivedPanelConstraints,n)&&t.groupSize===e)return;x(L,{defaultLayoutDeferred:!1,derivedPanelConstraints:n,groupSize:e,layout:a,separatorToPanels:t.separatorToPanels})}}else!function(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let a=l({group:e}),i="horizontal"===e.orientation?r.element.offsetWidth:r.element.offsetHeight,s=r.mutableValues.prevSize,u={asPercentage:o(i/a*100),inPixels:i};r.mutableValues.prevSize=u,r.onResize(u,r.id,s)}(L,r,e)}})).observe(L.element),L.panels.forEach(e=>{u(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&i.observe(e.element)}),d=l({group:L}),p=s(L),c=L.panels.map(({id:e})=>e).join(","),(h=L.mutableState.defaultLayout)&&(function(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}(L.panels,h)||(h=void 0)),v=O({layout:L.mutableState.layouts[c]??h??et(p),panelConstraints:p}),b=L.element.ownerDocument,en.set(b,(en.get(b)??0)+1),y=new Map,g(L).forEach(e=>{e.separator&&y.set(e.separator,e.panels)}),x(L,{defaultLayoutDeferred:0===d,derivedPanelConstraints:p,groupSize:d,layout:v,separatorToPanels:y}),L.separators.forEach(e=>{u(!a.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),a.add(e.id),e.element.addEventListener("keydown",G)}),1===en.get(b)&&(b.addEventListener("dblclick",N,!0),b.addEventListener("pointerdown",V,!0),b.addEventListener("pointerleave",J),b.addEventListener("pointermove",Q),b.addEventListener("pointerout",Z),b.addEventListener("pointerup",ee,!0)),function(){t=!1,en.set(b,Math.max(0,(en.get(b)??0)-1)),(m=new Map(m)).delete(L),L.separators.forEach(e=>{e.element.removeEventListener("keydown",G)}),en.get(b)||(b.removeEventListener("dblclick",N,!0),b.removeEventListener("pointerdown",V,!0),b.removeEventListener("pointerleave",J),b.removeEventListener("pointermove",Q),b.removeEventListener("pointerout",Z),b.removeEventListener("pointerup",ee,!0)),i.disconnect()}),{defaultLayoutDeferred:E,derivedPanelConstraints:F,layout:A}=z(L.id,!0);!E&&F.length>0&&(k(A),D(A));let $=S(T,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:r}=e.next;if(t||0===n.length)return;let a=L.panels.map(({id:e})=>e).join(",");L.mutableState.layouts[a]=r,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=M(t.collapsedSize,r[t.panelId]),a=M(t.collapsedSize,n[t.panelId]);e&&!a&&(L.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let i="active"!==B.state;k(r),i&&D(r)});return()=>{K.current=null,R(),$()}},[f,T,D,k,w,F,Y]),(0,a.useEffect)(()=>{let e=K.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!i)}),(0,r.jsx)(es.Provider,{value:_,children:(0,r.jsx)("div",{...L,className:t,"data-group":!0,"data-testid":T,id:T,ref:H,style:{height:"100%",width:"100%",overflow:"hidden",...P,display:"flex",flexDirection:"horizontal"===w?"row":"column",flexWrap:"nowrap",touchAction:"horizontal"===w?"pan-y":"pan-x"},children:e})})}function ed(){let e=(0,a.useContext)(es);return u(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function ef({children:e,className:t,collapsedSize:n="0%",collapsible:i=!1,defaultSize:o,disabled:l,elementRef:s,groupResizeBehavior:u="preserve-relative-size",id:d,maxSize:f="100%",minSize:p="0%",onResize:c,panelRef:h,style:g,...v}){let m,b=!!d,y=er(d),z=el({disabled:l}),x=(0,a.useRef)(null),w=eo(x,s),{getPanelStyles:C,id:P,orientation:L,registerPanel:R,updatePanelProps:E}=ed(),M=null!==c,k=ei((e,t,n)=>{c?.(e,d,n)});ea(()=>{let e=x.current;if(null!==e)return R({element:e,id:y,idIsStable:b,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:M?k:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:i,defaultSize:o,disabled:z.disabled,maxSize:f,minSize:p}})},[u,n,i,o,M,y,b,f,p,k,R,z]),(0,a.useEffect)(()=>{E(y,{disabled:l})},[l,y,E]),function(e,t){let{id:n}=ed(),r=(0,a.useRef)({collapse:U,expand:U,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:U});(0,a.useImperativeHandle)(t,()=>r.current,[]),ea(()=>{Object.assign(r.current,j({groupId:n,panelId:e}))})}(y,h);let D=()=>{let e=C(P,y);if(e)return JSON.stringify(e)},T=(0,a.useSyncExternalStore)(e=>S(P,e),D,D);return m=T?JSON.parse(T):void 0!==o?{flexGrow:void 0,flexShrink:void 0,flexBasis:o}:{flexGrow:1},(0,r.jsx)("div",{...v,"data-disabled":l||void 0,"data-panel":!0,"data-testid":y,id:y,ref:w,style:{...ep,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...m},children:(0,r.jsx)("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...g,touchAction:"horizontal"===L?"pan-y":"pan-x"},children:e})})}eu.displayName="Group",ef.displayName="Panel";let ep={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ec({children:e,className:t,disabled:n,disableDoubleClick:i,elementRef:o,id:l,style:s,...u}){let d,f,p=er(l),c=el({disabled:n,disableDoubleClick:i}),[h,g]=(0,a.useState)({}),[v,m]=(0,a.useState)("inactive"),[b,y]=(0,a.useState)(!1),z=(0,a.useRef)(null),x=eo(z,o),{disableCursor:w,id:C,orientation:P,registerSeparator:L,updateSeparatorProps:R}=ed();return ea(()=>{let e=z.current;if(null!==e){var t;let n={disabled:c.disabled,disableDoubleClick:c.disableDoubleClick,element:e,id:p},r=L(n),a=(t=e=>{m("inactive"!==e.next.state&&e.next.hitRegions.some(e=>e.separator===n)?e.next.state:"inactive")},W.addListener("change",t)),i=S(C,e=>{let{derivedPanelConstraints:t,layout:r,separatorToPanels:a}=e.next,i=a.get(n);if(i){let e=i[0],n=i.indexOf(e);g(function({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let a,i,o=e[n],l=t.find(e=>e.panelId===n);if(l){let s=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[r,r+1];i=O({layout:T({delta:u-o,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],a=O({layout:T({delta:s-o,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:a,valueMin:i,valueNow:o}}({layout:r,panelConstraints:t,panelId:e.id,panelIndex:n}))}});return()=>{a(),i(),r()}}},[C,p,L,c]),(0,a.useEffect)(()=>{R(p,{disabled:n,disableDoubleClick:i})},[n,i,p,R]),n&&!w&&(d="not-allowed"),f=n?"disabled":"active"===v?"active":b?"focus":v,(0,r.jsx)("div",{...u,"aria-controls":h.valueControls,"aria-disabled":n||void 0,"aria-orientation":"horizontal"===P?"vertical":"horizontal","aria-valuemax":h.valueMax,"aria-valuemin":h.valueMin,"aria-valuenow":h.valueNow,children:e,className:t,"data-separator":f,"data-testid":p,id:p,onBlur:()=>y(!1),onFocus:()=>y(!0),ref:x,role:"separator",style:{flexBasis:"auto",cursor:d,...s,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}ec.displayName="Separator";var eh=e.i(613349);e.s(["ResizableHandle",0,function({withHandle:e,className:t,...n}){return(0,r.jsx)(ec,{"data-slot":"resizable-handle",className:(0,eh.cn)("relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",t),...n,children:e&&(0,r.jsx)("div",{className:"z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border"})})},"ResizablePanel",0,function({...e}){return(0,r.jsx)(ef,{"data-slot":"resizable-panel",...e})},"ResizablePanelGroup",0,function({className:e,...t}){return(0,r.jsx)(eu,{"data-slot":"resizable-panel-group",className:(0,eh.cn)("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}],888917)}]);