@madarco/agentbox 0.26.1 → 0.27.1
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/CHANGELOG.md +42 -0
- package/README.md +1 -1
- package/dist/{_cloud-attach-7WRQH6XZ.js → _cloud-attach-WDGM6FL5.js} +4 -4
- package/dist/{chunk-UIFL7F2G.js → chunk-26IKZRTT.js} +2 -2
- package/dist/chunk-G3H2L3O2.js +0 -0
- package/dist/{chunk-DJQMK4RN.js → chunk-HR7NHH5J.js} +14 -9
- package/dist/chunk-HR7NHH5J.js.map +1 -0
- package/dist/{chunk-K5KOLYIL.js → chunk-IDH5A4RR.js} +2 -2
- package/dist/{chunk-ZY7M7MXH.js → chunk-JE6UI5YR.js} +10 -10
- package/dist/chunk-JGZSA5ZI.js +0 -0
- package/dist/{chunk-7ZZAZPYX.js → chunk-KWOEUFVA.js} +2 -2
- package/dist/{chunk-BA2VLJVU.js → chunk-LL7NCMUU.js} +3 -3
- package/dist/{chunk-I2OAJS3L.js → chunk-NEF6MDJO.js} +4 -4
- package/dist/{chunk-I2OAJS3L.js.map → chunk-NEF6MDJO.js.map} +1 -1
- package/dist/{dist-YA7EXBGG.js → chunk-SJ75AIA2.js} +486 -92
- package/dist/chunk-SJ75AIA2.js.map +1 -0
- package/dist/{chunk-PK2QF4IR.js → chunk-UJEH2NJT.js} +27 -14
- package/dist/chunk-UJEH2NJT.js.map +1 -0
- package/dist/{chunk-DQHMDDAT.js → chunk-V5XXJH63.js} +2 -2
- package/dist/chunk-WJFZJZIM.js +0 -0
- package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
- package/dist/{dist-DTNYMBQ5.js → dist-FTKS2GI4.js} +5 -5
- package/dist/{dist-5IICYSR6.js → dist-KQTMCVME.js} +5 -5
- package/dist/{dist-5IICYSR6.js.map → dist-KQTMCVME.js.map} +1 -1
- package/dist/{dist-AR5CHRSV.js → dist-O3LKOIE7.js} +5 -5
- package/dist/{dist-POVRY7HO.js → dist-OO52HARR.js} +3 -3
- package/dist/{dist-K4LNH3EC.js → dist-TSFVB7AI.js} +5 -5
- package/dist/dist-U2SVLJUQ.js +0 -0
- package/dist/{dist-XYY6SIKG.js → dist-WVYAURMF.js} +5 -5
- package/dist/dist-Z6L5MM5D.js +46 -0
- package/dist/index.js +392 -211
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-75DIZ55S-W6NU3S3B.js → prepared-state-75DIZ55S-TNJXWMXV.js} +2 -2
- package/dist/prepared-state-75DIZ55S-TNJXWMXV.js.map +1 -0
- package/package.json +31 -29
- package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
- package/runtime/_shared/agentbox-dockerd-start +0 -0
- package/runtime/_shared/agentbox-open +0 -0
- package/runtime/_shared/agentbox-portless-trust +0 -0
- package/runtime/_shared/agentbox-vnc-start +0 -0
- package/runtime/_shared/ctl.cjs +0 -0
- package/runtime/_shared/gh-shim +0 -0
- package/runtime/_shared/git-shim +0 -0
- package/runtime/_shared/linear-shim +0 -0
- package/runtime/_shared/ntn-shim +0 -0
- package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
- package/runtime/digitalocean/agentbox-dockerd-start +0 -0
- package/runtime/digitalocean/agentbox-open +0 -0
- package/runtime/digitalocean/agentbox-portless-trust +0 -0
- package/runtime/digitalocean/agentbox-vnc-start +0 -0
- package/runtime/digitalocean/ctl.cjs +0 -0
- package/runtime/digitalocean/gh-shim +0 -0
- package/runtime/digitalocean/git-shim +0 -0
- package/runtime/digitalocean/linear-shim +0 -0
- package/runtime/digitalocean/ntn-shim +0 -0
- package/runtime/digitalocean/scripts/install-box.sh +0 -0
- package/runtime/docker/packages/ctl/dist/bin.cjs +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
- package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
- package/runtime/e2b/agentbox-dockerd-start +0 -0
- package/runtime/e2b/agentbox-open +0 -0
- package/runtime/e2b/agentbox-vnc-start +0 -0
- package/runtime/e2b/ctl.cjs +0 -0
- package/runtime/e2b/gh-shim +0 -0
- package/runtime/e2b/git-shim +0 -0
- package/runtime/e2b/linear-shim +0 -0
- package/runtime/e2b/ntn-shim +0 -0
- package/runtime/e2b/scripts/build-template.sh +0 -0
- package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
- package/runtime/hetzner/agentbox-dockerd-start +0 -0
- package/runtime/hetzner/agentbox-open +0 -0
- package/runtime/hetzner/agentbox-portless-trust +0 -0
- package/runtime/hetzner/agentbox-vnc-start +0 -0
- package/runtime/hetzner/ctl.cjs +0 -0
- package/runtime/hetzner/gh-shim +0 -0
- package/runtime/hetzner/git-shim +0 -0
- package/runtime/hetzner/linear-shim +0 -0
- package/runtime/hetzner/ntn-shim +0 -0
- package/runtime/hetzner/scripts/install-box.sh +0 -0
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/routes-manifest.json +22 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js +2 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js +2 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +11 -11
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_hosts_route_actions_0b_404_.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_hosts_[alias]_route_actions_0swypy5.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_hosts_[alias]_bake_route_actions_1-_pu3n.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bmro0b._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t4qmv-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xh14bo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1k8g143._.js → [root-of-the-server]__19pc87s._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4xycg._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +4 -4
- package/runtime/hub/apps/hub/.next/server/chunks/_1bng7w9._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +14 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_1uccfbf._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_03s-ah2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r4px38._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_18w2zeh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0od97-d._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_settings_page_tsx_0hv6n82._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +18 -18
- package/runtime/hub/apps/hub/.next/static/chunks/070w7h5rh5ja6.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1_ur0im1g7_s9.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/{000a1sa7te1h8.js → 2awpm9w8crker.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{3-zanu4ioia5i.js → 2gfw8-qyx5xi_.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/30de2x24ntwkg.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3e5n630psqst8.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3tqnniym2yvpb.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/{3dfjrxx-dy644.css → 42uysd_max-yq.css} +1 -1
- package/runtime/hub/apps/hub/{chunk-BARD2DI6.js → chunk-EHBJKZCL.js} +13 -8
- package/runtime/hub/apps/hub/{chunk-4QY2VZCF.js → chunk-RXYOWSSN.js} +19 -13
- package/runtime/hub/apps/hub/{chunk-XZZXPEVV.js → chunk-YJ5MJOXK.js} +1 -1
- package/runtime/hub/apps/hub/{dist-3ENKQN5G.js → dist-3I7KUI6W.js} +3 -3
- package/runtime/hub/apps/hub/{dist-WAZKGVYL.js → dist-6FPPUSWZ.js} +2 -2
- package/runtime/hub/apps/hub/{dist-NNBELNA7.js → dist-DX6IYMAH.js} +300 -109
- package/runtime/hub/apps/hub/{dist-RJJ2SDYO.js → dist-G6TXUSPZ.js} +3 -3
- package/runtime/hub/apps/hub/{dist-AE6IV4FV.js → dist-GTVVXCBP.js} +3 -3
- package/runtime/hub/apps/hub/{dist-6VGJOQYK.js → dist-JG45OFT2.js} +3 -3
- package/runtime/hub/apps/hub/{dist-TU7D6UTB.js → dist-LYDHYTP2.js} +3 -3
- package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-NYEDSU2U.js → prepared-state-75DIZ55S-2IFNUHHM.js} +1 -1
- package/runtime/hub/apps/hub/server.js +136 -19
- package/runtime/relay/bin.cjs +0 -0
- package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
- package/runtime/vercel/agentbox-dockerd-start +0 -0
- package/runtime/vercel/agentbox-open +0 -0
- package/runtime/vercel/agentbox-vnc-start +0 -0
- package/runtime/vercel/ctl.cjs +0 -0
- package/runtime/vercel/gh-shim +0 -0
- package/runtime/vercel/git-shim +0 -0
- package/runtime/vercel/linear-shim +0 -0
- package/runtime/vercel/ntn-shim +0 -0
- package/runtime/vercel/scripts/provision.sh +0 -0
- package/LICENSE +0 -21
- package/dist/chunk-DJQMK4RN.js.map +0 -1
- package/dist/chunk-PK2QF4IR.js.map +0 -1
- package/dist/chunk-ZYKNSHOH.js +0 -259
- package/dist/chunk-ZYKNSHOH.js.map +0 -1
- package/dist/dist-YA7EXBGG.js.map +0 -1
- package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +0 -14
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +0 -14
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +0 -3
- package/runtime/hub/apps/hub/.next/static/chunks/1c5w3kqosumog.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1o3ot_9-8jgzc.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1z4elhg8gyq98.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3uq9hf-roasav.js +0 -1
- /package/dist/{_cloud-attach-7WRQH6XZ.js.map → _cloud-attach-WDGM6FL5.js.map} +0 -0
- /package/dist/{chunk-UIFL7F2G.js.map → chunk-26IKZRTT.js.map} +0 -0
- /package/dist/{chunk-K5KOLYIL.js.map → chunk-IDH5A4RR.js.map} +0 -0
- /package/dist/{chunk-ZY7M7MXH.js.map → chunk-JE6UI5YR.js.map} +0 -0
- /package/dist/{chunk-7ZZAZPYX.js.map → chunk-KWOEUFVA.js.map} +0 -0
- /package/dist/{chunk-BA2VLJVU.js.map → chunk-LL7NCMUU.js.map} +0 -0
- /package/dist/{chunk-DQHMDDAT.js.map → chunk-V5XXJH63.js.map} +0 -0
- /package/dist/{dist-DTNYMBQ5.js.map → dist-FTKS2GI4.js.map} +0 -0
- /package/dist/{dist-AR5CHRSV.js.map → dist-O3LKOIE7.js.map} +0 -0
- /package/dist/{dist-POVRY7HO.js.map → dist-OO52HARR.js.map} +0 -0
- /package/dist/{dist-K4LNH3EC.js.map → dist-TSFVB7AI.js.map} +0 -0
- /package/dist/{dist-XYY6SIKG.js.map → dist-WVYAURMF.js.map} +0 -0
- /package/dist/{prepared-state-75DIZ55S-W6NU3S3B.js.map → dist-Z6L5MM5D.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → PWF2iHQOg9-rRyfqVDLrh}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → PWF2iHQOg9-rRyfqVDLrh}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → PWF2iHQOg9-rRyfqVDLrh}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77084,e=>{"use strict";let t,n;var r,i=e.i(1262),o=e.i(45971),l=e.i(33789),a=e.i(44344),s=e.i(86892),c=e.i(65232);function u({className:e,icon:t,title:n,children:r}){return(0,i.jsxs)("div",{className:(0,c.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[t?(0,i.jsx)(t,{className:"mt-0.5 size-4 flex-none"}):null,(0,i.jsxs)("div",{className:"min-w-0",children:[n?(0,i.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,i.jsx)("div",{className:"text-[12.5px] leading-normal",children:r})]})]})}var d=e.i(8536),f=e.i(96621),p=e.i(88451);function m({boxId:e}){let{state:t}=(0,f.useStore)(),n=t.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===n.length?null:(0,i.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,i.jsx)(a.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,i.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[n.length," pending approval",1===n.length?"":"s"]}),(0,i.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,i.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:n.map(e=>(0,i.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,i.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,i.jsx)(l.Ago,{ms:e.createdAt})})]}),(0,i.jsx)("div",{className:"flex-none pt-0.5",children:(0,i.jsx)(p.ApprovalActions,{id:e.id})})]},e.id))})]})}var x=e.i(54129),h=e.i(69377);function v(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}function g(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function b(...e){return x.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=g(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():g(e[t],null)}}}}(...e),e)}function y(e,t=[]){let n=[],r=()=>{let t=n.map(e=>x.createContext(e));return function(n){let r=n?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=x.createContext(r);o.displayName=t+"Context";let l=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[l]||o,c=x.useMemo(()=>a,Object.values(a));return(0,i.jsx)(s.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,i,a={}){let{optional:s=!1}=a,c=i?.[e]?.[l]||o,u=x.useContext(c);if(u)return u;if(void 0!==r)return r;if(!s)throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}"u">typeof window&&window.document&&window.document.createElement;var w=e.i(94766),j=Symbol.for("radix.slottable"),N=Symbol.for("react.lazy");function C(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===N&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var S=x[" use ".trim().toString()],E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n;let r,o=(n=`Primitive.${t}`,(r=x.forwardRef((e,t)=>{var r;let i,o,{children:l,...a}=e,s=null,c=!1,u=[];C(l)&&"function"==typeof S&&(l=S(l._payload)),x.Children.forEach(l,e=>{var t;if(t=e,x.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===j){c=!0;let t="child"in e.props?e.props.child:e.props.children;C(t)&&"function"==typeof S&&(t=S(t._payload)),s=((e,t)=>{if("child"in e.props){let t=e.props.child;return x.isValidElement(t)?x.cloneElement(t,void 0,e.props.children(t.props.children)):null}return x.isValidElement(t)?t:null})(e,t),u.push(s?.props?.children)}else u.push(e)}),s?s=x.cloneElement(s,void 0,u):!c&&1===x.Children.count(l)&&x.isValidElement(l)&&(s=l);let d=s?(r=s,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,f=b(t,d);if(!s){if(l||0===l){let e,t;throw Error(c?(e=n,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=n,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(a,s.props??{});return s.type!==x.Fragment&&(p.ref=t?f:d),x.cloneElement(s,p)})).displayName=`${n}.Slot`,r),l=x.forwardRef((e,n)=>{let{asChild:r,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(r?o:t,{...l,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function R(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var k="dismissableLayer.update",T=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),L=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...d}=e,f=x.useContext(T),[p,m]=x.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=x.useState({}),y=b(t,m),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,C=p?w.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,L=C>=N,D=x.useRef(!1),I=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:l=A}=t,a=R(e),s=x.useRef(!1),c=x.useRef(!1),u=x.useRef(new Map),d=x.useRef(()=>{});return x.useEffect(()=>{function e(){c.current=!1,i.current=!1,u.current.clear()}function t(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function f(e){c.current&&u.current.set(e.type,!1)}let p=t=>{if(t.target&&!s.current){let o=function(){n.removeEventListener("click",d.current);let t=Array.from(u.current.values()).some(Boolean);e(),t||P("dismissableLayer.pointerDownOutside",a,f,{discrete:!0})};if(!l(t.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let f={originalEvent:t};c.current=!0,i.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",d.current),d.current=o,n.addEventListener("click",d.current,{once:!0})):o()}else n.removeEventListener("click",d.current),e();s.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,t,!0),n.addEventListener(e,f);let x=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{for(let e of(window.clearTimeout(x),n.removeEventListener("pointerdown",p),n.removeEventListener("click",d.current),m))n.removeEventListener(e,t,!0),n.removeEventListener(e,f)}},[n,a,r,i,o,l]),{onPointerDownCapture:()=>s.current=!0}}(e=>{a?.(e),c?.(e),e.defaultPrevented||u?.()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return L&&!t},[f.branches,L])}),B=function(e,t=globalThis?.document){let n=R(e),r=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!r.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(o&&D.current)return;let t=e.target;![...f.branches].some(e=>e.contains(t))&&(s?.(e),c?.(e),e.defaultPrevented||u?.())},h),$=!!p&&C===w.length-1,M=R(e=>{"Escape"===e.key&&(l?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return x.useEffect(()=>{if($)return h.addEventListener("keydown",M,{capture:!0}),()=>h.removeEventListener("keydown",M,{capture:!0})},[h,$,M]),x.useEffect(()=>{if(p)return n&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(r=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),O(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),0===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=r))}},[p,h,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,f]),x.useEffect(()=>{let e=()=>g({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,i.jsx)(E.div,{...d,ref:y,style:{pointerEvents:S?L?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,B.onFocusCapture),onBlurCapture:v(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,I.onPointerDownCapture)})});L.displayName="DismissableLayer",x.forwardRef((e,t)=>{let n=x.useContext(T),r=x.useRef(null),o=b(t,r);return x.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,i.jsx)(E.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=()=>!0;function O(){let e=new CustomEvent(k);document.dispatchEvent(e)}function P(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&w.flushSync(()=>i.dispatchEvent(o));else i.dispatchEvent(o)}var D=globalThis?.document?x.useLayoutEffect:()=>{},I=x[" useId ".trim().toString()]||(()=>void 0),B=0;let $=["top","right","bottom","left"],M=Math.min,_=Math.max,F=Math.round,z=Math.floor,H=e=>({x:e,y:e}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function U(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function K(e){return"y"===e?"height":"width"}function q(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function G(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let J=["left","right"],Z=["right","left"],Q=["top","bottom"],ee=["bottom","top"];function et(e){let t=V(e);return W[t]+e.slice(t.length)}function en(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function er(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ei(e,t,n){let r,{reference:i,floating:o}=e,l=q(t),a=X(q(t)),s=K(a),c=V(t),u="y"===l,d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,p=i[s]/2-o[s]/2;switch(c){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:f};break;case"left":r={x:i.x-o.width,y:f};break;default:r={x:i.x,y:i.y}}switch(Y(t)){case"start":r[a]-=p*(n&&u?-1:1);break;case"end":r[a]+=p*(n&&u?-1:1)}return r}async function eo(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=U(t,e),m=en(p),x=a[f?"floating"===d?"reference":"floating":d],h=er(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(x)))||n?x:x.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,g=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await (null==o.isElement?void 0:o.isElement(g))&&await (null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},y=er(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:g,strategy:s}):v);return{top:(h.top-y.top+m.top)/b.y,bottom:(y.bottom-h.bottom+m.bottom)/b.y,left:(h.left-y.left+m.left)/b.x,right:(y.right-h.right+m.right)/b.x}}let el=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:eo},s=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ei(c,r,s),f=r,p=0,m={};for(let n=0;n<o.length;n++){let x=o[n];if(!x)continue;let{name:h,fn:v}=x,{x:g,y:b,data:y,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,m[h]={...m[h],...y},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=ei(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}};function ea(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function es(e){return $.some(t=>e[t]>=0)}let ec=new Set(["left","top"]);async function eu(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=V(n),a=Y(n),s="y"===q(n),c=ec.has(l)?-1:1,u=o&&s?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function ed(){return"u">typeof window}function ef(e){return ex(e)?(e.nodeName||"").toLowerCase():"#document"}function ep(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function em(e){var t;return null==(t=(ex(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ex(e){return!!ed()&&(e instanceof Node||e instanceof ep(e).Node)}function eh(e){return!!ed()&&(e instanceof Element||e instanceof ep(e).Element)}function ev(e){return!!ed()&&(e instanceof HTMLElement||e instanceof ep(e).HTMLElement)}function eg(e){return!(!ed()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ep(e).ShadowRoot)}function eb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function ey(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ew=/transform|translate|scale|rotate|perspective|filter/,ej=/paint|layout|strict|content/,eN=e=>!!e&&"none"!==e;function eC(e){let t=eh(e)?eR(e):e;return eN(t.transform)||eN(t.translate)||eN(t.scale)||eN(t.rotate)||eN(t.perspective)||!eS()&&(eN(t.backdropFilter)||eN(t.filter))||ew.test(t.willChange||"")||ej.test(t.contain||"")}function eS(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function eE(e){return/^(html|body|#document)$/.test(ef(e))}function eR(e){return ep(e).getComputedStyle(e)}function ek(e){return eh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eT(e){if("html"===ef(e))return e;let t=e.assignedSlot||e.parentNode||eg(e)&&e.host||em(e);return eg(t)?t.host:t}function eL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=eT(t);return eE(n)?t.ownerDocument?t.ownerDocument.body:t.body:ev(n)&&eb(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=ep(i);if(!o)return t.concat(i,eL(i,[],n));{let e=eA(l);return t.concat(l,l.visualViewport||[],eb(i)?i:[],e&&n?eL(e):[])}}function eA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eO(e){let t=eR(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ev(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=F(n)!==o||F(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function eP(e){return eh(e)?e:e.contextElement}function eD(e){let t=eP(e);if(!ev(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=eO(t),l=(o?F(n.width):n.width)/r,a=(o?F(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eI=H(0);function eB(e){let t=ep(e);return eS()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eI}function e$(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=eP(e),a=H(1);t&&(r?eh(r)&&(a=eD(r)):a=eD(e));let s=(void 0===(i=n)&&(i=!1),r&&(!i||r===ep(l))&&i)?eB(l):H(0),c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(l){let e=ep(l),t=r&&eh(r)?ep(r):r,n=e,i=eA(n);for(;i&&r&&t!==n;){let e=eD(i),t=i.getBoundingClientRect(),r=eR(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=o,u+=l,i=eA(n=ep(i))}}return er({width:d,height:f,x:c,y:u})}function eM(e,t){let n=ek(e).scrollLeft;return t?t.left+n:e$(em(e)).left+n}function e_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eM(e,n),y:n.top+t.scrollTop}}function eF(e,t,n){var r;let i;if("viewport"===t)i=function(e,t){let n=ep(e),r=em(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;let e=eS();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,s=i.offsetTop)}let c=eM(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:a,y:s}}(e,n);else if("document"===t){let t,n,o,l,a,s,c;r=em(e),t=em(r),n=ek(r),o=r.ownerDocument.body,l=_(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=_(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+eM(r),c=-n.scrollTop,"rtl"===eR(o).direction&&(s+=_(t.clientWidth,o.clientWidth)-l),i={width:l,height:a,x:s,y:c}}else if(eh(t)){let e,r,o,l,a,s;r=(e=e$(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,l=ev(t)?eD(t):H(1),a=t.clientWidth*l.x,s=t.clientHeight*l.y,i={width:a,height:s,x:o*l.x,y:r*l.y}}else{let n=eB(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return er(i)}function ez(e){return"static"===eR(e).position}function eH(e,t){if(!ev(e)||"fixed"===eR(e).position)return null;if(t)return t(e);let n=e.offsetParent;return em(e)===n&&(n=n.ownerDocument.body),n}function eW(e,t){var n;let r=ep(e);if(ey(e))return r;if(!ev(e)){let t=eT(e);for(;t&&!eE(t);){if(eh(t)&&!ez(t))return t;t=eT(t)}return r}let i=eH(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(ef(n)))&&ez(i);)i=eH(i,t);return i&&eE(i)&&ez(i)&&!eC(i)?r:i||function(e){let t=eT(e);for(;ev(t)&&!eE(t);){if(eC(t))return t;if(ey(t))break;t=eT(t)}return null}(e)||r}let eU=async function(e){let t=this.getOffsetParent||eW,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=ev(t),i=em(t),o="fixed"===n,l=e$(e,!0,o,t),a={scrollLeft:0,scrollTop:0},s=H(0);if(r||!r&&!o)if(("body"!==ef(t)||eb(i))&&(a=ek(t)),r){let e=e$(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=eM(i));o&&!r&&i&&(s.x=eM(i));let c=!i||r||o?H(0):e_(i,a);return{x:l.left+a.scrollLeft-s.x-c.x,y:l.top+a.scrollTop-s.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=em(r),a=!!t&&ey(t.floating);if(r===l||a&&o)return n;let s={scrollLeft:0,scrollTop:0},c=H(1),u=H(0),d=ev(r);if((d||!d&&!o)&&(("body"!==ef(r)||eb(l))&&(s=ek(r)),d)){let e=e$(r);c=eD(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!l||d||o?H(0):e_(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:em,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?ey(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=eL(e,[],!1).filter(e=>eh(e)&&"body"!==ef(e)),i=null,o="fixed"===eR(e).position,l=o?eT(e):e;for(;eh(l)&&!eE(l);){let t=eR(l),n=eC(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||eb(l)&&!n&&function e(t,n){let r=eT(t);return!(r===n||!eh(r)||eE(r))&&("fixed"===eR(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=eT(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=eF(t,o[0],i),a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<o.length;e++){let n=eF(t,o[e],i);a=_(n.top,a),s=M(n.right,s),c=M(n.bottom,c),u=_(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:eW,getElementRects:eU,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=eO(e);return{width:t,height:n}},getScale:eD,isElement:eh,isRTL:function(e){return"rtl"===eR(e).direction}};function eY(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eX=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=U(e,t)||{};if(null==c)return{};let d=en(u),f={x:n,y:r},p=X(q(i)),m=K(p),x=await l.getDimensions(c),h="y"===p,v=h?"clientHeight":"clientWidth",g=o.reference[m]+o.reference[p]-f[p]-o.floating[m],b=f[p]-o.reference[p],y=await (null==l.getOffsetParent?void 0:l.getOffsetParent(c)),w=y?y[v]:0;w&&await (null==l.isElement?void 0:l.isElement(y))||(w=a.floating[v]||o.floating[m]);let j=w/2-x[m]/2-1,N=M(d[h?"top":"left"],j),C=M(d[h?"bottom":"right"],j),S=w-x[m]-C,E=w/2-x[m]/2+(g/2-b/2),R=_(N,M(E,S)),k=!s.arrow&&null!=Y(i)&&E!==R&&o.reference[m]/2-(E<N?N:C)-x[m]/2<0,T=k?E<N?E-N:E-S:0;return{[p]:f[p]+T,data:{[p]:R,centerOffset:E-R-T,...k&&{alignmentOffset:T}},reset:k}}});var eK="u">typeof document?x.useLayoutEffect:function(){};function eq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!eq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eJ(e,t){let n=eG(e);return Math.round(t*n)/n}function eZ(e){let t=x.useRef(e);return eK(()=>{t.current=e}),t}var eQ=x.forwardRef((e,t)=>{let{children:n,width:r=10,height:o=5,...l}=e;return(0,i.jsx)(E.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eQ.displayName="Arrow";var e0="Popper",[e1,e5]=y(e0),[e4,e2]=e1(e0),e3=e=>{let{__scopePopper:t,children:n}=e,[r,o]=x.useState(null),[l,a]=x.useState(void 0);return(0,i.jsx)(e4,{scope:t,anchor:r,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})};e3.displayName=e0;var e6="PopperAnchor",e9=x.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,l=e2(e6,n),a=x.useRef(null),s=l.onAnchorChange,c=b(t,x.useCallback(e=>{a.current=e,e&&s(e)},[s])),u=x.useRef(null);x.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=l.placementState&&ta(l.placementState),f=d?.[0],p=d?.[1];return r?null:(0,i.jsx)(E.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...o,ref:c})});e9.displayName=e6;var e7="PopperContent",[e8,te]=e1(e7),tt=x.forwardRef((e,t)=>{var n,r,o,l,a,s,c,u,d,f,p,m,h;let v,g,y,j,N,C,{__scopePopper:S,side:k="bottom",sideOffset:T=0,align:L="center",alignOffset:A=0,arrowPadding:O=0,avoidCollisions:P=!0,collisionBoundary:I=[],collisionPadding:B=0,sticky:$="partial",hideWhenDetached:F=!1,updatePositionStrategy:H="optimized",onPlaced:W,...en}=e,er=e2(e7,S),[ei,eo]=x.useState(null),ed=b(t,eo),[ef,ep]=x.useState(null),ex=function(e){let[t,n]=x.useState(void 0);return D(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(ef),eh=ex?.width??0,ev=ex?.height??0,eg="number"==typeof B?B:{top:0,right:0,bottom:0,left:0,...B},eb=Array.isArray(I)?I:[I],ey=eb.length>0,ew={padding:eg,boundary:eb.filter(to),altBoundary:ey},{refs:ej,floatingStyles:eN,placement:eC,isPositioned:eS,middlewareData:eE}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);eq(f,r)||p(r);let[m,h]=x.useState(null),[v,g]=x.useState(null),b=x.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=x.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),j=o||m,N=l||v,C=x.useRef(null),S=x.useRef(null),E=x.useRef(u),R=null!=s,k=eZ(s),T=eZ(i),L=eZ(c),A=x.useCallback(()=>{var e,r;let i,o,l;if(!C.current||!S.current)return;let a={placement:t,strategy:n,middleware:f};T.current&&(a.platform=T.current),(e=C.current,r=S.current,i=new Map,l={...(o={platform:eV,...a}).platform,_c:i},el(e,r,{...o,platform:l})).then(e=>{let t={...e,isPositioned:!1!==L.current};O.current&&!eq(E.current,t)&&(E.current=t,w.flushSync(()=>{d(t)}))})},[f,t,n,T,L]);eK(()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let O=x.useRef(!1);eK(()=>(O.current=!0,()=>{O.current=!1}),[]),eK(()=>{if(j&&(C.current=j),N&&(S.current=N),j&&N){if(k.current)return k.current(j,N,A);A()}},[j,N,A,k,R]);let P=x.useMemo(()=>({reference:C,floating:S,setReference:b,setFloating:y}),[b,y]),D=x.useMemo(()=>({reference:j,floating:N}),[j,N]),I=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eJ(D.floating,u.x),r=eJ(D.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...eG(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,D.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:P,elements:D,floatingStyles:I}),[u,A,P,D,I])}({strategy:"fixed",placement:k+("center"!==L?"-"+L:""),whileElementsMounted:(...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=eP(e),d=o||l?[...u?eL(u):[],...t?eL(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let f=u&&s?function(e,t){let n,r=null,i=em(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(a||t(),!f||!p)return;let m={rootMargin:-z(d)+"px "+-z(i.clientWidth-(u+f))+"px "+-z(i.clientHeight-(d+p))+"px "+-z(u)+"px",threshold:_(0,M(1,s))||1},x=!0;function h(t){let r=t[0].intersectionRatio;if(r!==s){if(!x)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||eY(c,e.getBoundingClientRect())||l(),x=!1}try{r=new IntersectionObserver(h,{...m,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),o}(u,n):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let x=c?e$(e):null;return c&&function t(){let r=e$(e);x&&!eY(x,r)&&n(),x=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===H}),elements:{reference:er.anchor},middleware:[{name:(v={name:"offset",options:r=n={mainAxis:T+ev,alignmentAxis:A},async fn(e){var t,n;let{x:i,y:o,placement:l,middlewareData:a}=e,s=await eu(e,r);return l===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:l}}}}).name,fn:v.fn,options:[n,void 0]},P&&{name:(g={name:"shift",options:a=l={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(o=void 0,{options:o={},fn(e){let{x:t,y:n,placement:r,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=U(o,e),u={x:t,y:n},d=q(r),f=X(d),p=u[f],m=u[d],x=U(a,e),h="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+h.mainAxis,n=i.reference[f]+i.reference[e]-h.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,g;let e="y"===f?"width":"height",t=ec.has(V(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:h.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(g=l.offset)?void 0:g[d])||0)-(t?h.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[f]:p,[d]:m}}}).fn,options:[void 0,void 0]}:void 0,...ew},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=U(a,e),u={x:t,y:n},d=await i.detectOverflow(e,c),f=q(V(r)),p=X(f),m=u[p],x=u[f];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=m+d[e],r=m-d[t];m=_(n,M(m,r))}if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",n=x+d[e],r=x-d[t];x=_(n,M(x,r))}let h=s.fn({...e,[p]:m,[f]:x});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:o,[f]:l}}}}}).name,fn:g.fn,options:[l,void 0]},P&&{name:(y={name:"flip",options:c=s={...ew},async fn(e){var t,n,r,i,o,l,a,s;let u,d,f,{placement:p,middlewareData:m,rects:x,initialPlacement:h,platform:v,elements:g}=e,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:C=!0,...S}=U(c,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let E=V(p),R=q(h),k=V(h)===h,T=await (null==v.isRTL?void 0:v.isRTL(g.floating)),L=w||(k||!C?[et(h)]:(u=et(h),[G(h),u,G(u)])),A="none"!==N;!w&&A&&L.push(...(d=Y(h),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Z:J;return t?J:Z;case"left":case"right":return t?Q:ee;default:return[]}}(V(h),"start"===N,T),d&&(f=f.map(e=>e+"-"+d),C&&(f=f.concat(f.map(G)))),f));let O=[h,...L],P=await v.detectOverflow(e,S),D=[],I=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&D.push(P[E]),y){let e,t,n,r,i=(l=p,a=x,void 0===(s=T)&&(s=!1),e=Y(l),n=K(t=X(q(l))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=et(r)),[r,et(r)]);D.push(P[i[0]],P[i[1]])}if(I=[...I,{placement:p,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=m.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==y||R===q(t)||I.every(e=>q(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(i=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(j){case"bestFit":{let e=null==(o=I.filter(e=>{if(A){let t=q(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=h}if(p!==n)return{reset:{placement:n}}}return{}}}).name,fn:y.fn,options:[s,void 0]},{name:(j={name:"size",options:d=u={...ew,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:o}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${i}px`),l.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){var t,n;let r,i,{placement:o,rects:l,platform:a,elements:s}=e,{apply:c=()=>{},...u}=U(d,e),f=await a.detectOverflow(e,u),p=V(o),m=Y(o),x="y"===q(o),{width:h,height:v}=l.floating;"top"===p||"bottom"===p?(r=p,i=m===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,r="end"===m?"top":"bottom");let g=v-f.top-f.bottom,b=h-f.left-f.right,y=M(v-f[r],g),w=M(h-f[i],b),j=!e.middlewareData.shift,N=y,C=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=b),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(N=g),j&&!m){let e=_(f.left,0),t=_(f.right,0),n=_(f.top,0),r=_(f.bottom,0);x?C=h-2*(0!==e||0!==t?e+t:_(f.left,f.right)):N=v-2*(0!==n||0!==r?n+r:_(f.top,f.bottom))}await c({...e,availableWidth:C,availableHeight:N});let S=await a.getDimensions(s.floating);return h!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}).name,fn:j.fn,options:[u,void 0]},ef&&{name:(N={name:"arrow",options:p=f={element:ef,padding:O},fn(e){let{element:t,padding:n}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?eX({element:t.current,padding:n}).fn(e):{}:t?eX({element:t,padding:n}).fn(e):{}}}).name,fn:N.fn,options:[f,void 0]},tl({arrowWidth:eh,arrowHeight:ev}),F&&{name:(C={name:"hide",options:h=m={strategy:"referenceHidden",...ew,boundary:ey?ew.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=U(h,e);switch(r){case"referenceHidden":{let r=ea(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:es(r)}}}case"escaped":{let r=ea(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:es(r)}}}default:return{}}}}).name,fn:C.fn,options:[m,void 0]}]}),eR=er.setPlacementState;D(()=>(eR(eC),()=>{eR(void 0)}),[eC,eR]);let[ek,eT]=ta(eC),eA=R(W);D(()=>{eS&&eA?.()},[eS,eA]);let eO=eE.arrow?.x,eD=eE.arrow?.y,eI=eE.arrow?.centerOffset!==0,[eB,eM]=x.useState();return D(()=>{ei&&eM(window.getComputedStyle(ei).zIndex)},[ei]),(0,i.jsx)("div",{ref:ej.setFloating,"data-radix-popper-content-wrapper":"",style:{...eN,transform:eS?eN.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eB,"--radix-popper-transform-origin":[eE.transformOrigin?.x,eE.transformOrigin?.y].join(" "),...eE.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(e8,{scope:S,placedSide:ek,placedAlign:eT,onArrowChange:ep,arrowX:eO,arrowY:eD,shouldHideArrow:eI,children:(0,i.jsx)(E.div,{"data-side":ek,"data-align":eT,...en,ref:ed,style:{...en.style,animation:eS?void 0:"none"}})})})});tt.displayName=e7;var tn="PopperArrow",tr={top:"bottom",right:"left",bottom:"top",left:"right"},ti=x.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,o=te(tn,n),l=tr[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(eQ,{...r,ref:t,style:{...r.style,display:"block"}})})});function to(e){return null!==e}ti.displayName=tn;var tl=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[s,c]=ta(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(i.arrow?.x??0)+l/2,f=(i.arrow?.y??0)+a/2,p="",m="";return"bottom"===s?(p=o?u:`${d}px`,m=`${-a}px`):"top"===s?(p=o?u:`${d}px`,m=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,m=o?u:`${f}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=o?u:`${f}px`),{data:{x:p,y:m}}}});function ta(e){let[t,n="center"]=e.split("-");return[t,n]}var ts=x.forwardRef((e,t)=>{let{container:n,...r}=e,[o,l]=x.useState(!1);D(()=>l(!0),[]);let a=n||o&&globalThis?.document?.body;return a?w.createPortal((0,i.jsx)(E.div,{...r,ref:t}),a):null});ts.displayName="Portal";var tc=e=>{var t;let n,r,{present:i,children:o}=e,l=function(e){var t,n;let[r,i]=x.useState(),o=x.useRef(null),l=x.useRef(e),a=x.useRef("none"),s=x.useRef(void 0),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>n[e][t]??e,t));return x.useEffect(()=>{"mounted"===c?(a.current=s.current??td(o.current),s.current=void 0):a.current="none"},[c]),D(()=>{let t=o.current,n=l.current;if(n!==e){let r=a.current,i=td(t);e?(s.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),D(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=td(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(a.current=td(o.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,s.current=td(t)}else o.current=null;i(e)},[])}}(i),a="function"==typeof o?o({present:l.isPresent}):x.Children.only(o),s=function(...e){let t=x.useRef(e);return t.current=e,x.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=tu(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():tu(n[e],null)}}},[])}(l.ref,(t=a,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?x.cloneElement(a,{ref:s}):null};function tu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function td(e){return e?.animationName||"none"}tc.displayName="Presence",x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var tf=x[" useInsertionEffect ".trim().toString()]||D;Symbol("RADIX:SYNC_STATE");var tp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tm=x.forwardRef((e,t)=>(0,i.jsx)(E.span,{...e,ref:t,style:{...tp,...e.style}}));tm.displayName="VisuallyHidden";var[tx,th]=y("Tooltip",[e5]),tv=e5(),tg="TooltipProvider",tb="tooltip.open",[ty,tw]=tx(tg),tj=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,a=x.useRef(!0),s=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,i.jsx)(ty,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(e=>{s.current=e},[]),disableHoverableContent:o,children:l})};tj.displayName=tg;var tN="Tooltip",[tC,tS]=tx(tN),tE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:a,delayDuration:s}=e,c=tw(tN,e.__scopeTooltip),u=tv(t),[d,f]=x.useState(null),p=function(){let[e,t]=x.useState(I());return D(()=>{t(e=>e??String(B++))},[void 0]),e?`radix-${e}`:""}(),m=x.useRef(0),h=a??c.disableHoverableContent,v=s??c.delayDuration,g=x.useRef(!1),[b,y]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,l]=function({defaultProp:e,onChange:t}){let[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return tf(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:i;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==a){let t=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a},[a,r])}return[s,x.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else o(t)},[a,e,o,l])]}({prop:r,defaultProp:o??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(tb))):c.onClose(),l?.(e)},caller:tN}),w=x.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,y(!0)},[y]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,y(!0),m.current=0},v)},[v,y]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,i.jsx)(e3,{...u,children:(0,i.jsx)(tC,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:x.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:j,onClose:N,disableHoverableContent:h,children:n})})};tE.displayName=tN;var tR="TooltipTrigger",tk=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tS(tR,n),l=tw(tR,n),a=tv(n),s=b(t,x.useRef(null),o.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),d=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,i.jsx)(e9,{asChild:!0,...a,children:(0,i.jsx)(E.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||l.isPointerInTransitRef.current||(o.onTriggerEnter(),u.current=!0))}),onPointerLeave:v(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:v(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:v(e.onBlur,o.onClose),onClick:v(e.onClick,o.onClose)})})});tk.displayName=tR;var tT="TooltipPortal",[tL,tA]=tx(tT,{forceMount:void 0}),tO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=tS(tT,t);return(0,i.jsx)(tL,{scope:t,forceMount:n,children:(0,i.jsx)(tc,{present:n||l.open,children:(0,i.jsx)(ts,{asChild:!0,container:o,children:r})})})};tO.displayName=tT;var tP="TooltipContent",tD=x.forwardRef((e,t)=>{let n=tA(tP,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,a=tS(tP,e.__scopeTooltip);return(0,i.jsx)(tc,{present:r||a.open,children:a.disableHoverableContent?(0,i.jsx)(t_,{side:o,...l,ref:t}):(0,i.jsx)(tI,{side:o,...l,ref:t})})}),tI=x.forwardRef((e,t)=>{let n=tS(tP,e.__scopeTooltip),r=tw(tP,e.__scopeTooltip),o=x.useRef(null),l=b(t,o),[a,s]=x.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=x.useCallback(()=>{s(null),f(!1)},[f]),m=x.useCallback((e,t)=>{let n,r=e.currentTarget,i={x:e.clientX,y:e.clientY},o=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(i,r.getBoundingClientRect());s(((n=[...function(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(i,o),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(n))),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,m,p]),x.useEffect(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let l=t[e],a=t[o],s=l.x,c=l.y,u=a.x,d=a.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(i=!i)}return i}(n,a);r?p():i&&(p(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,a,u,p]),(0,i.jsx)(t_,{...e,ref:l})}),[tB,t$]=tx(tN,{isInside:!1}),tM=((n=e=>"child"in e?e.children(e.child):e.children).displayName="TooltipContent.Slottable",n.__radixId=j,n),t_=x.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:a,...s}=e,c=tS(tP,n),u=tv(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(tb,d),()=>document.removeEventListener(tb,d)),[d]),x.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,i.jsx)(L,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,i.jsxs)(tt,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,i.jsx)(tM,{children:r}),(0,i.jsx)(tB,{scope:n,isInside:!0,children:(0,i.jsx)(tm,{id:c.contentId,role:"tooltip",children:o||r})})]})})});tD.displayName=tP;var tF="TooltipArrow",tz=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tv(n);return t$(tF,n).isInside?null:(0,i.jsx)(ti,{...o,...r,ref:t})});function tH({delayDuration:e=0,...t}){return(0,i.jsx)(tj,{delayDuration:e,...t})}function tW(e){return(0,i.jsx)(tH,{children:(0,i.jsx)(tE,{...e})})}function tU(e){return(0,i.jsx)(tk,{...e})}function tV({className:e,sideOffset:t=4,children:n,...r}){return(0,i.jsx)(tO,{children:(0,i.jsxs)(tD,{sideOffset:t,className:(0,c.cn)("z-50 w-fit max-w-64 origin-(--radix-tooltip-content-transform-origin) rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,(0,i.jsx)(tz,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}tz.displayName=tF;var tY=e.i(1485);let tX=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function tK({url:e}){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let o=(0,x.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1500)}catch{}},[e]);return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:o,children:[t?(0,i.jsx)(a.Icons.check,{}):(0,i.jsx)(a.Icons.copy,{}),t?"Copied":"Copy URL"]})}function tq({reason:e,children:t}){return e?(0,i.jsxs)(tW,{children:[(0,i.jsx)(tU,{asChild:!0,children:(0,i.jsx)("span",{className:"cursor-not-allowed",children:t})}),(0,i.jsx)(tV,{children:e})]}):(0,i.jsx)(i.Fragment,{children:t})}function tG({box:e}){let{webUrl:t,vncUrl:n}=e,{apps:r,supported:o,pending:l,launch:s}=function(e){let[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&n(t.ok?await t.json():null)}catch{e&&n(null)}})(),()=>{e=!1}},[]);let o=(0,x.useCallback)(async t=>{i(t);try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!n.ok){let e=await n.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${n.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{i(null)}},[e.id]),l=t?.supported?t.targets:null;return{apps:l?tX.map(({app:t,label:n,icon:r})=>{let i=l[t],o=i.available?i.providers&&!i.providers.includes(e.provider)?`Not available for ${e.provider} boxes`:null:i.reason??`${n} is not installed`;return{app:t,label:n,icon:r,disabledReason:o}}):[],supported:null!==l,pending:r,launch:o}}(e),c="paused"===e.status?"Box is paused — resume to access":"stopped"===e.status?"Box is stopped — start to access":null,u=t?null:c??"No web service exposed",f=n?null:!1===e.vncEnabled?"VNC is not enabled for this box":c??"VNC is not available";return o||t||n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{children:"Access"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:t||!n?"Web":"VNC"}),(0,i.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:t??(n?"Remote desktop":u)})]}),(0,i.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[t?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:t,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]}):(0,i.jsx)(tq,{reason:u,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]})}),t?(0,i.jsx)(tK,{url:t}):null,n?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:n,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]}):(0,i.jsx)(tq,{reason:f,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]})})]})]}),o?(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,i.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:r.map(({app:e,label:t,icon:n,disabledReason:r})=>{let o=a.Icons[n];return(0,i.jsx)(tq,{reason:r,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:null!==r||null!==l,onClick:()=>void s(e),children:[(0,i.jsx)(o,{}),t]})},e)})})]}):null]})]}):null}var tJ=e.i(80922),tZ=e.i(30544),tQ=e.i(51096);function t0({k:e,v:t,mono:n,link:r}){return(0,i.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,i.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,i.jsx)("div",{className:(0,c.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:r?(0,i.jsx)(tQ.default,{className:"cursor-pointer text-primary",href:r,children:t}):t})]})}var t1=e.i(31758),t5=e.i(95141),t4=e.i(3060),t2=e.i(16200),t3=e.i(49604),t6=e.i(9383);let t9=(0,t6.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",t6.callServer,void 0,t6.findSourceMapURL,"gitBranchAction"),t7=(0,t6.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",t6.callServer,void 0,t6.findSourceMapURL,"gitCheckoutAction"),t8=(0,t6.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",t6.callServer,void 0,t6.findSourceMapURL,"gitPullAction"),ne=(0,t6.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",t6.callServer,void 0,t6.findSourceMapURL,"gitPushAction"),nt=(0,t6.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",t6.callServer,void 0,t6.findSourceMapURL,"gitPushHostAction"),nn=0;function nr({toasts:e,dismiss:t}){return(0,i.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:e.map(e=>(0,i.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,i.jsx)("span",{className:(0,c.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===e.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===e.variant?(0,i.jsx)(a.Icons.warn,{className:"size-3.5"}):(0,i.jsx)(a.Icons.check,{className:"size-3.5"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,i.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>t(e.id),"aria-label":"Dismiss",children:(0,i.jsx)(a.Icons.x,{className:"size-3"})})]},e.id))})}function ni({label:e,desc:t,children:n}){return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:t})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function no({icon:e,disabled:t,onRun:n,children:r}){let[o,l]=(0,x.useState)(!1),a=async()=>{l(!0);try{await n()}finally{l(!1)}};return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:t||o,onClick:a,children:[o?(0,i.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,i.jsx)(e,{}),r]})}function nl(e,t){let n=(e??"").trim()||(t??"").trim();return n?n.split("\n")[0]:void 0}function na({box:e}){let t=(0,o.useRouter)(),{toasts:n,push:r,dismiss:l}=function(){let[e,t]=(0,x.useState)([]),n=(0,x.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,x.useCallback)(e=>{let r=++nn;t(t=>[...t,{id:r,...e}]),setTimeout(()=>n(r),4200)},[n]),dismiss:n}}(),[s,u]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),m="running"!==e.status,v=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});u(t.ok?await t.json():null)}catch{u(null)}},[e.id]);(0,x.useEffect)(()=>{v()},[v]);let g=s?.ok&&s.branch?s.branch:e.branch||"—",b=()=>{v(),t.refresh()},y=async(e,t)=>{let n=await t();n.ok?(r({title:e,detail:nl(n.stdout,n.stderr)}),b()):r({variant:"error",title:`${e} failed`,detail:n.error})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Card,{className:(0,c.cn)("divide-y divide-border/60 overflow-hidden",m?"opacity-90":""),children:[m?(0,i.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,i.jsx)(a.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,i.jsxs)(ni,{label:"Sync",desc:`origin ↔ ${g}`,children:[(0,i.jsx)(no,{icon:a.Icons.arrowL,disabled:m,onRun:()=>y("Pulled from origin",()=>t8(e.id)),children:"Pull"}),(0,i.jsx)(no,{icon:a.Icons.ext,disabled:m,onRun:()=>y("Pushed to origin",()=>ne(e.id)),children:"Push"}),(0,i.jsx)(no,{icon:a.Icons.host,disabled:m,onRun:()=>y("Pushed to host",()=>nt(e.id)),children:"Push to host"})]}),(0,i.jsxs)(ni,{label:"Branch",desc:`currently on ${g}`,children:[(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("change"),children:[(0,i.jsx)(a.Icons.branch,{}),"Change branch"]}),(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("new"),children:[(0,i.jsx)(a.Icons.plus,{}),"New branch"]})]})]}),"change"===f?(0,i.jsx)(nu,{box:e,branch:g,onClose:()=>p(null),onDone:r,onRefresh:b}):null,"new"===f?(0,i.jsx)(nd,{box:e,onClose:()=>p(null),onDone:r,onRefresh:b}):null,(0,i.jsx)(nr,{toasts:n,dismiss:l})]})}let ns="__manual__";function nc({boxId:e,value:t,onChange:n,id:r,headLabel:o,currentBranch:l}){let[a,s]=(0,x.useState)(null),[c,u]=(0,x.useState)(l??null),[d,f]=(0,x.useState)(!1);return((0,x.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),r=n.ok?await n.json():null;if(t)return;r&&Array.isArray(r.branches)&&r.branches.length>0?(s(r.branches),l||"string"!=typeof r.current||u(r.current)):(s([]),f(!0))}catch{t||(s([]),f(!0))}})(),()=>{t=!0}},[e,l]),null===a)?(0,i.jsx)(t3.Select,{id:r,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,i.jsx)("option",{value:"",children:"Loading branches…"})}):d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t4.Input,{id:r,className:"font-mono text-[13px]",autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:o?"HEAD":"feature-x"}),a.length>0?(0,i.jsx)("button",{type:"button",onClick:()=>{f(!1),n("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,i.jsxs)(t3.Select,{id:r,value:t,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===ns){f(!0),n("");return}n(e.target.value)},children:[o?(0,i.jsx)("option",{value:"",children:o}):(0,i.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,i.jsx)("option",{value:ns,children:"Other / type manually…"}),(0,i.jsx)("option",{disabled:!0,children:"────────────"}),a.map(e=>(0,i.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function nu({box:e,branch:t,onClose:n,onDone:r,onRefresh:o}){let[l,s]=(0,x.useState)(""),[c,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(null),p=l.trim().length>0;return(0,i.jsxs)(t5.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"Change branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · currently on ",t]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsx)(t2.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,i.jsx)(nc,{boxId:e.id,id:"gb-branch",value:l,onChange:s,currentBranch:t}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),d?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:d}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:()=>{p&&!c&&(u(!0),f(null),(async()=>{let t=await t7(e.id,l.trim());t.ok?(r({title:"Branch changed",detail:nl(t.stdout,t.stderr)}),n(),o()):(f(t.error),u(!1))})())},disabled:!p||c,children:[c?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function nd({box:e,onClose:t,onDone:n,onRefresh:r}){let[o,l]=(0,x.useState)(""),[s,c]=(0,x.useState)(""),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),m=o.trim().length>0,v=()=>{m&&!u&&(d(!0),p(null),(async()=>{let i=await t9(e.id,o.trim(),s.trim()||void 0);i.ok?(n({title:"Branch created",detail:nl(i.stdout,i.stderr)}),t(),r()):(p(i.error),d(!1))})())};return(0,i.jsxs)(t5.Dialog,{onClose:t,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"New branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(t2.Label,{htmlFor:"nb-name",children:"Name"}),(0,i.jsx)(t4.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()},placeholder:"my-branch"}),(0,i.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,i.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,i.jsxs)(t2.Label,{htmlFor:"nb-from",children:["Base ref ",(0,i.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,i.jsx)(nc,{boxId:e.id,id:"nb-from",value:s,onChange:c,headLabel:"Current HEAD (default)"}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),f?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:f}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:t,disabled:u,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:v,disabled:!m||u,children:[u?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.plus,{}),u?"Creating…":"Create branch"]})]})]})}let nf=(0,t6.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",t6.callServer,void 0,t6.findSourceMapURL,"restartServiceAction"),np=new Set(["ready","running","done"]),nm=new Set(["crashed","unhealthy","backoff","failed"]),nx={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},nh={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function nv({svc:e,disabled:t,onRestart:n}){var r;let o=(r=e.state,np.has(r)?"up":nm.has(r)?"bad":"idle");return(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,i.jsx)("span",{className:(0,c.cn)("badge-dot",nx[o]),"aria-hidden":!0}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,i.jsx)("span",{className:(0,c.cn)("font-mono text-xs",nh[o]),children:e.state}),e.restarts>0?(0,i.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,i.jsx)(h.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:t,onClick:()=>n(e.name),children:(0,i.jsx)(a.Icons.refresh,{})})]})}function ng({id:e,running:t}){let[n,r]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[s,c]=(0,x.useTransition)(),u=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);r(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,x.useEffect)(()=>{if(u(),!t)return;let e=setInterval(()=>void u(),4e3);return()=>clearInterval(e)},[u,t]);let f=t=>{c(async()=>{let n=await nf(e,t);n.ok||window.alert(`Restart failed: ${n.error}`),await u()})},p=n?.services??[],m=p.length>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{right:m?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!t||s,onClick:()=>f(void 0),children:[(0,i.jsx)(a.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,i.jsx)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||o?o?(0,i.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",o,")."]}):m?(0,i.jsxs)(i.Fragment,{children:[n?.source==="persisted"?(0,i.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,p.map(e=>(0,i.jsx)(nv,{svc:e,disabled:!t||s,onRestart:e=>f(e)},e.name))]}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:n?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var nb=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,o.useParams)(),{box:t,project:n}=(0,f.useStore)(),r=t(e);if(!r)return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,i.jsx)(tJ.BackLink,{to:"/",children:"All boxes"}),(0,i.jsx)(t1.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let c=n(r.projectId);return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,i.jsx)(tJ.BackLink,{to:"/projects/"+r.projectId,children:c?c.name:"Project"}),(0,i.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[r.task,(0,i.jsx)(s.StatusBadge,{status:r.status})]}),(0,i.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.id})," ·"," ",(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.repo})," · ",r.host]})]}),(0,i.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,i.jsx)(tZ.BoxActions,{box:r,size:"lg"})})]}),r.error?(0,i.jsx)(u,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:a.Icons.warn,title:"Box errored",children:(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.error})}):null,(0,i.jsx)(m,{boxId:r.id}),(0,i.jsx)(tY.SectionLabel,{children:"Overview"}),(0,i.jsxs)(nb.StatGrid,{children:[(0,i.jsx)(nb.Stat,{k:"Status",v:(0,i.jsx)(s.StatusBadge,{status:r.status})}),(0,i.jsx)(nb.Stat,{k:"Agent CLI",v:r.agent,mono:!0}),(0,i.jsx)(nb.Stat,{k:"Commits",v:r.commits??"—",icon:a.Icons.commit}),(0,i.jsx)(nb.Stat,{k:"Files touched",v:r.filesTouched??"—",icon:a.Icons.file}),(0,i.jsx)(nb.Stat,{k:"Last activity",v:(0,i.jsx)(l.Ago,{ms:r.lastActivity}),mono:!0})]}),(0,i.jsx)(tG,{box:r}),(0,i.jsx)(tY.SectionLabel,{children:"Git operations"}),(0,i.jsx)(na,{box:r}),(0,i.jsx)(ng,{id:r.id,running:"running"===r.status}),(0,i.jsx)(tY.SectionLabel,{children:"Details"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsx)(t0,{k:"Box ID",v:r.id,mono:!0}),(0,i.jsx)(t0,{k:"Project",v:c?c.name:"—",link:c?"/projects/"+r.projectId:null}),(0,i.jsx)(t0,{k:"Repository",v:r.repo,mono:!0}),(0,i.jsx)(t0,{k:"Branch",v:r.branch,mono:!0}),(0,i.jsx)(t0,{k:"Host",v:r.host,mono:!0}),(0,i.jsx)(t0,{k:"Created",v:new Date(r.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77084,e=>{"use strict";let t,n;var r,i=e.i(1262),o=e.i(45971),l=e.i(33789),a=e.i(44344),s=e.i(86892),c=e.i(65232);function u({className:e,icon:t,title:n,children:r}){return(0,i.jsxs)("div",{className:(0,c.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[t?(0,i.jsx)(t,{className:"mt-0.5 size-4 flex-none"}):null,(0,i.jsxs)("div",{className:"min-w-0",children:[n?(0,i.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,i.jsx)("div",{className:"text-[12.5px] leading-normal",children:r})]})]})}var d=e.i(8536),f=e.i(96621),p=e.i(88451);function m({boxId:e}){let{state:t}=(0,f.useStore)(),n=t.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===n.length?null:(0,i.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,i.jsx)(a.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,i.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[n.length," pending approval",1===n.length?"":"s"]}),(0,i.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,i.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:n.map(e=>(0,i.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,i.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,i.jsx)(l.Ago,{ms:e.createdAt})})]}),(0,i.jsx)("div",{className:"flex-none pt-0.5",children:(0,i.jsx)(p.ApprovalActions,{id:e.id})})]},e.id))})]})}var x=e.i(54129),h=e.i(69377);function v(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}function g(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function b(...e){return x.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=g(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():g(e[t],null)}}}}(...e),e)}function y(e,t=[]){let n=[],r=()=>{let t=n.map(e=>x.createContext(e));return function(n){let r=n?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=x.createContext(r);o.displayName=t+"Context";let l=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[l]||o,c=x.useMemo(()=>a,Object.values(a));return(0,i.jsx)(s.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,i,a={}){let{optional:s=!1}=a,c=i?.[e]?.[l]||o,u=x.useContext(c);if(u)return u;if(void 0!==r)return r;if(!s)throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}"u">typeof window&&window.document&&window.document.createElement;var w=e.i(94766),j=Symbol.for("radix.slottable"),N=Symbol.for("react.lazy");function C(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===N&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var S=x[" use ".trim().toString()],E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n;let r,o=(n=`Primitive.${t}`,(r=x.forwardRef((e,t)=>{var r;let i,o,{children:l,...a}=e,s=null,c=!1,u=[];C(l)&&"function"==typeof S&&(l=S(l._payload)),x.Children.forEach(l,e=>{var t;if(t=e,x.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===j){c=!0;let t="child"in e.props?e.props.child:e.props.children;C(t)&&"function"==typeof S&&(t=S(t._payload)),s=((e,t)=>{if("child"in e.props){let t=e.props.child;return x.isValidElement(t)?x.cloneElement(t,void 0,e.props.children(t.props.children)):null}return x.isValidElement(t)?t:null})(e,t),u.push(s?.props?.children)}else u.push(e)}),s?s=x.cloneElement(s,void 0,u):!c&&1===x.Children.count(l)&&x.isValidElement(l)&&(s=l);let d=s?(r=s,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,f=b(t,d);if(!s){if(l||0===l){let e,t;throw Error(c?(e=n,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=n,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(a,s.props??{});return s.type!==x.Fragment&&(p.ref=t?f:d),x.cloneElement(s,p)})).displayName=`${n}.Slot`,r),l=x.forwardRef((e,n)=>{let{asChild:r,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(r?o:t,{...l,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function R(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var k="dismissableLayer.update",T=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),L=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...d}=e,f=x.useContext(T),[p,m]=x.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=x.useState({}),y=b(t,m),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,C=p?w.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,L=C>=N,D=x.useRef(!1),I=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:l=A}=t,a=R(e),s=x.useRef(!1),c=x.useRef(!1),u=x.useRef(new Map),d=x.useRef(()=>{});return x.useEffect(()=>{function e(){c.current=!1,i.current=!1,u.current.clear()}function t(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function f(e){c.current&&u.current.set(e.type,!1)}let p=t=>{if(t.target&&!s.current){let o=function(){n.removeEventListener("click",d.current);let t=Array.from(u.current.values()).some(Boolean);e(),t||P("dismissableLayer.pointerDownOutside",a,f,{discrete:!0})};if(!l(t.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let f={originalEvent:t};c.current=!0,i.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",d.current),d.current=o,n.addEventListener("click",d.current,{once:!0})):o()}else n.removeEventListener("click",d.current),e();s.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,t,!0),n.addEventListener(e,f);let x=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{for(let e of(window.clearTimeout(x),n.removeEventListener("pointerdown",p),n.removeEventListener("click",d.current),m))n.removeEventListener(e,t,!0),n.removeEventListener(e,f)}},[n,a,r,i,o,l]),{onPointerDownCapture:()=>s.current=!0}}(e=>{a?.(e),c?.(e),e.defaultPrevented||u?.()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return L&&!t},[f.branches,L])}),B=function(e,t=globalThis?.document){let n=R(e),r=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!r.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(o&&D.current)return;let t=e.target;![...f.branches].some(e=>e.contains(t))&&(s?.(e),c?.(e),e.defaultPrevented||u?.())},h),$=!!p&&C===w.length-1,M=R(e=>{"Escape"===e.key&&(l?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return x.useEffect(()=>{if($)return h.addEventListener("keydown",M,{capture:!0}),()=>h.removeEventListener("keydown",M,{capture:!0})},[h,$,M]),x.useEffect(()=>{if(p)return n&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(r=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),O(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),0===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=r))}},[p,h,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,f]),x.useEffect(()=>{let e=()=>g({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,i.jsx)(E.div,{...d,ref:y,style:{pointerEvents:S?L?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,B.onFocusCapture),onBlurCapture:v(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,I.onPointerDownCapture)})});L.displayName="DismissableLayer",x.forwardRef((e,t)=>{let n=x.useContext(T),r=x.useRef(null),o=b(t,r);return x.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,i.jsx)(E.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=()=>!0;function O(){let e=new CustomEvent(k);document.dispatchEvent(e)}function P(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&w.flushSync(()=>i.dispatchEvent(o));else i.dispatchEvent(o)}var D=globalThis?.document?x.useLayoutEffect:()=>{},I=x[" useId ".trim().toString()]||(()=>void 0),B=0;let $=["top","right","bottom","left"],M=Math.min,_=Math.max,F=Math.round,z=Math.floor,H=e=>({x:e,y:e}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function U(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function K(e){return"y"===e?"height":"width"}function q(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function G(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let J=["left","right"],Z=["right","left"],Q=["top","bottom"],ee=["bottom","top"];function et(e){let t=V(e);return W[t]+e.slice(t.length)}function en(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function er(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ei(e,t,n){let r,{reference:i,floating:o}=e,l=q(t),a=X(q(t)),s=K(a),c=V(t),u="y"===l,d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,p=i[s]/2-o[s]/2;switch(c){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:f};break;case"left":r={x:i.x-o.width,y:f};break;default:r={x:i.x,y:i.y}}switch(Y(t)){case"start":r[a]-=p*(n&&u?-1:1);break;case"end":r[a]+=p*(n&&u?-1:1)}return r}async function eo(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=U(t,e),m=en(p),x=a[f?"floating"===d?"reference":"floating":d],h=er(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(x)))||n?x:x.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,g=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await (null==o.isElement?void 0:o.isElement(g))&&await (null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},y=er(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:g,strategy:s}):v);return{top:(h.top-y.top+m.top)/b.y,bottom:(y.bottom-h.bottom+m.bottom)/b.y,left:(h.left-y.left+m.left)/b.x,right:(y.right-h.right+m.right)/b.x}}let el=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:eo},s=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ei(c,r,s),f=r,p=0,m={};for(let n=0;n<o.length;n++){let x=o[n];if(!x)continue;let{name:h,fn:v}=x,{x:g,y:b,data:y,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,m[h]={...m[h],...y},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=ei(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}};function ea(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function es(e){return $.some(t=>e[t]>=0)}let ec=new Set(["left","top"]);async function eu(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=V(n),a=Y(n),s="y"===q(n),c=ec.has(l)?-1:1,u=o&&s?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function ed(){return"u">typeof window}function ef(e){return ex(e)?(e.nodeName||"").toLowerCase():"#document"}function ep(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function em(e){var t;return null==(t=(ex(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ex(e){return!!ed()&&(e instanceof Node||e instanceof ep(e).Node)}function eh(e){return!!ed()&&(e instanceof Element||e instanceof ep(e).Element)}function ev(e){return!!ed()&&(e instanceof HTMLElement||e instanceof ep(e).HTMLElement)}function eg(e){return!(!ed()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ep(e).ShadowRoot)}function eb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function ey(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ew=/transform|translate|scale|rotate|perspective|filter/,ej=/paint|layout|strict|content/,eN=e=>!!e&&"none"!==e;function eC(e){let t=eh(e)?eR(e):e;return eN(t.transform)||eN(t.translate)||eN(t.scale)||eN(t.rotate)||eN(t.perspective)||!eS()&&(eN(t.backdropFilter)||eN(t.filter))||ew.test(t.willChange||"")||ej.test(t.contain||"")}function eS(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function eE(e){return/^(html|body|#document)$/.test(ef(e))}function eR(e){return ep(e).getComputedStyle(e)}function ek(e){return eh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eT(e){if("html"===ef(e))return e;let t=e.assignedSlot||e.parentNode||eg(e)&&e.host||em(e);return eg(t)?t.host:t}function eL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=eT(t);return eE(n)?t.ownerDocument?t.ownerDocument.body:t.body:ev(n)&&eb(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=ep(i);if(!o)return t.concat(i,eL(i,[],n));{let e=eA(l);return t.concat(l,l.visualViewport||[],eb(i)?i:[],e&&n?eL(e):[])}}function eA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eO(e){let t=eR(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ev(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=F(n)!==o||F(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function eP(e){return eh(e)?e:e.contextElement}function eD(e){let t=eP(e);if(!ev(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=eO(t),l=(o?F(n.width):n.width)/r,a=(o?F(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eI=H(0);function eB(e){let t=ep(e);return eS()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eI}function e$(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=eP(e),a=H(1);t&&(r?eh(r)&&(a=eD(r)):a=eD(e));let s=(void 0===(i=n)&&(i=!1),r&&(!i||r===ep(l))&&i)?eB(l):H(0),c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(l){let e=ep(l),t=r&&eh(r)?ep(r):r,n=e,i=eA(n);for(;i&&r&&t!==n;){let e=eD(i),t=i.getBoundingClientRect(),r=eR(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=o,u+=l,i=eA(n=ep(i))}}return er({width:d,height:f,x:c,y:u})}function eM(e,t){let n=ek(e).scrollLeft;return t?t.left+n:e$(em(e)).left+n}function e_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eM(e,n),y:n.top+t.scrollTop}}function eF(e,t,n){var r;let i;if("viewport"===t)i=function(e,t){let n=ep(e),r=em(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;let e=eS();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,s=i.offsetTop)}let c=eM(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:a,y:s}}(e,n);else if("document"===t){let t,n,o,l,a,s,c;r=em(e),t=em(r),n=ek(r),o=r.ownerDocument.body,l=_(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=_(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+eM(r),c=-n.scrollTop,"rtl"===eR(o).direction&&(s+=_(t.clientWidth,o.clientWidth)-l),i={width:l,height:a,x:s,y:c}}else if(eh(t)){let e,r,o,l,a,s;r=(e=e$(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,l=ev(t)?eD(t):H(1),a=t.clientWidth*l.x,s=t.clientHeight*l.y,i={width:a,height:s,x:o*l.x,y:r*l.y}}else{let n=eB(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return er(i)}function ez(e){return"static"===eR(e).position}function eH(e,t){if(!ev(e)||"fixed"===eR(e).position)return null;if(t)return t(e);let n=e.offsetParent;return em(e)===n&&(n=n.ownerDocument.body),n}function eW(e,t){var n;let r=ep(e);if(ey(e))return r;if(!ev(e)){let t=eT(e);for(;t&&!eE(t);){if(eh(t)&&!ez(t))return t;t=eT(t)}return r}let i=eH(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(ef(n)))&&ez(i);)i=eH(i,t);return i&&eE(i)&&ez(i)&&!eC(i)?r:i||function(e){let t=eT(e);for(;ev(t)&&!eE(t);){if(eC(t))return t;if(ey(t))break;t=eT(t)}return null}(e)||r}let eU=async function(e){let t=this.getOffsetParent||eW,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=ev(t),i=em(t),o="fixed"===n,l=e$(e,!0,o,t),a={scrollLeft:0,scrollTop:0},s=H(0);if(r||!r&&!o)if(("body"!==ef(t)||eb(i))&&(a=ek(t)),r){let e=e$(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=eM(i));o&&!r&&i&&(s.x=eM(i));let c=!i||r||o?H(0):e_(i,a);return{x:l.left+a.scrollLeft-s.x-c.x,y:l.top+a.scrollTop-s.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=em(r),a=!!t&&ey(t.floating);if(r===l||a&&o)return n;let s={scrollLeft:0,scrollTop:0},c=H(1),u=H(0),d=ev(r);if((d||!d&&!o)&&(("body"!==ef(r)||eb(l))&&(s=ek(r)),d)){let e=e$(r);c=eD(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!l||d||o?H(0):e_(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:em,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?ey(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=eL(e,[],!1).filter(e=>eh(e)&&"body"!==ef(e)),i=null,o="fixed"===eR(e).position,l=o?eT(e):e;for(;eh(l)&&!eE(l);){let t=eR(l),n=eC(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||eb(l)&&!n&&function e(t,n){let r=eT(t);return!(r===n||!eh(r)||eE(r))&&("fixed"===eR(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=eT(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=eF(t,o[0],i),a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<o.length;e++){let n=eF(t,o[e],i);a=_(n.top,a),s=M(n.right,s),c=M(n.bottom,c),u=_(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:eW,getElementRects:eU,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=eO(e);return{width:t,height:n}},getScale:eD,isElement:eh,isRTL:function(e){return"rtl"===eR(e).direction}};function eY(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eX=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=U(e,t)||{};if(null==c)return{};let d=en(u),f={x:n,y:r},p=X(q(i)),m=K(p),x=await l.getDimensions(c),h="y"===p,v=h?"clientHeight":"clientWidth",g=o.reference[m]+o.reference[p]-f[p]-o.floating[m],b=f[p]-o.reference[p],y=await (null==l.getOffsetParent?void 0:l.getOffsetParent(c)),w=y?y[v]:0;w&&await (null==l.isElement?void 0:l.isElement(y))||(w=a.floating[v]||o.floating[m]);let j=w/2-x[m]/2-1,N=M(d[h?"top":"left"],j),C=M(d[h?"bottom":"right"],j),S=w-x[m]-C,E=w/2-x[m]/2+(g/2-b/2),R=_(N,M(E,S)),k=!s.arrow&&null!=Y(i)&&E!==R&&o.reference[m]/2-(E<N?N:C)-x[m]/2<0,T=k?E<N?E-N:E-S:0;return{[p]:f[p]+T,data:{[p]:R,centerOffset:E-R-T,...k&&{alignmentOffset:T}},reset:k}}});var eK="u">typeof document?x.useLayoutEffect:function(){};function eq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!eq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eJ(e,t){let n=eG(e);return Math.round(t*n)/n}function eZ(e){let t=x.useRef(e);return eK(()=>{t.current=e}),t}var eQ=x.forwardRef((e,t)=>{let{children:n,width:r=10,height:o=5,...l}=e;return(0,i.jsx)(E.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eQ.displayName="Arrow";var e0="Popper",[e1,e5]=y(e0),[e2,e3]=e1(e0),e4=e=>{let{__scopePopper:t,children:n}=e,[r,o]=x.useState(null),[l,a]=x.useState(void 0);return(0,i.jsx)(e2,{scope:t,anchor:r,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})};e4.displayName=e0;var e6="PopperAnchor",e9=x.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,l=e3(e6,n),a=x.useRef(null),s=l.onAnchorChange,c=b(t,x.useCallback(e=>{a.current=e,e&&s(e)},[s])),u=x.useRef(null);x.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=l.placementState&&ta(l.placementState),f=d?.[0],p=d?.[1];return r?null:(0,i.jsx)(E.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...o,ref:c})});e9.displayName=e6;var e8="PopperContent",[e7,te]=e1(e8),tt=x.forwardRef((e,t)=>{var n,r,o,l,a,s,c,u,d,f,p,m,h;let v,g,y,j,N,C,{__scopePopper:S,side:k="bottom",sideOffset:T=0,align:L="center",alignOffset:A=0,arrowPadding:O=0,avoidCollisions:P=!0,collisionBoundary:I=[],collisionPadding:B=0,sticky:$="partial",hideWhenDetached:F=!1,updatePositionStrategy:H="optimized",onPlaced:W,...en}=e,er=e3(e8,S),[ei,eo]=x.useState(null),ed=b(t,eo),[ef,ep]=x.useState(null),ex=function(e){let[t,n]=x.useState(void 0);return D(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(ef),eh=ex?.width??0,ev=ex?.height??0,eg="number"==typeof B?B:{top:0,right:0,bottom:0,left:0,...B},eb=Array.isArray(I)?I:[I],ey=eb.length>0,ew={padding:eg,boundary:eb.filter(to),altBoundary:ey},{refs:ej,floatingStyles:eN,placement:eC,isPositioned:eS,middlewareData:eE}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);eq(f,r)||p(r);let[m,h]=x.useState(null),[v,g]=x.useState(null),b=x.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=x.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),j=o||m,N=l||v,C=x.useRef(null),S=x.useRef(null),E=x.useRef(u),R=null!=s,k=eZ(s),T=eZ(i),L=eZ(c),A=x.useCallback(()=>{var e,r;let i,o,l;if(!C.current||!S.current)return;let a={placement:t,strategy:n,middleware:f};T.current&&(a.platform=T.current),(e=C.current,r=S.current,i=new Map,l={...(o={platform:eV,...a}).platform,_c:i},el(e,r,{...o,platform:l})).then(e=>{let t={...e,isPositioned:!1!==L.current};O.current&&!eq(E.current,t)&&(E.current=t,w.flushSync(()=>{d(t)}))})},[f,t,n,T,L]);eK(()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let O=x.useRef(!1);eK(()=>(O.current=!0,()=>{O.current=!1}),[]),eK(()=>{if(j&&(C.current=j),N&&(S.current=N),j&&N){if(k.current)return k.current(j,N,A);A()}},[j,N,A,k,R]);let P=x.useMemo(()=>({reference:C,floating:S,setReference:b,setFloating:y}),[b,y]),D=x.useMemo(()=>({reference:j,floating:N}),[j,N]),I=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eJ(D.floating,u.x),r=eJ(D.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...eG(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,D.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:P,elements:D,floatingStyles:I}),[u,A,P,D,I])}({strategy:"fixed",placement:k+("center"!==L?"-"+L:""),whileElementsMounted:(...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=eP(e),d=o||l?[...u?eL(u):[],...t?eL(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let f=u&&s?function(e,t){let n,r=null,i=em(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(a||t(),!f||!p)return;let m={rootMargin:-z(d)+"px "+-z(i.clientWidth-(u+f))+"px "+-z(i.clientHeight-(d+p))+"px "+-z(u)+"px",threshold:_(0,M(1,s))||1},x=!0;function h(t){let r=t[0].intersectionRatio;if(r!==s){if(!x)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||eY(c,e.getBoundingClientRect())||l(),x=!1}try{r=new IntersectionObserver(h,{...m,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),o}(u,n):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let x=c?e$(e):null;return c&&function t(){let r=e$(e);x&&!eY(x,r)&&n(),x=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===H}),elements:{reference:er.anchor},middleware:[{name:(v={name:"offset",options:r=n={mainAxis:T+ev,alignmentAxis:A},async fn(e){var t,n;let{x:i,y:o,placement:l,middlewareData:a}=e,s=await eu(e,r);return l===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:l}}}}).name,fn:v.fn,options:[n,void 0]},P&&{name:(g={name:"shift",options:a=l={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(o=void 0,{options:o={},fn(e){let{x:t,y:n,placement:r,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=U(o,e),u={x:t,y:n},d=q(r),f=X(d),p=u[f],m=u[d],x=U(a,e),h="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+h.mainAxis,n=i.reference[f]+i.reference[e]-h.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,g;let e="y"===f?"width":"height",t=ec.has(V(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:h.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(g=l.offset)?void 0:g[d])||0)-(t?h.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[f]:p,[d]:m}}}).fn,options:[void 0,void 0]}:void 0,...ew},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=U(a,e),u={x:t,y:n},d=await i.detectOverflow(e,c),f=q(V(r)),p=X(f),m=u[p],x=u[f];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=m+d[e],r=m-d[t];m=_(n,M(m,r))}if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",n=x+d[e],r=x-d[t];x=_(n,M(x,r))}let h=s.fn({...e,[p]:m,[f]:x});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:o,[f]:l}}}}}).name,fn:g.fn,options:[l,void 0]},P&&{name:(y={name:"flip",options:c=s={...ew},async fn(e){var t,n,r,i,o,l,a,s;let u,d,f,{placement:p,middlewareData:m,rects:x,initialPlacement:h,platform:v,elements:g}=e,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:C=!0,...S}=U(c,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let E=V(p),R=q(h),k=V(h)===h,T=await (null==v.isRTL?void 0:v.isRTL(g.floating)),L=w||(k||!C?[et(h)]:(u=et(h),[G(h),u,G(u)])),A="none"!==N;!w&&A&&L.push(...(d=Y(h),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Z:J;return t?J:Z;case"left":case"right":return t?Q:ee;default:return[]}}(V(h),"start"===N,T),d&&(f=f.map(e=>e+"-"+d),C&&(f=f.concat(f.map(G)))),f));let O=[h,...L],P=await v.detectOverflow(e,S),D=[],I=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&D.push(P[E]),y){let e,t,n,r,i=(l=p,a=x,void 0===(s=T)&&(s=!1),e=Y(l),n=K(t=X(q(l))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=et(r)),[r,et(r)]);D.push(P[i[0]],P[i[1]])}if(I=[...I,{placement:p,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=m.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==y||R===q(t)||I.every(e=>q(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(i=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(j){case"bestFit":{let e=null==(o=I.filter(e=>{if(A){let t=q(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=h}if(p!==n)return{reset:{placement:n}}}return{}}}).name,fn:y.fn,options:[s,void 0]},{name:(j={name:"size",options:d=u={...ew,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:o}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${i}px`),l.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){var t,n;let r,i,{placement:o,rects:l,platform:a,elements:s}=e,{apply:c=()=>{},...u}=U(d,e),f=await a.detectOverflow(e,u),p=V(o),m=Y(o),x="y"===q(o),{width:h,height:v}=l.floating;"top"===p||"bottom"===p?(r=p,i=m===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,r="end"===m?"top":"bottom");let g=v-f.top-f.bottom,b=h-f.left-f.right,y=M(v-f[r],g),w=M(h-f[i],b),j=!e.middlewareData.shift,N=y,C=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=b),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(N=g),j&&!m){let e=_(f.left,0),t=_(f.right,0),n=_(f.top,0),r=_(f.bottom,0);x?C=h-2*(0!==e||0!==t?e+t:_(f.left,f.right)):N=v-2*(0!==n||0!==r?n+r:_(f.top,f.bottom))}await c({...e,availableWidth:C,availableHeight:N});let S=await a.getDimensions(s.floating);return h!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}).name,fn:j.fn,options:[u,void 0]},ef&&{name:(N={name:"arrow",options:p=f={element:ef,padding:O},fn(e){let{element:t,padding:n}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?eX({element:t.current,padding:n}).fn(e):{}:t?eX({element:t,padding:n}).fn(e):{}}}).name,fn:N.fn,options:[f,void 0]},tl({arrowWidth:eh,arrowHeight:ev}),F&&{name:(C={name:"hide",options:h=m={strategy:"referenceHidden",...ew,boundary:ey?ew.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=U(h,e);switch(r){case"referenceHidden":{let r=ea(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:es(r)}}}case"escaped":{let r=ea(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:es(r)}}}default:return{}}}}).name,fn:C.fn,options:[m,void 0]}]}),eR=er.setPlacementState;D(()=>(eR(eC),()=>{eR(void 0)}),[eC,eR]);let[ek,eT]=ta(eC),eA=R(W);D(()=>{eS&&eA?.()},[eS,eA]);let eO=eE.arrow?.x,eD=eE.arrow?.y,eI=eE.arrow?.centerOffset!==0,[eB,eM]=x.useState();return D(()=>{ei&&eM(window.getComputedStyle(ei).zIndex)},[ei]),(0,i.jsx)("div",{ref:ej.setFloating,"data-radix-popper-content-wrapper":"",style:{...eN,transform:eS?eN.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eB,"--radix-popper-transform-origin":[eE.transformOrigin?.x,eE.transformOrigin?.y].join(" "),...eE.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(e7,{scope:S,placedSide:ek,placedAlign:eT,onArrowChange:ep,arrowX:eO,arrowY:eD,shouldHideArrow:eI,children:(0,i.jsx)(E.div,{"data-side":ek,"data-align":eT,...en,ref:ed,style:{...en.style,animation:eS?void 0:"none"}})})})});tt.displayName=e8;var tn="PopperArrow",tr={top:"bottom",right:"left",bottom:"top",left:"right"},ti=x.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,o=te(tn,n),l=tr[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(eQ,{...r,ref:t,style:{...r.style,display:"block"}})})});function to(e){return null!==e}ti.displayName=tn;var tl=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[s,c]=ta(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(i.arrow?.x??0)+l/2,f=(i.arrow?.y??0)+a/2,p="",m="";return"bottom"===s?(p=o?u:`${d}px`,m=`${-a}px`):"top"===s?(p=o?u:`${d}px`,m=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,m=o?u:`${f}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=o?u:`${f}px`),{data:{x:p,y:m}}}});function ta(e){let[t,n="center"]=e.split("-");return[t,n]}var ts=x.forwardRef((e,t)=>{let{container:n,...r}=e,[o,l]=x.useState(!1);D(()=>l(!0),[]);let a=n||o&&globalThis?.document?.body;return a?w.createPortal((0,i.jsx)(E.div,{...r,ref:t}),a):null});ts.displayName="Portal";var tc=e=>{var t;let n,r,{present:i,children:o}=e,l=function(e){var t,n;let[r,i]=x.useState(),o=x.useRef(null),l=x.useRef(e),a=x.useRef("none"),s=x.useRef(void 0),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>n[e][t]??e,t));return x.useEffect(()=>{"mounted"===c?(a.current=s.current??td(o.current),s.current=void 0):a.current="none"},[c]),D(()=>{let t=o.current,n=l.current;if(n!==e){let r=a.current,i=td(t);e?(s.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),D(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=td(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(a.current=td(o.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,s.current=td(t)}else o.current=null;i(e)},[])}}(i),a="function"==typeof o?o({present:l.isPresent}):x.Children.only(o),s=function(...e){let t=x.useRef(e);return t.current=e,x.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=tu(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():tu(n[e],null)}}},[])}(l.ref,(t=a,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?x.cloneElement(a,{ref:s}):null};function tu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function td(e){return e?.animationName||"none"}tc.displayName="Presence",x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var tf=x[" useInsertionEffect ".trim().toString()]||D;Symbol("RADIX:SYNC_STATE");var tp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tm=x.forwardRef((e,t)=>(0,i.jsx)(E.span,{...e,ref:t,style:{...tp,...e.style}}));tm.displayName="VisuallyHidden";var[tx,th]=y("Tooltip",[e5]),tv=e5(),tg="TooltipProvider",tb="tooltip.open",[ty,tw]=tx(tg),tj=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,a=x.useRef(!0),s=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,i.jsx)(ty,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(e=>{s.current=e},[]),disableHoverableContent:o,children:l})};tj.displayName=tg;var tN="Tooltip",[tC,tS]=tx(tN),tE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:a,delayDuration:s}=e,c=tw(tN,e.__scopeTooltip),u=tv(t),[d,f]=x.useState(null),p=function(){let[e,t]=x.useState(I());return D(()=>{t(e=>e??String(B++))},[void 0]),e?`radix-${e}`:""}(),m=x.useRef(0),h=a??c.disableHoverableContent,v=s??c.delayDuration,g=x.useRef(!1),[b,y]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,l]=function({defaultProp:e,onChange:t}){let[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return tf(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:i;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==a){let t=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a},[a,r])}return[s,x.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else o(t)},[a,e,o,l])]}({prop:r,defaultProp:o??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(tb))):c.onClose(),l?.(e)},caller:tN}),w=x.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,y(!0)},[y]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,y(!0),m.current=0},v)},[v,y]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,i.jsx)(e4,{...u,children:(0,i.jsx)(tC,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:x.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:j,onClose:N,disableHoverableContent:h,children:n})})};tE.displayName=tN;var tR="TooltipTrigger",tk=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tS(tR,n),l=tw(tR,n),a=tv(n),s=b(t,x.useRef(null),o.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),d=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,i.jsx)(e9,{asChild:!0,...a,children:(0,i.jsx)(E.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||l.isPointerInTransitRef.current||(o.onTriggerEnter(),u.current=!0))}),onPointerLeave:v(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:v(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:v(e.onBlur,o.onClose),onClick:v(e.onClick,o.onClose)})})});tk.displayName=tR;var tT="TooltipPortal",[tL,tA]=tx(tT,{forceMount:void 0}),tO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=tS(tT,t);return(0,i.jsx)(tL,{scope:t,forceMount:n,children:(0,i.jsx)(tc,{present:n||l.open,children:(0,i.jsx)(ts,{asChild:!0,container:o,children:r})})})};tO.displayName=tT;var tP="TooltipContent",tD=x.forwardRef((e,t)=>{let n=tA(tP,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,a=tS(tP,e.__scopeTooltip);return(0,i.jsx)(tc,{present:r||a.open,children:a.disableHoverableContent?(0,i.jsx)(t_,{side:o,...l,ref:t}):(0,i.jsx)(tI,{side:o,...l,ref:t})})}),tI=x.forwardRef((e,t)=>{let n=tS(tP,e.__scopeTooltip),r=tw(tP,e.__scopeTooltip),o=x.useRef(null),l=b(t,o),[a,s]=x.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=x.useCallback(()=>{s(null),f(!1)},[f]),m=x.useCallback((e,t)=>{let n,r=e.currentTarget,i={x:e.clientX,y:e.clientY},o=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(i,r.getBoundingClientRect());s(((n=[...function(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(i,o),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(n))),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,m,p]),x.useEffect(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let l=t[e],a=t[o],s=l.x,c=l.y,u=a.x,d=a.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(i=!i)}return i}(n,a);r?p():i&&(p(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,a,u,p]),(0,i.jsx)(t_,{...e,ref:l})}),[tB,t$]=tx(tN,{isInside:!1}),tM=((n=e=>"child"in e?e.children(e.child):e.children).displayName="TooltipContent.Slottable",n.__radixId=j,n),t_=x.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:a,...s}=e,c=tS(tP,n),u=tv(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(tb,d),()=>document.removeEventListener(tb,d)),[d]),x.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,i.jsx)(L,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,i.jsxs)(tt,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,i.jsx)(tM,{children:r}),(0,i.jsx)(tB,{scope:n,isInside:!0,children:(0,i.jsx)(tm,{id:c.contentId,role:"tooltip",children:o||r})})]})})});tD.displayName=tP;var tF="TooltipArrow",tz=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tv(n);return t$(tF,n).isInside?null:(0,i.jsx)(ti,{...o,...r,ref:t})});function tH({delayDuration:e=0,...t}){return(0,i.jsx)(tj,{delayDuration:e,...t})}function tW(e){return(0,i.jsx)(tH,{children:(0,i.jsx)(tE,{...e})})}function tU(e){return(0,i.jsx)(tk,{...e})}function tV({className:e,sideOffset:t=4,children:n,...r}){return(0,i.jsx)(tO,{children:(0,i.jsxs)(tD,{sideOffset:t,className:(0,c.cn)("z-50 w-fit max-w-64 origin-(--radix-tooltip-content-transform-origin) rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,(0,i.jsx)(tz,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}tz.displayName=tF;var tY=e.i(1485);let tX=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function tK({url:e}){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let o=(0,x.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1500)}catch{}},[e]);return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:o,children:[t?(0,i.jsx)(a.Icons.check,{}):(0,i.jsx)(a.Icons.copy,{}),t?"Copied":"Copy URL"]})}function tq({reason:e,children:t}){return e?(0,i.jsxs)(tW,{children:[(0,i.jsx)(tU,{asChild:!0,children:(0,i.jsx)("span",{className:"cursor-not-allowed",children:t})}),(0,i.jsx)(tV,{children:e})]}):(0,i.jsx)(i.Fragment,{children:t})}function tG({box:e}){let{webUrl:t,vncUrl:n}=e,{apps:r,supported:o,pending:l,launch:s}=function(e){let[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&n(t.ok?await t.json():null)}catch{e&&n(null)}})(),()=>{e=!1}},[]);let o=(0,x.useCallback)(async t=>{i(t);try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!n.ok){let e=await n.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${n.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{i(null)}},[e.id]),l=t?.supported?t.targets:null;return{apps:l?tX.map(({app:t,label:n,icon:r})=>{let i=l[t],o=i.available?i.providers&&!i.providers.includes(e.provider)?`Not available for ${e.provider} boxes`:null:i.reason??`${n} is not installed`;return{app:t,label:n,icon:r,disabledReason:o}}):[],supported:null!==l,pending:r,launch:o}}(e),c="paused"===e.status?"Box is paused — resume to access":"stopped"===e.status?"Box is stopped — start to access":null,u=t?null:c??"No web service exposed",f=n?null:!1===e.vncEnabled?"VNC is not enabled for this box":c??"VNC is not available";return o||t||n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{children:"Access"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:t||!n?"Web":"VNC"}),(0,i.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:t??(n?"Remote desktop":u)})]}),(0,i.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[t?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:t,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]}):(0,i.jsx)(tq,{reason:u,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]})}),t?(0,i.jsx)(tK,{url:t}):null,n?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:n,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]}):(0,i.jsx)(tq,{reason:f,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]})})]})]}),o?(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,i.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:r.map(({app:e,label:t,icon:n,disabledReason:r})=>{let o=a.Icons[n];return(0,i.jsx)(tq,{reason:r,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:null!==r||null!==l,onClick:()=>void s(e),children:[(0,i.jsx)(o,{}),t]})},e)})})]}):null]})]}):null}var tJ=e.i(80922),tZ=e.i(30544),tQ=e.i(51096);function t0({k:e,v:t,mono:n,link:r}){return(0,i.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,i.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,i.jsx)("div",{className:(0,c.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:r?(0,i.jsx)(tQ.default,{className:"cursor-pointer text-primary",href:r,children:t}):t})]})}var t1=e.i(31758),t5=e.i(95141),t2=e.i(3060),t3=e.i(16200),t4=e.i(49604),t6=e.i(9383);let t9=(0,t6.createServerReference)("7046ef1a22ef35c2ac4e283b89fbbd152677ee1823",t6.callServer,void 0,t6.findSourceMapURL,"gitBranchAction"),t8=(0,t6.createServerReference)("60c7dbb7902d69abccc3c979da46261bb43a24a0a8",t6.callServer,void 0,t6.findSourceMapURL,"gitCheckoutAction"),t7=(0,t6.createServerReference)("6034abeee79a93747466212d3a9009fe1994b5395d",t6.callServer,void 0,t6.findSourceMapURL,"gitPullAction"),ne=(0,t6.createServerReference)("60bb24bff65e6ce9139843f080bf35a0e07563b9cd",t6.callServer,void 0,t6.findSourceMapURL,"gitPushAction"),nt=(0,t6.createServerReference)("60843ce1357b9d46461a9556b844aa02d3726ede23",t6.callServer,void 0,t6.findSourceMapURL,"gitPushHostAction"),nn=0;function nr({toasts:e,dismiss:t}){return(0,i.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:e.map(e=>(0,i.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,i.jsx)("span",{className:(0,c.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===e.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===e.variant?(0,i.jsx)(a.Icons.warn,{className:"size-3.5"}):(0,i.jsx)(a.Icons.check,{className:"size-3.5"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,i.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>t(e.id),"aria-label":"Dismiss",children:(0,i.jsx)(a.Icons.x,{className:"size-3"})})]},e.id))})}function ni({label:e,desc:t,children:n}){return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:t})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function no({icon:e,disabled:t,onRun:n,children:r}){let[o,l]=(0,x.useState)(!1),a=async()=>{l(!0);try{await n()}finally{l(!1)}};return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:t||o,onClick:a,children:[o?(0,i.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,i.jsx)(e,{}),r]})}function nl(e,t){let n=(e??"").trim()||(t??"").trim();return n?n.split("\n")[0]:void 0}function na({box:e}){let t=(0,o.useRouter)(),{toasts:n,push:r,dismiss:l}=function(){let[e,t]=(0,x.useState)([]),n=(0,x.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,x.useCallback)(e=>{let r=++nn;t(t=>[...t,{id:r,...e}]),setTimeout(()=>n(r),4200)},[n]),dismiss:n}}(),[s,u]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),m="running"!==e.status,v=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});u(t.ok?await t.json():null)}catch{u(null)}},[e.id]);(0,x.useEffect)(()=>{v()},[v]);let g=s?.ok&&s.branch?s.branch:e.branch||"—",b=()=>{v(),t.refresh()},y=async(e,t)=>{let n=await t();n.ok?(r({title:e,detail:nl(n.stdout,n.stderr)}),b()):r({variant:"error",title:`${e} failed`,detail:n.error})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Card,{className:(0,c.cn)("divide-y divide-border/60 overflow-hidden",m?"opacity-90":""),children:[m?(0,i.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,i.jsx)(a.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,i.jsxs)(ni,{label:"Sync",desc:`origin ↔ ${g}`,children:[(0,i.jsx)(no,{icon:a.Icons.arrowL,disabled:m,onRun:()=>y("Pulled from origin",()=>t7(e.id)),children:"Pull"}),(0,i.jsx)(no,{icon:a.Icons.ext,disabled:m,onRun:()=>y("Pushed to origin",()=>ne(e.id)),children:"Push"}),(0,i.jsx)(no,{icon:a.Icons.host,disabled:m,onRun:()=>y("Pushed to host",()=>nt(e.id)),children:"Push to host"})]}),(0,i.jsxs)(ni,{label:"Branch",desc:`currently on ${g}`,children:[(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("change"),children:[(0,i.jsx)(a.Icons.branch,{}),"Change branch"]}),(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("new"),children:[(0,i.jsx)(a.Icons.plus,{}),"New branch"]})]})]}),"change"===f?(0,i.jsx)(nu,{box:e,branch:g,onClose:()=>p(null),onDone:r,onRefresh:b}):null,"new"===f?(0,i.jsx)(nd,{box:e,onClose:()=>p(null),onDone:r,onRefresh:b}):null,(0,i.jsx)(nr,{toasts:n,dismiss:l})]})}let ns="__manual__";function nc({boxId:e,value:t,onChange:n,id:r,headLabel:o,currentBranch:l}){let[a,s]=(0,x.useState)(null),[c,u]=(0,x.useState)(l??null),[d,f]=(0,x.useState)(!1);return((0,x.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),r=n.ok?await n.json():null;if(t)return;r&&Array.isArray(r.branches)&&r.branches.length>0?(s(r.branches),l||"string"!=typeof r.current||u(r.current)):(s([]),f(!0))}catch{t||(s([]),f(!0))}})(),()=>{t=!0}},[e,l]),null===a)?(0,i.jsx)(t4.Select,{id:r,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,i.jsx)("option",{value:"",children:"Loading branches…"})}):d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2.Input,{id:r,className:"font-mono text-[13px]",autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:o?"HEAD":"feature-x"}),a.length>0?(0,i.jsx)("button",{type:"button",onClick:()=>{f(!1),n("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,i.jsxs)(t4.Select,{id:r,value:t,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===ns){f(!0),n("");return}n(e.target.value)},children:[o?(0,i.jsx)("option",{value:"",children:o}):(0,i.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,i.jsx)("option",{value:ns,children:"Other / type manually…"}),(0,i.jsx)("option",{disabled:!0,children:"────────────"}),a.map(e=>(0,i.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function nu({box:e,branch:t,onClose:n,onDone:r,onRefresh:o}){let[l,s]=(0,x.useState)(""),[c,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(null),p=l.trim().length>0;return(0,i.jsxs)(t5.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"Change branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · currently on ",t]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsx)(t3.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,i.jsx)(nc,{boxId:e.id,id:"gb-branch",value:l,onChange:s,currentBranch:t}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),d?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:d}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:()=>{p&&!c&&(u(!0),f(null),(async()=>{let t=await t8(e.id,l.trim());t.ok?(r({title:"Branch changed",detail:nl(t.stdout,t.stderr)}),n(),o()):(f(t.error),u(!1))})())},disabled:!p||c,children:[c?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function nd({box:e,onClose:t,onDone:n,onRefresh:r}){let[o,l]=(0,x.useState)(""),[s,c]=(0,x.useState)(""),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),m=o.trim().length>0,v=()=>{m&&!u&&(d(!0),p(null),(async()=>{let i=await t9(e.id,o.trim(),s.trim()||void 0);i.ok?(n({title:"Branch created",detail:nl(i.stdout,i.stderr)}),t(),r()):(p(i.error),d(!1))})())};return(0,i.jsxs)(t5.Dialog,{onClose:t,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"New branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(t3.Label,{htmlFor:"nb-name",children:"Name"}),(0,i.jsx)(t2.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()},placeholder:"my-branch"}),(0,i.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,i.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,i.jsxs)(t3.Label,{htmlFor:"nb-from",children:["Base ref ",(0,i.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,i.jsx)(nc,{boxId:e.id,id:"nb-from",value:s,onChange:c,headLabel:"Current HEAD (default)"}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),f?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:f}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:t,disabled:u,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:v,disabled:!m||u,children:[u?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.plus,{}),u?"Creating…":"Create branch"]})]})]})}let nf=(0,t6.createServerReference)("60b48213a6a3e796c8acac95ca2d4ceace06a88bf8",t6.callServer,void 0,t6.findSourceMapURL,"restartServiceAction"),np=new Set(["ready","running","done"]),nm=new Set(["crashed","unhealthy","backoff","failed"]),nx={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},nh={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function nv({svc:e,disabled:t,onRestart:n}){var r;let o=(r=e.state,np.has(r)?"up":nm.has(r)?"bad":"idle");return(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,i.jsx)("span",{className:(0,c.cn)("badge-dot",nx[o]),"aria-hidden":!0}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,i.jsx)("span",{className:(0,c.cn)("font-mono text-xs",nh[o]),children:e.state}),e.restarts>0?(0,i.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,i.jsx)(h.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:t,onClick:()=>n(e.name),children:(0,i.jsx)(a.Icons.refresh,{})})]})}function ng({id:e,running:t}){let[n,r]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[s,c]=(0,x.useTransition)(),u=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);r(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,x.useEffect)(()=>{if(u(),!t)return;let e=setInterval(()=>void u(),4e3);return()=>clearInterval(e)},[u,t]);let f=t=>{c(async()=>{let n=await nf(e,t);n.ok||window.alert(`Restart failed: ${n.error}`),await u()})},p=n?.services??[],m=p.length>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{right:m?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!t||s,onClick:()=>f(void 0),children:[(0,i.jsx)(a.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,i.jsx)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||o?o?(0,i.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",o,")."]}):m?(0,i.jsxs)(i.Fragment,{children:[n?.source==="persisted"?(0,i.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,p.map(e=>(0,i.jsx)(nv,{svc:e,disabled:!t||s,onRestart:e=>f(e)},e.name))]}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:n?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var nb=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,o.useParams)(),{box:t,project:n}=(0,f.useStore)(),r=t(e);if(!r)return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,i.jsx)(tJ.BackLink,{to:"/",children:"All boxes"}),(0,i.jsx)(t1.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let c=n(r.projectId);return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,i.jsx)(tJ.BackLink,{to:"/projects/"+r.projectId,children:c?c.name:"Project"}),(0,i.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[r.task,(0,i.jsx)(s.StatusBadge,{status:r.status})]}),(0,i.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.id})," ·"," ",(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.repo})," · ",r.host]})]}),(0,i.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,i.jsx)(tZ.BoxActions,{box:r,size:"lg"})})]}),r.error?(0,i.jsx)(u,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:a.Icons.warn,title:"Box errored",children:(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.error})}):null,(0,i.jsx)(m,{boxId:r.id}),(0,i.jsx)(tY.SectionLabel,{children:"Overview"}),(0,i.jsxs)(nb.StatGrid,{children:[(0,i.jsx)(nb.Stat,{k:"Status",v:(0,i.jsx)(s.StatusBadge,{status:r.status})}),(0,i.jsx)(nb.Stat,{k:"Agent CLI",v:r.agent,mono:!0}),(0,i.jsx)(nb.Stat,{k:"Commits",v:r.commits??"—",icon:a.Icons.commit}),(0,i.jsx)(nb.Stat,{k:"Files touched",v:r.filesTouched??"—",icon:a.Icons.file}),(0,i.jsx)(nb.Stat,{k:"Last activity",v:(0,i.jsx)(l.Ago,{ms:r.lastActivity}),mono:!0})]}),(0,i.jsx)(tG,{box:r}),(0,i.jsx)(tY.SectionLabel,{children:"Git operations"}),(0,i.jsx)(na,{box:r}),(0,i.jsx)(ng,{id:r.id,running:"running"===r.status}),(0,i.jsx)(tY.SectionLabel,{children:"Details"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsx)(t0,{k:"Box ID",v:r.id,mono:!0}),(0,i.jsx)(t0,{k:"Project",v:c?c.name:"—",link:c?"/projects/"+r.projectId:null}),(0,i.jsx)(t0,{k:"Repository",v:r.repo,mono:!0}),(0,i.jsx)(t0,{k:"Branch",v:r.branch,mono:!0}),(0,i.jsx)(t0,{k:"Host",v:r.host,mono:!0}),(0,i.jsx)(t0,{k:"Created",v:new Date(r.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(54129),
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(54129),a=e.i(44344),n=e.i(69377),o=e.i(9383);let i=(0,o.createServerReference)("60e3280ae2ee5aa5fbbb2e64245d61d5ea3df1cf32",o.callServer,void 0,o.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let o=(0,r.useRouter)(),[l,d]=(0,s.useTransition)(),c=t=>{d(async()=>{let r=await i(e,t);r.ok||window.alert(`Failed: ${r.error}`),o.refresh()})};return(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:l,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>c("n"),children:[(0,t.jsx)(a.Icons.x,{}),"Deny"]}),(0,t.jsxs)(n.Button,{size:"sm",disabled:l,onClick:()=>c("y"),children:[(0,t.jsx)(a.Icons.check,{}),"Approve"]})]})}],88451)},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...s})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[s,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>a(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:s?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let s=Math.floor(r/60);return s<24?s+"h ago":Math.floor(s/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return n.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(57855),o=e.r(61414),i=e.r(97615)},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...s}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...s})},"TableBody",0,function({className:e,...s}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...s})},"TableCell",0,function({className:e,...s}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...s})},"TableHead",0,function({className:e,...s}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...s})},"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...s})},"TableRow",0,function({className:e,...s}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...s})}])},66438,e=>{"use strict";var t=e.i(1262),r=e.i(51096),s=e.i(33789),a=e.i(44344),n=e.i(8536),o=e.i(23878),i=e.i(96621),l=e.i(31758),d=e.i(1485),c=e.i(88451);e.s(["default",0,function(){let{state:e,box:x}=(0,i.useStore)(),u=[...e.approvals].sort((e,t)=>e.createdAt-t.createdAt);return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Approvals"}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:["Host actions a box is waiting on — ",(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.length})," ","pending. Approving unblocks the box; denying returns an error to it."]})]}),(0,t.jsx)(d.SectionLabel,{children:"Pending"}),0===u.length?(0,t.jsxs)(l.EmptyBox,{children:[(0,t.jsx)("div",{children:"No pending approvals."}),(0,t.jsx)("div",{className:"mt-1.5 font-mono text-xs text-muted-foreground",children:"Host actions (git push, file copy, downloads) appear here when a box requests one."})]}):(0,t.jsx)(n.Card,{className:"overflow-hidden",children:(0,t.jsxs)(o.Table,{children:[(0,t.jsx)(o.TableHeader,{children:(0,t.jsxs)(o.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(o.TableHead,{className:"w-[24%]",children:"Box"}),(0,t.jsx)(o.TableHead,{className:"w-[40%]",children:"Action"}),(0,t.jsx)(o.TableHead,{className:"max-md:hidden",children:"Requested"}),(0,t.jsx)(o.TableHead,{className:"text-right",children:"Answer"})]})}),(0,t.jsx)(o.TableBody,{children:u.map(e=>{let n=x(e.boxId);return(0,t.jsxs)(o.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsxs)(o.TableCell,{children:[n?(0,t.jsx)(r.default,{className:"text-[13.5px] font-medium hover:text-[var(--green-ink)]",href:"/boxes/"+n.id,children:n.task}):(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:e.boxId}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:n?n.repo:e.boxId})]}),(0,t.jsx)(o.TableCell,{children:(0,t.jsxs)("div",{className:"flex items-start gap-1.5 text-[13px]",children:[(0,t.jsx)(a.Icons.shield,{className:"mt-0.5 size-3.5 flex-none text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"truncate font-mono text-secondary-foreground",children:e.command??e.message}),e.detail?(0,t.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,t.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null]})]})}),(0,t.jsx)(o.TableCell,{className:"max-md:hidden",children:(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:(0,t.jsx)(s.Ago,{ms:e.createdAt})})}),(0,t.jsx)(o.TableCell,{className:"text-right",children:(0,t.jsx)(c.ApprovalActions,{id:e.id})})]},e.id)})})]})})]})}])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var s=e.i(1262),t=e.i(45971),n=e.i(54129),r=e.i(44344),a=e.i(69377),o=e.i(9383);let l=(0,o.createServerReference)("60e3280ae2ee5aa5fbbb2e64245d61d5ea3df1cf32",o.callServer,void 0,o.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let o=(0,t.useRouter)(),[i,c]=(0,n.useTransition)(),d=s=>{c(async()=>{let t=await l(e,s);t.ok||window.alert(`Failed: ${t.error}`),o.refresh()})};return(0,s.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,s.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:i,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>d("n"),children:[(0,s.jsx)(r.Icons.x,{}),"Deny"]}),(0,s.jsxs)(a.Button,{size:"sm",disabled:i,onClick:()=>d("y"),children:[(0,s.jsx)(r.Icons.check,{}),"Approve"]})]})}],88451)},87340,e=>{"use strict";var s=e.i(1262),t=e.i(51096),n=e.i(44344),r=e.i(96621),a=e.i(88451);function o(){let{state:e,box:o}=(0,r.useStore)();if(0===e.approvals.length)return null;let l=[...e.approvals].sort((e,s)=>e.createdAt-s.createdAt),i=l[0],c=o(i.boxId);return(0,s.jsxs)("div",{className:"mb-6 flex items-start gap-3 rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)] p-4",children:[(0,s.jsx)(n.Icons.shield,{className:"mt-0.5 size-4 flex-none text-[var(--amber)]"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[c?(0,s.jsx)(t.default,{className:"text-[13.5px] font-semibold hover:text-[var(--green-ink)]",href:"/boxes/"+c.id,children:c.task}):(0,s.jsx)("span",{className:"text-[13.5px] font-semibold",children:i.boxId}),(0,s.jsx)("span",{className:"truncate font-mono text-[12.5px] text-secondary-foreground",children:i.command??i.message})]}),i.detail?(0,s.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:i.detail}):null,i.cwd?(0,s.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:i.cwd}):null]}),(0,s.jsxs)("div",{className:"flex flex-none items-center gap-3",children:[l.length>1?(0,s.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,s.jsxs)("span",{className:"font-mono text-[11.5px] text-[var(--amber)]",children:[l.length," pending"]}),(0,s.jsx)(t.default,{className:"font-mono text-[11.5px] text-muted-foreground hover:text-[var(--green-ink)]",href:"/approvals",children:"View all"})]}):null,(0,s.jsx)(a.ApprovalActions,{id:i.id})]})]})}var l=e.i(45971),i=e.i(54129),c=e.i(69377),d=e.i(95141),x=e.i(3060),m=e.i(9383);let p=(0,m.createServerReference)("4052a82ff3493d4a1fc0afdabf6c8d7fee43497f6e",m.callServer,void 0,m.findSourceMapURL,"addProjectAction"),u=(0,m.createServerReference)("4086527e113d7df8e3523c9fe79e8fe180da7102db",m.callServer,void 0,m.findSourceMapURL,"browseDirAction");function f(){let[e,t]=(0,i.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(c.Button,{onClick:()=>t(!0),children:[(0,s.jsx)(n.Icons.plus,{}),"New project"]}),e?(0,s.jsx)(h,{onClose:()=>t(!1)}):null]})}function h({onClose:e}){let t=(0,l.useRouter)(),[r,a]=(0,i.useTransition)(),[o,m]=(0,i.useState)(""),[f,j]=(0,i.useState)(null),[g,b]=(0,i.useState)([]),[v,N]=(0,i.useState)(!0),[y,w]=(0,i.useState)(null),k=(0,i.useCallback)(async e=>{N(!0),w(null);let s=await u(e);if(!s.ok){w(s.error),N(!1);return}m(s.path),j(s.parent),b(s.entries),N(!1)},[]);return(0,i.useEffect)(()=>{k()},[k]),(0,s.jsxs)(d.Dialog,{onClose:e,children:[(0,s.jsxs)(d.DialogHeader,{children:[(0,s.jsx)(d.DialogIcon,{children:(0,s.jsx)(n.Icons.folder,{})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.DialogTitle,{children:"Add project"}),(0,s.jsx)(d.DialogDescription,{children:"Pick a folder on this machine"})]})]}),(0,s.jsxs)(d.DialogBody,{className:"flex flex-col gap-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.Button,{variant:"outline",className:"flex-none px-2.5",onClick:()=>void k(f??void 0),disabled:!f||v,title:"Up one level","aria-label":"Up one level",children:(0,s.jsx)(n.Icons.arrowUp,{})}),(0,s.jsx)(x.Input,{value:o,onChange:e=>m(e.target.value),placeholder:"/Users/you/Projects/my-app",className:"font-mono text-xs",onKeyDown:e=>{"Enter"===e.key&&k(o)}})]}),(0,s.jsx)("div",{className:"h-56 overflow-y-auto rounded-lg border border-border bg-background",children:v?(0,s.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"Loading…"}):0===g.length?(0,s.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"No subfolders here"}):g.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>void k(e.path),className:"flex w-full cursor-pointer items-center gap-2 border-0 border-b border-border/60 bg-transparent px-3 py-2 text-left text-[13px] transition-colors last:border-b-0 hover:bg-secondary",children:[(0,s.jsx)(n.Icons.folder,{className:"size-4 flex-none text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate",children:e.name}),e.isProject?(0,s.jsx)("span",{className:"ml-auto flex-none rounded border border-[var(--green-line)] bg-accent px-1.5 py-px font-mono text-[10px] uppercase tracking-wide text-primary",children:"project"}):(0,s.jsx)(n.Icons.chevR,{className:"ml-auto size-3.5 flex-none text-[#a4a9b0]"})]},e.path))}),y?(0,s.jsx)("div",{className:"font-mono text-xs text-destructive",children:y}):null]}),(0,s.jsxs)(d.DialogFooter,{children:[(0,s.jsx)(c.Button,{variant:"outline",onClick:e,disabled:r,children:"Cancel"}),(0,s.jsx)(c.Button,{onClick:()=>{w(null);let s=o.trim();s?a(async()=>{let n=await p(s);n.ok?(t.refresh(),e()):w(n.error)}):w("choose a folder")},disabled:r||v,children:r?"Adding…":"Add this folder"})]})]})}var j=e.i(22983),g=e.i(93268),b=e.i(66818),v=e.i(31758),N=e.i(1485);e.s(["default",0,function(){let{state:e,boxesFor:a}=(0,r.useStore)(),l=e.projects.map(e=>({p:e,boxes:a(e.id)})).sort((e,s)=>(e.boxes.length>0?0:1)-(s.boxes.length>0?0:1)),i=e.boxes.filter(e=>"running"===e.status).length;return(0,s.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,s.jsx)(o,{}),(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Boxes"}),(0,s.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,s.jsx)("span",{className:"font-mono text-secondary-foreground",children:i})," running across"," ",(0,s.jsx)("span",{className:"font-mono text-secondary-foreground",children:e.projects.length})," ","project",1===e.projects.length?"":"s"," on this machine."]})]}),(0,s.jsx)("div",{className:"ml-auto flex flex-none gap-2",children:(0,s.jsx)(f,{})})]}),(0,s.jsx)(N.SectionLabel,{children:"Projects"}),0===l.length?(0,s.jsxs)(v.EmptyBox,{children:[(0,s.jsx)("div",{children:"No projects on this machine yet."}),(0,s.jsx)("div",{className:"mt-1.5 font-mono text-xs text-muted-foreground",children:"Add one with “New project”, or run `agentbox create` in a folder."})]}):null,l.map(({p:e,boxes:r})=>(0,s.jsxs)("div",{className:"mb-7",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-1 pb-3",children:[(0,s.jsxs)(t.default,{className:"flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-[15px] font-semibold tracking-[-0.01em] text-foreground hover:text-[var(--green-ink)]",href:"/projects/"+e.id,children:[(0,s.jsx)("span",{className:"grid h-[22px] w-[22px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,s.jsx)(n.Icons.folder,{className:"size-[13px]"})}),e.name]}),(0,s.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.repo}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsxs)("span",{className:"font-mono text-[11.5px] text-[#a4a9b0]",children:[r.length," box",1===r.length?"":"es"]}),(0,s.jsx)(g.CreateBoxButton,{project:e,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===r.length?(0,s.jsx)(b.DeleteProjectButton,{project:e,size:"sm",className:"font-mono text-xs"}):null]}),r.length?(0,s.jsx)(j.BoxTable,{boxes:r}):(0,s.jsx)(v.EmptyBox,{children:(0,s.jsxs)("div",{children:["No boxes in ",(0,s.jsx)("b",{className:"font-semibold text-secondary-foreground",children:e.name})," yet."]})})]},e.id))]})}],87340)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:s,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",s),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(69377),n=e.i(3060);function s({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),b="exchanging"===o.phase,m=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&m()},placeholder:"Paste approval code",disabled:b,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void m(),disabled:!l.trim()||c||b,children:b?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:n,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),b=(0,r.useRef)(n);b.current=n;let m=(0,r.useRef)(o);m.current=o;let p=(0,r.useRef)(l);return p.current=l,(0,r.useEffect)(()=>{m.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),p.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);m.current?.(r.status),b.current?.(r.status),t.close()}),()=>t.close()},[e,a]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(s,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},86892,30544,49604,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let a={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let n=a[e]??a.stopped;return(0,t.jsxs)(r.Badge,{className:n.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),n.label]})}],86892);var n=e.i(45971),s=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("406145ed27942ca988f613b59ab48f5aefbcfd4f05",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("4038bed43a23f173fc52655549d6d6afca3e1c3fd7",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("60bc3399c1ca903d8aa98c6fe53f386830b88ddd8e",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),b=(0,c.createServerReference)("40b7ede3d7f39c93f9e96a161499dbfe08b57f1184",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),m=(0,c.createServerReference)("4085c8b8ede98e4ff6f88f8f1be93170cf50d68e3f",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let a=(0,n.useRouter)(),[c,p]=(0,s.useTransition)(),f="running"===e.status,h="paused"===e.status,g="stopped"===e.status,j=e.id.startsWith("job:"),v="lg"===r,N=v?"sm":"icon-sm",S=(t,r,n)=>{t.stopPropagation(),(!n||window.confirm(n))&&p(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),a.refresh()})};return j?(0,t.jsx)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Dismiss",disabled:c||"error"!==e.status,onClick:t=>S(t,d,`Dismiss failed box ${e.id}? This clears the failed create.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Dismiss":null]})}):(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:[h?(0,t.jsxs)(l.Button,{variant:v?"default":"outline",size:N,title:"Resume",disabled:c,className:v?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>S(e,b),children:[(0,t.jsx)(i.Icons.play,{}),v?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||!f,title:"Pause",className:v?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>S(e,u),children:[(0,t.jsx)(i.Icons.pause,{}),v?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||g,title:"Stop",onClick:e=>S(e,m),children:[(0,t.jsx)(i.Icons.stop,{}),v?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&p(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),a.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),v?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Destroy",disabled:c,onClick:t=>S(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Destroy":null]})]})}],30544),e.s(["Select",0,function({wrapperClassName:e,className:r,children:a,...n}){return(0,t.jsxs)("span",{className:(0,o.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,o.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",r),...n,children:a}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}],49604)},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[a,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>n(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:a?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let a=Math.floor(r/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...a}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...a})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),n=e.i(44344),s=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(n.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(a.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(s.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),b=e.i(3060),m=e.i(49604),p=e.i(65232);function f({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,p.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var h=e.i(9383);let g=(0,h.createServerReference)("402e69872ac5cc7b84479325d8b18020d181f0ccb2",h.callServer,void 0,h.findSourceMapURL,"createBoxAction"),j=(0,h.createServerReference)("40b21c2ad91fa1708c513ab1647dc78fa0d7e56f70",h.callServer,void 0,h.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:a,onClose:s}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),[i,d]=(0,c.useState)(null),h=i??(l.providers.length?l.providers:S),[k,B]=(0,c.useTransition)(),[R,T]=(0,c.useState)(e?.id??a[0]?.id??""),[D,I]=(0,c.useState)("claude"),[L,A]=(0,c.useState)("docker"),[E,P]=(0,c.useState)(""),[z,U]=(0,c.useState)(""),[M,O]=(0,c.useState)(""),[H,$]=(0,c.useState)(null),[F,_]=(0,c.useState)(!1),[J,W]=(0,c.useState)(!1),[q,K]=(0,c.useState)(null),[V,Y]=(0,c.useState)(null),[G,Q]=(0,c.useState)("streaming"),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(null),[er,ea]=(0,c.useState)(!1),[en,es]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1&hosts=expand",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let a=r.providers??[];d(a);let n={};for(let e of a)n[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};es(n)}catch{}})(),()=>{e=!0}},[]);let eo=a.find(e=>e.id===R)??e,el=L??"docker",ei=h.find(e=>e.id===el),ec=en?.[el],ed=!!ec&&(!!ec.jobId||"unprepared"===ec.baseStatus||"stale"===ec.baseStatus);(0,c.useEffect)(()=>{if(!R||V)return;_(eo?.needsSetup??!1),A("docker");let e=!1;return $(null),O(eo?.currentBranch??""),j(R).then(t=>{if(e||!t.ok){e||t.ok||$([]);return}$(t.branches),t.current&&t.branches.includes(t.current)&&O(t.current)}),()=>{e=!0}},[R,V]);let eu=()=>{K(null);let e=ec?.jobId;e?et(e):B(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(el)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void K(t?.error?.message??`base image build request failed (${e.status})`);et(t.jobId)}catch(e){K(e instanceof Error?e.message:String(e))}})},ex=()=>{K(null),B(async()=>{let e=await g({projectId:R,agent:D,provider:L,name:E.trim()||void 0,prompt:"none"===D?void 0:z.trim()||void 0,fromBranch:M.trim()&&M.trim()!==eo?.currentBranch?M.trim():void 0,setupWizard:"none"!==D&&F});e.ok?(Y(e.jobId),o.refresh()):K(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:s,className:V||ee?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(n.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!V&&ee?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:eo?eo.name:"Start a box in a project"})]}),V||ee?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:G,loginPhase:X})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:V?(0,t.jsx)(N.JobLogStream,{jobId:V,onStatus:Q,onDone:()=>o.refresh(),onLogin:e=>Z(e?.phase??null)}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ei?.label??el," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:ee,onStatus:Q,onDone:e=>{"done"===e?ex():K(`base image build ${e}`)}}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(C,{label:"Project",children:(0,t.jsxs)(m.Select,{value:R,onChange:e=>T(e.target.value),children:[0===a.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(C,{label:"Provider",children:(0,t.jsx)(m.Select,{value:L,onChange:e=>A(e.target.value),children:h.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ed?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:ec?.baseStaleReason,children:ec?.jobId?"A base-image build is already running — the box will be created when it finishes.":ec?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(C,{label:"Agent",children:(0,t.jsxs)(m.Select,{value:D,onChange:e=>I(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(C,{label:"Name (optional)",children:(0,t.jsx)(b.Input,{value:E,onChange:e=>P(e.target.value),placeholder:"auto"})}),eo?.needsSetup&&"none"!==D?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:F,onChange:e=>_(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===D?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(n.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",J&&"rotate-90")}),"Advanced"]}),J?(0,t.jsxs)(t.Fragment,{children:[null===H?(0,t.jsx)(C,{label:"Base branch",children:(0,t.jsx)(m.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):H.length>0?(0,t.jsx)(C,{label:"Base branch",children:(0,t.jsxs)(m.Select,{value:M,onChange:e=>O(e.target.value),children:[eo?.currentBranch&&!H.includes(eo.currentBranch)?(0,t.jsxs)("option",{value:"",children:[eo.currentBranch," (current)"]}):null,H.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===eo?.currentBranch?" (current)":""]},e))]})}):null,"none"!==D?(0,t.jsx)(C,{label:"Initial prompt (optional)",children:(0,t.jsx)(f,{value:z,onChange:e=>U(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]})}),(0,t.jsx)(x.DialogFooter,{children:V||ee?(0,t.jsxs)(t.Fragment,{children:["streaming"===G?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:V?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:s,children:"Close"})]}):er?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:ec?.baseStaleReason,children:["The ",ei?.label??el," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>ea(!1),disabled:k,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{ea(!1),ex()},disabled:k,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{ea(!1),eu()},disabled:k,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:s,disabled:k,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(K(null),R)?ed?"docker"===el||ec?.baseStatus!=="stale"||ec.jobId?eu():ea(!0):ex():K("pick a project")},disabled:k||!R,children:k?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function C({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:a,size:s,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:a,size:s,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(n.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let k=(0,h.createServerReference)("4030be3a72d5d8e0f43e0cb8632561b0a65ad269f2",h.callServer,void 0,h.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:a,className:s,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:a,className:s,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await k(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(n.Icons.trash,{}),"Delete"]})}],66818)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33789,1485,e=>{"use strict";var r=e.i(1262),t=e.i(54129);e.s(["Ago",0,function({ms:e}){let[n,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>s(!0),[]),(0,r.jsx)("span",{suppressHydrationWarning:!0,children:n?function(e){let r=Math.floor((Date.now()-e)/1e3);if(r<60)return r+"s ago";let t=Math.floor(r/60);if(t<60)return t+"m ago";let n=Math.floor(t/60);return n<24?n+"h ago":Math.floor(n/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:t}){return(0,r.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,r.jsx)("span",{className:"h-px flex-1 bg-border"}),t??null]})}],1485)},9383,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let a=e.r(57855),i=e.r(61414),o=e.r(97615)},31758,e=>{"use strict";var r=e.i(1262),t=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,r.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,r.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,r.jsx)(t.Icons.box,{className:"size-5"})}),e]})}])},88451,e=>{"use strict";var r=e.i(1262),t=e.i(45971),n=e.i(54129),s=e.i(44344),a=e.i(69377),i=e.i(9383);let o=(0,i.createServerReference)("60e3280ae2ee5aa5fbbb2e64245d61d5ea3df1cf32",i.callServer,void 0,i.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let i=(0,t.useRouter)(),[l,c]=(0,n.useTransition)(),d=r=>{c(async()=>{let t=await o(e,r);t.ok||window.alert(`Failed: ${t.error}`),i.refresh()})};return(0,r.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,r.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:l,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>d("n"),children:[(0,r.jsx)(s.Icons.x,{}),"Deny"]}),(0,r.jsxs)(a.Button,{size:"sm",disabled:l,onClick:()=>d("y"),children:[(0,r.jsx)(s.Icons.check,{}),"Approve"]})]})}],88451)},16200,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Label",0,function({className:e,...n}){return(0,r.jsx)("label",{className:(0,t.cn)("mb-2 block text-[13px] font-medium leading-none",e),...n})}])},8536,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Card",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...n})},"CardContent",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("p-5 pt-0",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("text-[12.5px] text-muted-foreground",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("flex flex-col space-y-1 p-5",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...n})}])},3060,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Input",0,function({className:e,...n}){return(0,r.jsx)("input",{className:(0,t.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...n})}])},95141,e=>{"use strict";var r=e.i(1262),t=e.i(54129),n=e.i(65232),s=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:a,children:i}){return(0,t.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),(0,r.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,r.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,n.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",a),onClick:e=>e.stopPropagation(),children:[i,(0,r.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,r.jsx)(s.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("px-5 py-4",e),...t})},"DialogDescription",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...t})},"DialogFooter",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...t})},"DialogHeader",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...t})},"DialogIcon",0,function({children:e}){return(0,r.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("text-base font-semibold leading-tight tracking-tight",e),...t})}])},86892,30544,49604,e=>{"use strict";var r=e.i(1262),t=e.i(64595);let n={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let s=n[e]??n.stopped;return(0,r.jsxs)(t.Badge,{className:s.badgeClass,children:[(0,r.jsx)("span",{className:"badge-dot"}),s.label]})}],86892);var s=e.i(45971),a=e.i(54129),i=e.i(65232),o=e.i(69377),l=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("406145ed27942ca988f613b59ab48f5aefbcfd4f05",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("4038bed43a23f173fc52655549d6d6afca3e1c3fd7",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("60bc3399c1ca903d8aa98c6fe53f386830b88ddd8e",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),f=(0,c.createServerReference)("40b7ede3d7f39c93f9e96a161499dbfe08b57f1184",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),b=(0,c.createServerReference)("4085c8b8ede98e4ff6f88f8f1be93170cf50d68e3f",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:t}){let n=(0,s.useRouter)(),[c,p]=(0,a.useTransition)(),m="running"===e.status,v="paused"===e.status,g="stopped"===e.status,h=e.id.startsWith("job:"),j="lg"===t,y=j?"sm":"icon-sm",N=(r,t,s)=>{r.stopPropagation(),(!s||window.confirm(s))&&p(async()=>{let r=await t(e.id);r.ok||window.alert(`Action failed: ${r.error}`),n.refresh()})};return h?(0,r.jsx)("div",{className:(0,i.cn)("flex gap-1.5",j?"":"justify-end"),children:(0,r.jsxs)(o.Button,{variant:"destructive",size:y,title:"Dismiss",disabled:c||"error"!==e.status,onClick:r=>N(r,d,`Dismiss failed box ${e.id}? This clears the failed create.`),children:[(0,r.jsx)(l.Icons.trash,{}),j?"Dismiss":null]})}):(0,r.jsxs)("div",{className:(0,i.cn)("flex gap-1.5",j?"":"justify-end"),children:[v?(0,r.jsxs)(o.Button,{variant:j?"default":"outline",size:y,title:"Resume",disabled:c,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,f),children:[(0,r.jsx)(l.Icons.play,{}),j?"Resume":null]}):(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:c||!m,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,u),children:[(0,r.jsx)(l.Icons.pause,{}),j?"Pause":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:c||g,title:"Stop",onClick:e=>N(e,b),children:[(0,r.jsx)(l.Icons.stop,{}),j?"Stop":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:c,title:"Rename",onClick:r=>{r.stopPropagation();let t=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==t&&p(async()=>{let r=await x(e.id,t.trim());r.ok||window.alert(`Rename failed: ${r.error}`),n.refresh()})},children:[(0,r.jsx)(l.Icons.pencil,{}),j?"Rename":null]}),(0,r.jsxs)(o.Button,{variant:"destructive",size:y,title:"Destroy",disabled:c,onClick:r=>N(r,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,r.jsx)(l.Icons.trash,{}),j?"Destroy":null]})]})}],30544),e.s(["Select",0,function({wrapperClassName:e,className:t,children:n,...s}){return(0,r.jsxs)("span",{className:(0,i.cn)("relative inline-flex",e),children:[(0,r.jsx)("select",{className:(0,i.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",t),...s,children:n}),(0,r.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}],49604)},80922,35594,e=>{"use strict";var r=e.i(1262),t=e.i(51096),n=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,r.jsxs)(t.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,r.jsx)(n.Icons.arrowL,{className:"size-[13px]"}),s]})}],80922);var s=e.i(65232),a=e.i(8536);e.s(["Stat",0,function({k:e,v:t,mono:n,icon:a}){return(0,r.jsxs)("div",{className:"px-4.5 p-4",children:[(0,r.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,r.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",n?"font-mono text-sm font-medium":"text-base"),children:[a?(0,r.jsx)(a,{className:"size-[15px] text-muted-foreground"}):null,t]})]})},"StatGrid",0,function({children:e}){return(0,r.jsx)(a.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)}]);
|