@alook/app 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/email-worker/index.js +8 -5
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0t3u2c6n51rlj.js → 01apep3k2lhu1.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/039rsmy2xv5a-.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/08_pxrd46meym.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/08p2ekglkxw~q.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0aj8yzj6vrad4.css +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{1712ppta_sub~.js → 0caq6r63e_.cz.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/0kjdnm3_zoplm.js +63 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/11.l90o9r_vdp.js +62 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0aiuwip8_7r1i.js → 13bvgms2h_9ud.js} +1 -1
- package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/sitemap.xml.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
- 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
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/chat-init/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/whitelist/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/recruit/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/calendar/[id]/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/calendar/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/active-task/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/buffered-messages/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/init/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/messages/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/deregister/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/heartbeat/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/register/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/sweep/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/complete/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/fail/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/messages/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/start/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/supersede/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/poll/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/notify/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/[id]/comments/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/[id]/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/meeting/callback/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/runtimes/machine/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/studios/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/tasks/[id]/retry/route.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__027mioa._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ai~o9t._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0g2f8es._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0hfok0d._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ibt4_b._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__0d6ebrz._.js → [root-of-the-server]__0l2s5a9._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__0ycrc-4._.js → [root-of-the-server]__0p25hr6._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__042daks._.js → [root-of-the-server]__0twttjc._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__0lc6d3p._.js → [root-of-the-server]__0y7iq_6._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__0l7bqz8._.js → [root-of-the-server]__0~6oegu._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0~qx7w~._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +35 -35
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0kfs6gu._.js → _0.gkbx8._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0xjhix2._.js → _00-p7_0._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0v78k7n._.js → _0047hu1._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0r7d~ex._.js → _03.wj5m._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0j5oga0._.js → _03gwxos._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_09yl_9p._.js → _03pj4c4._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0zhu~h5._.js → _0403fh~._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_06imn.m._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_08xh_f8._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0xfvf8p._.js → _0aa_-d.._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0a3hhbw._.js → _0aomz8a._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0qh5atg._.js → _0aqlpnt._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0iiaqss._.js → _0b6v~wp._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0d5xg0u._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0es3xrw._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_089u_am._.js → _0fj.mo3._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0fjzb27._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0j22j5s._.js → _0huk3rm._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_027kyge._.js → _0i~wxfn._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0f2yj1_._.js → _0nyvdk.._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_07n_1wf._.js → _0oewl7j._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r~swxs._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0y1jmbv._.js → _0w5uflk._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0p8t2cq._.js → _0wbaduy._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0t1vdvk._.js → _0xed-yu._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0xfnkkm._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0422iyn._.js → _0yzq1gx._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_00clbi5._.js → _0zt3sdk._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_13sefqw._.js → _11zk~pq._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_064~~s0._.js → _12-_-5g._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{src_0yrpg8t._.js → src_0wkbw.-._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{[root-of-the-server]__13_rzu8._.js → [root-of-the-server]__00ir-1l._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +35 -35
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_06glull._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0orn3gz._.js → _0lb.qjt._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0llmkdo._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0r_z7cy._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ryz7_7._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0v378m.._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0amp3a1._.js → _0xhqu2a._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0viys_q._.js → _12~4zih._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0~23g-y._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_00xgo_-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_0nj0euq._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{src_web_src_components_avatar_04z95~4._.js → src_web_src_components_avatar_0a0h8en._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_home_home-page_tsx_0to84tv._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_typewriter-visual_tsx_0lk-33~._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +55 -55
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +358 -358
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
- package/bundled/ws-do/index.js +4 -2
- package/dist/cli/index.js +5 -4
- package/package.json +5 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/0-cq0qfayk62j.js +0 -63
- package/bundled/web/.open-next/assets/_next/static/chunks/09fgwh4kts~24.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0eih9s5qcj60s.js +0 -62
- package/bundled/web/.open-next/assets/_next/static/chunks/0or~sn2q6u39-.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0puh0qew5ubn-.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0q.6r1w8fuz_c.css +0 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_11wu9fj._.js +0 -3
- /package/bundled/web/.open-next/assets/_next/static/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{ZoH0qYtBG9o2M-yTRK3ab → KbaMV38oRSu84qh40vSuT}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)},224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936),process.env.ALOOK_DOMAIN;let k=/^[a-zA-Z0-9-]{3,}$/,l=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function m(a){return k.test(a)&&!l.has(a.toLowerCase())}var n=a.i(75118),o=a.i(647651);let p=(0,o.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(73270);let r=(0,o.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var s=a.i(28429),t=a.i(506180),u=a.i(588339);a.i(752792);var v=a.i(446827),w=a.i(921584),x=a.i(973111),y=a.i(27647);function z({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(s.ChevronDown,{className:(0,n.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,t.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,r]=(0,c.useState)([]),[s,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,u.listAgentAccess)(i,e),(0,u.listMembers)(i)]).then(([b,c])=>{a||(o(b),r(c))}).catch(b=>{a||(b instanceof v.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,u.updateAgent)(e,{visibility:a},i),w.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),w.toast.error("Failed to update visibility")}finally{m(!1)}},K=p.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=p.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,u.grantAgentAccess)(i,e,a);let b=p.find(b=>b.user_id===a);b&&o(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),w.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){o(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,u.revokeAgentAccess)(i,e,F.user_id,H),w.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{o(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(x.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),s?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,t.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(null),[s,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,u.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||r("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,u.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),r(null);try{let b=await (0,u.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){r(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),r(null);try{await (0,u.removeWhitelistEmail)(a,b,f)}catch{h(g),r("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),s&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!m(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:l,runtimeId:m,setRuntimeId:o,runtimes:p,providerModels:q,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:w}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(r,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||p.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===p.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):p.map(a=>{let c="online"===a.status,d=m===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,n.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=p.find(a=>a.id===m)?.provider,c=a.provider;o(a.id),b&&b!==c&&l("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:m,onValueChange:a=>{let b=p.find(a=>a.id===m)?.provider,c=p.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&l("")},runtimes:p,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||w)&&(0,b.jsxs)(z,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>l(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),q.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:q.map(a=>(0,b.jsx)("option",{value:a},a))})]}),w]})]})},"getHandleError",0,function(a){return a&&!m(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)}];
|
|
1
|
+
module.exports=[137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)},224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936),process.env.ALOOK_DOMAIN;let k=/^[a-zA-Z0-9-]{3,}$/,l=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function m(a){return k.test(a)&&!l.has(a.toLowerCase())}var n=a.i(75118),o=a.i(647651);let p=(0,o.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(73270);let r=(0,o.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var s=a.i(28429),t=a.i(506180),u=a.i(588339),v=a.i(446827),w=a.i(921584),x=a.i(973111),y=a.i(27647);function z({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(s.ChevronDown,{className:(0,n.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,t.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,r]=(0,c.useState)([]),[s,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,u.listAgentAccess)(i,e),(0,u.listMembers)(i)]).then(([b,c])=>{a||(o(b),r(c))}).catch(b=>{a||(b instanceof v.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,u.updateAgent)(e,{visibility:a},i),w.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),w.toast.error("Failed to update visibility")}finally{m(!1)}},K=p.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=p.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,u.grantAgentAccess)(i,e,a);let b=p.find(b=>b.user_id===a);b&&o(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),w.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){o(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,u.revokeAgentAccess)(i,e,F.user_id,H),w.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{o(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(x.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),s?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,t.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(null),[s,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,u.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||r("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,u.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),r(null);try{let b=await (0,u.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){r(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),r(null);try{await (0,u.removeWhitelistEmail)(a,b,f)}catch{h(g),r("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),s&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!m(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:l,runtimeId:m,setRuntimeId:o,runtimes:p,providerModels:q,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:w}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(r,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||p.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===p.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):p.map(a=>{let c="online"===a.status,d=m===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,n.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=p.find(a=>a.id===m)?.provider,c=a.provider;o(a.id),b&&b!==c&&l("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:m,onValueChange:a=>{let b=p.find(a=>a.id===m)?.provider,c=p.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&l("")},runtimes:p,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||w)&&(0,b.jsxs)(z,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>l(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),q.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:q.map(a=>(0,b.jsx)("option",{value:a},a))})]}),w]})]})},"getHandleError",0,function(a){return a&&!m(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_00xgo_-._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936),process.env.ALOOK_DOMAIN;let k=/^[a-zA-Z0-9-]{3,}$/,l=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function m(a){return k.test(a)&&!l.has(a.toLowerCase())}var n=a.i(75118),o=a.i(647651);let p=(0,o.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(73270);let r=(0,o.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var s=a.i(28429),t=a.i(506180),u=a.i(588339);a.i(752792);var v=a.i(446827),w=a.i(921584),x=a.i(973111),y=a.i(27647);function z({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(s.ChevronDown,{className:(0,n.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,t.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,r]=(0,c.useState)([]),[s,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,u.listAgentAccess)(i,e),(0,u.listMembers)(i)]).then(([b,c])=>{a||(o(b),r(c))}).catch(b=>{a||(b instanceof v.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,u.updateAgent)(e,{visibility:a},i),w.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),w.toast.error("Failed to update visibility")}finally{m(!1)}},K=p.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=p.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,u.grantAgentAccess)(i,e,a);let b=p.find(b=>b.user_id===a);b&&o(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),w.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){o(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,u.revokeAgentAccess)(i,e,F.user_id,H),w.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{o(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(x.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),s?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,t.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(null),[s,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,u.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||r("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,u.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),r(null);try{let b=await (0,u.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){r(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),r(null);try{await (0,u.removeWhitelistEmail)(a,b,f)}catch{h(g),r("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),s&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!m(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:l,runtimeId:m,setRuntimeId:o,runtimes:p,providerModels:q,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:w}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(r,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||p.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===p.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):p.map(a=>{let c="online"===a.status,d=m===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,n.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=p.find(a=>a.id===m)?.provider,c=a.provider;o(a.id),b&&b!==c&&l("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:m,onValueChange:a=>{let b=p.find(a=>a.id===m)?.provider,c=p.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&l("")},runtimes:p,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||w)&&(0,b.jsxs)(z,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>l(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),q.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:q.map(a=>(0,b.jsx)("option",{value:a},a))})]}),w]})]})},"getHandleError",0,function(a){return a&&!m(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)},137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)}];
|
|
1
|
+
module.exports=[224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936),process.env.ALOOK_DOMAIN;let k=/^[a-zA-Z0-9-]{3,}$/,l=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function m(a){return k.test(a)&&!l.has(a.toLowerCase())}var n=a.i(75118),o=a.i(647651);let p=(0,o.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(73270);let r=(0,o.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var s=a.i(28429),t=a.i(506180),u=a.i(588339),v=a.i(446827),w=a.i(921584),x=a.i(973111),y=a.i(27647);function z({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(s.ChevronDown,{className:(0,n.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,t.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,r]=(0,c.useState)([]),[s,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,u.listAgentAccess)(i,e),(0,u.listMembers)(i)]).then(([b,c])=>{a||(o(b),r(c))}).catch(b=>{a||(b instanceof v.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,u.updateAgent)(e,{visibility:a},i),w.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),w.toast.error("Failed to update visibility")}finally{m(!1)}},K=p.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=p.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,u.grantAgentAccess)(i,e,a);let b=p.find(b=>b.user_id===a);b&&o(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),w.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){o(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,u.revokeAgentAccess)(i,e,F.user_id,H),w.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{o(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(x.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),s?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,t.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(null),[s,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,u.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||r("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,u.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),r(null);try{let b=await (0,u.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){r(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),r(null);try{await (0,u.removeWhitelistEmail)(a,b,f)}catch{h(g),r("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),s&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!m(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:l,runtimeId:m,setRuntimeId:o,runtimes:p,providerModels:q,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:w}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(r,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||p.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===p.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):p.map(a=>{let c="online"===a.status,d=m===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,n.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=p.find(a=>a.id===m)?.provider,c=a.provider;o(a.id),b&&b!==c&&l("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:m,onValueChange:a=>{let b=p.find(a=>a.id===m)?.provider,c=p.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&l("")},runtimes:p,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||w)&&(0,b.jsxs)(z,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>l(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),q.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:q.map(a=>(0,b.jsx)("option",{value:a},a))})]}),w]})]})},"getHandleError",0,function(a){return a&&!m(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)},137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_0nj0euq._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[325848,a=>{"use strict";var b=a.i(749314),c=a.i(437199);let d="#27272a",e={fill:"rgba(255,255,255,0.92)",stroke:"rgba(255,255,255,0.95)",strokeWidth:3.5},f=[{name:"Purple",value:"#a855f7",gradient:["#c084fc","#a855f7","#7c3aed"],faceColor:"#2e1065"},{name:"Teal",value:"#14b8a6",gradient:["#5eead4","#14b8a6","#0d9488"],faceColor:"#134e4a"},{name:"Orange",value:"#f97316",gradient:["#fdba74","#f97316","#c2410c"],faceColor:"#7c2d12"},{name:"Blue",value:"#3b82f6",gradient:["#93c5fd","#3b82f6","#1d4ed8"],faceColor:"#1e3a5f"},{name:"Pink",value:"#f472b6",gradient:["#fda4af","#f472b6","#be185d"],faceColor:"#831843"},{name:"Yellow",value:"#eab308",gradient:["#fde047","#eab308","#a16207"],faceColor:"#713f12"},{name:"Green",value:"#22c55e",gradient:["#86efac","#22c55e","#15803d"],faceColor:"#14532d"},{name:"Beige",value:"#d6ccb8",gradient:["#e8e0d4","#d6ccb8","#b8a990"],faceColor:"#57534e"},{name:"Red",value:"#ef4444",gradient:["#fca5a5","#ef4444","#991b1b"],faceColor:"#7f1d1d"},{name:"Lake Blue",value:"#6366f1",gradient:["#a5b4fc","#6366f1","#3730a3"],faceColor:"#312e81"},{name:"Gray",value:"#9ca3af",gradient:["#d4d4d8","#9ca3af","#6b7280"],faceColor:"#374151"},{name:"Deep Purple",value:"#8b5cf6",gradient:["#c4b5fd","#8b5cf6","#5b21b6"],faceColor:"#3b0764"}],g={circle:{name:"Circle",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("circle",{cx:"100",cy:"100",r:"66",...e})},rounded:{name:"Rounded",face:{cx:100,cy:100,w:90},render:()=>(0,b.jsx)("rect",{x:"30",y:"30",width:"140",height:"140",rx:"32",...e})},hexagon:{name:"Hexagon",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("path",{d:"M100 32 C108 32 114 35 120 39 L155 60 C161 64 165 70 165 78 L165 122 C165 130 161 136 155 140 L120 161 C114 165 108 168 100 168 C92 168 86 165 80 161 L45 140 C39 136 35 130 35 122 L35 78 C35 70 39 64 45 60 L80 39 C86 35 92 32 100 32 Z",...e})},task:{name:"Task",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("rect",{x:"34",y:"34",width:"132",height:"132",rx:"24",...e})},book:{name:"Book",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M42 162 L42 88 C42 54 68 34 100 34 C132 34 158 54 158 88 L158 162 C158 166 154 170 150 170 L50 170 C46 170 42 166 42 162 Z",...e})},mail:{name:"Mail",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("rect",{x:"28",y:"54",width:"144",height:"92",rx:"46",...e})},calendar:{name:"Calendar",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M100 34 C138 34 166 52 166 80 C166 94 158 106 158 118 C158 148 138 166 100 166 C62 166 42 148 42 118 C42 106 34 94 34 80 C34 52 62 34 100 34 Z",...e})},bulb:{name:"Bulb",face:{cx:100,cy:104,w:76},render:()=>(0,b.jsx)("ellipse",{cx:"100",cy:"104",rx:"58",ry:"66",...e})},folder:{name:"Folder",face:{cx:102,cy:108,w:80},render:()=>(0,b.jsx)("path",{d:"M62 144 C40 144 32 128 36 116 C32 104 40 90 54 88 C56 72 70 60 88 62 C100 50 118 50 132 58 C144 52 162 60 162 76 C172 82 174 98 166 108 C172 120 164 136 150 140 Z",...e})},mountain:{name:"Mountain",face:{cx:100,cy:100,w:76},render:()=>(0,b.jsx)("path",{d:"M92 36 C120 32 156 48 164 78 C172 108 156 148 124 160 C92 172 48 156 38 124 C28 92 62 40 92 36 Z",...e})}},h=Object.keys(g),i={dot:{name:"Dot",render:(a=d)=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"4.5",fill:a})},dash:{name:"Dash",render:(a=d)=>(0,b.jsx)("line",{x1:"-10",y1:"0",x2:"10",y2:"0",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},hookL:{name:"Hook",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q-5.5 7 0 1.5 Q5.5 7 11 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})},smile:{name:"Smile",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q0 11 11 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},caret:{name:"Caret",render:(a=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:"M-10 0 Q0 8 10 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round"}),(0,b.jsx)("ellipse",{cx:"3",cy:"6",rx:"4",ry:"4.5",fill:"#f472b6"})]})},arrow:{name:"Arrow",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"6",ry:"7.5",fill:a})},oh:{name:"o",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"7",ry:"7.5",fill:"none",stroke:a,strokeWidth:"4.5"})}},j=Object.keys(i),k=(a,c)=>{let e=c??a,f=(c,f=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-c}, 0)`,children:a(f)}),(0,b.jsx)("g",{transform:`translate(${c}, 0)`,children:e(f)})]});return f.displayName="EyePair",f},l={dots:{name:"Dots",render:k(a=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:a}))},big:{name:"Big",render:k(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("circle",{cx:"0",cy:"0",r:"10",fill:a}),(0,b.jsx)("circle",{cx:"2.5",cy:"-3",r:"3.5",fill:"rgba(255,255,255,0.9)"})]}))},rings:{name:"Rings",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:"none",stroke:a,strokeWidth:"4.5"}))},arches:{name:"Arches",render:k(a=>(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},lines:{name:"Lines",render:k(a=>(0,b.jsx)("path",{d:"M-10 0 Q0 -6 10 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},happy:{name:"Happy",render:k(a=>(0,b.jsx)("path",{d:"M-10 5 Q0 -11 10 5",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},sleepy:{name:"Sleepy",render:k(a=>(0,b.jsx)("path",{d:"M-10 -2 Q0 8 10 -2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},shy:{name:"Shy",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:a}))},wink:{name:"Wink",render:(a,c=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-a}, 0)`,children:(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:c})}),(0,b.jsx)("g",{transform:`translate(${a}, 0)`,children:(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:c,strokeWidth:"5",strokeLinecap:"round"})})]})}},m=Object.keys(l),n={shape:"book",eye:"happy",nose:"dash",bg:1};function o(a){return a[Math.floor(Math.random()*a.length)]}let p="avatar:";a.s(["AvatarRenderer",0,function({config:a,size:d=200,className:e}){let h=(0,c.useId)().replace(/:/g,""),j=g[a.shape]??g.book,k=l[a.eye],m=i[a.nose],n=f[a.bg]??f[0],[o,p,q]=n.gradient,r=n.faceColor,{cx:s,cy:t,w:u}=j.face,v=Math.max(13,.24*u),w=t-Math.max(12,.16*u);return(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:d,height:d,className:e,style:{display:"block"},children:[(0,b.jsxs)("defs",{children:[(0,b.jsxs)("linearGradient",{id:`bg-${h}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:o}),(0,b.jsx)("stop",{offset:"50%",stopColor:p}),(0,b.jsx)("stop",{offset:"100%",stopColor:q})]}),(0,b.jsxs)("radialGradient",{id:`gl-${h}`,cx:"30%",cy:"25%",r:"60%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.32)"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0)"})]}),(0,b.jsx)("filter",{id:`sh-${h}`,x:"-10%",y:"-5%",width:"120%",height:"130%",children:(0,b.jsx)("feDropShadow",{dx:"0",dy:"3",stdDeviation:"4",floodColor:"rgba(0,0,0,0.18)"})})]}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#bg-${h})`}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#gl-${h})`}),(0,b.jsxs)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:[(0,b.jsx)("g",{"data-avatar-shape":"",filter:`url(#sh-${h})`,children:j.render()}),k&&(0,b.jsx)("g",{transform:`translate(${s}, ${w})`,children:(0,b.jsx)("g",{"data-avatar-eyes":"",children:k.render(v,r)})}),m&&(0,b.jsx)("g",{transform:`translate(${s}, ${t+7})`,children:(0,b.jsx)("g",{"data-avatar-nose":"",children:m.render(r)})})]})]})},"BG_COLORS",0,f,"DEFAULT_CONFIG",0,n,"EYE_KEYS",0,m,"Eyes",0,l,"NOSE_KEYS",0,j,"Noses",0,i,"PRESETS",0,[{name:"Task",config:{shape:"task",nose:"dot",eye:"dots",bg:0}},{name:"Notes",config:{shape:"book",nose:"dash",eye:"happy",bg:1}},{name:"Mail",config:{shape:"mail",nose:"smile",eye:"dots",bg:3}},{name:"Schedule",config:{shape:"calendar",nose:"dot",eye:"dots",bg:4}},{name:"Idea",config:{shape:"bulb",nose:"oh",eye:"rings",bg:5}},{name:"Project",config:{shape:"folder",nose:"dash",eye:"lines",bg:7}},{name:"Goal",config:{shape:"mountain",nose:"caret",eye:"arches",bg:8}},{name:"Dream",config:{shape:"circle",nose:"smile",eye:"shy",bg:11}},{name:"Organize",config:{shape:"rounded",nose:"dot",eye:"sleepy",bg:6}},{name:"Explore",config:{shape:"hexagon",nose:"hookL",eye:"wink",bg:9}},{name:"Focus",config:{shape:"task",nose:"caret",eye:"lines",bg:2}},{name:"Collect",config:{shape:"book",nose:"oh",eye:"rings",bg:10}}],"SHAPE_KEYS",0,h,"Shapes",0,g,"parseAvatarUrl",0,function(a){if(!a||!a.startsWith(p))return null;try{let b=JSON.parse(a.slice(p.length));if("object"==typeof b&&null!==b&&"string"==typeof b.shape&&"string"==typeof b.eye&&"string"==typeof b.nose&&"number"==typeof b.bg)return b;if("object"==typeof b&&null!==b&&"outline"in b)return n;return null}catch{return null}},"randomConfig",0,function(){return{shape:o(h),eye:o(m),nose:o(j),bg:Math.floor(Math.random()*f.length)}},"serializeAvatarConfig",0,function(a){return p+JSON.stringify(a)}])},253260,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(325848);let e=["avatar-anim-shape-bounce","avatar-anim-head-tilt","avatar-anim-shake","avatar-anim-wobble","avatar-anim-pulse","avatar-anim-spin","avatar-anim-jelly","avatar-anim-float","avatar-anim-nod"];a.s(["AnimatedAvatar",0,function({config:a,size:f,className:g,isHovered:h,isWorking:i}){let[j,k]=(0,c.useState)(null),l=(0,c.useRef)(-1);function m(){let a=Math.floor(Math.random()*e.length);return a===l.current&&(a=(a+1)%e.length),l.current=a,e[a]}return(0,c.useEffect)(()=>{h?k(m()):i||k(null)},[h,i]),(0,c.useEffect)(()=>{if(!i){h||k(null);return}k(m());let a=setInterval(()=>{k(m())},4e3);return()=>clearInterval(a)},[h,i]),(0,b.jsx)("div",{className:j??void 0,children:(0,b.jsx)(d.AvatarRenderer,{config:a,size:f,className:g})})}])},690287,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(325848),e=a.i(75118),f=a.i(655795),g=a.i(525132);function h({label:a,keys:c,value:d,onChange:f,renderThumb:g,mobile:i=!1}){let j=c.indexOf(d),k=a=>f(c[(j+a+c.length)%c.length]),l=c[(j-1+c.length)%c.length],m=c[(j+1)%c.length];return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-12 text-xs font-medium text-muted-foreground shrink-0",children:a}),(0,b.jsx)("button",{type:"button",onClick:()=>k(-1),className:(0,e.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",i?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M15 5 L8 12 L15 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 justify-center",children:[(0,b.jsx)("button",{type:"button",onClick:()=>k(-1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:g(l)}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:"border-2 border-primary rounded-lg p-0.5",children:g(d)}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:g(m)})]}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:(0,e.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",i?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M9 5 L16 12 L9 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}a.s(["AvatarGenerator",0,function({config:a,onChange:i,layout:j="vertical",mobile:k=!1}){let[l,m]=(0,c.useState)("presets"),n=(0,c.useCallback)((b,c)=>{i({...a,[b]:c})},[a,i]),[o,p]=(0,c.useState)(!1),q=(0,c.useRef)(a);(0,c.useEffect)(()=>{if(q.current.shape!==a.shape||q.current.eye!==a.eye||q.current.nose!==a.nose||q.current.bg!==a.bg){p(!0);let b=setTimeout(()=>p(!1),450);return q.current=a,()=>clearTimeout(b)}},[a]),(0,c.useEffect)(()=>{if("horizontal"!==j)return;let a=a=>{"Space"===a.code&&a.target===document.body&&(a.preventDefault(),i((0,d.randomConfig)()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[j,i]);let r="horizontal"===j,s=r?220:k?120:160,t=(0,b.jsxs)("div",{className:(0,e.cn)("flex flex-col items-center gap-3 rounded-2xl bg-muted/30",k?"p-3":"p-4",r?"w-70 shrink-0 justify-center":""),children:[(0,b.jsx)("div",{className:(0,e.cn)("rounded-2xl",o&&"animate-[shake_0.45s_cubic-bezier(.36,.07,.19,.97)]"),children:(0,b.jsx)(d.AvatarRenderer,{config:a,size:s})}),(0,b.jsxs)("button",{type:"button",onClick:()=>i((0,d.randomConfig)()),className:"inline-flex items-center gap-2 rounded-full bg-foreground px-4 py-1.5 text-sm font-medium text-background hover:bg-foreground/80 transition-colors",children:[(0,b.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),(0,b.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"8",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),"Random",r&&(0,b.jsx)(f.Kbd,{className:"ml-1 bg-background/20 text-[10px] text-inherit",children:"Space"})]})]}),u=(0,b.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-3 flex-1 min-w-0",r&&"rounded-2xl bg-muted/30 p-4 h-95"),children:[(0,b.jsxs)("div",{className:"flex border-b border-border",children:[(0,b.jsx)("button",{type:"button",onClick:()=>m("presets"),className:(0,e.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","presets"===l?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"★ Presets"}),(0,b.jsx)("button",{type:"button",onClick:()=>m("custom"),className:(0,e.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","custom"===l?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"⚙ Custom"})]}),(0,b.jsxs)("div",{className:(0,e.cn)("flex-1 min-h-0",r&&"overflow-y-auto thin-scrollbar"),children:["presets"===l&&(0,b.jsx)("div",{className:(0,e.cn)("grid gap-2",k?"grid-cols-3":"grid-cols-4"),children:d.PRESETS.map(c=>{let f=c.config.shape===a.shape&&c.config.eye===a.eye&&c.config.nose===a.nose&&c.config.bg===a.bg;return(0,b.jsx)("button",{type:"button",onClick:()=>i(c.config),className:(0,e.cn)("flex items-center justify-center rounded-xl border p-2 transition-all",f?"border-primary border-2 bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/40"),children:(0,b.jsx)(d.AvatarRenderer,{config:c.config,size:56})},c.name)})}),"custom"===l&&(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsx)(h,{label:"Shape",keys:d.SHAPE_KEYS,value:a.shape,onChange:a=>n("shape",a),renderThumb:a=>(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:"40",height:"40",children:[(0,b.jsx)("rect",{width:"200",height:"200",rx:"56",fill:"hsl(var(--muted))"}),(0,b.jsx)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:d.Shapes[a]?.render()})]}),mobile:k}),(0,b.jsx)(h,{label:"Nose",keys:d.NOSE_KEYS,value:a.nose,onChange:a=>n("nose",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-14 -10 28 20",width:"36",height:"24",children:d.Noses[a]?.render("currentColor")}),mobile:k}),(0,b.jsx)(h,{label:"Eyes",keys:d.EYE_KEYS,value:a.eye,onChange:a=>n("eye",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-18 -10 36 20",width:"44",height:"24",children:d.Eyes[a]?.render(8,"currentColor")}),mobile:k}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Color"}),(0,b.jsx)("div",{className:(0,e.cn)("flex flex-wrap p-1",k?"gap-3":"gap-2"),children:d.BG_COLORS.map((c,d)=>(0,b.jsxs)(g.Tooltip,{children:[(0,b.jsx)(g.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:()=>n("bg",d),className:(0,e.cn)("rounded-full transition-shadow",k?"size-8":"size-7",a.bg===d?"ring-2 ring-primary ring-offset-2":"ring-1 ring-border"),style:{background:`linear-gradient(135deg, ${c.gradient[0]}, ${c.gradient[1]}, ${c.gradient[2]})`}})}),(0,b.jsx)(g.TooltipContent,{children:c.name})]},c.value))})]})]})]})]});return r?(0,b.jsxs)("div",{className:"flex gap-4",children:[t,u]}):(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[t,u]})}])},628508,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(432340),e=a.i(325848),f=a.i(690287),g=a.i(586220);a.s(["AvatarPickerDialog",0,function({config:a,onChange:h}){let[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(a),m=(0,g.useIsMobile)();return(0,b.jsxs)(d.Dialog,{open:i,onOpenChange:b=>{b&&l(a),j(b)},children:[(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)(d.DialogTrigger,{render:(0,b.jsx)("button",{type:"button",className:"rounded-2xl bg-background p-1.5 shadow-sm border border-border hover:border-primary/40 transition-colors cursor-pointer"}),children:(0,b.jsx)(e.AvatarRenderer,{config:a,size:80})})}),(0,b.jsxs)(d.DialogContent,{className:m?"top-auto left-0 translate-x-0 translate-y-0 bottom-0 max-w-full sm:max-w-full w-full rounded-b-none rounded-t-xl max-h-[85dvh] overflow-y-auto pb-[env(safe-area-inset-bottom)]":"sm:max-w-180",children:[(0,b.jsx)(d.DialogHeader,{children:(0,b.jsx)(d.DialogTitle,{children:"Choose Avatar"})}),(0,b.jsx)(f.AvatarGenerator,{config:k,layout:m?"vertical":"horizontal",onChange:a=>{l(a),h(a)},mobile:m}),m&&(0,b.jsx)("button",{type:"button",onClick:()=>j(!1),className:"w-full rounded-xl bg-primary py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]})]})}])},949409,a=>{"use strict";var b=a.i(749314),c=a.i(325848);a.s(["AgentAvatar",0,function({name:a,avatarUrl:d,size:e=32}){let f=(0,c.parseAvatarUrl)(d);return f?(0,b.jsx)(c.AvatarRenderer,{config:f,size:e,className:"rounded-full shrink-0"}):(0,b.jsx)("span",{className:"flex items-center justify-center rounded-full bg-secondary text-xs font-medium shrink-0",style:{width:e,height:e},children:(a??"?").charAt(0).toUpperCase()})}])}];
|
|
1
|
+
module.exports=[325848,a=>{"use strict";var b=a.i(749314),c=a.i(437199);let d="#27272a",e={fill:"rgba(255,255,255,0.92)",stroke:"rgba(255,255,255,0.95)",strokeWidth:3.5},f=[{name:"Purple",value:"#a855f7",gradient:["#c084fc","#a855f7","#7c3aed"],faceColor:"#2e1065"},{name:"Teal",value:"#14b8a6",gradient:["#5eead4","#14b8a6","#0d9488"],faceColor:"#134e4a"},{name:"Orange",value:"#f97316",gradient:["#fdba74","#f97316","#c2410c"],faceColor:"#7c2d12"},{name:"Blue",value:"#3b82f6",gradient:["#93c5fd","#3b82f6","#1d4ed8"],faceColor:"#1e3a5f"},{name:"Pink",value:"#f472b6",gradient:["#fda4af","#f472b6","#be185d"],faceColor:"#831843"},{name:"Yellow",value:"#eab308",gradient:["#fde047","#eab308","#a16207"],faceColor:"#713f12"},{name:"Green",value:"#22c55e",gradient:["#86efac","#22c55e","#15803d"],faceColor:"#14532d"},{name:"Beige",value:"#d6ccb8",gradient:["#e8e0d4","#d6ccb8","#b8a990"],faceColor:"#57534e"},{name:"Red",value:"#ef4444",gradient:["#fca5a5","#ef4444","#991b1b"],faceColor:"#7f1d1d"},{name:"Lake Blue",value:"#6366f1",gradient:["#a5b4fc","#6366f1","#3730a3"],faceColor:"#312e81"},{name:"Gray",value:"#9ca3af",gradient:["#d4d4d8","#9ca3af","#6b7280"],faceColor:"#374151"},{name:"Deep Purple",value:"#8b5cf6",gradient:["#c4b5fd","#8b5cf6","#5b21b6"],faceColor:"#3b0764"}],g={circle:{name:"Circle",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("circle",{cx:"100",cy:"100",r:"66",...e})},rounded:{name:"Rounded",face:{cx:100,cy:100,w:90},render:()=>(0,b.jsx)("rect",{x:"30",y:"30",width:"140",height:"140",rx:"32",...e})},hexagon:{name:"Hexagon",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("path",{d:"M100 32 C108 32 114 35 120 39 L155 60 C161 64 165 70 165 78 L165 122 C165 130 161 136 155 140 L120 161 C114 165 108 168 100 168 C92 168 86 165 80 161 L45 140 C39 136 35 130 35 122 L35 78 C35 70 39 64 45 60 L80 39 C86 35 92 32 100 32 Z",...e})},task:{name:"Task",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("rect",{x:"34",y:"34",width:"132",height:"132",rx:"24",...e})},book:{name:"Book",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M42 162 L42 88 C42 54 68 34 100 34 C132 34 158 54 158 88 L158 162 C158 166 154 170 150 170 L50 170 C46 170 42 166 42 162 Z",...e})},mail:{name:"Mail",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("rect",{x:"28",y:"54",width:"144",height:"92",rx:"46",...e})},calendar:{name:"Calendar",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M100 34 C138 34 166 52 166 80 C166 94 158 106 158 118 C158 148 138 166 100 166 C62 166 42 148 42 118 C42 106 34 94 34 80 C34 52 62 34 100 34 Z",...e})},bulb:{name:"Bulb",face:{cx:100,cy:104,w:76},render:()=>(0,b.jsx)("ellipse",{cx:"100",cy:"104",rx:"58",ry:"66",...e})},folder:{name:"Folder",face:{cx:102,cy:108,w:80},render:()=>(0,b.jsx)("path",{d:"M62 144 C40 144 32 128 36 116 C32 104 40 90 54 88 C56 72 70 60 88 62 C100 50 118 50 132 58 C144 52 162 60 162 76 C172 82 174 98 166 108 C172 120 164 136 150 140 Z",...e})},mountain:{name:"Mountain",face:{cx:100,cy:100,w:76},render:()=>(0,b.jsx)("path",{d:"M92 36 C120 32 156 48 164 78 C172 108 156 148 124 160 C92 172 48 156 38 124 C28 92 62 40 92 36 Z",...e})}},h=Object.keys(g),i={dot:{name:"Dot",render:(a=d)=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"4.5",fill:a})},dash:{name:"Dash",render:(a=d)=>(0,b.jsx)("line",{x1:"-10",y1:"0",x2:"10",y2:"0",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},hookL:{name:"Hook",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q-5.5 7 0 1.5 Q5.5 7 11 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})},smile:{name:"Smile",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q0 11 11 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},caret:{name:"Caret",render:(a=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:"M-10 0 Q0 8 10 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round"}),(0,b.jsx)("ellipse",{cx:"3",cy:"6",rx:"4",ry:"4.5",fill:"#f472b6"})]})},arrow:{name:"Arrow",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"6",ry:"7.5",fill:a})},oh:{name:"o",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"7",ry:"7.5",fill:"none",stroke:a,strokeWidth:"4.5"})}},j=Object.keys(i),k=(a,c)=>{let e=c??a,f=(c,f=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-c}, 0)`,children:a(f)}),(0,b.jsx)("g",{transform:`translate(${c}, 0)`,children:e(f)})]});return f.displayName="EyePair",f},l={dots:{name:"Dots",render:k(a=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:a}))},big:{name:"Big",render:k(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("circle",{cx:"0",cy:"0",r:"10",fill:a}),(0,b.jsx)("circle",{cx:"2.5",cy:"-3",r:"3.5",fill:"rgba(255,255,255,0.9)"})]}))},rings:{name:"Rings",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:"none",stroke:a,strokeWidth:"4.5"}))},arches:{name:"Arches",render:k(a=>(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},lines:{name:"Lines",render:k(a=>(0,b.jsx)("path",{d:"M-10 0 Q0 -6 10 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},happy:{name:"Happy",render:k(a=>(0,b.jsx)("path",{d:"M-10 5 Q0 -11 10 5",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},sleepy:{name:"Sleepy",render:k(a=>(0,b.jsx)("path",{d:"M-10 -2 Q0 8 10 -2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},shy:{name:"Shy",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:a}))},wink:{name:"Wink",render:(a,c=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-a}, 0)`,children:(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:c})}),(0,b.jsx)("g",{transform:`translate(${a}, 0)`,children:(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:c,strokeWidth:"5",strokeLinecap:"round"})})]})}},m=Object.keys(l),n={shape:"book",eye:"happy",nose:"dash",bg:1};function o(a){return a[Math.floor(Math.random()*a.length)]}let p="avatar:";a.s(["AvatarRenderer",0,function({config:a,size:d=200,className:e}){let h=(0,c.useId)().replace(/:/g,""),j=g[a.shape]??g.book,k=l[a.eye],m=i[a.nose],n=f[a.bg]??f[0],[o,p,q]=n.gradient,r=n.faceColor,{cx:s,cy:t,w:u}=j.face,v=Math.max(13,.24*u),w=t-Math.max(12,.16*u);return(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:d,height:d,className:e,style:{display:"block"},children:[(0,b.jsxs)("defs",{children:[(0,b.jsxs)("linearGradient",{id:`bg-${h}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:o}),(0,b.jsx)("stop",{offset:"50%",stopColor:p}),(0,b.jsx)("stop",{offset:"100%",stopColor:q})]}),(0,b.jsxs)("radialGradient",{id:`gl-${h}`,cx:"30%",cy:"25%",r:"60%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.32)"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0)"})]}),(0,b.jsx)("filter",{id:`sh-${h}`,x:"-10%",y:"-5%",width:"120%",height:"130%",children:(0,b.jsx)("feDropShadow",{dx:"0",dy:"3",stdDeviation:"4",floodColor:"rgba(0,0,0,0.18)"})})]}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#bg-${h})`}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#gl-${h})`}),(0,b.jsxs)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:[(0,b.jsx)("g",{"data-avatar-shape":"",filter:`url(#sh-${h})`,children:j.render()}),k&&(0,b.jsx)("g",{transform:`translate(${s}, ${w})`,children:(0,b.jsx)("g",{"data-avatar-eyes":"",children:k.render(v,r)})}),m&&(0,b.jsx)("g",{transform:`translate(${s}, ${t+7})`,children:(0,b.jsx)("g",{"data-avatar-nose":"",children:m.render(r)})})]})]})},"BG_COLORS",0,f,"DEFAULT_CONFIG",0,n,"EYE_KEYS",0,m,"Eyes",0,l,"NOSE_KEYS",0,j,"Noses",0,i,"PRESETS",0,[{name:"Task",config:{shape:"task",nose:"dot",eye:"dots",bg:0}},{name:"Notes",config:{shape:"book",nose:"dash",eye:"happy",bg:1}},{name:"Mail",config:{shape:"mail",nose:"smile",eye:"dots",bg:3}},{name:"Schedule",config:{shape:"calendar",nose:"dot",eye:"dots",bg:4}},{name:"Idea",config:{shape:"bulb",nose:"oh",eye:"rings",bg:5}},{name:"Project",config:{shape:"folder",nose:"dash",eye:"lines",bg:7}},{name:"Goal",config:{shape:"mountain",nose:"caret",eye:"arches",bg:8}},{name:"Dream",config:{shape:"circle",nose:"smile",eye:"shy",bg:11}},{name:"Organize",config:{shape:"rounded",nose:"dot",eye:"sleepy",bg:6}},{name:"Explore",config:{shape:"hexagon",nose:"hookL",eye:"wink",bg:9}},{name:"Focus",config:{shape:"task",nose:"caret",eye:"lines",bg:2}},{name:"Collect",config:{shape:"book",nose:"oh",eye:"rings",bg:10}}],"SHAPE_KEYS",0,h,"Shapes",0,g,"parseAvatarUrl",0,function(a){if(!a||!a.startsWith(p))return null;try{let b=JSON.parse(a.slice(p.length));if("object"==typeof b&&null!==b&&"string"==typeof b.shape&&"string"==typeof b.eye&&"string"==typeof b.nose&&"number"==typeof b.bg)return b;if("object"==typeof b&&null!==b&&"outline"in b)return n;return null}catch{return null}},"randomConfig",0,function(){return{shape:o(h),eye:o(m),nose:o(j),bg:Math.floor(Math.random()*f.length)}},"serializeAvatarConfig",0,function(a){return p+JSON.stringify(a)}])},253260,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(325848);let e=["avatar-anim-shape-bounce","avatar-anim-head-tilt","avatar-anim-shake","avatar-anim-wobble","avatar-anim-pulse","avatar-anim-spin","avatar-anim-jelly","avatar-anim-float","avatar-anim-nod"];a.s(["AnimatedAvatar",0,function({config:a,size:f,className:g,isHovered:h,isWorking:i}){let[j,k]=(0,c.useState)(null),l=(0,c.useRef)(-1);function m(){let a=Math.floor(Math.random()*e.length);return a===l.current&&(a=(a+1)%e.length),l.current=a,e[a]}return(0,c.useEffect)(()=>{h?k(m()):i||k(null)},[h,i]),(0,c.useEffect)(()=>{if(!i){h||k(null);return}k(m());let a=setInterval(()=>{k(m())},4e3);return()=>clearInterval(a)},[h,i]),(0,b.jsx)("div",{className:j??void 0,children:(0,b.jsx)(d.AvatarRenderer,{config:a,size:f,className:g})})}])},628508,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(432340),e=a.i(325848),f=a.i(75118),g=a.i(655795),h=a.i(525132);function i({label:a,keys:c,value:d,onChange:e,renderThumb:g,mobile:h=!1}){let j=c.indexOf(d),k=a=>e(c[(j+a+c.length)%c.length]),l=c[(j-1+c.length)%c.length],m=c[(j+1)%c.length];return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-12 text-xs font-medium text-muted-foreground shrink-0",children:a}),(0,b.jsx)("button",{type:"button",onClick:()=>k(-1),className:(0,f.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",h?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M15 5 L8 12 L15 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 justify-center",children:[(0,b.jsx)("button",{type:"button",onClick:()=>k(-1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:g(l)}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:"border-2 border-primary rounded-lg p-0.5",children:g(d)}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:g(m)})]}),(0,b.jsx)("button",{type:"button",onClick:()=>k(1),className:(0,f.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",h?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M9 5 L16 12 L9 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function j({config:a,onChange:d,layout:k="vertical",mobile:l=!1}){let[m,n]=(0,c.useState)("presets"),o=(0,c.useCallback)((b,c)=>{d({...a,[b]:c})},[a,d]),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)(a);(0,c.useEffect)(()=>{if(r.current.shape!==a.shape||r.current.eye!==a.eye||r.current.nose!==a.nose||r.current.bg!==a.bg){q(!0);let b=setTimeout(()=>q(!1),450);return r.current=a,()=>clearTimeout(b)}},[a]),(0,c.useEffect)(()=>{if("horizontal"!==k)return;let a=a=>{"Space"===a.code&&a.target===document.body&&(a.preventDefault(),d((0,e.randomConfig)()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[k,d]);let s="horizontal"===k,t=s?220:l?120:160,u=(0,b.jsxs)("div",{className:(0,f.cn)("flex flex-col items-center gap-3 rounded-2xl bg-muted/30",l?"p-3":"p-4",s?"w-70 shrink-0 justify-center":""),children:[(0,b.jsx)("div",{className:(0,f.cn)("rounded-2xl",p&&"animate-[shake_0.45s_cubic-bezier(.36,.07,.19,.97)]"),children:(0,b.jsx)(e.AvatarRenderer,{config:a,size:t})}),(0,b.jsxs)("button",{type:"button",onClick:()=>d((0,e.randomConfig)()),className:"inline-flex items-center gap-2 rounded-full bg-foreground px-4 py-1.5 text-sm font-medium text-background hover:bg-foreground/80 transition-colors",children:[(0,b.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),(0,b.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"8",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),"Random",s&&(0,b.jsx)(g.Kbd,{className:"ml-1 bg-background/20 text-[10px] text-inherit",children:"Space"})]})]}),v=(0,b.jsxs)("div",{className:(0,f.cn)("flex flex-col gap-3 flex-1 min-w-0",s&&"rounded-2xl bg-muted/30 p-4 h-95"),children:[(0,b.jsxs)("div",{className:"flex border-b border-border",children:[(0,b.jsx)("button",{type:"button",onClick:()=>n("presets"),className:(0,f.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","presets"===m?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"★ Presets"}),(0,b.jsx)("button",{type:"button",onClick:()=>n("custom"),className:(0,f.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","custom"===m?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"⚙ Custom"})]}),(0,b.jsxs)("div",{className:(0,f.cn)("flex-1 min-h-0",s&&"overflow-y-auto thin-scrollbar"),children:["presets"===m&&(0,b.jsx)("div",{className:(0,f.cn)("grid gap-2",l?"grid-cols-3":"grid-cols-4"),children:e.PRESETS.map(c=>{let g=c.config.shape===a.shape&&c.config.eye===a.eye&&c.config.nose===a.nose&&c.config.bg===a.bg;return(0,b.jsx)("button",{type:"button",onClick:()=>d(c.config),className:(0,f.cn)("flex items-center justify-center rounded-xl border p-2 transition-all",g?"border-primary border-2 bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/40"),children:(0,b.jsx)(e.AvatarRenderer,{config:c.config,size:56})},c.name)})}),"custom"===m&&(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsx)(i,{label:"Shape",keys:e.SHAPE_KEYS,value:a.shape,onChange:a=>o("shape",a),renderThumb:a=>(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:"40",height:"40",children:[(0,b.jsx)("rect",{width:"200",height:"200",rx:"56",fill:"hsl(var(--muted))"}),(0,b.jsx)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:e.Shapes[a]?.render()})]}),mobile:l}),(0,b.jsx)(i,{label:"Nose",keys:e.NOSE_KEYS,value:a.nose,onChange:a=>o("nose",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-14 -10 28 20",width:"36",height:"24",children:e.Noses[a]?.render("currentColor")}),mobile:l}),(0,b.jsx)(i,{label:"Eyes",keys:e.EYE_KEYS,value:a.eye,onChange:a=>o("eye",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-18 -10 36 20",width:"44",height:"24",children:e.Eyes[a]?.render(8,"currentColor")}),mobile:l}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Color"}),(0,b.jsx)("div",{className:(0,f.cn)("flex flex-wrap p-1",l?"gap-3":"gap-2"),children:e.BG_COLORS.map((c,d)=>(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:()=>o("bg",d),className:(0,f.cn)("rounded-full transition-shadow",l?"size-8":"size-7",a.bg===d?"ring-2 ring-primary ring-offset-2":"ring-1 ring-border"),style:{background:`linear-gradient(135deg, ${c.gradient[0]}, ${c.gradient[1]}, ${c.gradient[2]})`}})}),(0,b.jsx)(h.TooltipContent,{children:c.name})]},c.value))})]})]})]})]});return s?(0,b.jsxs)("div",{className:"flex gap-4",children:[u,v]}):(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[u,v]})}var k=a.i(586220);a.s(["AvatarPickerDialog",0,function({config:a,onChange:f}){let[g,h]=(0,c.useState)(!1),[i,l]=(0,c.useState)(a),m=(0,k.useIsMobile)();return(0,b.jsxs)(d.Dialog,{open:g,onOpenChange:b=>{b&&l(a),h(b)},children:[(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)(d.DialogTrigger,{render:(0,b.jsx)("button",{type:"button",className:"rounded-2xl bg-background p-1.5 shadow-sm border border-border hover:border-primary/40 transition-colors cursor-pointer"}),children:(0,b.jsx)(e.AvatarRenderer,{config:a,size:80})})}),(0,b.jsxs)(d.DialogContent,{className:m?"top-auto left-0 translate-x-0 translate-y-0 bottom-0 max-w-full sm:max-w-full w-full rounded-b-none rounded-t-xl max-h-[85dvh] overflow-y-auto pb-[env(safe-area-inset-bottom)]":"sm:max-w-180",children:[(0,b.jsx)(d.DialogHeader,{children:(0,b.jsx)(d.DialogTitle,{children:"Choose Avatar"})}),(0,b.jsx)(j,{config:i,layout:m?"vertical":"horizontal",onChange:a=>{l(a),f(a)},mobile:m}),m&&(0,b.jsx)("button",{type:"button",onClick:()=>h(!1),className:"w-full rounded-xl bg-primary py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]})]})}],628508)},949409,a=>{"use strict";var b=a.i(749314),c=a.i(325848);a.s(["AgentAvatar",0,function({name:a,avatarUrl:d,size:e=32}){let f=(0,c.parseAvatarUrl)(d);return f?(0,b.jsx)(c.AvatarRenderer,{config:f,size:e,className:"rounded-full shrink-0"}):(0,b.jsx)("span",{className:"flex items-center justify-center rounded-full bg-secondary text-xs font-medium shrink-0",style:{width:e,height:e},children:(a??"?").charAt(0).toUpperCase()})}])}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=src_web_src_components_avatar_0a0h8en._.js.map
|