bazilion 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +18 -6
  2. package/dist/cli.js +288 -89
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +514 -76
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/web/client/assets/{ConfirmDialog-CyL9A20V.js → ConfirmDialog-_bmG-wVG.js} +1 -1
  7. package/dist/web/client/assets/{FieldRow-D6REbYUa.js → FieldRow-Do1cBkRc.js} +1 -1
  8. package/dist/web/client/assets/{ProductionTeamPolicyEditor-DBKnOezm.js → ProductionTeamPolicyEditor-XP-QJul4.js} +1 -1
  9. package/dist/web/client/assets/{ProfileCommunicationEditor-4RK2laqO.js → ProfileCommunicationEditor-CwdFPdpk.js} +1 -1
  10. package/dist/web/client/assets/{TeamTabs-CdtNEqt4.js → TeamTabs-DIRiKcqx.js} +1 -1
  11. package/dist/web/client/assets/{TemplatesTabs-CZyss2Y0.js → TemplatesTabs-D4WHvs6b.js} +1 -1
  12. package/dist/web/client/assets/{UnsavedChangesGuard-CEoK-ZcN.js → UnsavedChangesGuard-B1aLqiK5.js} +1 -1
  13. package/dist/web/client/assets/{_id-DIqtdQij.js → _id-3w4PFfma.js} +1 -1
  14. package/dist/web/client/assets/{_id-4ZS-w_Aj.js → _id-BH3v_vI_.js} +1 -1
  15. package/dist/web/client/assets/{_id-DbcC2E7F.js → _id-Cx7o4Zmf.js} +1 -1
  16. package/dist/web/client/assets/{_id-f_r5M0p3.js → _id-DIiVVxBl.js} +1 -1
  17. package/dist/web/client/assets/{activity-CB9Ufth-.js → activity-A_HrG1Tv.js} +1 -1
  18. package/dist/web/client/assets/{agents-D-JGXVg9.js → agents-BeeFCt2c.js} +1 -1
  19. package/dist/web/client/assets/{agents-DS2XafoA.js → agents-C8OVKq3N.js} +1 -1
  20. package/dist/web/client/assets/{approvals-Cke_mrJv.js → approvals-BIdZ9BSn.js} +1 -1
  21. package/dist/web/client/assets/{attention-PYwRM2wC.js → attention-B9bUrxiU.js} +1 -1
  22. package/dist/web/client/assets/chevron-right-VWrk_dTX.js +1 -0
  23. package/dist/web/client/assets/{config-DF9Gqmfa.js → config-By86S7k-.js} +2 -2
  24. package/dist/web/client/assets/{inbox-DC_HdOfI.js → inbox-DlXQCJLe.js} +1 -1
  25. package/dist/web/client/assets/{index-Cp6UHWr2.js → index-CLdmsmiN.js} +2 -2
  26. package/dist/web/client/assets/{learning-BfrQ4YZY.js → learning-BqZIw2nA.js} +1 -1
  27. package/dist/web/client/assets/{login-D4n3AcBR.js → login-CCMPXiny.js} +1 -1
  28. package/dist/web/client/assets/{mcp-CnjQc_JJ.js → mcp-DKSY2yVa.js} +1 -1
  29. package/dist/web/client/assets/{members-wxsVTJdW.js → members-9GuOiq6J.js} +1 -1
  30. package/dist/web/client/assets/{memory-Du60O3pE.js → memory-DiGMI6FC.js} +1 -1
  31. package/dist/web/client/assets/{policy-BOfnkJsL.js → policy-TBGQffw5.js} +1 -1
  32. package/dist/web/client/assets/{routes-B9CuhzUW.js → routes-g3yUOhCb.js} +1 -1
  33. package/dist/web/client/assets/{services-DyvqJqM2.js → services-1Z398CES.js} +1 -1
  34. package/dist/web/client/assets/{skills-DQo7ioW7.js → skills-BP2gciFt.js} +1 -1
  35. package/dist/web/client/assets/{teams-DPggy97H.js → teams-DBIivGT7.js} +1 -1
  36. package/dist/web/client/assets/{teams-DdawcfNR.js → teams-tNoMDJ_M.js} +1 -1
  37. package/dist/web/client/assets/{telegram-DcTeDpP5.js → telegram-CJG_DFdI.js} +1 -1
  38. package/dist/web/client/assets/{tokens-CIEKwZXc.js → tokens-eDWCGQQ2.js} +1 -1
  39. package/dist/web/client/assets/{triggers-Bc2RrUPm.js → triggers-DZME3IcK.js} +1 -1
  40. package/dist/web/client/assets/{welcome-DlhNXUIa.js → welcome-B49sh_uf.js} +1 -1
  41. package/dist/web/client/assets/{wire-constants-BzdHSc6A.js → wire-constants-zZ7Wjb9C.js} +1 -1
  42. package/dist/web/client/assets/{x-DAXGIe_Q.js → x-CHc7_-TH.js} +1 -1
  43. package/dist/web/server/assets/{_tanstack-start-manifest_v-C-OiOZeM.js → _tanstack-start-manifest_v-Duhf0z7H.js} +76 -76
  44. package/dist/web/server/assets/{config-ExacOzHX.js → config-BmLq53tq.js} +33 -11
  45. package/dist/web/server/assets/{config-BlMkHStx.js → config-Wy6hnZ-Z.js} +1 -1
  46. package/dist/web/server/assets/{router-pjH2t8Rl.js → router-CY_pCgP1.js} +4 -3
  47. package/dist/web/server/assets/{welcome-B8nchXdF.js → welcome-BdQGR68o.js} +1 -1
  48. package/dist/web/server/server.js +2 -2
  49. package/dist/worker.js +64 -19
  50. package/dist/worker.js.map +1 -1
  51. package/package.json +6 -6
  52. package/dist/web/client/assets/chevron-right-BG4OeFRQ.js +0 -1
@@ -1,3 +1,3 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./chevron-right-BG4OeFRQ.js";import{t as a}from"./ConfirmDialog-CyL9A20V.js";import{G as o,W as s,q as c,x as l}from"./index-Cp6UHWr2.js";import{a as u,t as d}from"./Page-NV96O47A.js";import{t as f}from"./Button-ByiV6fpd.js";import{t as p}from"./ConfigPage-BCLp-FUC.js";import{t as m}from"./FieldRow-D6REbYUa.js";var h=c(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),g=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),_=c(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),v=e(n()),y=t();function b({status:e}){let t=e.configuredOperatorHttp,n=e.protectedUnattendedTurns;return(0,y.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,y.jsxs)(`header`,{className:`border-b px-4 py-3`,children:[(0,y.jsx)(`h2`,{className:`font-semibold`,children:`Execution security`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Operator HTTP requests keep their configured compatibility behavior. Unattended sources use a separate mandatory protected baseline.`})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 p-4 lg:grid-cols-2`,children:[(0,y.jsxs)(`section`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Configured operator HTTP`}),(0,y.jsx)(x,{ok:!1,children:`legacy · unprotected`})]}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:C(t.codingSurface)}),(0,y.jsx)(S,{label:`Docker image`,value:t.dockerImage,mono:!0}),(0,y.jsx)(S,{label:`Browser`,value:t.browser}),(0,y.jsx)(S,{label:`MCP`,value:t.mcp})]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`This compatibility branch is for operator requests; Telegram and unattended delivery never select it.`})]}),(0,y.jsxs)(`section`,{className:`rounded-md border p-3 ${n.baseRuntimeReady?`border-success/25 bg-success/5`:`border-warning/25 bg-warning/10`}`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Protected unattended turns`}),(0,y.jsx)(x,{ok:n.baseRuntimeReady,children:n.baseRuntimeReady?`base runtime ready`:`base runtime unavailable`})]}),(0,y.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Telegram, schedules, inbox wake-ups, and approval delivery cannot select the legacy surface.`}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:`Docker only`}),(0,y.jsx)(S,{label:`Docker`,value:n.docker.ready?`ready`:`unavailable`,ok:n.docker.ready}),(0,y.jsx)(S,{label:`Docker image`,value:n.docker.image,mono:!0}),n.docker.reason&&(0,y.jsx)(S,{label:`Docker reason`,value:n.docker.reason}),(0,y.jsx)(S,{label:`OpenAI Codex enabled`,value:w(n.openaiCodex.enabled),ok:n.openaiCodex.enabled}),(0,y.jsx)(S,{label:`ChatGPT connected`,value:w(n.openaiCodex.connected),ok:n.openaiCodex.connected}),(0,y.jsx)(S,{label:`OpenAI access`,value:T(n.openaiCodex),ok:n.openaiCodex.accessCurrent||n.openaiCodex.refreshOnNextTurn}),(0,y.jsx)(S,{label:`OpenAI Codex baseline eligible`,value:w(n.openaiCodex.baselineEligible),ok:n.openaiCodex.baselineEligible}),(0,y.jsx)(S,{label:`Browser`,value:n.browser,ok:!0}),(0,y.jsx)(S,{label:`MCP`,value:n.mcp,ok:!0})]}),n.remediation&&(0,y.jsxs)(`p`,{className:`mt-3 rounded-md border border-warning/25 bg-background/60 px-3 py-2 text-xs text-warning`,children:[(0,y.jsx)(`strong`,{children:`Remediation:`}),` `,n.remediation]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Every turn separately validates its selected normal/review model, bound OAuth refresh, and Team/input/memory/skill mounts and paths before execution.`})]})]})]})}function x({ok:e,children:t}){return(0,y.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs font-semibold uppercase ${e?`bg-success/10 text-success`:`bg-warning/10 text-warning`}`,children:t})}function S({label:e,value:t,ok:n,mono:r=!1}){return(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,y.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,y.jsx)(`dd`,{className:`${r?`font-mono`:`font-medium`} text-right ${n===void 0?``:n?`text-success`:`text-warning`}`,children:t})]})}function C(e){return e===`host`?`Host tools`:e===`docker`?`Docker only`:`Unavailable`}function w(e){return e?`yes`:`no`}function T(e){return e.accessCurrent?`current`:e.refreshOnNextTurn?`refresh on next turn`:`unavailable`}var E=new Set([`openai-codex`,`openai`,`anthropic`,`google`]),D=new Set([`ollama`,`lmstudio`,`llamacpp`]);function O(e){return e.enabled||e.curated.length>0||e.fields.some(e=>e.set)}function k(e,t){let n=t.trim().toLocaleLowerCase();return n?[e.id,e.displayName,e.hint??``,e.envHint,...e.fields.flatMap(e=>[e.label,e.envVar]),...e.curated,...e.catalog].some(e=>e.toLocaleLowerCase().includes(n)):!0}function A(e,t=``){let n=e.filter(e=>k(e,t)),r=n.filter(O),i=new Set(r.map(e=>e.id)),a=n.filter(e=>!i.has(e.id));return[{key:`configured`,title:`Configured`,description:`Providers you enabled, added models to, or saved credentials for.`,providers:r},{key:`recommended`,title:`Recommended starting points`,description:`The simplest hosted options for a first Bazilion conversation.`,providers:a.filter(e=>E.has(e.id))},{key:`local`,title:`Local models`,description:`Use a model server on the same machine without exposing the daemon.`,providers:a.filter(e=>D.has(e.id))},{key:`more`,title:`More providers`,description:`Specialist, regional, enterprise, and subscription endpoints.`,providers:a.filter(e=>!E.has(e.id)&&!D.has(e.id))}].filter(e=>e.providers.length>0)}function j(e){return e.enabled?e.curated.length===0?{label:`Needs a model`,tone:`warning`}:{label:`Configured, unverified`,tone:`warning`}:O(e)?{label:`Saved, disabled`,tone:`neutral`}:{label:`Not configured`,tone:`neutral`}}function M(){let{providers:e,openaiCodex:t,executionSecurity:n}=l.useLoaderData(),r=e.some(e=>e.enabled&&e.curated.length>0),a=(0,v.useRef)(r),[c,u]=(0,v.useState)(!1),[m,x]=(0,v.useState)(``),S=(0,v.useMemo)(()=>A(e,m),[e,m]),C=e.filter(O).length,w=e.filter(e=>e.enabled).length;return(0,v.useEffect)(()=>{!a.current&&r&&u(!0)},[r]),(0,y.jsxs)(p,{active:`providers`,title:`Providers`,description:(0,y.jsx)(y.Fragment,{children:`Connect the model services your agents may use. Credentials stay encrypted; advanced endpoint and environment names remain available inside each provider.`}),children:[(0,y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,"aria-label":`Provider summary`,children:[(0,y.jsx)(N,{label:`Configured`,value:C,detail:`credentials, models, or toggle`}),(0,y.jsx)(N,{label:`Enabled`,value:w,detail:`available to agent runtime`}),(0,y.jsx)(N,{label:`Selected models`,value:e.reduce((e,t)=>e+(t.enabled?t.curated.length:0),0),detail:`configured; test connectivity separately`})]}),(0,y.jsxs)(`details`,{className:`rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex min-h-12 cursor-pointer list-none items-center gap-3 px-4 py-3 text-sm font-semibold text-foreground marker:hidden sm:px-5`,children:[(0,y.jsx)(s,{className:`size-4 text-primary`,"aria-hidden":`true`}),`Execution security`,(0,y.jsx)(`span`,{className:`ml-auto text-xs font-normal text-muted-foreground`,children:`Inspect host and protected-turn posture`}),(0,y.jsx)(o,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`border-t border-border p-3 sm:p-4`,children:(0,y.jsx)(b,{status:n})})]}),!r&&(0,y.jsx)(P,{providers:e,openaiCodex:t}),c&&(0,y.jsx)(`section`,{role:`status`,className:`rounded-2xl border border-success/30 bg-success/10 p-5 text-sm`,children:(0,y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,y.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-success`,"aria-hidden":`true`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`h2`,{className:`m-0 font-body text-base font-semibold text-foreground`,children:`Your default workspace is ready`}),(0,y.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Bazilion created the default Agent template and Team. Test the selected model below before relying on it, or continue to spawn your first agent.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,y.jsxs)(`a`,{href:`/agents`,className:`btn-primary no-underline`,children:[`Spawn your first agent`,(0,y.jsx)(i,{className:`size-4`,"aria-hidden":`true`})]}),(0,y.jsx)(f,{variant:`ghost`,onClick:()=>u(!1),children:`Keep configuring`})]})]})]})}),(0,y.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4 shadow-baziu-sm sm:p-5`,children:[(0,y.jsx)(`label`,{htmlFor:`provider-search`,className:`m-0 text-sm font-semibold text-foreground`,children:`Find a provider`}),(0,y.jsxs)(`div`,{className:`relative mt-2`,children:[(0,y.jsx)(g,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,y.jsx)(`input`,{id:`provider-search`,type:`search`,value:m,onChange:e=>x(e.target.value),placeholder:`Search by service, model, or advanced key`,className:`pl-9`})]}),(0,y.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:`Start with one provider. Everything else stays collapsed until you need it.`})]}),S.length===0?(0,y.jsx)(d,{icon:(0,y.jsx)(g,{className:`size-4`,"aria-hidden":`true`}),title:`No providers match`,description:`Try another search instead of “${m}”.`,actions:(0,y.jsx)(f,{variant:`ghost`,onClick:()=>x(``),children:`Clear search`})}):(0,y.jsx)(`div`,{className:`space-y-4`,children:S.map(e=>(0,y.jsxs)(`details`,{open:!!m||e.key===`configured`||!r&&e.key===`recommended`,className:`group/providers overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3 px-4 py-4 marker:hidden sm:px-5`,children:[(0,y.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-foreground`,children:(0,y.jsx)(_,{className:`size-4`,"aria-hidden":`true`})}),(0,y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`span`,{className:`block text-sm font-semibold text-foreground`,children:e.title}),(0,y.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:e.description})]}),(0,y.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground`,children:e.providers.length}),(0,y.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/providers:rotate-180`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`space-y-2 border-t border-border bg-muted/20 p-2 sm:p-3`,children:e.providers.map(e=>(0,y.jsx)(F,{p:e,initiallyOpen:e.enabled||!!m||!r&&e.id===`openai-codex`,openaiCodexStatus:e.id===`openai-codex`?t:void 0},e.id))})]},`${e.key}:${m}`))})]})}function N({label:e,value:t,detail:n}){return(0,y.jsxs)(`div`,{className:`min-w-0 rounded-2xl border border-border bg-card p-4 shadow-baziu-sm`,children:[(0,y.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:`mt-1 text-2xl font-semibold text-foreground`,children:t}),(0,y.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:n})]})}function P({providers:e,openaiCodex:t}){let n=[];for(let r of e)r.enabled&&(r.id===`openai-codex`&&!t.connected&&n.push(`${r.id}: enabled but ChatGPT is not connected — click "Connect ChatGPT" below`),r.curated.length===0&&n.push(`${r.id}: enabled but no curated models — add at least one name in the "curated models" box below and save`));let r=e.filter(e=>e.enabled).length;return(0,y.jsxs)(`div`,{role:`status`,className:`rounded-2xl border border-warning/30 bg-warning/10 p-5 text-sm`,children:[(0,y.jsx)(`div`,{className:`font-semibold text-foreground mb-1`,children:`Finish your first provider`}),(0,y.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`Enable one provider, save at least one exact model id, then send the small test request. Saving the model creates your default resources; a successful test confirms that the credential and model actually work.`}),n.length>0?(0,y.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-warning`,children:n.map(e=>(0,y.jsx)(`li`,{children:e},e))}):r===0?(0,y.jsx)(`p`,{className:`text-warning`,children:`No provider is enabled. Open a recommended option below and follow its steps.`}):null]})}function F({p:e,openaiCodexStatus:t,initiallyOpen:n}){let a=r(),[o,s]=(0,v.useState)(e.enabled),[c,l]=(0,v.useState)(n),[d,p]=(0,v.useState)(e.curated.join(`
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./chevron-right-VWrk_dTX.js";import{t as a}from"./ConfirmDialog-_bmG-wVG.js";import{G as o,W as s,q as c,x as l}from"./index-CLdmsmiN.js";import{a as u,t as d}from"./Page-NV96O47A.js";import{t as f}from"./Button-ByiV6fpd.js";import{t as p}from"./ConfigPage-BCLp-FUC.js";import{t as m}from"./FieldRow-Do1cBkRc.js";var h=c(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),g=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),_=c(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),v=e(n()),y=t();function b({status:e}){let t=e.configuredOperatorHttp,n=e.protectedUnattendedTurns;return(0,y.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,y.jsxs)(`header`,{className:`border-b px-4 py-3`,children:[(0,y.jsx)(`h2`,{className:`font-semibold`,children:`Execution security`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Operator HTTP requests keep their configured compatibility behavior. Unattended sources use a separate mandatory protected baseline.`})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 p-4 lg:grid-cols-2`,children:[(0,y.jsxs)(`section`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Configured operator HTTP`}),(0,y.jsx)(x,{ok:!1,children:`legacy · unprotected`})]}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:C(t.codingSurface)}),(0,y.jsx)(S,{label:`Docker image`,value:t.dockerImage,mono:!0}),(0,y.jsx)(S,{label:`Browser`,value:t.browser}),(0,y.jsx)(S,{label:`MCP`,value:t.mcp})]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`This compatibility branch is for operator requests; Telegram and unattended delivery never select it.`})]}),(0,y.jsxs)(`section`,{className:`rounded-md border p-3 ${n.baseRuntimeReady?`border-success/25 bg-success/5`:`border-warning/25 bg-warning/10`}`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,y.jsx)(`h3`,{className:`font-semibold`,children:`Protected unattended turns`}),(0,y.jsx)(x,{ok:n.baseRuntimeReady,children:n.baseRuntimeReady?`base runtime ready`:`base runtime unavailable`})]}),(0,y.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Telegram, schedules, inbox wake-ups, and approval delivery cannot select the legacy surface.`}),(0,y.jsxs)(`dl`,{className:`space-y-2 text-sm`,children:[(0,y.jsx)(S,{label:`Coding surface`,value:`Docker only`}),(0,y.jsx)(S,{label:`Docker`,value:n.docker.ready?`ready`:`unavailable`,ok:n.docker.ready}),(0,y.jsx)(S,{label:`Docker image`,value:n.docker.image,mono:!0}),n.docker.reason&&(0,y.jsx)(S,{label:`Docker reason`,value:n.docker.reason}),(0,y.jsx)(S,{label:`OpenAI Codex enabled`,value:w(n.openaiCodex.enabled),ok:n.openaiCodex.enabled}),(0,y.jsx)(S,{label:`ChatGPT connected`,value:w(n.openaiCodex.connected),ok:n.openaiCodex.connected}),(0,y.jsx)(S,{label:`OpenAI access`,value:T(n.openaiCodex),ok:n.openaiCodex.accessCurrent||n.openaiCodex.refreshOnNextTurn}),(0,y.jsx)(S,{label:`OpenAI Codex baseline eligible`,value:w(n.openaiCodex.baselineEligible),ok:n.openaiCodex.baselineEligible}),(0,y.jsx)(S,{label:`Browser`,value:n.browser,ok:!0}),(0,y.jsx)(S,{label:`MCP`,value:n.mcp,ok:!0})]}),n.remediation&&(0,y.jsxs)(`p`,{className:`mt-3 rounded-md border border-warning/25 bg-background/60 px-3 py-2 text-xs text-warning`,children:[(0,y.jsx)(`strong`,{children:`Remediation:`}),` `,n.remediation]}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Every turn separately validates its selected normal/review model, bound OAuth refresh, and Team/input/memory/skill mounts and paths before execution.`})]})]})]})}function x({ok:e,children:t}){return(0,y.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs font-semibold uppercase ${e?`bg-success/10 text-success`:`bg-warning/10 text-warning`}`,children:t})}function S({label:e,value:t,ok:n,mono:r=!1}){return(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,y.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,y.jsx)(`dd`,{className:`${r?`font-mono`:`font-medium`} text-right ${n===void 0?``:n?`text-success`:`text-warning`}`,children:t})]})}function C(e){return e===`host`?`Host tools`:e===`docker`?`Docker only`:`Unavailable`}function w(e){return e?`yes`:`no`}function T(e){return e.accessCurrent?`current`:e.refreshOnNextTurn?`refresh on next turn`:`unavailable`}var E=new Set([`openai-codex`,`openai`,`anthropic`,`google`]),D=new Set([`ollama`,`lmstudio`,`llamacpp`]);function O(e){return e.enabled||e.curated.length>0||e.fields.some(e=>e.set)}function k(e,t){let n=t.trim().toLocaleLowerCase();return n?[e.id,e.displayName,e.hint??``,e.envHint,...e.fields.flatMap(e=>[e.label,e.envVar]),...e.curated,...e.catalog].some(e=>e.toLocaleLowerCase().includes(n)):!0}function A(e,t=``){let n=e.filter(e=>k(e,t)),r=n.filter(O),i=new Set(r.map(e=>e.id)),a=n.filter(e=>!i.has(e.id));return[{key:`configured`,title:`Configured`,description:`Providers you enabled, added models to, or saved credentials for.`,providers:r},{key:`recommended`,title:`Recommended starting points`,description:`The simplest hosted options for a first Bazilion conversation.`,providers:a.filter(e=>E.has(e.id))},{key:`local`,title:`Local models`,description:`Use a model server on the same machine without exposing the daemon.`,providers:a.filter(e=>D.has(e.id))},{key:`more`,title:`More providers`,description:`Specialist, regional, enterprise, and subscription endpoints.`,providers:a.filter(e=>!E.has(e.id)&&!D.has(e.id))}].filter(e=>e.providers.length>0)}function j(e){return e.enabled?e.curated.length===0?{label:`Needs a model`,tone:`warning`}:{label:`Configured, unverified`,tone:`warning`}:O(e)?{label:`Saved, disabled`,tone:`neutral`}:{label:`Not configured`,tone:`neutral`}}function M(){let{providers:e,openaiCodex:t,executionSecurity:n}=l.useLoaderData(),r=e.some(e=>e.enabled&&e.curated.length>0),a=(0,v.useRef)(r),[c,u]=(0,v.useState)(!1),[m,x]=(0,v.useState)(``),S=(0,v.useMemo)(()=>A(e,m),[e,m]),C=e.filter(O).length,w=e.filter(e=>e.enabled).length;return(0,v.useEffect)(()=>{!a.current&&r&&u(!0)},[r]),(0,y.jsxs)(p,{active:`providers`,title:`Providers`,description:(0,y.jsx)(y.Fragment,{children:`Connect the model services your agents may use. Credentials stay encrypted; advanced endpoint and environment names remain available inside each provider.`}),children:[(0,y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,"aria-label":`Provider summary`,children:[(0,y.jsx)(N,{label:`Configured`,value:C,detail:`credentials, models, or toggle`}),(0,y.jsx)(N,{label:`Enabled`,value:w,detail:`available to agent runtime`}),(0,y.jsx)(N,{label:`Selected models`,value:e.reduce((e,t)=>e+(t.enabled?t.curated.length:0),0),detail:`configured; test connectivity separately`})]}),(0,y.jsxs)(`details`,{className:`rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex min-h-12 cursor-pointer list-none items-center gap-3 px-4 py-3 text-sm font-semibold text-foreground marker:hidden sm:px-5`,children:[(0,y.jsx)(s,{className:`size-4 text-primary`,"aria-hidden":`true`}),`Execution security`,(0,y.jsx)(`span`,{className:`ml-auto text-xs font-normal text-muted-foreground`,children:`Inspect host and protected-turn posture`}),(0,y.jsx)(o,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`border-t border-border p-3 sm:p-4`,children:(0,y.jsx)(b,{status:n})})]}),!r&&(0,y.jsx)(P,{providers:e,openaiCodex:t}),c&&(0,y.jsx)(`section`,{role:`status`,className:`rounded-2xl border border-success/30 bg-success/10 p-5 text-sm`,children:(0,y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,y.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-success`,"aria-hidden":`true`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`h2`,{className:`m-0 font-body text-base font-semibold text-foreground`,children:`Your default workspace is ready`}),(0,y.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Bazilion created the default Agent template and Team. Test the selected model below before relying on it, or continue to spawn your first agent.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,y.jsxs)(`a`,{href:`/agents`,className:`btn-primary no-underline`,children:[`Spawn your first agent`,(0,y.jsx)(i,{className:`size-4`,"aria-hidden":`true`})]}),(0,y.jsx)(f,{variant:`ghost`,onClick:()=>u(!1),children:`Keep configuring`})]})]})]})}),(0,y.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4 shadow-baziu-sm sm:p-5`,children:[(0,y.jsx)(`label`,{htmlFor:`provider-search`,className:`m-0 text-sm font-semibold text-foreground`,children:`Find a provider`}),(0,y.jsxs)(`div`,{className:`relative mt-2`,children:[(0,y.jsx)(g,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,y.jsx)(`input`,{id:`provider-search`,type:`search`,value:m,onChange:e=>x(e.target.value),placeholder:`Search by service, model, or advanced key`,className:`pl-9`})]}),(0,y.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:`Start with one provider. Everything else stays collapsed until you need it.`})]}),S.length===0?(0,y.jsx)(d,{icon:(0,y.jsx)(g,{className:`size-4`,"aria-hidden":`true`}),title:`No providers match`,description:`Try another search instead of “${m}”.`,actions:(0,y.jsx)(f,{variant:`ghost`,onClick:()=>x(``),children:`Clear search`})}):(0,y.jsx)(`div`,{className:`space-y-4`,children:S.map(e=>(0,y.jsxs)(`details`,{open:!!m||e.key===`configured`||!r&&e.key===`recommended`,className:`group/providers overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,y.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3 px-4 py-4 marker:hidden sm:px-5`,children:[(0,y.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-foreground`,children:(0,y.jsx)(_,{className:`size-4`,"aria-hidden":`true`})}),(0,y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`span`,{className:`block text-sm font-semibold text-foreground`,children:e.title}),(0,y.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:e.description})]}),(0,y.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground`,children:e.providers.length}),(0,y.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/providers:rotate-180`,"aria-hidden":`true`})]}),(0,y.jsx)(`div`,{className:`space-y-2 border-t border-border bg-muted/20 p-2 sm:p-3`,children:e.providers.map(e=>(0,y.jsx)(F,{p:e,initiallyOpen:e.enabled||!!m||!r&&e.id===`openai-codex`,openaiCodexStatus:e.id===`openai-codex`?t:void 0},e.id))})]},`${e.key}:${m}`))})]})}function N({label:e,value:t,detail:n}){return(0,y.jsxs)(`div`,{className:`min-w-0 rounded-2xl border border-border bg-card p-4 shadow-baziu-sm`,children:[(0,y.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:`mt-1 text-2xl font-semibold text-foreground`,children:t}),(0,y.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:n})]})}function P({providers:e,openaiCodex:t}){let n=[];for(let r of e)r.enabled&&(r.id===`openai-codex`&&!t.connected&&n.push(`${r.id}: enabled but ChatGPT is not connected — click "Connect ChatGPT" below`),r.curated.length===0&&n.push(`${r.id}: enabled but no curated models — add at least one name in the "curated models" box below and save`));let r=e.filter(e=>e.enabled).length;return(0,y.jsxs)(`div`,{role:`status`,className:`rounded-2xl border border-warning/30 bg-warning/10 p-5 text-sm`,children:[(0,y.jsx)(`div`,{className:`font-semibold text-foreground mb-1`,children:`Finish your first provider`}),(0,y.jsx)(`p`,{className:`text-muted-foreground mb-2`,children:`Enable one provider, save at least one exact model id, then send the small test request. Saving the model creates your default resources; a successful test confirms that the credential and model actually work.`}),n.length>0?(0,y.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-warning`,children:n.map(e=>(0,y.jsx)(`li`,{children:e},e))}):r===0?(0,y.jsx)(`p`,{className:`text-warning`,children:`No provider is enabled. Open a recommended option below and follow its steps.`}):null]})}function F({p:e,openaiCodexStatus:t,initiallyOpen:n}){let a=r(),[o,s]=(0,v.useState)(e.enabled),[c,l]=(0,v.useState)(n),[d,p]=(0,v.useState)(e.curated.join(`
2
2
  `)),[h,g]=(0,v.useState)(!1),[_,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(e.curated[0]??``),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(null),k=j({...e,enabled:o});async function A(t){s(t),S(null);try{let n=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:t})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Could not update provider (${n.status})`)}t&&l(!0),await a.invalidate()}catch(e){s(!t),S(e instanceof Error?e.message:String(e))}}async function M(t){t.preventDefault(),g(!0),b(null);try{let t=d.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),n=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/models`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({models:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}b({kind:`success`,message:`Models saved. Run the connection test before relying on them.`}),w(t[0]??``),O(null),await a.invalidate()}catch(e){b({kind:`error`,message:e.message})}finally{g(!1)}}async function N(){if(C){E(!0),O(null);try{let t=await fetch(`/api/providers/test`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({model:`${e.id}:${C}`,message:`Reply with exactly: Bazilion connection verified.`})}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??`Connection test failed (${t.status})`);O({kind:`success`,message:`Verified ${e.displayName} with ${C}.`}),await a.invalidate()}catch(e){O({kind:`error`,message:e instanceof Error?e.message:String(e)})}finally{E(!1)}}}return(0,y.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-border bg-card`,children:[(0,y.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`unstyled flex min-w-0 flex-1 items-center gap-2 rounded-lg text-left`,"aria-expanded":c,"aria-controls":`provider-${e.id}`,onClick:()=>l(e=>!e),children:[(0,y.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${c?`rotate-90`:``}`,"aria-hidden":`true`}),(0,y.jsxs)(`span`,{className:`min-w-0`,children:[(0,y.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e.displayName}),(0,y.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.id})]})]}),(0,y.jsx)(u,{variant:k.tone===`success`?`success`:k.tone===`warning`?`warning`:`neutral`,children:k.label}),(0,y.jsxs)(`label`,{className:`m-0 flex cursor-pointer items-center gap-1.5 rounded-lg px-1 text-xs font-semibold`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>A(e.target.checked),className:`size-4`,"aria-label":`${o?`Disable`:`Enable`} ${e.displayName}`}),(0,y.jsx)(`span`,{className:o?`text-success`:`text-muted-foreground`,children:o?`enabled`:`disabled`})]}),(0,y.jsxs)(`span`,{className:`w-full pl-6 text-xs text-muted-foreground sm:w-auto sm:pl-0`,children:[e.curated.length>0&&(0,y.jsxs)(`span`,{children:[e.curated.length,` curated`]}),e.catalog.length>0&&(0,y.jsxs)(`span`,{children:[` · `,e.catalog.length,` catalog`]}),e.live&&!e.live.error&&(0,y.jsxs)(`span`,{children:[` · `,e.live.models.length,` live`]})]})]}),x&&(0,y.jsx)(`p`,{role:`alert`,className:`mx-4 mb-3 text-sm text-danger`,children:x}),c&&(0,y.jsxs)(`div`,{id:`provider-${e.id}`,className:`border-t border-dashed px-3 py-4 sm:px-4`,children:[e.hint&&(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:e.hint}),e.id===`openai-codex`&&t&&(0,y.jsx)(R,{status:t}),e.fields.length===0&&e.envHint&&e.id!==`openai-codex`&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Credentials come from the process env: `,(0,y.jsx)(`code`,{className:`font-mono`,children:e.envHint})]}),e.fields.map(e=>(0,y.jsx)(m,{field:e},e.envVar)),(0,y.jsx)(`h4`,{id:`provider-${e.id}-models-label`,className:`mt-4 mb-1 font-body text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Models available to agents`}),e.curated.length===0&&(0,y.jsxs)(`p`,{className:`mb-2 text-xs font-medium text-warning`,children:[`First-run setup needs at least one model name here — type one (e.g.`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:I(e.id)}),`) and click`,` `,(0,y.jsx)(`em`,{children:`save models`}),`. Catalog chips below are the safest source when available.`]}),(0,y.jsxs)(`form`,{onSubmit:M,children:[(0,y.jsx)(`textarea`,{id:`provider-${e.id}-models`,"aria-labelledby":`provider-${e.id}-models-label`,value:d,onChange:e=>p(e.target.value),rows:Math.max(3,Math.min(8,d.split(`
3
- `).length)),className:`w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30`,placeholder:e.catalog.length===0&&!e.live?`Type model names one per line, e.g. qwen3-coder-30b`:`Click catalog chips below, or type names one per line`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,y.jsx)(`button`,{type:`submit`,disabled:h,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:h?`Saving…`:`Save models`}),_&&(0,y.jsx)(`span`,{role:_.kind===`error`?`alert`:`status`,className:`text-xs ${_.kind===`error`?`text-danger`:`text-success`}`,children:_.message})]})]}),e.catalog.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,y.jsx)(L,{items:e.catalog,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,y.jsx)(L,{items:e.live.models,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,y.jsxs)(`p`,{role:`alert`,className:`text-xs text-danger mt-2`,children:[`Could not fetch live models: `,e.live.error]}),o&&e.curated.length>0&&(0,y.jsxs)(`div`,{className:`mt-4 rounded-xl border border-border bg-muted/30 p-3`,children:[(0,y.jsx)(`h4`,{className:`m-0 font-body text-sm font-semibold text-foreground`,children:`Test the connection`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`Sends one short real request. Your provider may charge its normal token cost.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-end`,children:[(0,y.jsxs)(`label`,{className:`m-0 min-w-0 flex-1 text-xs font-semibold text-foreground`,children:[`Model`,(0,y.jsx)(`select`,{className:`mt-1`,value:C,onChange:e=>w(e.target.value),children:e.curated.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))})]}),(0,y.jsx)(f,{variant:`ghost`,disabled:T||!C,onClick:()=>void N(),children:T?`Testing…`:`Send test request`})]}),D&&(0,y.jsx)(`p`,{role:D.kind===`error`?`alert`:`status`,className:`mt-3 rounded-lg px-3 py-2 text-sm ${D.kind===`error`?`bg-danger/10 text-danger`:`bg-success/10 text-success`}`,children:D.message})]})]})]})}function I(e){switch(e){case`openai-codex`:return`gpt-5.6-luna`;case`openai`:return`gpt-5.6-luna`;case`anthropic`:return`claude-opus-5`;case`google`:return`gemini-3.6-flash`;case`google-vertex`:return`gemini-3.6-flash`;case`xai`:return`grok-4.5`;case`groq`:return`llama-3.3-70b-versatile`;case`cerebras`:return`gpt-oss-120b`;case`mistral`:return`mistral-large-latest`;case`zai`:return`glm-5.2`;case`huggingface`:return`Qwen/Qwen3.5-397B-A17B`;case`openrouter`:return`anthropic/claude-opus-5`;case`vercel-ai-gateway`:return`anthropic/claude-opus-5`;case`deepseek`:return`deepseek-v4-pro`;case`fireworks`:return`accounts/fireworks/models/kimi-k3`;case`together`:return`moonshotai/Kimi-K3`;case`baseten`:return`moonshotai/Kimi-K3`;case`moonshotai`:return`kimi-k3`;case`moonshotai-cn`:return`kimi-k3`;case`kimi-coding`:return`kimi-for-coding`;case`minimax`:return`MiniMax-M2.7`;case`minimax-cn`:return`MiniMax-M3`;case`qwen-token-plan`:return`qwen3.8-max`;case`qwen-token-plan-cn`:case`qwen-token-plan-individual`:return`qwen3.8-max`;case`ant-ling`:return`Ling-2.6-1T`;case`nvidia`:return`nvidia/nemotron-3-super-120b-a12b`;case`cloudflare-workers-ai`:return`@cf/moonshotai/kimi-k2.6`;case`cloudflare-ai-gateway`:return`claude-opus-5`;case`github-copilot`:return`claude-opus-5`;case`xiaomi`:return`mimo-v2.5`;case`xiaomi-token-plan-ams`:case`xiaomi-token-plan-cn`:case`xiaomi-token-plan-sgp`:return`mimo-v2.5-pro`;case`opencode`:return`claude-opus-5`;case`opencode-go`:return`kimi-k2.7-code`;case`zai-coding-cn`:return`glm-5.2`;case`azure-openai`:return`gpt-5.6-luna`;case`bedrock`:return`global.anthropic.claude-opus-5`;case`ollama`:return`llama3.3`;case`lmstudio`:return`qwen3-coder-30b`;case`llamacpp`:return`unsloth/Qwen3.6-35B-A3B-MTP-GGUF:MXFP4_MOE`;default:return`model-name`}}function L({items:e,onPick:t}){return(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5 max-h-40 overflow-y-auto rounded-md border bg-background p-1.5`,children:e.map(e=>(0,y.jsx)(`button`,{type:`button`,onClick:()=>t(e),"aria-label":`Add ${e} to selected models`,className:`rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent`,children:e},e))})}function R({status:e}){let t=r(),[n,i]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1);async function u(){i(!0),s(null);try{let e=await fetch(`/api/auth/openai/login`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}await t.invalidate()}catch(e){s(e.message)}finally{i(!1)}}async function d(){i(!0),s(null);try{let e=await fetch(`/api/auth/openai`,{method:`DELETE`});if(!e.ok&&e.status!==204){let t=await e.json().catch(()=>null);throw Error(t?.error??`Could not disconnect ChatGPT (${e.status})`)}await t.invalidate()}catch(e){throw s(e instanceof Error?e.message:String(e)),e}finally{i(!1)}}return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`rounded-md border bg-muted/30 p-3 mb-3`,children:[e.connected?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center mb-2`,children:[(0,y.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-2 py-0.5 text-xs font-semibold uppercase`,children:`connected`}),e.accountId&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`account `,(0,y.jsx)(`code`,{className:`font-mono`,children:e.accountId})]}),e.expiresAt&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`token expires`,` `,new Date(e.expiresAt).toISOString().replace(/\.\d+Z$/,`Z`)]})]}),(0,y.jsx)(f,{variant:`danger`,onClick:()=>l(!0),disabled:n,children:`Disconnect ChatGPT`})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:[`Sign in with your ChatGPT account — the OAuth flow opens a new browser tab. The loopback callback at `,(0,y.jsx)(`code`,{className:`font-mono`,children:`localhost:1455`}),` only works when you're using the web UI on the same machine as the daemon. For remote setups, run `,(0,y.jsx)(`code`,{className:`font-mono`,children:`bazilion auth openai login`}),` on the client.`]}),(0,y.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:n?`opening browser…`:`Connect ChatGPT →`})]}),o&&(0,y.jsx)(`p`,{role:`alert`,className:`text-sm text-danger mt-2`,children:o})]}),(0,y.jsx)(a,{open:c,onOpenChange:l,title:`Disconnect ChatGPT?`,description:(0,y.jsxs)(`p`,{children:[`This removes the saved OpenAI Codex OAuth credentials. Agents using an`,` `,(0,y.jsx)(`code`,{children:`openai-codex`}),` model will stop working until you connect again.`]}),confirmLabel:`Disconnect ChatGPT`,onConfirm:d})]})}export{M as component};
3
+ `).length)),className:`w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30`,placeholder:e.catalog.length===0&&!e.live?`Type model names one per line, e.g. qwen3-coder-30b`:`Click catalog chips below, or type names one per line`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,y.jsx)(`button`,{type:`submit`,disabled:h,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:h?`Saving…`:`Save models`}),_&&(0,y.jsx)(`span`,{role:_.kind===`error`?`alert`:`status`,className:`text-xs ${_.kind===`error`?`text-danger`:`text-success`}`,children:_.message})]})]}),e.catalog.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,y.jsx)(L,{items:e.catalog,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,y.jsx)(L,{items:e.live.models,onPick:e=>p(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,y.jsxs)(`p`,{role:`alert`,className:`text-xs text-danger mt-2`,children:[`Could not fetch live models: `,e.live.error]}),o&&e.curated.length>0&&(0,y.jsxs)(`div`,{className:`mt-4 rounded-xl border border-border bg-muted/30 p-3`,children:[(0,y.jsx)(`h4`,{className:`m-0 font-body text-sm font-semibold text-foreground`,children:`Test the connection`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`Sends one short real request. Your provider may charge its normal token cost.`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-end`,children:[(0,y.jsxs)(`label`,{className:`m-0 min-w-0 flex-1 text-xs font-semibold text-foreground`,children:[`Model`,(0,y.jsx)(`select`,{className:`mt-1`,value:C,onChange:e=>w(e.target.value),children:e.curated.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))})]}),(0,y.jsx)(f,{variant:`ghost`,disabled:T||!C,onClick:()=>void N(),children:T?`Testing…`:`Send test request`})]}),D&&(0,y.jsx)(`p`,{role:D.kind===`error`?`alert`:`status`,className:`mt-3 rounded-lg px-3 py-2 text-sm ${D.kind===`error`?`bg-danger/10 text-danger`:`bg-success/10 text-success`}`,children:D.message})]})]})]})}function I(e){switch(e){case`openai-codex`:return`gpt-6-astra`;case`openai`:return`gpt-6-astra`;case`anthropic`:return`claude-opus-5`;case`google`:return`gemini-3.6-flash`;case`google-vertex`:return`gemini-3.6-flash`;case`xai`:return`grok-4.5`;case`groq`:return`llama-3.3-70b-versatile`;case`cerebras`:return`gpt-oss-120b`;case`mistral`:return`mistral-large-latest`;case`zai`:return`glm-5.2`;case`huggingface`:return`Qwen/Qwen3.5-397B-A17B`;case`openrouter`:return`anthropic/claude-opus-5`;case`vercel-ai-gateway`:return`anthropic/claude-opus-5`;case`deepseek`:return`deepseek-v4-pro`;case`fireworks`:return`accounts/fireworks/models/kimi-k3`;case`together`:return`moonshotai/Kimi-K3`;case`baseten`:return`moonshotai/Kimi-K3`;case`moonshotai`:return`kimi-k3`;case`moonshotai-cn`:return`kimi-k3`;case`kimi-coding`:return`kimi-for-coding`;case`minimax`:return`MiniMax-M2.7`;case`minimax-cn`:return`MiniMax-M3`;case`qwen-token-plan`:return`qwen3.8-max`;case`qwen-token-plan-cn`:case`qwen-token-plan-individual`:return`qwen3.8-max`;case`ant-ling`:return`Ling-2.6-1T`;case`nvidia`:return`nvidia/nemotron-3-super-120b-a12b`;case`cloudflare-workers-ai`:return`@cf/moonshotai/kimi-k2.6`;case`cloudflare-ai-gateway`:return`claude-opus-5`;case`github-copilot`:return`claude-opus-5`;case`xiaomi`:return`mimo-v2.5`;case`xiaomi-token-plan-ams`:case`xiaomi-token-plan-cn`:case`xiaomi-token-plan-sgp`:return`mimo-v2.5-pro`;case`opencode`:return`claude-opus-5`;case`opencode-go`:return`kimi-k2.7-code`;case`zai-coding-cn`:return`glm-5.2`;case`azure-openai`:return`gpt-5.6-luna`;case`bedrock`:return`global.anthropic.claude-opus-5`;case`ollama`:return`llama3.3`;case`lmstudio`:return`qwen3-coder-30b`;case`llamacpp`:return`unsloth/Qwen3.6-35B-A3B-MTP-GGUF:MXFP4_MOE`;default:return`model-name`}}function L({items:e,onPick:t}){return(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5 max-h-40 overflow-y-auto rounded-md border bg-background p-1.5`,children:e.map(e=>(0,y.jsx)(`button`,{type:`button`,onClick:()=>t(e),"aria-label":`Add ${e} to selected models`,className:`rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent`,children:e},e))})}function R({status:e}){let t=r(),[n,i]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null);(0,v.useEffect)(()=>()=>{u.current?.abort()},[]);async function d(){u.current?.abort();let e=new AbortController;u.current=e,i(!0),s(null);try{let n=await fetch(`/api/auth/openai/login`,{method:`POST`,signal:e.signal});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}if(e.signal.aborted)return;await t.invalidate()}catch(t){if(e.signal.aborted)return;s(t.message)}finally{u.current===e&&(u.current=null,e.signal.aborted||i(!1))}}async function p(){i(!0),s(null);try{let e=await fetch(`/api/auth/openai`,{method:`DELETE`});if(!e.ok&&e.status!==204){let t=await e.json().catch(()=>null);throw Error(t?.error??`Could not disconnect ChatGPT (${e.status})`)}await t.invalidate()}catch(e){throw s(e instanceof Error?e.message:String(e)),e}finally{i(!1)}}return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`rounded-md border bg-muted/30 p-3 mb-3`,children:[e.connected?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center mb-2`,children:[(0,y.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-2 py-0.5 text-xs font-semibold uppercase`,children:`connected`}),e.accountId&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`account `,(0,y.jsx)(`code`,{className:`font-mono`,children:e.accountId})]}),e.expiresAt&&(0,y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`token expires`,` `,new Date(e.expiresAt).toISOString().replace(/\.\d+Z$/,`Z`)]})]}),(0,y.jsx)(f,{variant:`danger`,onClick:()=>l(!0),disabled:n,children:`Disconnect ChatGPT`})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:[`Sign in with your ChatGPT account — the OAuth flow opens a new browser tab. The loopback callback at `,(0,y.jsx)(`code`,{className:`font-mono`,children:`localhost:1455`}),` only works when you're using the web UI on the same machine as the daemon. For remote setups or callback trouble, run`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:`bazilion auth openai login --device-code`}),` on the client. From a source checkout, run`,` `,(0,y.jsx)(`code`,{className:`font-mono`,children:`pnpm tsx apps/cli/src/index.ts auth openai login --device-code`}),` `,`from the repository root.`]}),(0,y.jsx)(f,{variant:`primary`,onClick:d,disabled:n,children:n?`opening browser…`:`Connect ChatGPT →`})]}),o&&(0,y.jsx)(`p`,{role:`alert`,className:`text-sm text-danger mt-2`,children:o})]}),(0,y.jsx)(a,{open:c,onOpenChange:l,title:`Disconnect ChatGPT?`,description:(0,y.jsxs)(`p`,{children:[`This removes the saved OpenAI Codex OAuth credentials. Agents using an`,` `,(0,y.jsx)(`code`,{children:`openai-codex`}),` model will stop working until you connect again.`]}),confirmLabel:`Disconnect ChatGPT`,onConfirm:p})]})}export{M as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{r as t}from"./index-Cp6UHWr2.js";import{r as n}from"./Page-NV96O47A.js";import{t as r}from"./AgentTabs-BcmmwYJc.js";var i=e();function a(e){try{let t=JSON.parse(e);if(typeof t.text==`string`)return t.text}catch{}return e}function o(){let{resolved:e,messages:o,unreadCount:s,selected:c,agentNames:l,loopBreaks:u}=t.useLoaderData(),d=t.useSearch().unread===`1`,f=!!(c&&c.toAgentId!==e.agent.id);function p(e){let t=l[e];return t?`${t} (${e.slice(0,8)})`:e.slice(0,8)}return(0,i.jsxs)(n,{children:[(0,i.jsx)(`h1`,{className:`font-serif text-3xl text-foreground mb-1`,children:e.agent.name}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-6`,children:[(0,i.jsxs)(`code`,{className:`font-mono`,children:[e.agent.id.slice(0,8),`…`]}),` · unread: `,s]}),(0,i.jsx)(r,{agentId:e.agent.id,active:`inbox`,archived:e.agent.status===`archived`}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[360px_1fr] gap-6`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex gap-1 border-b mb-3`,children:[(0,i.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${d?`border-transparent text-muted-foreground`:`border-primary text-primary font-semibold`}`,children:`all`}),(0,i.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox?unread=1`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${d?`border-primary text-primary font-semibold`:`border-transparent text-muted-foreground`}`,children:`unread`})]}),(0,i.jsx)(`div`,{className:`rounded-lg border bg-card max-h-[640px] overflow-y-auto`,children:o.length===0?(0,i.jsx)(`div`,{className:`p-6 text-center text-muted-foreground italic`,children:d?`no unread messages`:`inbox empty`}):o.map(t=>{let n=a(t.payload),r=n.length>80?`${n.slice(0,80)}…`:n,o=new Date(t.createdAt).toLocaleString(),s=c?.id===t.id,l=t.readAt===null,u=d?`?unread=1&id=${t.id}`:`?id=${t.id}`;return(0,i.jsxs)(`a`,{href:`/agents/${e.agent.id}/inbox${u}`,className:`block border-b last:border-0 px-3 py-2 text-sm hover:bg-accent/30 ${s?`bg-accent/40`:``} ${l?`font-medium`:``}`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{className:`font-mono`,children:[l&&(0,i.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-primary mr-1.5 align-middle`}),`from `,p(t.fromAgentId)]}),(0,i.jsx)(`span`,{className:`font-mono`,children:o})]}),(0,i.jsx)(`div`,{className:`text-foreground mt-0.5 truncate`,children:r})]},t.id)})})]}),(0,i.jsxs)(`div`,{children:[c&&!f&&(0,i.jsxs)(`div`,{className:`rounded-lg border bg-card p-5 mb-4`,children:[(0,i.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground mb-2 space-y-0.5`,children:[(0,i.jsxs)(`div`,{children:[`id: `,(0,i.jsx)(`code`,{children:c.id})]}),(0,i.jsxs)(`div`,{children:[`from: `,(0,i.jsx)(`code`,{children:p(c.fromAgentId)})]}),(0,i.jsxs)(`div`,{children:[`received: `,new Date(c.createdAt).toLocaleString()]}),(0,i.jsxs)(`div`,{children:[`read:`,` `,c.readAt?new Date(c.readAt).toLocaleString():`(unread)`]}),c.replyTo&&(0,i.jsxs)(`div`,{children:[`reply to: `,(0,i.jsx)(`code`,{children:c.replyTo})]})]}),(0,i.jsx)(`div`,{className:`border-t pt-3 font-mono text-sm whitespace-pre-wrap break-words`,children:a(c.payload)})]}),f&&(0,i.jsx)(`div`,{className:`rounded-lg border bg-card p-5 mb-4 text-muted-foreground`,children:`message is not addressed to this agent`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents exchange messages automatically via their`,` `,(0,i.jsx)(`code`,{className:`font-mono`,children:`send_message`}),` tool. An idle recipient's scheduler tick drains unread mail.`]}),(0,i.jsxs)(`div`,{className:`mt-6 rounded-lg border bg-card p-4`,children:[(0,i.jsx)(`h2`,{className:`mb-2 font-serif text-lg text-foreground`,children:`Loop circuit breaker`}),u.length===0?(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agent-message chains stopped.`}):(0,i.jsx)(`div`,{className:`space-y-3`,children:u.map(e=>(0,i.jsxs)(`div`,{className:`border-t first:border-0 first:pt-0 pt-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`font-mono text-foreground`,children:[p(e.fromAgentId),` → `,p(e.toAgentId)]}),(0,i.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`stopped hop `,e.attemptedHop,` at limit `,e.maxHops,` · chain`,` `,(0,i.jsx)(`code`,{children:e.causalChainId.slice(0,8)}),` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]})]})]})}export{o as component};
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{r as t}from"./index-CLdmsmiN.js";import{r as n}from"./Page-NV96O47A.js";import{t as r}from"./AgentTabs-BcmmwYJc.js";var i=e();function a(e){try{let t=JSON.parse(e);if(typeof t.text==`string`)return t.text}catch{}return e}function o(){let{resolved:e,messages:o,unreadCount:s,selected:c,agentNames:l,loopBreaks:u}=t.useLoaderData(),d=t.useSearch().unread===`1`,f=!!(c&&c.toAgentId!==e.agent.id);function p(e){let t=l[e];return t?`${t} (${e.slice(0,8)})`:e.slice(0,8)}return(0,i.jsxs)(n,{children:[(0,i.jsx)(`h1`,{className:`font-serif text-3xl text-foreground mb-1`,children:e.agent.name}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-6`,children:[(0,i.jsxs)(`code`,{className:`font-mono`,children:[e.agent.id.slice(0,8),`…`]}),` · unread: `,s]}),(0,i.jsx)(r,{agentId:e.agent.id,active:`inbox`,archived:e.agent.status===`archived`}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[360px_1fr] gap-6`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex gap-1 border-b mb-3`,children:[(0,i.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${d?`border-transparent text-muted-foreground`:`border-primary text-primary font-semibold`}`,children:`all`}),(0,i.jsx)(`a`,{href:`/agents/${e.agent.id}/inbox?unread=1`,className:`px-3 py-1.5 text-sm border-b-2 -mb-px ${d?`border-primary text-primary font-semibold`:`border-transparent text-muted-foreground`}`,children:`unread`})]}),(0,i.jsx)(`div`,{className:`rounded-lg border bg-card max-h-[640px] overflow-y-auto`,children:o.length===0?(0,i.jsx)(`div`,{className:`p-6 text-center text-muted-foreground italic`,children:d?`no unread messages`:`inbox empty`}):o.map(t=>{let n=a(t.payload),r=n.length>80?`${n.slice(0,80)}…`:n,o=new Date(t.createdAt).toLocaleString(),s=c?.id===t.id,l=t.readAt===null,u=d?`?unread=1&id=${t.id}`:`?id=${t.id}`;return(0,i.jsxs)(`a`,{href:`/agents/${e.agent.id}/inbox${u}`,className:`block border-b last:border-0 px-3 py-2 text-sm hover:bg-accent/30 ${s?`bg-accent/40`:``} ${l?`font-medium`:``}`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{className:`font-mono`,children:[l&&(0,i.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-primary mr-1.5 align-middle`}),`from `,p(t.fromAgentId)]}),(0,i.jsx)(`span`,{className:`font-mono`,children:o})]}),(0,i.jsx)(`div`,{className:`text-foreground mt-0.5 truncate`,children:r})]},t.id)})})]}),(0,i.jsxs)(`div`,{children:[c&&!f&&(0,i.jsxs)(`div`,{className:`rounded-lg border bg-card p-5 mb-4`,children:[(0,i.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground mb-2 space-y-0.5`,children:[(0,i.jsxs)(`div`,{children:[`id: `,(0,i.jsx)(`code`,{children:c.id})]}),(0,i.jsxs)(`div`,{children:[`from: `,(0,i.jsx)(`code`,{children:p(c.fromAgentId)})]}),(0,i.jsxs)(`div`,{children:[`received: `,new Date(c.createdAt).toLocaleString()]}),(0,i.jsxs)(`div`,{children:[`read:`,` `,c.readAt?new Date(c.readAt).toLocaleString():`(unread)`]}),c.replyTo&&(0,i.jsxs)(`div`,{children:[`reply to: `,(0,i.jsx)(`code`,{children:c.replyTo})]})]}),(0,i.jsx)(`div`,{className:`border-t pt-3 font-mono text-sm whitespace-pre-wrap break-words`,children:a(c.payload)})]}),f&&(0,i.jsx)(`div`,{className:`rounded-lg border bg-card p-5 mb-4 text-muted-foreground`,children:`message is not addressed to this agent`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents exchange messages automatically via their`,` `,(0,i.jsx)(`code`,{className:`font-mono`,children:`send_message`}),` tool. An idle recipient's scheduler tick drains unread mail.`]}),(0,i.jsxs)(`div`,{className:`mt-6 rounded-lg border bg-card p-4`,children:[(0,i.jsx)(`h2`,{className:`mb-2 font-serif text-lg text-foreground`,children:`Loop circuit breaker`}),u.length===0?(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agent-message chains stopped.`}):(0,i.jsx)(`div`,{className:`space-y-3`,children:u.map(e=>(0,i.jsxs)(`div`,{className:`border-t first:border-0 first:pt-0 pt-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`font-mono text-foreground`,children:[p(e.fromAgentId),` → `,p(e.toAgentId)]}),(0,i.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`stopped hop `,e.attemptedHop,` at limit `,e.maxHops,` · chain`,` `,(0,i.jsx)(`code`,{children:e.causalChainId.slice(0,8)}),` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]})]})]})}export{o as component};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/welcome-DlhNXUIa.js","assets/jsx-runtime-DGeXAQPT.js","assets/Page-NV96O47A.js","assets/utils-B6KiDbIe.js","assets/login-D4n3AcBR.js","assets/routes-B9CuhzUW.js","assets/preload-helper-bztXdkDj.js","assets/react-3W8R1pOO.js","assets/Button-ByiV6fpd.js","assets/wire-constants-BzdHSc6A.js","assets/ConfirmDialog-CyL9A20V.js","assets/chevron-right-BG4OeFRQ.js","assets/x-DAXGIe_Q.js","assets/teams-CSNyLz3l.js","assets/RecoveryState-QfMSuwy3.js","assets/teams-DdawcfNR.js","assets/skills-DQo7ioW7.js","assets/config-DF9Gqmfa.js","assets/ConfigPage-BCLp-FUC.js","assets/SectionTabs-4kCQXuFY.js","assets/FieldRow-D6REbYUa.js","assets/attention-Gavt2yEp.js","assets/attention-PYwRM2wC.js","assets/approvals-DGi0PSx8.js","assets/approvals-Cke_mrJv.js","assets/agents-D-JGXVg9.js","assets/AgentAvatar-JYijLvZ2.js","assets/tokens-CIEKwZXc.js","assets/services-DyvqJqM2.js","assets/mcp-CnjQc_JJ.js","assets/teams-DPggy97H.js","assets/TemplatesTabs-CZyss2Y0.js","assets/agents-DS2XafoA.js","assets/UnsavedChangesGuard-CEoK-ZcN.js","assets/ProfileCommunicationEditor-4RK2laqO.js","assets/team-policy-D0jpnn2b.js","assets/_id-DbcC2E7F.js","assets/TeamTabs-CdtNEqt4.js","assets/_id-f_r5M0p3.js","assets/AgentTabs-BcmmwYJc.js","assets/policy-K4hIbbIN.js","assets/policy-BOfnkJsL.js","assets/ProductionTeamPolicyEditor-DBKnOezm.js","assets/ProductionTeamPolicyEditor-DLioOiRN.css","assets/memory-Du60O3pE.js","assets/members-wxsVTJdW.js","assets/activity-DJuhhQCb.js","assets/activity-CB9Ufth-.js","assets/telegram-DcTeDpP5.js","assets/triggers-Bc2RrUPm.js","assets/learning-BfrQ4YZY.js","assets/inbox-DC_HdOfI.js","assets/_id-DGyKURCp.js","assets/_id-DIqtdQij.js","assets/_id-4ZS-w_Aj.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/welcome-B49sh_uf.js","assets/jsx-runtime-DGeXAQPT.js","assets/Page-NV96O47A.js","assets/utils-B6KiDbIe.js","assets/login-CCMPXiny.js","assets/routes-g3yUOhCb.js","assets/preload-helper-bztXdkDj.js","assets/react-3W8R1pOO.js","assets/Button-ByiV6fpd.js","assets/wire-constants-zZ7Wjb9C.js","assets/ConfirmDialog-_bmG-wVG.js","assets/chevron-right-VWrk_dTX.js","assets/x-CHc7_-TH.js","assets/teams-CSNyLz3l.js","assets/RecoveryState-QfMSuwy3.js","assets/teams-tNoMDJ_M.js","assets/skills-BP2gciFt.js","assets/config-By86S7k-.js","assets/ConfigPage-BCLp-FUC.js","assets/SectionTabs-4kCQXuFY.js","assets/FieldRow-Do1cBkRc.js","assets/attention-Gavt2yEp.js","assets/attention-B9bUrxiU.js","assets/approvals-DGi0PSx8.js","assets/approvals-BIdZ9BSn.js","assets/agents-BeeFCt2c.js","assets/AgentAvatar-JYijLvZ2.js","assets/tokens-eDWCGQQ2.js","assets/services-1Z398CES.js","assets/mcp-DKSY2yVa.js","assets/teams-DBIivGT7.js","assets/TemplatesTabs-D4WHvs6b.js","assets/agents-C8OVKq3N.js","assets/UnsavedChangesGuard-B1aLqiK5.js","assets/ProfileCommunicationEditor-CwdFPdpk.js","assets/team-policy-D0jpnn2b.js","assets/_id-Cx7o4Zmf.js","assets/TeamTabs-DIRiKcqx.js","assets/_id-DIiVVxBl.js","assets/AgentTabs-BcmmwYJc.js","assets/policy-K4hIbbIN.js","assets/policy-TBGQffw5.js","assets/ProductionTeamPolicyEditor-XP-QJul4.js","assets/ProductionTeamPolicyEditor-DLioOiRN.css","assets/memory-DiGMI6FC.js","assets/members-9GuOiq6J.js","assets/activity-DJuhhQCb.js","assets/activity-A_HrG1Tv.js","assets/telegram-CJG_DFdI.js","assets/triggers-DZME3IcK.js","assets/learning-BqZIw2nA.js","assets/inbox-DlXQCJLe.js","assets/_id-DGyKURCp.js","assets/_id-3w4PFfma.js","assets/_id-BH3v_vI_.js"])))=>i.map(i=>d[i]);
2
2
  import{n as e,r as t,t as n}from"./jsx-runtime-DGeXAQPT.js";import{t as r}from"./react-3W8R1pOO.js";import{A as i,B as a,C as o,D as s,E as c,F as l,G as u,H as d,I as f,J as p,K as m,L as h,M as g,N as _,O as v,P as y,Q as b,R as x,S,T as C,U as ee,V as w,W as te,X as ne,Y as re,Z as ie,_ as ae,a as oe,b as se,c as E,d as D,f as O,g as k,h as ce,i as le,j as ue,k as de,m as fe,n as A,p as pe,q as me,r as j,s as he,t as M,u as ge,v as _e,w as ve,x as ye,y as be,z as xe}from"./preload-helper-bztXdkDj.js";var Se=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-w<ee)}function ne(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ce=e(((e,t)=>{t.exports=Se()})),we=e((e=>{var t=Ce(),n=r(),i=b();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function E(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case ee:return`Suspense`;case w:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?E(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return E(e(t))}catch{}}return null}var D=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function A(e,t){ue++,le[ue]=e.current,e.current=t}var pe=de(null),me=de(null),j=de(null),he=de(null);function M(e,t){switch(A(j,t),A(me,e),A(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),A(pe,e)}function ge(){fe(pe),fe(me),fe(j)}function _e(e){e.memoizedState!==null&&A(he,e);var t=pe.current,n=Wd(t,e.type);t!==n&&(A(me,e),A(pe,n))}function ve(e){me.current===e&&(fe(pe),fe(me)),he.current===e&&(fe(he),ep._currentValue=ce)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+ye+e+be}var Se=!1;function we(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -49,4 +49,4 @@ Error generating stack: `+e.message+`
49
49
  `},mu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},hu=function(){V.useEffect(function(){return document.body.setAttribute(fu,(mu()+1).toString()),function(){var e=mu()-1;e<=0?document.body.removeAttribute(fu):document.body.setAttribute(fu,e.toString())}},[])},gu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;hu();var a=V.useMemo(function(){return uu(i)},[i]);return V.createElement(du,{styles:pu(a,!t,i,n?``:`!important`)})},_u=!1;if(typeof window<`u`)try{var vu=Object.defineProperty({},"passive",{get:function(){return _u=!0,!0}});window.addEventListener(`test`,vu,vu),window.removeEventListener(`test`,vu,vu)}catch{_u=!1}var yu=_u?{passive:!1}:!1,bu=function(e){return e.tagName===`TEXTAREA`},xu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!bu(e)&&n[t]===`visible`)},Su=function(e){return xu(e,`overflowY`)},Cu=function(e){return xu(e,`overflowX`)},wu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Du(e,r)){var i=Ou(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Tu=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Eu=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Du=function(e,t){return e===`v`?Su(t):Cu(t)},Ou=function(e,t){return e===`v`?Tu(t):Eu(t)},ku=function(e,t){return e===`h`&&t===`rtl`?-1:1},Au=function(e,t,n,r,i){var a=ku(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ou(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Du(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ju=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mu=function(e){return[e.deltaX,e.deltaY]},Nu=function(e){return e&&`current`in e?e.current:e},Pu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fu=function(e){return`
50
50
  .block-interactivity-${e} {pointer-events: none;}
51
51
  .allow-interactivity-${e} {pointer-events: all;}
52
- `},Iu=0,Lu=[];function Ru(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),i=V.useState(Iu++)[0],a=V.useState(ou)[0],o=V.useRef(e);V.useEffect(function(){o.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=K([e.lockRef.current],(e.shards||[]).map(Nu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=V.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ju(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=wu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=wu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Au(h,t,e,h===`h`?s:c,!0)},[]),c=V.useCallback(function(e){var n=e;if(!(!Lu.length||Lu[Lu.length-1]!==a)){var r=`deltaY`in n?Mu(n):ju(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Pu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Nu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=V.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:zu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=V.useCallback(function(e){n.current=ju(e),r.current=void 0},[]),d=V.useCallback(function(t){l(t.type,Mu(t),t.target,s(t,e.lockRef.current))},[]),f=V.useCallback(function(t){l(t.type,ju(t),t.target,s(t,e.lockRef.current))},[]);V.useEffect(function(){return Lu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,yu),document.addEventListener(`touchmove`,c,yu),document.addEventListener(`touchstart`,u,yu),function(){Lu=Lu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,yu),document.removeEventListener(`touchmove`,c,yu),document.removeEventListener(`touchstart`,u,yu)}},[]);var p=e.removeScrollBar,m=e.inert;return V.createElement(V.Fragment,null,m?V.createElement(a,{styles:Fu(i)}):null,p?V.createElement(gu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Bu=Yl(Xl,Ru),Vu=V.forwardRef(function(e,t){return V.createElement(Ql,Rl({},e,{ref:t,sideCar:Bu}))});Vu.classNames=Ql.classNames;var Hu=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Uu=new WeakMap,Wu=new WeakMap,Gu={},Z=0,Ku=function(e){return e&&(e.host||Ku(e.parentNode))},qu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ku(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ju=function(e,t,n,r){var i=qu(t,Array.isArray(e)?e:[e]);Gu[n]||(Gu[n]=new WeakMap);var a=Gu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Uu.get(e)||0)+1,l=(a.get(e)||0)+1;Uu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Wu.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Z++,function(){o.forEach(function(e){var t=Uu.get(e)-1,i=a.get(e)-1;Uu.set(e,t),a.set(e,i),t||(Wu.has(e)||e.removeAttribute(r),Wu.delete(e)),i||e.removeAttribute(n)}),Z--,Z||(Uu=new WeakMap,Uu=new WeakMap,Wu=new WeakMap,Gu={})}},Yu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Hu(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ju(r,i,n,`aria-hidden`)):function(){return null}};function Xu(e){let[t,n]=V.useState(void 0);return G(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Zu=[`top`,`right`,`bottom`,`left`],Qu=Math.min,$u=Math.max,ed=Math.round,td=Math.floor,nd=e=>({x:e,y:e}),rd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function id(e,t,n){return $u(e,Qu(t,n))}function ad(e,t){return typeof e==`function`?e(t):e}function od(e){return e.split(`-`)[0]}function sd(e){return e.split(`-`)[1]}function cd(e){return e===`x`?`y`:`x`}function ld(e){return e===`y`?`height`:`width`}function ud(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dd(e){return cd(ud(e))}function fd(e,t,n){n===void 0&&(n=!1);let r=sd(e),i=dd(e),a=ld(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Q(o)),[o,Q(o)]}function pd(e){let t=Q(e);return[md(e),t,md(t)]}function md(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hd=[`left`,`right`],gd=[`right`,`left`],_d=[`top`,`bottom`],vd=[`bottom`,`top`];function yd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gd:hd:t?hd:gd;case`left`:case`right`:return t?_d:vd;default:return[]}}function bd(e,t,n,r){let i=sd(e),a=yd(od(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(md)))),a}function Q(e){let t=od(e);return rd[t]+e.slice(t.length)}function xd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:xd(e)}function Cd(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 wd(e,t,n){let{reference:r,floating:i}=e,a=ud(t),o=dd(t),s=ld(o),c=od(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(sd(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Td(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ad(t,e),p=Sd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Cd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Cd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ed=50,Dd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Td},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=wd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ed&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=wd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Od=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ad(e,t)||{};if(l==null)return{};let d=Sd(u),f={x:n,y:r},p=dd(i),m=ld(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let ee=b/2-x/2,w=C/2-h[m]/2-1,te=Qu(d[_],w),ne=Qu(d[v],w),re=te,ie=C-h[m]-ne,ae=C/2-h[m]/2+ee,oe=id(re,ae,ie),se=!c.arrow&&sd(i)!=null&&ae!==oe&&a.reference[m]/2-(ae<re?te:ne)-h[m]/2<0,E=se?ae<re?ae-re:ae-ie:0;return{[p]:f[p]+E,data:{[p]:oe,centerOffset:ae-oe-E,...se&&{alignmentOffset:E}},reset:se}}}),kd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ad(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=od(r),_=ud(o),v=od(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Q(o)]:pd(o)),x=p!==`none`;!d&&x&&b.push(...bd(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],w=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=fd(r,a,y);ee.push(C[e[0]],C[e[1]])}if(w=[...w,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ud(t))||w.every(e=>ud(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=ud(e.placement);return t===_||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ad(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jd(e){return Zu.some(t=>e[t]>=0)}var Md=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ad(e,t);switch(i){case`referenceHidden`:{let e=Ad(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jd(e)}}}case`escaped`:{let e=Ad(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jd(e)}}}default:return{}}}}},Nd=new Set([`left`,`top`]);async function Pd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=od(n),s=sd(n),c=ud(n)===`y`,l=Nd.has(o)?-1:1,u=a&&c?-1:1,d=ad(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Id=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ad(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ud(od(i)),p=cd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=id(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=id(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ld=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ad(e,t),u={x:n,y:r},d=ud(i),f=cd(d),p=u[f],m=u[d],h=ad(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nd.has(od(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ad(e,t),u=await o.detectOverflow(t,l),d=od(i),f=sd(i),p=ud(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Qu(h-u[g],v),x=Qu(m-u[_],y),S=!t.middlewareData.shift,C=b,ee=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ee=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=$u(u.left,0),t=$u(u.right,0),n=$u(u.top,0),r=$u(u.bottom,0);p?ee=m-2*(e!==0||t!==0?e+t:$u(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:$u(u.top,u.bottom))}await c({...t,availableWidth:ee,availableHeight:C});let w=await o.getDimensions(s.floating);return m!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function zd(){return typeof window<`u`}function Bd(e){return Ud(e)?(e.nodeName||``).toLowerCase():`#document`}function Vd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hd(e){return((Ud(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ud(e){return zd()?e instanceof Node||e instanceof Vd(e).Node:!1}function Wd(e){return zd()?e instanceof Element||e instanceof Vd(e).Element:!1}function Gd(e){return zd()?e instanceof HTMLElement||e instanceof Vd(e).HTMLElement:!1}function Kd(e){return!zd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Vd(e).ShadowRoot}function qd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=af(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Jd(e){return/^(table|td|th)$/.test(Bd(e))}function Yd(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Xd=/transform|translate|scale|rotate|perspective|filter/,Zd=/paint|layout|strict|content/,Qd=e=>!!e&&e!==`none`,$d;function ef(e){let t=Wd(e)?af(e):e;return Qd(t.transform)||Qd(t.translate)||Qd(t.scale)||Qd(t.rotate)||Qd(t.perspective)||!nf()&&(Qd(t.backdropFilter)||Qd(t.filter))||Xd.test(t.willChange||``)||Zd.test(t.contain||``)}function tf(e){let t=sf(e);for(;Gd(t)&&!rf(t);){if(ef(t))return t;if(Yd(t))return null;t=sf(t)}return null}function nf(){return $d??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),$d}function rf(e){return/^(html|body|#document)$/.test(Bd(e))}function af(e){return Vd(e).getComputedStyle(e)}function of(e){return Wd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sf(e){if(Bd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Kd(e)&&e.host||Hd(e);return Kd(t)?t.host:t}function cf(e){let t=sf(e);return rf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gd(t)&&qd(t)?t:cf(t)}function lf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cf(e),i=r===e.ownerDocument?.body,a=Vd(r);if(i){let e=uf(a);return t.concat(a,a.visualViewport||[],qd(r)?r:[],e&&n?lf(e):[])}else return t.concat(r,lf(r,[],n))}function uf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function df(e){let t=af(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Gd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ed(n)!==a||ed(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ff(e){return Wd(e)?e:e.contextElement}function pf(e){let t=ff(e);if(!Gd(t))return nd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=df(t),o=(a?ed(n.width):n.width)/r,s=(a?ed(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var mf=nd(0);function hf(e){let t=Vd(e);return!nf()||!t.visualViewport?mf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vd(e)?!1:t}function _f(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ff(e),o=nd(1);t&&(r?Wd(r)&&(o=pf(r)):o=pf(e));let s=gf(a,n,r)?hf(a):nd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Vd(a),t=r&&Wd(r)?Vd(r):r,n=e,i=uf(n);for(;i&&r&&t!==n;){let e=pf(i),t=i.getBoundingClientRect(),r=af(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Vd(i),i=uf(n)}}return Cd({width:u,height:d,x:c,y:l})}function vf(e,t){let n=of(e).scrollLeft;return t?t.left+n:_f(Hd(e)).left+n}function yf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vf(e,n),y:n.top+t.scrollTop}}function bf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Hd(r),s=t?Yd(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=nd(1),u=nd(0),d=Gd(r);if((d||!d&&!a)&&((Bd(r)!==`body`||qd(o))&&(c=of(r)),d)){let e=_f(r);l=pf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yf(o,c):nd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function xf(e){return Array.from(e.getClientRects())}function Sf(e){let t=Hd(e),n=of(e),r=e.ownerDocument.body,i=$u(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$u(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+vf(e),s=-n.scrollTop;return af(r).direction===`rtl`&&(o+=$u(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Cf=25;function wf(e,t){let n=Vd(e),r=Hd(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=nf();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Cf&&(a-=o)}else l<=Cf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Tf(e,t){let n=_f(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Gd(e)?pf(e):nd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ef(e,t,n){let r;if(t===`viewport`)r=wf(e,n);else if(t===`document`)r=Sf(Hd(e));else if(Wd(t))r=Tf(t,n);else{let n=hf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Cd(r)}function Df(e,t){let n=sf(e);return n===t||!Wd(n)||rf(n)?!1:af(n).position===`fixed`||Df(n,t)}function Of(e,t){let n=t.get(e);if(n)return n;let r=lf(e,[],!1).filter(e=>Wd(e)&&Bd(e)!==`body`),i=null,a=af(e).position===`fixed`,o=a?sf(e):e;for(;Wd(o)&&!rf(o);){let t=af(o),n=ef(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||qd(o)&&!n&&Df(e,o))?r=r.filter(e=>e!==o):i=t,o=sf(o)}return t.set(e,r),r}function kf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Yd(t)?[]:Of(t,this._c):[].concat(n),r],o=Ef(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ef(t,a[e],i);s=$u(n.top,s),c=Qu(n.right,c),l=Qu(n.bottom,l),u=$u(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Af(e){let{width:t,height:n}=df(e);return{width:t,height:n}}function jf(e,t,n){let r=Gd(t),i=Hd(t),a=n===`fixed`,o=_f(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=nd(0);function l(){c.x=vf(i)}if(r||!r&&!a)if((Bd(t)!==`body`||qd(i))&&(s=of(t)),r){let e=_f(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?yf(i,s):nd(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Mf(e){return af(e).position===`static`}function Nf(e,t){if(!Gd(e)||af(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Hd(e)===n&&(n=n.ownerDocument.body),n}function Pf(e,t){let n=Vd(e);if(Yd(e))return n;if(!Gd(e)){let t=sf(e);for(;t&&!rf(t);){if(Wd(t)&&!Mf(t))return t;t=sf(t)}return n}let r=Nf(e,t);for(;r&&Jd(r)&&Mf(r);)r=Nf(r,t);return r&&rf(r)&&Mf(r)&&!ef(r)?n:r||tf(e)||n}var Ff=async function(e){let t=this.getOffsetParent||Pf,n=this.getDimensions,r=await n(e.floating);return{reference:jf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function If(e){return af(e).direction===`rtl`}var Lf={convertOffsetParentRelativeRectToViewportRelativeRect:bf,getDocumentElement:Hd,getClippingRect:kf,getOffsetParent:Pf,getElementRects:Ff,getClientRects:xf,getDimensions:Af,getScale:pf,isElement:Wd,isRTL:If};function Rf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zf(e,t){let n=null,r,i=Hd(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=td(d),h=td(i.clientWidth-(u+f)),g=td(i.clientHeight-(d+p)),_=td(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:$u(0,Qu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Rf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Bf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ff(e),u=i||a?[...l?lf(l):[],...t?lf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?zf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?_f(e):null;c&&g();function g(){let t=_f(e);h&&!Rf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Vf=Fd,Hf=Id,Uf=kd,Wf=Rd,Gf=Md,Kf=Od,qf=Ld,Jf=(e,t,n)=>{let r=new Map,i={platform:Lf,...n},a={...i.platform,_c:r};return Dd(e,t,{...i,platform:a})},Yf=typeof document<`u`?V.useLayoutEffect:function(){};function Xf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Xf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Zf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qf(e,t){let n=Zf(e);return Math.round(t*n)/n}function $f(e){let t=V.useRef(e);return Yf(()=>{t.current=e}),t}function ep(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=V.useState(r);Xf(f,r)||p(r);let[m,h]=V.useState(null),[g,_]=V.useState(null),v=V.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=V.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=V.useRef(null),C=V.useRef(null),ee=V.useRef(u),w=c!=null,te=$f(c),ne=$f(i),re=$f(l),ie=V.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),Jf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ae.current&&!Xf(ee.current,t)&&(ee.current=t,Mc.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);Yf(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ae=V.useRef(!1);Yf(()=>(ae.current=!0,()=>{ae.current=!1}),[]),Yf(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(te.current)return te.current(b,x,ie);ie()}},[b,x,ie,te,w]);let oe=V.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),se=V.useMemo(()=>({reference:b,floating:x}),[b,x]),E=V.useMemo(()=>{let e={position:n,left:0,top:0};if(!se.floating)return e;let t=Qf(se.floating,u.x),r=Qf(se.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Zf(se.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,se.floating,u.x,u.y]);return V.useMemo(()=>({...u,update:ie,refs:oe,elements:se,floatingStyles:E}),[u,ie,oe,se,E])}var tp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Kf({element:r.current,padding:i}).fn(n):r?Kf({element:r,padding:i}).fn(n):{}}}},np=(e,t)=>{let n=Vf(e);return{name:n.name,fn:n.fn,options:[e,t]}},rp=(e,t)=>{let n=Hf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>({fn:qf(e).fn,options:[e,t]}),ap=(e,t)=>{let n=Uf(e);return{name:n.name,fn:n.fn,options:[e,t]}},op=(e,t)=>{let n=Wf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp=(e,t)=>{let n=Gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp=(e,t)=>{let n=tp(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=`Arrow`,up=V.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(Nc.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});up.displayName=lp;var dp=up,fp=`Popper`,[pp,mp]=Fc(fp),[hp,gp]=pp(fp),_p=e=>{let{__scopePopper:t,children:n}=e,[r,i]=V.useState(null),[a,o]=V.useState(void 0);return(0,H.jsx)(hp,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};_p.displayName=fp;var vp=`PopperAnchor`,yp=V.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=gp(vp,n),o=V.useRef(null),s=a.onAnchorChange,c=vc(t,V.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=V.useRef(null);V.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&kp(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(Nc.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});yp.displayName=vp;var bp=`PopperContent`,[xp,Sp]=pp(bp),Cp=V.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=gp(bp,n),[_,v]=V.useState(null),y=vc(t,e=>v(e)),[b,x]=V.useState(null),S=Xu(b),C=S?.width??0,ee=S?.height??0,w=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ne=Array.isArray(l)?l:[l],re=ne.length>0,ie={padding:te,boundary:ne.filter(Dp),altBoundary:re},{refs:ae,floatingStyles:oe,placement:se,isPositioned:E,middlewareData:D}=ep({strategy:`fixed`,placement:w,whileElementsMounted:(...e)=>Bf(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[np({mainAxis:i+ee,alignmentAxis:o}),c&&rp({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?ip():void 0,...ie}),c&&ap({...ie}),op({...ie,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&cp({element:b,padding:s}),Op({arrowWidth:C,arrowHeight:ee}),f&&sp({strategy:`referenceHidden`,...ie,boundary:re?ie.boundary:void 0})]}),O=g.setPlacementState;G(()=>(O(se),()=>{O(void 0)}),[se,O]);let[k,ce]=kp(se),le=el(m);G(()=>{E&&le?.()},[E,le]);let ue=D.arrow?.x,de=D.arrow?.y,fe=D.arrow?.centerOffset!==0,[A,pe]=V.useState();return G(()=>{_&&pe(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...oe,transform:E?oe.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:A,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(` `),...D.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(xp,{scope:n,placedSide:k,placedAlign:ce,onArrowChange:x,arrowX:ue,arrowY:de,shouldHideArrow:fe,children:(0,H.jsx)(Nc.div,{"data-side":k,"data-align":ce,...h,ref:y,style:{...h.style,animation:E?void 0:`none`}})})})});Cp.displayName=bp;var wp=`PopperArrow`,Tp={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ep=V.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Sp(wp,n),a=Tp[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(dp,{...r,ref:t,style:{...r.style,display:`block`}})})});Ep.displayName=wp;function Dp(e){return e!==null}var Op=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=kp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function kp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ap=_p,jp=yp,Mp=Cp,Np=Ep,Pp=`rovingFocusGroup.onEntryFocus`,Fp={bubbles:!1,cancelable:!0},Ip=`RovingFocusGroup`,[Lp,Rp,zp]=Lc(Ip),[Bp,Vp]=Fc(Ip,[zp]),[Hp,Up]=Bp(Ip),Wp=V.forwardRef((e,t)=>(0,H.jsx)(Lp.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Lp.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Gp,{...e,ref:t})})}));Wp.displayName=Ip;var Gp=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=V.useRef(null),p=vc(t,f),m=$c(a),[h,g]=zc({prop:o,defaultProp:s??null,onChange:c,caller:Ip}),[_,v]=V.useState(!1),y=el(l),b=Rp(n),x=V.useRef(!1),[S,C]=V.useState(0);return V.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Pp,y),()=>e.removeEventListener(Pp,y)},[y]),(0,H.jsx)(Hp,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:V.useCallback(e=>g(e),[g]),onItemShiftTab:V.useCallback(()=>v(!0),[]),onFocusableItemAdd:V.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:V.useCallback(()=>C(e=>e-1),[]),children:(0,H.jsx)(Nc.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:W(e.onMouseDown,()=>{x.current=!0}),onFocus:W(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Pp,Fp);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Zp([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:W(e.onBlur,()=>v(!1))})})}),Kp=`RovingFocusGroupItem`,qp=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Zc(),l=a||c,u=Up(Kp,n),d=u.currentTabStopId===l,f=Rp(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return V.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,H.jsx)(Lp.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(Nc.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:W(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Xp(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Qp(n,r+1):n.slice(r+1)}setTimeout(()=>Zp(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});qp.displayName=Kp;var Jp={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Yp(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Xp(e,t,n){let r=Yp(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Jp[r]}function Zp(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Qp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $p=Wp,em=qp,tm=[`Enter`,` `],nm=[`ArrowDown`,`PageUp`,`Home`],rm=[`ArrowUp`,`PageDown`,`End`],im=[...nm,...rm],am={ltr:[...tm,`ArrowRight`],rtl:[...tm,`ArrowLeft`]},om={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},sm=`Menu`,[cm,lm,um]=Lc(sm),[dm,fm]=Fc(sm,[um,mp,Vp]),pm=mp(),mm=Vp(),[hm,gm]=dm(sm),[_m,vm]=dm(sm),ym=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=pm(t),[c,l]=V.useState(null),u=V.useRef(!1),d=el(a),f=$c(i);return V.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),V.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(Ap,{...s,children:(0,H.jsx)(hm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(_m,{scope:t,onClose:V.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ym.displayName=sm;var bm=`MenuAnchor`,xm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=pm(n);return(0,H.jsx)(jp,{...i,...r,ref:t})});xm.displayName=bm;var Sm=`MenuPortal`,[Cm,wm]=dm(Sm,{forceMount:void 0}),Tm=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=gm(Sm,t);return(0,H.jsx)(Cm,{scope:t,forceMount:n,children:(0,H.jsx)(Uc,{present:n||a.open,children:(0,H.jsx)(Nl,{asChild:!0,container:i,children:r})})})};Tm.displayName=Sm;var Em=`MenuContent`,[Dm,Om]=dm(Em),km=V.forwardRef((e,t)=>{let n=wm(Em,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=gm(Em,e.__scopeMenu),o=vm(Em,e.__scopeMenu);return(0,H.jsx)(cm.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Uc,{present:r||a.open,children:(0,H.jsx)(cm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(Am,{...i,ref:t}):(0,H.jsx)(jm,{...i,ref:t})})})})}),Am=V.forwardRef((e,t)=>{let n=gm(Em,e.__scopeMenu),r=V.useRef(null),i=vc(t,r);return V.useEffect(()=>{let e=r.current;if(e)return Yu(e)},[]),(0,H.jsx)(Nm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jm=V.forwardRef((e,t)=>{let n=gm(Em,e.__scopeMenu);return(0,H.jsx)(Nm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mm=yc(`MenuContent.ScrollLock`),Nm=V.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=gm(Em,n),_=vm(Em,n),v=pm(n),y=mm(n),b=lm(n),[x,S]=V.useState(null),C=V.useRef(null),ee=vc(t,C,g.onContentChange),w=V.useRef(0),te=V.useRef(``),ne=V.useRef(0),re=V.useRef(null),ie=V.useRef(`right`),ae=V.useRef(0),oe=m?Vu:V.Fragment,se=m?{as:Mm,allowPinchZoom:!0}:void 0,E=e=>{let t=te.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=_h(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){te.current=t,window.clearTimeout(w.current),t!==``&&(w.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};V.useEffect(()=>()=>window.clearTimeout(w.current),[]),Il();let D=V.useCallback(e=>ie.current===re.current?.side&&yh(e,re.current?.area),[]);return(0,H.jsx)(Dm,{scope:n,searchRef:te,onItemEnter:V.useCallback(e=>{D(e)&&e.preventDefault()},[D]),onItemLeave:V.useCallback(e=>{D(e)||(C.current?.focus(),S(null))},[D]),onTriggerLeave:V.useCallback(e=>{D(e)&&e.preventDefault()},[D]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:V.useCallback(e=>{re.current=e},[]),children:(0,H.jsx)(oe,{...se,children:(0,H.jsx)(bl,{asChild:!0,trapped:i,onMountAutoFocus:W(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(cl,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)($p,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:W(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(Mp,{role:`menu`,"aria-orientation":`vertical`,"data-state":fh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:W(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&E(e.key));let i=C.current;if(e.target!==i||!im.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);rm.includes(e.key)&&a.reverse(),hh(a)}),onBlur:W(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(w.current),te.current=``)}),onPointerMove:W(e.onPointerMove,bh(e=>{let t=e.target,n=ae.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ie.current=e.clientX>ae.current?`right`:`left`,ae.current=e.clientX)}))})})})})})})});km.displayName=Em;var Pm=`MenuGroup`,Fm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{role:`group`,...r,ref:t})});Fm.displayName=Pm;var Im=`MenuLabel`,Lm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{...r,ref:t})});Lm.displayName=Im;var Rm=`MenuItem`,zm=`menu.itemSelect`,Bm=V.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=V.useRef(null),o=vm(Rm,e.__scopeMenu),s=Om(Rm,e.__scopeMenu),c=vc(t,a),l=V.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(zm,{bubbles:!0,cancelable:!0});e.addEventListener(zm,e=>r?.(e),{once:!0}),Pc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,H.jsx)(Vm,{...i,ref:c,disabled:n,onClick:W(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:W(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:W(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||tm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Bm.displayName=Rm;var Vm=V.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Om(Rm,n),s=mm(n),c=V.useRef(null),l=vc(t,c),[u,d]=V.useState(!1),[f,p]=V.useState(``);return V.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(cm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(em,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(Nc.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:W(e.onPointerMove,bh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,bh(e=>o.onItemLeave(e))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),Hm=`MenuCheckboxItem`,Um=V.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(Zm,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(Bm,{role:`menuitemcheckbox`,"aria-checked":ph(n)?`mixed`:n,...i,ref:t,"data-state":mh(n),onSelect:W(i.onSelect,()=>r?.(ph(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Um.displayName=Hm;var Wm=`MenuRadioGroup`,[Gm,Km]=dm(Wm,{value:void 0,onValueChange:()=>{}}),qm=V.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=el(r);return(0,H.jsx)(Gm,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,H.jsx)(Fm,{...i,ref:t})})});qm.displayName=Wm;var Jm=`MenuRadioItem`,Ym=V.forwardRef((e,t)=>{let{value:n,...r}=e,i=Km(Jm,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(Zm,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(Bm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":mh(a),onSelect:W(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ym.displayName=Jm;var Xm=`MenuItemIndicator`,[Zm,Qm]=dm(Xm,{checked:!1}),$m=V.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Qm(Xm,n);return(0,H.jsx)(Uc,{present:r||ph(a.checked)||a.checked===!0,children:(0,H.jsx)(Nc.span,{...i,ref:t,"data-state":mh(a.checked)})})});$m.displayName=Xm;var eh=`MenuSeparator`,th=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});th.displayName=eh;var nh=`MenuArrow`,rh=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=pm(n);return(0,H.jsx)(Np,{...i,...r,ref:t})});rh.displayName=nh;var ih=`MenuSub`,[ah,oh]=dm(ih),sh=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=gm(ih,t),o=pm(t),[s,c]=V.useState(null),[l,u]=V.useState(null),d=el(i);return V.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,H.jsx)(Ap,{...o,children:(0,H.jsx)(hm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,H.jsx)(ah,{scope:t,contentId:Zc(),triggerId:Zc(),trigger:s,onTriggerChange:c,children:n})})})};sh.displayName=ih;var ch=`MenuSubTrigger`,lh=V.forwardRef((e,t)=>{let n=gm(ch,e.__scopeMenu),r=vm(ch,e.__scopeMenu),i=oh(ch,e.__scopeMenu),a=Om(ch,e.__scopeMenu),o=V.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=V.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return V.useEffect(()=>u,[u]),V.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,H.jsx)(xm,{asChild:!0,...l,children:(0,H.jsx)(Vm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":fh(n.open),...e,ref:_c(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,bh(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:W(e.onPointerLeave,bh(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||am[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});lh.displayName=ch;var uh=`MenuSubContent`,dh=V.forwardRef((e,t)=>{let n=wm(Em,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=gm(Em,e.__scopeMenu),s=vm(Em,e.__scopeMenu),c=oh(uh,e.__scopeMenu),l=V.useRef(null),u=vc(t,l);return(0,H.jsx)(cm.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Uc,{present:r||o.open,children:(0,H.jsx)(cm.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(Nm,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:W(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:W(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=om[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});dh.displayName=uh;function fh(e){return e?`open`:`closed`}function ph(e){return e===`indeterminate`}function mh(e){return ph(e)?`indeterminate`:e?`checked`:`unchecked`}function hh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _h(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=gh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function vh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function yh(e,t){return t?vh({x:e.clientX,y:e.clientY},t):!1}function bh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var xh=ym,Sh=xm,Ch=Tm,wh=km,Th=Fm,Eh=Lm,Dh=Bm,Oh=Um,kh=qm,Ah=Ym,jh=$m,Mh=th,Nh=rh,Ph=lh,Fh=dh,Ih=`DropdownMenu`,[Lh,Rh]=Fc(Ih,[fm]),zh=fm(),[Bh,Vh]=Lh(Ih),Hh=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=zh(t),l=V.useRef(null),[u,d]=zc({prop:i,defaultProp:a??!1,onChange:o,caller:Ih});return(0,H.jsx)(Bh,{scope:t,triggerId:Zc(),triggerRef:l,contentId:Zc(),open:u,onOpenChange:d,onOpenToggle:V.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(xh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Hh.displayName=Ih;var Uh=`DropdownMenuTrigger`,Wh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Vh(Uh,n),o=zh(n);return(0,H.jsx)(Sh,{asChild:!0,...o,children:(0,H.jsx)(Nc.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:_c(t,a.triggerRef),onPointerDown:W(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:W(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Wh.displayName=Uh;var Gh=`DropdownMenuPortal`,Kh=e=>{let{__scopeDropdownMenu:t,...n}=e,r=zh(t);return(0,H.jsx)(Ch,{...r,...n})};Kh.displayName=Gh;var qh=`DropdownMenuContent`,Jh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Vh(qh,n),a=zh(n),o=V.useRef(!1);return(0,H.jsx)(wh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:W(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Jh.displayName=qh;var Yh=`DropdownMenuGroup`,Xh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Th,{...i,...r,ref:t})});Xh.displayName=Yh;var Zh=`DropdownMenuLabel`,Qh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Eh,{...i,...r,ref:t})});Qh.displayName=Zh;var $h=`DropdownMenuItem`,eg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Dh,{...i,...r,ref:t})});eg.displayName=$h;var tg=`DropdownMenuCheckboxItem`,ng=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Oh,{...i,...r,ref:t})});ng.displayName=tg;var rg=`DropdownMenuRadioGroup`,ig=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(kh,{...i,...r,ref:t})});ig.displayName=rg;var ag=`DropdownMenuRadioItem`,og=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Ah,{...i,...r,ref:t})});og.displayName=ag;var sg=`DropdownMenuItemIndicator`,cg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(jh,{...i,...r,ref:t})});cg.displayName=sg;var lg=`DropdownMenuSeparator`,ug=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Mh,{...i,...r,ref:t})});ug.displayName=lg;var dg=`DropdownMenuArrow`,fg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Nh,{...i,...r,ref:t})});fg.displayName=dg;var pg=`DropdownMenuSubTrigger`,mg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Ph,{...i,...r,ref:t})});mg.displayName=pg;var hg=`DropdownMenuSubContent`,gg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Fh,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gg.displayName=hg;var _g=Hh,vg=Wh,yg=Kh,bg=Jh,xg=Qh,Sg=eg,Cg=`baziu-theme`,wg={system:lc,light:mc,dark:uc},Tg={system:`light`,light:`dark`,dark:`system`};function Eg(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(Cg);return e===`light`||e===`dark`||e===`system`?e:`system`}function Dg(e){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=e===`dark`||e===`system`&&t;document.documentElement.classList.toggle(`dark`,n)}function Og(){let[e,t]=(0,V.useState)(`system`);(0,V.useEffect)(()=>{t(Eg())},[]),(0,V.useEffect)(()=>{if(e!==`system`)return;let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Dg(`system`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]);let n=()=>{let n=Tg[e];t(n),window.localStorage.setItem(Cg,n),Dg(n)},r=wg[e],i=`Theme: ${e}. Switch to ${Tg[e]}.`;return(0,H.jsxs)(`button`,{type:`button`,onClick:n,className:`unstyled inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-frost bg-ivory px-2.5 text-mocha shadow-baziu-sm transition-all hover:border-sapphire-light hover:bg-sapphire-glow hover:text-sapphire active:translate-y-px`,title:i,"aria-label":i,children:[(0,H.jsx)(r,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`hidden text-xs font-medium capitalize xl:inline`,children:e})]})}var kg=[{to:`/`,label:`Chat`,icon:cc},{to:`/agents`,label:`Agents`,icon:ic},{to:`/teams`,label:`Teams`,icon:hc}],Ag=[{href:`/approvals`,label:`Approvals`,description:`Decide whether one captured action may proceed.`,icon:fc},{href:`/attention`,label:`Attention`,description:`Inspect failures, warnings, lessons, and open signals.`,icon:rc}],jg=[{href:`/templates`,label:`Templates`,description:`Reusable Agent behavior and Team rosters.`,icon:oc},{href:`/skills`,label:`Skills`,description:`Prompt skills available to your agents.`,icon:pc},{href:`/config`,label:`Setup`,description:`Providers, integrations, access, and services.`,icon:dc}];function Mg(){let e=Cs({select:e=>e.location.pathname}),[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(e===`/login`||e===`/welcome`)return;let t=new AbortController;return fetch(`/api/attention/summary`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>n(e)).catch(e=>{e instanceof DOMException&&e.name}),()=>t.abort()},[e]);async function a(){i(null);try{let e=await fetch(`/api/logout`,{method:`POST`});if(!e.ok)throw Error(`Log out failed (${e.status})`);window.location.assign(`/login`)}catch(e){i(e instanceof Error?e.message:String(e))}}return(0,H.jsxs)(`nav`,{"aria-label":`Primary navigation`,className:`relative mx-auto grid w-full max-w-[1500px] shrink-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2 border-b border-frost py-3 md:flex md:gap-2 md:py-4`,children:[(0,H.jsxs)(oe,{to:`/`,"aria-label":`Bazilion home`,className:`logo team flex min-w-0 items-center gap-2 rounded-lg text-charcoal transition-opacity hover:text-charcoal hover:opacity-80`,children:[(0,H.jsx)(Ws,{className:`logo-paw h-8 w-8 shrink-0 transition-transform duration-300 team-hover:rotate-[-8deg] team-hover:scale-[1.08]`}),(0,H.jsx)(`span`,{className:`truncate font-display text-[1.35rem] tracking-[-0.02em]`,children:`bazilion`})]}),(0,H.jsxs)(`div`,{className:`col-span-2 row-start-2 flex min-w-0 items-center gap-1 overflow-x-auto pb-0.5 md:col-auto md:row-auto md:ml-4 md:flex-1 md:overflow-visible md:pb-0`,children:[kg.map(t=>{let n=t.to===`/`?e===`/`:e===t.to||e.startsWith(`${t.to}/`),r=t.icon;return(0,H.jsxs)(oe,{to:t.to,"aria-current":n?`page`:void 0,className:Fg(n),children:[(0,H.jsx)(r,{className:`hidden size-4 shrink-0 sm:block`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:t.label})]},t.to)}),(0,H.jsx)(Ng,{label:`Operations`,compactLabel:`Ops`,icon:rc,links:Ag,pathname:e,badge:t?.openTotal??0,itemBadges:{"/approvals":t?.byKind.communication_approval??0,"/attention":t?.openTotal??0}}),(0,H.jsx)(Ng,{label:`Manage`,icon:dc,links:jg,pathname:e,align:`end`})]}),(0,H.jsxs)(`div`,{className:`col-start-2 row-start-1 flex items-center gap-1 md:col-auto md:row-auto md:ml-auto`,children:[(0,H.jsx)(Og,{}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void a(),"aria-label":`Log out`,title:`Log out`,className:`unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire`,children:(0,H.jsx)(sc,{className:`h-4 w-4`,"aria-hidden":`true`})})]}),r&&(0,H.jsx)(`p`,{role:`alert`,className:`col-span-2 m-0 rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger md:absolute md:right-0 md:top-[calc(100%+0.35rem)] md:z-50 md:shadow-baziu-md`,children:r})]})}function Ng({label:e,compactLabel:t,icon:n,links:r,pathname:i,badge:a=0,itemBadges:o={},align:s=`start`}){let c=r.some(e=>i===e.href||i.startsWith(`${e.href}/`));return(0,H.jsxs)(_g,{children:[(0,H.jsx)(vg,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:Fg(c),"aria-label":`${e} menu`,children:[(0,H.jsx)(n,{className:`hidden size-4 shrink-0 sm:block`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:t?`sm:hidden`:void 0,children:t??e}),t&&(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:e}),a>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-danger sm:hidden`,"aria-label":`${a} open items`}),(0,H.jsx)(`span`,{className:`hidden sm:inline-flex`,children:(0,H.jsx)(Pg,{value:a,label:`${a} open items`})})]}),(0,H.jsx)(ac,{className:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})]})}),(0,H.jsx)(yg,{children:(0,H.jsxs)(bg,{align:s,sideOffset:8,collisionPadding:12,className:`z-50 w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,children:[(0,H.jsx)(xg,{className:`px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground`,children:e}),r.map(e=>{let t=e.icon,n=i===e.href||i.startsWith(`${e.href}/`);return(0,H.jsx)(Sg,{asChild:!0,children:(0,H.jsxs)(`a`,{href:e.href,"aria-current":n?`page`:void 0,className:`flex cursor-pointer items-start gap-3 rounded-lg px-2.5 py-2.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground ${n?`bg-accent/70 text-accent-foreground`:`text-foreground`}`,children:[(0,H.jsx)(`span`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,H.jsx)(t,{className:`size-3.5`,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[e.label,(o[e.href]??0)>0&&(0,H.jsx)(Pg,{value:o[e.href]??0,label:`${o[e.href]} open ${e.label.toLowerCase()} items`})]}),(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:e.description})]})]})},e.href)})]})})]})}function Pg({value:e,label:t}){return(0,H.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full bg-danger px-1.5 py-0.5 text-xs font-semibold leading-4 text-primary-foreground`,"aria-label":t,children:e>99?`99+`:e})}function Fg(e){return`unstyled inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-sm font-semibold transition-colors sm:px-2.5 ${e?`border-sapphire-light bg-sapphire-glow text-sapphire shadow-baziu-sm`:`border-transparent text-mocha hover:border-frost hover:bg-ivory hover:text-sapphire`}`}var Ig=U({method:`GET`}).handler(B(`a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2`)),Lg=new Set([`/login`]),Rg=[`/welcome`,`/config`];function zg(e){for(let t of Rg)if(e===t||e.startsWith(`${t}/`))return!0;return!1}function Bg(e){let t=`${encodeURIComponent(e)}=`;for(let e of document.cookie.split(`;`)){let n=e.trim();if(n.startsWith(t))return decodeURIComponent(n.slice(t.length))}return null}function Vg(){if(typeof window>`u`)return;let e=`__bazilionCsrfFetchInstalled`,t=window;if(t[e])return;t[e]=!0;let n=window.fetch.bind(window);window.fetch=(e,t)=>{let r=e instanceof Request?e:null,i=(t?.method??r?.method??`GET`).toUpperCase();if(new URL(r?.url??String(e),window.location.href).origin!==window.location.origin||[`GET`,`HEAD`,`OPTIONS`].includes(i))return n(e,t);let a=Bg(`__Host-bz_csrf`)??Bg(`bz_csrf_dev`);if(!a)return n(e,t);let o=new Headers(r?.headers??void 0);for(let[e,n]of new Headers(t?.headers))o.set(e,n);return o.set(`x-bazilion-csrf`,a),n(e,{...t,headers:o})}}var Hg=`/assets/styles-B5vcgXln.css`,Ug=`(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;Vg();var $=le({beforeLoad:async({location:e})=>{let t=e.pathname;if(Lg.has(t)||t.startsWith(`/api/`))return;let n=await Ig();if(!n.authed)throw se({to:`/login`,search:{}});if(!zg(t)&&!n.setupComplete)throw se({to:`/welcome`})},head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`bazilion`}],links:[{rel:`icon`,type:`image/svg+xml`,href:`/baziu.svg`},{rel:`stylesheet`,href:Hg}]}),component:Gg,notFoundComponent:Wg});function Wg(){let e=Cs({select:e=>e.location.pathname});return(0,H.jsx)(`div`,{className:`mx-auto max-w-2xl`,children:(0,H.jsxs)(`div`,{className:`card`,children:[(0,H.jsx)(`h1`,{children:`Not found`}),(0,H.jsxs)(`p`,{className:`muted my-3`,children:[`Nothing lives at `,(0,H.jsx)(`code`,{children:e}),`.`]}),(0,H.jsx)(oe,{to:`/`,children:`Back to home`})]})})}function Gg(){let e=Cs({select:e=>e.location.pathname}),t=e===`/login`,n=e===`/`;return(0,H.jsxs)(`html`,{lang:`en`,"data-layout":n?`workspace`:`page`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(`script`,{dangerouslySetInnerHTML:{__html:Ug}}),(0,H.jsx)(Os,{})]}),(0,H.jsxs)(`body`,{"data-layout":n?`workspace`:`page`,children:[!t&&(0,H.jsx)(`a`,{href:`#main-content`,className:`sr-only z-[100] rounded-lg bg-primary px-4 py-2 font-semibold text-primary-foreground focus:not-sr-only focus:fixed focus:left-3 focus:top-3`,children:`Skip to main content`}),t?(0,H.jsx)(ms,{}):n?(0,H.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,H.jsx)(`div`,{className:`px-3 sm:px-5`,children:(0,H.jsx)(Mg,{})}),(0,H.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-hidden px-3 pb-3 sm:px-5 sm:pb-5`,children:(0,H.jsx)(ms,{})})]}):(0,H.jsxs)(`div`,{className:`flex min-h-dvh flex-col`,children:[(0,H.jsx)(`div`,{className:`px-3 sm:px-5`,children:(0,H.jsx)(Mg,{})}),(0,H.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`mx-auto w-full max-w-[1500px] flex-1 px-4 py-9 sm:px-6 sm:py-12`,children:(0,H.jsx)(ms,{})}),(0,H.jsx)(`div`,{className:`px-4 sm:px-6`,children:(0,H.jsx)(Ks,{})})]}),(0,H.jsx)(ks,{})]})]})}var Kg=j(`/welcome`)({beforeLoad:async()=>{if((await Ig()).setupComplete)throw se({to:`/`})},component:A(()=>M(()=>import(`./welcome-DlhNXUIa.js`),__vite__mapDeps([0,1,2,3])),`component`)}),qg=j(`/login`)({validateSearch:e=>({error:e.error===`token`||e.error===`origin`?e.error:void 0}),component:A(()=>M(()=>import(`./login-D4n3AcBR.js`),__vite__mapDeps([4,1])),`component`)}),Jg=()=>M(()=>import(`./routes-B9CuhzUW.js`),__vite__mapDeps([5,1,6,7,8,9,10,3,11,12])),Yg=U({method:`POST`}).handler(B(`26dbbcbe40063e8aedfd343cf1dfd4dfe5589f24591c0ba35e80c611d7c57c7c`)),Xg=j(`/`)({validateSearch:e=>({agent:typeof e.agent==`string`?e.agent:void 0}),loaderDeps:({search:e})=>({agentId:e.agent}),loader:({deps:e})=>Yg({data:{agentId:e.agentId}}),component:A(Jg,`component`)}),Zg=j(`/templates/`)({beforeLoad:()=>{throw se({to:`/templates/agents`})}}),Qg=()=>M(()=>import(`./teams-CSNyLz3l.js`),__vite__mapDeps([13,1,14,8])),$g=()=>M(()=>import(`./teams-DdawcfNR.js`),__vite__mapDeps([15,1,6,7,8,10,2,3])),e_=U({method:`GET`}).handler(B(`1ab05a58944792f34ad279deeaa56f70e9360687856b18327f335b022e8d21a5`)),t_=j(`/teams/`)({loader:()=>e_(),component:A($g,`component`),errorComponent:A(Qg,`errorComponent`)}),n_=()=>M(()=>import(`./skills-DQo7ioW7.js`),__vite__mapDeps([16,1,6,7,8,10,2,3])),r_=U({method:`GET`}).handler(B(`ae1d30575b229c1e2622fbaf2252800a9a7acc84afdd68cba025ca890b8d52c5`)),i_=j(`/skills/`)({loader:()=>r_(),component:A(n_,`component`)}),a_=()=>M(()=>import(`./config-DF9Gqmfa.js`),__vite__mapDeps([17,1,6,7,8,18,2,3,19,10,20,11])),o_=U({method:`GET`}).handler(B(`b18a227687dba45b99ea5a2ac7a5bf8efcd9bc54387bc279cd87510fd2f83f7e`)),s_=j(`/config/`)({loader:()=>o_(),component:A(a_,`component`)}),c_=()=>M(()=>import(`./attention-Gavt2yEp.js`),__vite__mapDeps([21,1,14,8])),l_=()=>M(()=>import(`./attention-PYwRM2wC.js`),__vite__mapDeps([22,1,6,7,8,2,3])),u_=U({method:`GET`}).handler(B(`883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a`)),d_=j(`/attention/`)({loader:()=>u_(),component:A(l_,`component`),errorComponent:A(c_,`errorComponent`)}),f_=()=>M(()=>import(`./approvals-DGi0PSx8.js`),__vite__mapDeps([23,1,14,8])),p_=()=>M(()=>import(`./approvals-Cke_mrJv.js`),__vite__mapDeps([24,1,8,2,3,7])),m_=U({method:`GET`}).handler(B(`816fcbc7b3c7f2952660d3a2c8f49bb0c91084627a284c185b333b1d418fadf8`)),h_=j(`/approvals/`)({loader:()=>m_(),component:A(p_,`component`),errorComponent:A(f_,`errorComponent`)}),g_=()=>M(()=>import(`./agents-D-JGXVg9.js`),__vite__mapDeps([25,1,6,7,26,8,10,2,3])),__=U({method:`POST`}).handler(B(`f715bab0037380aa3db7e237e7cf1e74168c363f48a960bb1ddfa5560de3a74e`)),v_=j(`/agents/`)({validateSearch:e=>({all:e.all===`1`?`1`:void 0}),loaderDeps:({search:e})=>({all:e.all===`1`}),loader:({deps:e})=>__({data:{all:e.all}}),component:A(g_,`component`)}),y_=()=>M(()=>import(`./tokens-CIEKwZXc.js`),__vite__mapDeps([27,1,6,7,8,18,2,3,19,10])),b_=U({method:`POST`}).handler(B(`46e35c9f1afc79423cb49703b454ef684344db08ec19775efd70a8768c7837f1`)),x_=j(`/config/tokens`)({validateSearch:e=>({all:e.all===`1`?`1`:void 0}),loaderDeps:({search:e})=>({all:e.all===`1`}),loader:({deps:e})=>b_({data:e}),component:A(y_,`component`)}),S_=()=>M(()=>import(`./services-DyvqJqM2.js`),__vite__mapDeps([28,1,18,2,3,19,20,6,7,8,10])),C_=U({method:`GET`}).handler(B(`6afd81bef0ee381d6e3641cd8e269968429c874e2f9d56c8f818cc9d180ee477`)),w_=j(`/config/services`)({loader:()=>C_(),component:A(S_,`component`)}),T_=()=>M(()=>import(`./mcp-CnjQc_JJ.js`),__vite__mapDeps([29,1,6,7,8,18,2,3,19,10])),E_=U({method:`GET`}).handler(B(`278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7`)),D_=j(`/config/mcp`)({loader:()=>E_(),component:A(T_,`component`)}),O_=()=>M(()=>import(`./teams-DPggy97H.js`),__vite__mapDeps([30,1,6,7,8,2,3,31,19])),k_=U({method:`GET`}).handler(B(`1bb12262aaa902fa208aafaa70b69c63da34c1fe523ab0322fe766903fc6b4c1`)),A_=j(`/templates/teams/`)({loader:()=>k_(),component:A(O_,`component`)}),j_=()=>M(()=>import(`./agents-DS2XafoA.js`),__vite__mapDeps([32,1,6,7,8,10,2,3,31,19,33,34,35])),M_=U({method:`GET`}).handler(B(`bc31355f2be9889a616d03c35062d483ea77c3f967af9432d721626a81078ef3`)),N_=j(`/templates/agents/`)({loader:()=>M_(),component:A(j_,`component`)}),P_=()=>M(()=>import(`./_id-DbcC2E7F.js`),__vite__mapDeps([36,1,6,7,8,2,3,37,19,33,10])),F_=U({method:`POST`}).handler(B(`4773184b3ddd3656fb80ec74375a6d304e25acb56b79f1d349dcabf9f0914359`)),I_=j(`/teams/$id/`)({loader:async({params:e})=>{let t=await F_({data:{id:e.id}});if(!t)throw se({to:`/teams`});return t},component:A(P_,`component`)}),L_=()=>M(()=>import(`./_id-f_r5M0p3.js`),__vite__mapDeps([38,1,6,7,26,39,2,3,19,8,9,10])),R_=U({method:`POST`}).handler(B(`846c9081aed17057351730985f133b0aab67a5dabfca9562552829a90ff30849`)),z_=j(`/agents/$id/`)({validateSearch:e=>({...e.mode===`settings`?{mode:`settings`}:{},...typeof e.teamPolicy==`string`&&e.teamPolicy?{teamPolicy:e.teamPolicy}:{},...e.view===`matrix`||e.view===`flow`?{view:e.view}:{},...typeof e.selected==`string`?{selected:e.selected}:{},...Number.isFinite(Number(e.vx))?{vx:Number(e.vx)}:{},...Number.isFinite(Number(e.vy))?{vy:Number(e.vy)}:{},...Number.isFinite(Number(e.vz))?{vz:Number(e.vz)}:{}}),loader:async({params:e})=>{let t=await R_({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(L_,`component`)}),B_=()=>M(()=>import(`./policy-K4hIbbIN.js`),__vite__mapDeps([40,1,14,8])),V_=()=>M(()=>import(`./policy-BOfnkJsL.js`),__vite__mapDeps([41,1,8,2,3,14,37,6,7,19,42,10,33,35,12,43])),H_=U({method:`POST`}).handler(B(`fc940d6dec5305aa64bdb9b9f5f7d4f925b2ba0608cb6d39af854a94872fc867`)),U_=j(`/teams/$id/policy`)({validateSearch:e=>({view:e.view===`matrix`?`matrix`:`flow`,selected:typeof e.selected==`string`?e.selected:null,vx:Number.isFinite(Number(e.vx))?Number(e.vx):0,vy:Number.isFinite(Number(e.vy))?Number(e.vy):0,vz:Number.isFinite(Number(e.vz))?Number(e.vz):.9}),loader:({params:e})=>H_({data:e}),component:A(V_,`component`),errorComponent:A(B_,`errorComponent`)}),W_=()=>M(()=>import(`./memory-Du60O3pE.js`),__vite__mapDeps([44,1,8,10,7,2,3,37,6,19,33])),G_=U({method:`POST`}).handler(B(`b96a98e3ed6c8a3ab5f6a4ed8458e93da753ffd74e2912ef1724bb6e58030cb5`)),K_=j(`/teams/$id/memory`)({loader:async({params:e})=>{let t=await G_({data:{id:e.id}});if(!t)throw se({to:`/teams`});return t},component:A(W_,`component`)}),q_=()=>M(()=>import(`./members-wxsVTJdW.js`),__vite__mapDeps([45,1,2,3,37,6,7,19])),J_=U({method:`POST`}).handler(B(`0a6e766d2b4ea526da34cefed5342a6ecc5ff35ad1ce38fba4129b8c24d8e6e5`)),Y_=j(`/teams/$id/members`)({loader:({params:e})=>J_({data:e}),component:A(q_,`component`)}),X_=j(`/teams/$id/context`)({beforeLoad:({params:e})=>{throw se({to:`/teams/$id`,params:{id:e.id}})}}),Z_=()=>M(()=>import(`./activity-DJuhhQCb.js`),__vite__mapDeps([46,1,14,8])),Q_=()=>M(()=>import(`./activity-CB9Ufth-.js`),__vite__mapDeps([47,1,8,2,3,37,6,7,19])),$_=U({method:`POST`}).handler(B(`5cdb81f2b930818ee9ab1d626ac99828ea652ff447fcbfc21b24dea415f8b39e`)),ev=j(`/teams/$id/activity`)({loader:({params:e})=>$_({data:e}),component:A(Q_,`component`),errorComponent:A(Z_,`errorComponent`)}),tv=()=>M(()=>import(`./telegram-DcTeDpP5.js`),__vite__mapDeps([48,1,6,7,8,18,2,3,19,10])),nv=U({method:`GET`}).handler(B(`00a157dd07824e1f126f06646effd1d876f280f6fc64c144d2f6429414a4e58a`)),rv=j(`/config/integrations/telegram`)({loader:()=>nv(),component:A(tv,`component`)}),iv=()=>M(()=>import(`./triggers-Bc2RrUPm.js`),__vite__mapDeps([49,1,6,7,39,2,3,19,8,10])),av=U({method:`POST`}).handler(B(`57ebf437fdb3fcfc63b176e796a55f04bdfec0b230059673196e98d413d15c4d`)),ov=j(`/agents/$id/triggers`)({loader:async({params:e})=>{let t=await av({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(iv,`component`)}),sv=()=>M(()=>import(`./learning-BfrQ4YZY.js`),__vite__mapDeps([50,1,6,7,39,2,3,19,8,10])),cv=U({method:`POST`}).handler(B(`fcdd0f08b635c7c501caa840d01d1376ace6683e26cc5ac7dead28d7870f98b9`)),lv=j(`/agents/$id/learning`)({loader:async({params:e})=>{let t=await cv({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(sv,`component`)}),uv=()=>M(()=>import(`./inbox-DC_HdOfI.js`),__vite__mapDeps([51,1,39,2,3,19])),dv=U({method:`POST`}).handler(B(`2cd8c6ec40e2e2d9518b5f127a518ecd83a2222d85665cc61d5144bcf59ed4fb`)),fv=j(`/agents/$id/inbox`)({validateSearch:e=>({unread:e.unread===`1`?`1`:void 0,id:typeof e.id==`string`?e.id:void 0}),loaderDeps:({search:e})=>({unreadOnly:e.unread===`1`,selectedId:e.id??``}),loader:async({params:e,deps:t})=>{let n=await dv({data:{id:e.id,...t}});if(!n)throw se({to:`/agents`});return n},component:A(uv,`component`)}),pv=()=>M(()=>import(`./_id-DGyKURCp.js`),__vite__mapDeps([52,1,14,8])),mv=()=>M(()=>import(`./_id-DIqtdQij.js`),__vite__mapDeps([53,1,2,3,14,8,31,6,7,19,42,10,33,35,12,43])),hv=U({method:`POST`}).handler(B(`a0bbbee5d0c1240a05e35c04d56a0e95ec78f05265e4e937eec48c8ac2041e58`)),gv=j(`/templates/teams/$id/`)({loader:({params:e})=>hv({data:e}),component:A(mv,`component`),errorComponent:A(pv,`errorComponent`)}),_v=()=>M(()=>import(`./_id-4ZS-w_Aj.js`),__vite__mapDeps([54,1,6,7,2,3,31,19,33,10,8,34,35])),vv=U({method:`POST`}).handler(B(`032d74b7d41c718191dbdde6b06ba44993340ce1154af1fa6723a6d4f7a7236e`)),yv=j(`/templates/agents/$id/`)({loader:async({params:e})=>{let t=await vv({data:{id:e.id}});if(!t)throw se({to:`/templates/agents`});return t},component:A(_v,`component`)}),bv=Kg.update({id:`/welcome`,path:`/welcome`,getParentRoute:()=>$}),xv=qg.update({id:`/login`,path:`/login`,getParentRoute:()=>$}),Sv=Xg.update({id:`/`,path:`/`,getParentRoute:()=>$}),Cv=Zg.update({id:`/templates/`,path:`/templates/`,getParentRoute:()=>$}),wv=t_.update({id:`/teams/`,path:`/teams/`,getParentRoute:()=>$}),Tv=i_.update({id:`/skills/`,path:`/skills/`,getParentRoute:()=>$}),Ev=s_.update({id:`/config/`,path:`/config/`,getParentRoute:()=>$}),Dv=d_.update({id:`/attention/`,path:`/attention/`,getParentRoute:()=>$}),Ov=h_.update({id:`/approvals/`,path:`/approvals/`,getParentRoute:()=>$}),kv=v_.update({id:`/agents/`,path:`/agents/`,getParentRoute:()=>$}),Av=x_.update({id:`/config/tokens`,path:`/config/tokens`,getParentRoute:()=>$}),jv=w_.update({id:`/config/services`,path:`/config/services`,getParentRoute:()=>$}),Mv=D_.update({id:`/config/mcp`,path:`/config/mcp`,getParentRoute:()=>$}),Nv=A_.update({id:`/templates/teams/`,path:`/templates/teams/`,getParentRoute:()=>$}),Pv=N_.update({id:`/templates/agents/`,path:`/templates/agents/`,getParentRoute:()=>$}),Fv=I_.update({id:`/teams/$id/`,path:`/teams/$id/`,getParentRoute:()=>$}),Iv=z_.update({id:`/agents/$id/`,path:`/agents/$id/`,getParentRoute:()=>$}),Lv=U_.update({id:`/teams/$id/policy`,path:`/teams/$id/policy`,getParentRoute:()=>$}),Rv=K_.update({id:`/teams/$id/memory`,path:`/teams/$id/memory`,getParentRoute:()=>$}),zv=Y_.update({id:`/teams/$id/members`,path:`/teams/$id/members`,getParentRoute:()=>$}),Bv=X_.update({id:`/teams/$id/context`,path:`/teams/$id/context`,getParentRoute:()=>$}),Vv=ev.update({id:`/teams/$id/activity`,path:`/teams/$id/activity`,getParentRoute:()=>$}),Hv=rv.update({id:`/config/integrations/telegram`,path:`/config/integrations/telegram`,getParentRoute:()=>$}),Uv=ov.update({id:`/agents/$id/triggers`,path:`/agents/$id/triggers`,getParentRoute:()=>$}),Wv=lv.update({id:`/agents/$id/learning`,path:`/agents/$id/learning`,getParentRoute:()=>$}),Gv=fv.update({id:`/agents/$id/inbox`,path:`/agents/$id/inbox`,getParentRoute:()=>$}),Kv=gv.update({id:`/templates/teams/$id/`,path:`/templates/teams/$id/`,getParentRoute:()=>$}),qv={IndexRoute:Sv,LoginRoute:xv,WelcomeRoute:bv,ConfigMcpRoute:Mv,ConfigServicesRoute:jv,ConfigTokensRoute:Av,AgentsIndexRoute:kv,ApprovalsIndexRoute:Ov,AttentionIndexRoute:Dv,ConfigIndexRoute:Ev,SkillsIndexRoute:Tv,TeamsIndexRoute:wv,TemplatesIndexRoute:Cv,AgentsIdInboxRoute:Gv,AgentsIdLearningRoute:Wv,AgentsIdTriggersRoute:Uv,ConfigIntegrationsTelegramRoute:Hv,TeamsIdActivityRoute:Vv,TeamsIdContextRoute:Bv,TeamsIdMembersRoute:zv,TeamsIdMemoryRoute:Rv,TeamsIdPolicyRoute:Lv,AgentsIdIndexRoute:Iv,TeamsIdIndexRoute:Fv,TemplatesAgentsIndexRoute:Pv,TemplatesTeamsIndexRoute:Nv,TemplatesAgentsIdIndexRoute:yv.update({id:`/templates/agents/$id/`,path:`/templates/agents/$id/`,getParentRoute:()=>$}),TemplatesTeamsIdIndexRoute:Kv},Jv=$._addFileChildren(qv);function Yv(){return ys({routeTree:Jv,scrollRestoration:!0,defaultPreload:`intent`})}async function Xv(){let e=await Yv(),t;if(Us){let n=await Us.getOptions();n.serializationAdapters=n.serializationAdapters??[],window.__TSS_START_OPTIONS__=n,t=n.serializationAdapters,e.options.defaultSsr=n.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(Eo),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await Mo(e),e}var Zv=Xv;async function Qv(){let e=await Zv();return window.$_TSR?.h(),e}var $v;function ey(){return $v||=Qv(),(0,H.jsx)(Po,{promise:$v,children:e=>(0,H.jsx)(Ss,{router:e})})}var ty=Te();(0,V.startTransition)(()=>{(0,ty.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(ey,{})}))});export{Nl as A,bc as B,t_ as C,Yu as D,Og as E,Uc as F,ac as G,vc as H,zc as I,Gs as J,ic as K,W as L,cl as M,dl as N,Vu as O,Zc as P,Fc as R,i_ as S,qg as T,hc as U,yc as V,fc as W,Cs as X,Ws as Y,x_ as _,ov as a,d_ as b,Y_ as c,z_ as d,I_ as f,w_ as g,D_ as h,lv as i,bl as j,Il as k,K_ as l,A_ as m,gv as n,rv as o,N_ as p,nc as q,fv as r,ev as s,yv as t,U_ as u,v_ as v,Xg as w,s_ as x,h_ as y,Nc as z};
52
+ `},Iu=0,Lu=[];function Ru(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),i=V.useState(Iu++)[0],a=V.useState(ou)[0],o=V.useRef(e);V.useEffect(function(){o.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=K([e.lockRef.current],(e.shards||[]).map(Nu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=V.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ju(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=wu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=wu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Au(h,t,e,h===`h`?s:c,!0)},[]),c=V.useCallback(function(e){var n=e;if(!(!Lu.length||Lu[Lu.length-1]!==a)){var r=`deltaY`in n?Mu(n):ju(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Pu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Nu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=V.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:zu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=V.useCallback(function(e){n.current=ju(e),r.current=void 0},[]),d=V.useCallback(function(t){l(t.type,Mu(t),t.target,s(t,e.lockRef.current))},[]),f=V.useCallback(function(t){l(t.type,ju(t),t.target,s(t,e.lockRef.current))},[]);V.useEffect(function(){return Lu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,yu),document.addEventListener(`touchmove`,c,yu),document.addEventListener(`touchstart`,u,yu),function(){Lu=Lu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,yu),document.removeEventListener(`touchmove`,c,yu),document.removeEventListener(`touchstart`,u,yu)}},[]);var p=e.removeScrollBar,m=e.inert;return V.createElement(V.Fragment,null,m?V.createElement(a,{styles:Fu(i)}):null,p?V.createElement(gu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Bu=Yl(Xl,Ru),Vu=V.forwardRef(function(e,t){return V.createElement(Ql,Rl({},e,{ref:t,sideCar:Bu}))});Vu.classNames=Ql.classNames;var Hu=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Uu=new WeakMap,Wu=new WeakMap,Gu={},Z=0,Ku=function(e){return e&&(e.host||Ku(e.parentNode))},qu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ku(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ju=function(e,t,n,r){var i=qu(t,Array.isArray(e)?e:[e]);Gu[n]||(Gu[n]=new WeakMap);var a=Gu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Uu.get(e)||0)+1,l=(a.get(e)||0)+1;Uu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Wu.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Z++,function(){o.forEach(function(e){var t=Uu.get(e)-1,i=a.get(e)-1;Uu.set(e,t),a.set(e,i),t||(Wu.has(e)||e.removeAttribute(r),Wu.delete(e)),i||e.removeAttribute(n)}),Z--,Z||(Uu=new WeakMap,Uu=new WeakMap,Wu=new WeakMap,Gu={})}},Yu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Hu(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ju(r,i,n,`aria-hidden`)):function(){return null}};function Xu(e){let[t,n]=V.useState(void 0);return G(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Zu=[`top`,`right`,`bottom`,`left`],Qu=Math.min,$u=Math.max,ed=Math.round,td=Math.floor,nd=e=>({x:e,y:e}),rd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function id(e,t,n){return $u(e,Qu(t,n))}function ad(e,t){return typeof e==`function`?e(t):e}function od(e){return e.split(`-`)[0]}function sd(e){return e.split(`-`)[1]}function cd(e){return e===`x`?`y`:`x`}function ld(e){return e===`y`?`height`:`width`}function ud(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dd(e){return cd(ud(e))}function fd(e,t,n){n===void 0&&(n=!1);let r=sd(e),i=dd(e),a=ld(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Q(o)),[o,Q(o)]}function pd(e){let t=Q(e);return[md(e),t,md(t)]}function md(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hd=[`left`,`right`],gd=[`right`,`left`],_d=[`top`,`bottom`],vd=[`bottom`,`top`];function yd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gd:hd:t?hd:gd;case`left`:case`right`:return t?_d:vd;default:return[]}}function bd(e,t,n,r){let i=sd(e),a=yd(od(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(md)))),a}function Q(e){let t=od(e);return rd[t]+e.slice(t.length)}function xd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:xd(e)}function Cd(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 wd(e,t,n){let{reference:r,floating:i}=e,a=ud(t),o=dd(t),s=ld(o),c=od(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(sd(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Td(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ad(t,e),p=Sd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Cd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Cd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ed=50,Dd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Td},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=wd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ed&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=wd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Od=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ad(e,t)||{};if(l==null)return{};let d=Sd(u),f={x:n,y:r},p=dd(i),m=ld(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let ee=b/2-x/2,w=C/2-h[m]/2-1,te=Qu(d[_],w),ne=Qu(d[v],w),re=te,ie=C-h[m]-ne,ae=C/2-h[m]/2+ee,oe=id(re,ae,ie),se=!c.arrow&&sd(i)!=null&&ae!==oe&&a.reference[m]/2-(ae<re?te:ne)-h[m]/2<0,E=se?ae<re?ae-re:ae-ie:0;return{[p]:f[p]+E,data:{[p]:oe,centerOffset:ae-oe-E,...se&&{alignmentOffset:E}},reset:se}}}),kd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ad(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=od(r),_=ud(o),v=od(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Q(o)]:pd(o)),x=p!==`none`;!d&&x&&b.push(...bd(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],w=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=fd(r,a,y);ee.push(C[e[0]],C[e[1]])}if(w=[...w,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ud(t))||w.every(e=>ud(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=ud(e.placement);return t===_||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ad(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jd(e){return Zu.some(t=>e[t]>=0)}var Md=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ad(e,t);switch(i){case`referenceHidden`:{let e=Ad(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jd(e)}}}case`escaped`:{let e=Ad(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jd(e)}}}default:return{}}}}},Nd=new Set([`left`,`top`]);async function Pd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=od(n),s=sd(n),c=ud(n)===`y`,l=Nd.has(o)?-1:1,u=a&&c?-1:1,d=ad(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Id=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ad(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ud(od(i)),p=cd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=id(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=id(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ld=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ad(e,t),u={x:n,y:r},d=ud(i),f=cd(d),p=u[f],m=u[d],h=ad(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nd.has(od(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ad(e,t),u=await o.detectOverflow(t,l),d=od(i),f=sd(i),p=ud(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Qu(h-u[g],v),x=Qu(m-u[_],y),S=!t.middlewareData.shift,C=b,ee=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ee=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=$u(u.left,0),t=$u(u.right,0),n=$u(u.top,0),r=$u(u.bottom,0);p?ee=m-2*(e!==0||t!==0?e+t:$u(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:$u(u.top,u.bottom))}await c({...t,availableWidth:ee,availableHeight:C});let w=await o.getDimensions(s.floating);return m!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function zd(){return typeof window<`u`}function Bd(e){return Ud(e)?(e.nodeName||``).toLowerCase():`#document`}function Vd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hd(e){return((Ud(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ud(e){return zd()?e instanceof Node||e instanceof Vd(e).Node:!1}function Wd(e){return zd()?e instanceof Element||e instanceof Vd(e).Element:!1}function Gd(e){return zd()?e instanceof HTMLElement||e instanceof Vd(e).HTMLElement:!1}function Kd(e){return!zd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Vd(e).ShadowRoot}function qd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=af(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Jd(e){return/^(table|td|th)$/.test(Bd(e))}function Yd(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Xd=/transform|translate|scale|rotate|perspective|filter/,Zd=/paint|layout|strict|content/,Qd=e=>!!e&&e!==`none`,$d;function ef(e){let t=Wd(e)?af(e):e;return Qd(t.transform)||Qd(t.translate)||Qd(t.scale)||Qd(t.rotate)||Qd(t.perspective)||!nf()&&(Qd(t.backdropFilter)||Qd(t.filter))||Xd.test(t.willChange||``)||Zd.test(t.contain||``)}function tf(e){let t=sf(e);for(;Gd(t)&&!rf(t);){if(ef(t))return t;if(Yd(t))return null;t=sf(t)}return null}function nf(){return $d??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),$d}function rf(e){return/^(html|body|#document)$/.test(Bd(e))}function af(e){return Vd(e).getComputedStyle(e)}function of(e){return Wd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sf(e){if(Bd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Kd(e)&&e.host||Hd(e);return Kd(t)?t.host:t}function cf(e){let t=sf(e);return rf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gd(t)&&qd(t)?t:cf(t)}function lf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cf(e),i=r===e.ownerDocument?.body,a=Vd(r);if(i){let e=uf(a);return t.concat(a,a.visualViewport||[],qd(r)?r:[],e&&n?lf(e):[])}else return t.concat(r,lf(r,[],n))}function uf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function df(e){let t=af(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Gd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ed(n)!==a||ed(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ff(e){return Wd(e)?e:e.contextElement}function pf(e){let t=ff(e);if(!Gd(t))return nd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=df(t),o=(a?ed(n.width):n.width)/r,s=(a?ed(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var mf=nd(0);function hf(e){let t=Vd(e);return!nf()||!t.visualViewport?mf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vd(e)?!1:t}function _f(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ff(e),o=nd(1);t&&(r?Wd(r)&&(o=pf(r)):o=pf(e));let s=gf(a,n,r)?hf(a):nd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Vd(a),t=r&&Wd(r)?Vd(r):r,n=e,i=uf(n);for(;i&&r&&t!==n;){let e=pf(i),t=i.getBoundingClientRect(),r=af(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Vd(i),i=uf(n)}}return Cd({width:u,height:d,x:c,y:l})}function vf(e,t){let n=of(e).scrollLeft;return t?t.left+n:_f(Hd(e)).left+n}function yf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vf(e,n),y:n.top+t.scrollTop}}function bf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Hd(r),s=t?Yd(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=nd(1),u=nd(0),d=Gd(r);if((d||!d&&!a)&&((Bd(r)!==`body`||qd(o))&&(c=of(r)),d)){let e=_f(r);l=pf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yf(o,c):nd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function xf(e){return Array.from(e.getClientRects())}function Sf(e){let t=Hd(e),n=of(e),r=e.ownerDocument.body,i=$u(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$u(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+vf(e),s=-n.scrollTop;return af(r).direction===`rtl`&&(o+=$u(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Cf=25;function wf(e,t){let n=Vd(e),r=Hd(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=nf();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Cf&&(a-=o)}else l<=Cf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Tf(e,t){let n=_f(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Gd(e)?pf(e):nd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ef(e,t,n){let r;if(t===`viewport`)r=wf(e,n);else if(t===`document`)r=Sf(Hd(e));else if(Wd(t))r=Tf(t,n);else{let n=hf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Cd(r)}function Df(e,t){let n=sf(e);return n===t||!Wd(n)||rf(n)?!1:af(n).position===`fixed`||Df(n,t)}function Of(e,t){let n=t.get(e);if(n)return n;let r=lf(e,[],!1).filter(e=>Wd(e)&&Bd(e)!==`body`),i=null,a=af(e).position===`fixed`,o=a?sf(e):e;for(;Wd(o)&&!rf(o);){let t=af(o),n=ef(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||qd(o)&&!n&&Df(e,o))?r=r.filter(e=>e!==o):i=t,o=sf(o)}return t.set(e,r),r}function kf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Yd(t)?[]:Of(t,this._c):[].concat(n),r],o=Ef(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ef(t,a[e],i);s=$u(n.top,s),c=Qu(n.right,c),l=Qu(n.bottom,l),u=$u(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Af(e){let{width:t,height:n}=df(e);return{width:t,height:n}}function jf(e,t,n){let r=Gd(t),i=Hd(t),a=n===`fixed`,o=_f(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=nd(0);function l(){c.x=vf(i)}if(r||!r&&!a)if((Bd(t)!==`body`||qd(i))&&(s=of(t)),r){let e=_f(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?yf(i,s):nd(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Mf(e){return af(e).position===`static`}function Nf(e,t){if(!Gd(e)||af(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Hd(e)===n&&(n=n.ownerDocument.body),n}function Pf(e,t){let n=Vd(e);if(Yd(e))return n;if(!Gd(e)){let t=sf(e);for(;t&&!rf(t);){if(Wd(t)&&!Mf(t))return t;t=sf(t)}return n}let r=Nf(e,t);for(;r&&Jd(r)&&Mf(r);)r=Nf(r,t);return r&&rf(r)&&Mf(r)&&!ef(r)?n:r||tf(e)||n}var Ff=async function(e){let t=this.getOffsetParent||Pf,n=this.getDimensions,r=await n(e.floating);return{reference:jf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function If(e){return af(e).direction===`rtl`}var Lf={convertOffsetParentRelativeRectToViewportRelativeRect:bf,getDocumentElement:Hd,getClippingRect:kf,getOffsetParent:Pf,getElementRects:Ff,getClientRects:xf,getDimensions:Af,getScale:pf,isElement:Wd,isRTL:If};function Rf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zf(e,t){let n=null,r,i=Hd(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=td(d),h=td(i.clientWidth-(u+f)),g=td(i.clientHeight-(d+p)),_=td(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:$u(0,Qu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Rf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Bf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ff(e),u=i||a?[...l?lf(l):[],...t?lf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?zf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?_f(e):null;c&&g();function g(){let t=_f(e);h&&!Rf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Vf=Fd,Hf=Id,Uf=kd,Wf=Rd,Gf=Md,Kf=Od,qf=Ld,Jf=(e,t,n)=>{let r=new Map,i={platform:Lf,...n},a={...i.platform,_c:r};return Dd(e,t,{...i,platform:a})},Yf=typeof document<`u`?V.useLayoutEffect:function(){};function Xf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Xf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Zf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qf(e,t){let n=Zf(e);return Math.round(t*n)/n}function $f(e){let t=V.useRef(e);return Yf(()=>{t.current=e}),t}function ep(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=V.useState(r);Xf(f,r)||p(r);let[m,h]=V.useState(null),[g,_]=V.useState(null),v=V.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=V.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=V.useRef(null),C=V.useRef(null),ee=V.useRef(u),w=c!=null,te=$f(c),ne=$f(i),re=$f(l),ie=V.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),Jf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ae.current&&!Xf(ee.current,t)&&(ee.current=t,Mc.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);Yf(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ae=V.useRef(!1);Yf(()=>(ae.current=!0,()=>{ae.current=!1}),[]),Yf(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(te.current)return te.current(b,x,ie);ie()}},[b,x,ie,te,w]);let oe=V.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),se=V.useMemo(()=>({reference:b,floating:x}),[b,x]),E=V.useMemo(()=>{let e={position:n,left:0,top:0};if(!se.floating)return e;let t=Qf(se.floating,u.x),r=Qf(se.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Zf(se.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,se.floating,u.x,u.y]);return V.useMemo(()=>({...u,update:ie,refs:oe,elements:se,floatingStyles:E}),[u,ie,oe,se,E])}var tp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Kf({element:r.current,padding:i}).fn(n):r?Kf({element:r,padding:i}).fn(n):{}}}},np=(e,t)=>{let n=Vf(e);return{name:n.name,fn:n.fn,options:[e,t]}},rp=(e,t)=>{let n=Hf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>({fn:qf(e).fn,options:[e,t]}),ap=(e,t)=>{let n=Uf(e);return{name:n.name,fn:n.fn,options:[e,t]}},op=(e,t)=>{let n=Wf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp=(e,t)=>{let n=Gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp=(e,t)=>{let n=tp(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=`Arrow`,up=V.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(Nc.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});up.displayName=lp;var dp=up,fp=`Popper`,[pp,mp]=Fc(fp),[hp,gp]=pp(fp),_p=e=>{let{__scopePopper:t,children:n}=e,[r,i]=V.useState(null),[a,o]=V.useState(void 0);return(0,H.jsx)(hp,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};_p.displayName=fp;var vp=`PopperAnchor`,yp=V.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=gp(vp,n),o=V.useRef(null),s=a.onAnchorChange,c=vc(t,V.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=V.useRef(null);V.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&kp(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(Nc.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});yp.displayName=vp;var bp=`PopperContent`,[xp,Sp]=pp(bp),Cp=V.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=gp(bp,n),[_,v]=V.useState(null),y=vc(t,e=>v(e)),[b,x]=V.useState(null),S=Xu(b),C=S?.width??0,ee=S?.height??0,w=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ne=Array.isArray(l)?l:[l],re=ne.length>0,ie={padding:te,boundary:ne.filter(Dp),altBoundary:re},{refs:ae,floatingStyles:oe,placement:se,isPositioned:E,middlewareData:D}=ep({strategy:`fixed`,placement:w,whileElementsMounted:(...e)=>Bf(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[np({mainAxis:i+ee,alignmentAxis:o}),c&&rp({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?ip():void 0,...ie}),c&&ap({...ie}),op({...ie,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&cp({element:b,padding:s}),Op({arrowWidth:C,arrowHeight:ee}),f&&sp({strategy:`referenceHidden`,...ie,boundary:re?ie.boundary:void 0})]}),O=g.setPlacementState;G(()=>(O(se),()=>{O(void 0)}),[se,O]);let[k,ce]=kp(se),le=el(m);G(()=>{E&&le?.()},[E,le]);let ue=D.arrow?.x,de=D.arrow?.y,fe=D.arrow?.centerOffset!==0,[A,pe]=V.useState();return G(()=>{_&&pe(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...oe,transform:E?oe.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:A,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(` `),...D.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(xp,{scope:n,placedSide:k,placedAlign:ce,onArrowChange:x,arrowX:ue,arrowY:de,shouldHideArrow:fe,children:(0,H.jsx)(Nc.div,{"data-side":k,"data-align":ce,...h,ref:y,style:{...h.style,animation:E?void 0:`none`}})})})});Cp.displayName=bp;var wp=`PopperArrow`,Tp={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ep=V.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Sp(wp,n),a=Tp[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(dp,{...r,ref:t,style:{...r.style,display:`block`}})})});Ep.displayName=wp;function Dp(e){return e!==null}var Op=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=kp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function kp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ap=_p,jp=yp,Mp=Cp,Np=Ep,Pp=`rovingFocusGroup.onEntryFocus`,Fp={bubbles:!1,cancelable:!0},Ip=`RovingFocusGroup`,[Lp,Rp,zp]=Lc(Ip),[Bp,Vp]=Fc(Ip,[zp]),[Hp,Up]=Bp(Ip),Wp=V.forwardRef((e,t)=>(0,H.jsx)(Lp.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Lp.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Gp,{...e,ref:t})})}));Wp.displayName=Ip;var Gp=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=V.useRef(null),p=vc(t,f),m=$c(a),[h,g]=zc({prop:o,defaultProp:s??null,onChange:c,caller:Ip}),[_,v]=V.useState(!1),y=el(l),b=Rp(n),x=V.useRef(!1),[S,C]=V.useState(0);return V.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Pp,y),()=>e.removeEventListener(Pp,y)},[y]),(0,H.jsx)(Hp,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:V.useCallback(e=>g(e),[g]),onItemShiftTab:V.useCallback(()=>v(!0),[]),onFocusableItemAdd:V.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:V.useCallback(()=>C(e=>e-1),[]),children:(0,H.jsx)(Nc.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:W(e.onMouseDown,()=>{x.current=!0}),onFocus:W(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Pp,Fp);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Zp([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:W(e.onBlur,()=>v(!1))})})}),Kp=`RovingFocusGroupItem`,qp=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Zc(),l=a||c,u=Up(Kp,n),d=u.currentTabStopId===l,f=Rp(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return V.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,H.jsx)(Lp.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(Nc.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:W(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Xp(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Qp(n,r+1):n.slice(r+1)}setTimeout(()=>Zp(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});qp.displayName=Kp;var Jp={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Yp(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Xp(e,t,n){let r=Yp(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Jp[r]}function Zp(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Qp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $p=Wp,em=qp,tm=[`Enter`,` `],nm=[`ArrowDown`,`PageUp`,`Home`],rm=[`ArrowUp`,`PageDown`,`End`],im=[...nm,...rm],am={ltr:[...tm,`ArrowRight`],rtl:[...tm,`ArrowLeft`]},om={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},sm=`Menu`,[cm,lm,um]=Lc(sm),[dm,fm]=Fc(sm,[um,mp,Vp]),pm=mp(),mm=Vp(),[hm,gm]=dm(sm),[_m,vm]=dm(sm),ym=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=pm(t),[c,l]=V.useState(null),u=V.useRef(!1),d=el(a),f=$c(i);return V.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),V.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(Ap,{...s,children:(0,H.jsx)(hm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(_m,{scope:t,onClose:V.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ym.displayName=sm;var bm=`MenuAnchor`,xm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=pm(n);return(0,H.jsx)(jp,{...i,...r,ref:t})});xm.displayName=bm;var Sm=`MenuPortal`,[Cm,wm]=dm(Sm,{forceMount:void 0}),Tm=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=gm(Sm,t);return(0,H.jsx)(Cm,{scope:t,forceMount:n,children:(0,H.jsx)(Uc,{present:n||a.open,children:(0,H.jsx)(Nl,{asChild:!0,container:i,children:r})})})};Tm.displayName=Sm;var Em=`MenuContent`,[Dm,Om]=dm(Em),km=V.forwardRef((e,t)=>{let n=wm(Em,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=gm(Em,e.__scopeMenu),o=vm(Em,e.__scopeMenu);return(0,H.jsx)(cm.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Uc,{present:r||a.open,children:(0,H.jsx)(cm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(Am,{...i,ref:t}):(0,H.jsx)(jm,{...i,ref:t})})})})}),Am=V.forwardRef((e,t)=>{let n=gm(Em,e.__scopeMenu),r=V.useRef(null),i=vc(t,r);return V.useEffect(()=>{let e=r.current;if(e)return Yu(e)},[]),(0,H.jsx)(Nm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jm=V.forwardRef((e,t)=>{let n=gm(Em,e.__scopeMenu);return(0,H.jsx)(Nm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mm=yc(`MenuContent.ScrollLock`),Nm=V.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=gm(Em,n),_=vm(Em,n),v=pm(n),y=mm(n),b=lm(n),[x,S]=V.useState(null),C=V.useRef(null),ee=vc(t,C,g.onContentChange),w=V.useRef(0),te=V.useRef(``),ne=V.useRef(0),re=V.useRef(null),ie=V.useRef(`right`),ae=V.useRef(0),oe=m?Vu:V.Fragment,se=m?{as:Mm,allowPinchZoom:!0}:void 0,E=e=>{let t=te.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=_h(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){te.current=t,window.clearTimeout(w.current),t!==``&&(w.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};V.useEffect(()=>()=>window.clearTimeout(w.current),[]),Il();let D=V.useCallback(e=>ie.current===re.current?.side&&yh(e,re.current?.area),[]);return(0,H.jsx)(Dm,{scope:n,searchRef:te,onItemEnter:V.useCallback(e=>{D(e)&&e.preventDefault()},[D]),onItemLeave:V.useCallback(e=>{D(e)||(C.current?.focus(),S(null))},[D]),onTriggerLeave:V.useCallback(e=>{D(e)&&e.preventDefault()},[D]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:V.useCallback(e=>{re.current=e},[]),children:(0,H.jsx)(oe,{...se,children:(0,H.jsx)(bl,{asChild:!0,trapped:i,onMountAutoFocus:W(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(cl,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)($p,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:W(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(Mp,{role:`menu`,"aria-orientation":`vertical`,"data-state":fh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:W(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&E(e.key));let i=C.current;if(e.target!==i||!im.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);rm.includes(e.key)&&a.reverse(),hh(a)}),onBlur:W(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(w.current),te.current=``)}),onPointerMove:W(e.onPointerMove,bh(e=>{let t=e.target,n=ae.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ie.current=e.clientX>ae.current?`right`:`left`,ae.current=e.clientX)}))})})})})})})});km.displayName=Em;var Pm=`MenuGroup`,Fm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{role:`group`,...r,ref:t})});Fm.displayName=Pm;var Im=`MenuLabel`,Lm=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{...r,ref:t})});Lm.displayName=Im;var Rm=`MenuItem`,zm=`menu.itemSelect`,Bm=V.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=V.useRef(null),o=vm(Rm,e.__scopeMenu),s=Om(Rm,e.__scopeMenu),c=vc(t,a),l=V.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(zm,{bubbles:!0,cancelable:!0});e.addEventListener(zm,e=>r?.(e),{once:!0}),Pc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,H.jsx)(Vm,{...i,ref:c,disabled:n,onClick:W(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:W(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:W(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||tm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Bm.displayName=Rm;var Vm=V.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Om(Rm,n),s=mm(n),c=V.useRef(null),l=vc(t,c),[u,d]=V.useState(!1),[f,p]=V.useState(``);return V.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(cm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(em,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(Nc.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:W(e.onPointerMove,bh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,bh(e=>o.onItemLeave(e))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),Hm=`MenuCheckboxItem`,Um=V.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(Zm,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(Bm,{role:`menuitemcheckbox`,"aria-checked":ph(n)?`mixed`:n,...i,ref:t,"data-state":mh(n),onSelect:W(i.onSelect,()=>r?.(ph(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Um.displayName=Hm;var Wm=`MenuRadioGroup`,[Gm,Km]=dm(Wm,{value:void 0,onValueChange:()=>{}}),qm=V.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=el(r);return(0,H.jsx)(Gm,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,H.jsx)(Fm,{...i,ref:t})})});qm.displayName=Wm;var Jm=`MenuRadioItem`,Ym=V.forwardRef((e,t)=>{let{value:n,...r}=e,i=Km(Jm,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(Zm,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(Bm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":mh(a),onSelect:W(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ym.displayName=Jm;var Xm=`MenuItemIndicator`,[Zm,Qm]=dm(Xm,{checked:!1}),$m=V.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Qm(Xm,n);return(0,H.jsx)(Uc,{present:r||ph(a.checked)||a.checked===!0,children:(0,H.jsx)(Nc.span,{...i,ref:t,"data-state":mh(a.checked)})})});$m.displayName=Xm;var eh=`MenuSeparator`,th=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Nc.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});th.displayName=eh;var nh=`MenuArrow`,rh=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=pm(n);return(0,H.jsx)(Np,{...i,...r,ref:t})});rh.displayName=nh;var ih=`MenuSub`,[ah,oh]=dm(ih),sh=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=gm(ih,t),o=pm(t),[s,c]=V.useState(null),[l,u]=V.useState(null),d=el(i);return V.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,H.jsx)(Ap,{...o,children:(0,H.jsx)(hm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,H.jsx)(ah,{scope:t,contentId:Zc(),triggerId:Zc(),trigger:s,onTriggerChange:c,children:n})})})};sh.displayName=ih;var ch=`MenuSubTrigger`,lh=V.forwardRef((e,t)=>{let n=gm(ch,e.__scopeMenu),r=vm(ch,e.__scopeMenu),i=oh(ch,e.__scopeMenu),a=Om(ch,e.__scopeMenu),o=V.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=V.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return V.useEffect(()=>u,[u]),V.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,H.jsx)(xm,{asChild:!0,...l,children:(0,H.jsx)(Vm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":fh(n.open),...e,ref:_c(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,bh(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:W(e.onPointerLeave,bh(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||am[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});lh.displayName=ch;var uh=`MenuSubContent`,dh=V.forwardRef((e,t)=>{let n=wm(Em,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=gm(Em,e.__scopeMenu),s=vm(Em,e.__scopeMenu),c=oh(uh,e.__scopeMenu),l=V.useRef(null),u=vc(t,l);return(0,H.jsx)(cm.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Uc,{present:r||o.open,children:(0,H.jsx)(cm.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(Nm,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:W(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:W(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=om[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});dh.displayName=uh;function fh(e){return e?`open`:`closed`}function ph(e){return e===`indeterminate`}function mh(e){return ph(e)?`indeterminate`:e?`checked`:`unchecked`}function hh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _h(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=gh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function vh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function yh(e,t){return t?vh({x:e.clientX,y:e.clientY},t):!1}function bh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var xh=ym,Sh=xm,Ch=Tm,wh=km,Th=Fm,Eh=Lm,Dh=Bm,Oh=Um,kh=qm,Ah=Ym,jh=$m,Mh=th,Nh=rh,Ph=lh,Fh=dh,Ih=`DropdownMenu`,[Lh,Rh]=Fc(Ih,[fm]),zh=fm(),[Bh,Vh]=Lh(Ih),Hh=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=zh(t),l=V.useRef(null),[u,d]=zc({prop:i,defaultProp:a??!1,onChange:o,caller:Ih});return(0,H.jsx)(Bh,{scope:t,triggerId:Zc(),triggerRef:l,contentId:Zc(),open:u,onOpenChange:d,onOpenToggle:V.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(xh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Hh.displayName=Ih;var Uh=`DropdownMenuTrigger`,Wh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Vh(Uh,n),o=zh(n);return(0,H.jsx)(Sh,{asChild:!0,...o,children:(0,H.jsx)(Nc.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:_c(t,a.triggerRef),onPointerDown:W(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:W(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Wh.displayName=Uh;var Gh=`DropdownMenuPortal`,Kh=e=>{let{__scopeDropdownMenu:t,...n}=e,r=zh(t);return(0,H.jsx)(Ch,{...r,...n})};Kh.displayName=Gh;var qh=`DropdownMenuContent`,Jh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Vh(qh,n),a=zh(n),o=V.useRef(!1);return(0,H.jsx)(wh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:W(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Jh.displayName=qh;var Yh=`DropdownMenuGroup`,Xh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Th,{...i,...r,ref:t})});Xh.displayName=Yh;var Zh=`DropdownMenuLabel`,Qh=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Eh,{...i,...r,ref:t})});Qh.displayName=Zh;var $h=`DropdownMenuItem`,eg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Dh,{...i,...r,ref:t})});eg.displayName=$h;var tg=`DropdownMenuCheckboxItem`,ng=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Oh,{...i,...r,ref:t})});ng.displayName=tg;var rg=`DropdownMenuRadioGroup`,ig=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(kh,{...i,...r,ref:t})});ig.displayName=rg;var ag=`DropdownMenuRadioItem`,og=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Ah,{...i,...r,ref:t})});og.displayName=ag;var sg=`DropdownMenuItemIndicator`,cg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(jh,{...i,...r,ref:t})});cg.displayName=sg;var lg=`DropdownMenuSeparator`,ug=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Mh,{...i,...r,ref:t})});ug.displayName=lg;var dg=`DropdownMenuArrow`,fg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Nh,{...i,...r,ref:t})});fg.displayName=dg;var pg=`DropdownMenuSubTrigger`,mg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Ph,{...i,...r,ref:t})});mg.displayName=pg;var hg=`DropdownMenuSubContent`,gg=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(n);return(0,H.jsx)(Fh,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gg.displayName=hg;var _g=Hh,vg=Wh,yg=Kh,bg=Jh,xg=Qh,Sg=eg,Cg=`baziu-theme`,wg={system:lc,light:mc,dark:uc},Tg={system:`light`,light:`dark`,dark:`system`};function Eg(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(Cg);return e===`light`||e===`dark`||e===`system`?e:`system`}function Dg(e){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=e===`dark`||e===`system`&&t;document.documentElement.classList.toggle(`dark`,n)}function Og(){let[e,t]=(0,V.useState)(`system`);(0,V.useEffect)(()=>{t(Eg())},[]),(0,V.useEffect)(()=>{if(e!==`system`)return;let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Dg(`system`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]);let n=()=>{let n=Tg[e];t(n),window.localStorage.setItem(Cg,n),Dg(n)},r=wg[e],i=`Theme: ${e}. Switch to ${Tg[e]}.`;return(0,H.jsxs)(`button`,{type:`button`,onClick:n,className:`unstyled inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-frost bg-ivory px-2.5 text-mocha shadow-baziu-sm transition-all hover:border-sapphire-light hover:bg-sapphire-glow hover:text-sapphire active:translate-y-px`,title:i,"aria-label":i,children:[(0,H.jsx)(r,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`hidden text-xs font-medium capitalize xl:inline`,children:e})]})}var kg=[{to:`/`,label:`Chat`,icon:cc},{to:`/agents`,label:`Agents`,icon:ic},{to:`/teams`,label:`Teams`,icon:hc}],Ag=[{href:`/approvals`,label:`Approvals`,description:`Decide whether one captured action may proceed.`,icon:fc},{href:`/attention`,label:`Attention`,description:`Inspect failures, warnings, lessons, and open signals.`,icon:rc}],jg=[{href:`/templates`,label:`Templates`,description:`Reusable Agent behavior and Team rosters.`,icon:oc},{href:`/skills`,label:`Skills`,description:`Prompt skills available to your agents.`,icon:pc},{href:`/config`,label:`Setup`,description:`Providers, integrations, access, and services.`,icon:dc}];function Mg(){let e=Cs({select:e=>e.location.pathname}),[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(e===`/login`||e===`/welcome`)return;let t=new AbortController;return fetch(`/api/attention/summary`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>n(e)).catch(e=>{e instanceof DOMException&&e.name}),()=>t.abort()},[e]);async function a(){i(null);try{let e=await fetch(`/api/logout`,{method:`POST`});if(!e.ok)throw Error(`Log out failed (${e.status})`);window.location.assign(`/login`)}catch(e){i(e instanceof Error?e.message:String(e))}}return(0,H.jsxs)(`nav`,{"aria-label":`Primary navigation`,className:`relative mx-auto grid w-full max-w-[1500px] shrink-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2 border-b border-frost py-3 md:flex md:gap-2 md:py-4`,children:[(0,H.jsxs)(oe,{to:`/`,"aria-label":`Bazilion home`,className:`logo team flex min-w-0 items-center gap-2 rounded-lg text-charcoal transition-opacity hover:text-charcoal hover:opacity-80`,children:[(0,H.jsx)(Ws,{className:`logo-paw h-8 w-8 shrink-0 transition-transform duration-300 team-hover:rotate-[-8deg] team-hover:scale-[1.08]`}),(0,H.jsx)(`span`,{className:`truncate font-display text-[1.35rem] tracking-[-0.02em]`,children:`bazilion`})]}),(0,H.jsxs)(`div`,{className:`col-span-2 row-start-2 flex min-w-0 items-center gap-1 overflow-x-auto pb-0.5 md:col-auto md:row-auto md:ml-4 md:flex-1 md:overflow-visible md:pb-0`,children:[kg.map(t=>{let n=t.to===`/`?e===`/`:e===t.to||e.startsWith(`${t.to}/`),r=t.icon;return(0,H.jsxs)(oe,{to:t.to,"aria-current":n?`page`:void 0,className:Fg(n),children:[(0,H.jsx)(r,{className:`hidden size-4 shrink-0 sm:block`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:t.label})]},t.to)}),(0,H.jsx)(Ng,{label:`Operations`,compactLabel:`Ops`,icon:rc,links:Ag,pathname:e,badge:t?.openTotal??0,itemBadges:{"/approvals":t?.byKind.communication_approval??0,"/attention":t?.openTotal??0}}),(0,H.jsx)(Ng,{label:`Manage`,icon:dc,links:jg,pathname:e,align:`end`})]}),(0,H.jsxs)(`div`,{className:`col-start-2 row-start-1 flex items-center gap-1 md:col-auto md:row-auto md:ml-auto`,children:[(0,H.jsx)(Og,{}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void a(),"aria-label":`Log out`,title:`Log out`,className:`unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire`,children:(0,H.jsx)(sc,{className:`h-4 w-4`,"aria-hidden":`true`})})]}),r&&(0,H.jsx)(`p`,{role:`alert`,className:`col-span-2 m-0 rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger md:absolute md:right-0 md:top-[calc(100%+0.35rem)] md:z-50 md:shadow-baziu-md`,children:r})]})}function Ng({label:e,compactLabel:t,icon:n,links:r,pathname:i,badge:a=0,itemBadges:o={},align:s=`start`}){let c=r.some(e=>i===e.href||i.startsWith(`${e.href}/`));return(0,H.jsxs)(_g,{children:[(0,H.jsx)(vg,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:Fg(c),"aria-label":`${e} menu`,children:[(0,H.jsx)(n,{className:`hidden size-4 shrink-0 sm:block`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:t?`sm:hidden`:void 0,children:t??e}),t&&(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:e}),a>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-danger sm:hidden`,"aria-label":`${a} open items`}),(0,H.jsx)(`span`,{className:`hidden sm:inline-flex`,children:(0,H.jsx)(Pg,{value:a,label:`${a} open items`})})]}),(0,H.jsx)(ac,{className:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})]})}),(0,H.jsx)(yg,{children:(0,H.jsxs)(bg,{align:s,sideOffset:8,collisionPadding:12,className:`z-50 w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,children:[(0,H.jsx)(xg,{className:`px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground`,children:e}),r.map(e=>{let t=e.icon,n=i===e.href||i.startsWith(`${e.href}/`);return(0,H.jsx)(Sg,{asChild:!0,children:(0,H.jsxs)(`a`,{href:e.href,"aria-current":n?`page`:void 0,className:`flex cursor-pointer items-start gap-3 rounded-lg px-2.5 py-2.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground ${n?`bg-accent/70 text-accent-foreground`:`text-foreground`}`,children:[(0,H.jsx)(`span`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,H.jsx)(t,{className:`size-3.5`,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[e.label,(o[e.href]??0)>0&&(0,H.jsx)(Pg,{value:o[e.href]??0,label:`${o[e.href]} open ${e.label.toLowerCase()} items`})]}),(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:e.description})]})]})},e.href)})]})})]})}function Pg({value:e,label:t}){return(0,H.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full bg-danger px-1.5 py-0.5 text-xs font-semibold leading-4 text-primary-foreground`,"aria-label":t,children:e>99?`99+`:e})}function Fg(e){return`unstyled inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-sm font-semibold transition-colors sm:px-2.5 ${e?`border-sapphire-light bg-sapphire-glow text-sapphire shadow-baziu-sm`:`border-transparent text-mocha hover:border-frost hover:bg-ivory hover:text-sapphire`}`}var Ig=U({method:`GET`}).handler(B(`a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2`)),Lg=new Set([`/login`]),Rg=[`/welcome`,`/config`];function zg(e){for(let t of Rg)if(e===t||e.startsWith(`${t}/`))return!0;return!1}function Bg(e){let t=`${encodeURIComponent(e)}=`;for(let e of document.cookie.split(`;`)){let n=e.trim();if(n.startsWith(t))return decodeURIComponent(n.slice(t.length))}return null}function Vg(){if(typeof window>`u`)return;let e=`__bazilionCsrfFetchInstalled`,t=window;if(t[e])return;t[e]=!0;let n=window.fetch.bind(window);window.fetch=(e,t)=>{let r=e instanceof Request?e:null,i=(t?.method??r?.method??`GET`).toUpperCase();if(new URL(r?.url??String(e),window.location.href).origin!==window.location.origin||[`GET`,`HEAD`,`OPTIONS`].includes(i))return n(e,t);let a=Bg(`__Host-bz_csrf`)??Bg(`bz_csrf_dev`);if(!a)return n(e,t);let o=new Headers(r?.headers??void 0);for(let[e,n]of new Headers(t?.headers))o.set(e,n);return o.set(`x-bazilion-csrf`,a),n(e,{...t,headers:o})}}var Hg=`/assets/styles-B5vcgXln.css`,Ug=`(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;Vg();var $=le({beforeLoad:async({location:e})=>{let t=e.pathname;if(Lg.has(t)||t.startsWith(`/api/`))return;let n=await Ig();if(!n.authed)throw se({to:`/login`,search:{}});if(!zg(t)&&!n.setupComplete)throw se({to:`/welcome`})},head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`bazilion`}],links:[{rel:`icon`,type:`image/svg+xml`,href:`/baziu.svg`},{rel:`stylesheet`,href:Hg}]}),component:Gg,notFoundComponent:Wg});function Wg(){let e=Cs({select:e=>e.location.pathname});return(0,H.jsx)(`div`,{className:`mx-auto max-w-2xl`,children:(0,H.jsxs)(`div`,{className:`card`,children:[(0,H.jsx)(`h1`,{children:`Not found`}),(0,H.jsxs)(`p`,{className:`muted my-3`,children:[`Nothing lives at `,(0,H.jsx)(`code`,{children:e}),`.`]}),(0,H.jsx)(oe,{to:`/`,children:`Back to home`})]})})}function Gg(){let e=Cs({select:e=>e.location.pathname}),t=e===`/login`,n=e===`/`;return(0,H.jsxs)(`html`,{lang:`en`,"data-layout":n?`workspace`:`page`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(`script`,{dangerouslySetInnerHTML:{__html:Ug}}),(0,H.jsx)(Os,{})]}),(0,H.jsxs)(`body`,{"data-layout":n?`workspace`:`page`,children:[!t&&(0,H.jsx)(`a`,{href:`#main-content`,className:`sr-only z-[100] rounded-lg bg-primary px-4 py-2 font-semibold text-primary-foreground focus:not-sr-only focus:fixed focus:left-3 focus:top-3`,children:`Skip to main content`}),t?(0,H.jsx)(ms,{}):n?(0,H.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,H.jsx)(`div`,{className:`px-3 sm:px-5`,children:(0,H.jsx)(Mg,{})}),(0,H.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-hidden px-3 pb-3 sm:px-5 sm:pb-5`,children:(0,H.jsx)(ms,{})})]}):(0,H.jsxs)(`div`,{className:`flex min-h-dvh flex-col`,children:[(0,H.jsx)(`div`,{className:`px-3 sm:px-5`,children:(0,H.jsx)(Mg,{})}),(0,H.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`mx-auto w-full max-w-[1500px] flex-1 px-4 py-9 sm:px-6 sm:py-12`,children:(0,H.jsx)(ms,{})}),(0,H.jsx)(`div`,{className:`px-4 sm:px-6`,children:(0,H.jsx)(Ks,{})})]}),(0,H.jsx)(ks,{})]})]})}var Kg=j(`/welcome`)({beforeLoad:async()=>{if((await Ig()).setupComplete)throw se({to:`/`})},component:A(()=>M(()=>import(`./welcome-B49sh_uf.js`),__vite__mapDeps([0,1,2,3])),`component`)}),qg=j(`/login`)({validateSearch:e=>({error:e.error===`token`||e.error===`origin`?e.error:void 0}),component:A(()=>M(()=>import(`./login-CCMPXiny.js`),__vite__mapDeps([4,1])),`component`)}),Jg=()=>M(()=>import(`./routes-g3yUOhCb.js`),__vite__mapDeps([5,1,6,7,8,9,10,3,11,12])),Yg=U({method:`POST`}).handler(B(`26dbbcbe40063e8aedfd343cf1dfd4dfe5589f24591c0ba35e80c611d7c57c7c`)),Xg=j(`/`)({validateSearch:e=>({agent:typeof e.agent==`string`?e.agent:void 0}),loaderDeps:({search:e})=>({agentId:e.agent}),loader:({deps:e})=>Yg({data:{agentId:e.agentId}}),component:A(Jg,`component`)}),Zg=j(`/templates/`)({beforeLoad:()=>{throw se({to:`/templates/agents`})}}),Qg=()=>M(()=>import(`./teams-CSNyLz3l.js`),__vite__mapDeps([13,1,14,8])),$g=()=>M(()=>import(`./teams-tNoMDJ_M.js`),__vite__mapDeps([15,1,6,7,8,10,2,3])),e_=U({method:`GET`}).handler(B(`1ab05a58944792f34ad279deeaa56f70e9360687856b18327f335b022e8d21a5`)),t_=j(`/teams/`)({loader:()=>e_(),component:A($g,`component`),errorComponent:A(Qg,`errorComponent`)}),n_=()=>M(()=>import(`./skills-BP2gciFt.js`),__vite__mapDeps([16,1,6,7,8,10,2,3])),r_=U({method:`GET`}).handler(B(`ae1d30575b229c1e2622fbaf2252800a9a7acc84afdd68cba025ca890b8d52c5`)),i_=j(`/skills/`)({loader:()=>r_(),component:A(n_,`component`)}),a_=()=>M(()=>import(`./config-By86S7k-.js`),__vite__mapDeps([17,1,6,7,8,18,2,3,19,10,20,11])),o_=U({method:`GET`}).handler(B(`b18a227687dba45b99ea5a2ac7a5bf8efcd9bc54387bc279cd87510fd2f83f7e`)),s_=j(`/config/`)({loader:()=>o_(),component:A(a_,`component`)}),c_=()=>M(()=>import(`./attention-Gavt2yEp.js`),__vite__mapDeps([21,1,14,8])),l_=()=>M(()=>import(`./attention-B9bUrxiU.js`),__vite__mapDeps([22,1,6,7,8,2,3])),u_=U({method:`GET`}).handler(B(`883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a`)),d_=j(`/attention/`)({loader:()=>u_(),component:A(l_,`component`),errorComponent:A(c_,`errorComponent`)}),f_=()=>M(()=>import(`./approvals-DGi0PSx8.js`),__vite__mapDeps([23,1,14,8])),p_=()=>M(()=>import(`./approvals-BIdZ9BSn.js`),__vite__mapDeps([24,1,8,2,3,7])),m_=U({method:`GET`}).handler(B(`816fcbc7b3c7f2952660d3a2c8f49bb0c91084627a284c185b333b1d418fadf8`)),h_=j(`/approvals/`)({loader:()=>m_(),component:A(p_,`component`),errorComponent:A(f_,`errorComponent`)}),g_=()=>M(()=>import(`./agents-BeeFCt2c.js`),__vite__mapDeps([25,1,6,7,26,8,10,2,3])),__=U({method:`POST`}).handler(B(`f715bab0037380aa3db7e237e7cf1e74168c363f48a960bb1ddfa5560de3a74e`)),v_=j(`/agents/`)({validateSearch:e=>({all:e.all===`1`?`1`:void 0}),loaderDeps:({search:e})=>({all:e.all===`1`}),loader:({deps:e})=>__({data:{all:e.all}}),component:A(g_,`component`)}),y_=()=>M(()=>import(`./tokens-eDWCGQQ2.js`),__vite__mapDeps([27,1,6,7,8,18,2,3,19,10])),b_=U({method:`POST`}).handler(B(`46e35c9f1afc79423cb49703b454ef684344db08ec19775efd70a8768c7837f1`)),x_=j(`/config/tokens`)({validateSearch:e=>({all:e.all===`1`?`1`:void 0}),loaderDeps:({search:e})=>({all:e.all===`1`}),loader:({deps:e})=>b_({data:e}),component:A(y_,`component`)}),S_=()=>M(()=>import(`./services-1Z398CES.js`),__vite__mapDeps([28,1,18,2,3,19,20,6,7,8,10])),C_=U({method:`GET`}).handler(B(`6afd81bef0ee381d6e3641cd8e269968429c874e2f9d56c8f818cc9d180ee477`)),w_=j(`/config/services`)({loader:()=>C_(),component:A(S_,`component`)}),T_=()=>M(()=>import(`./mcp-DKSY2yVa.js`),__vite__mapDeps([29,1,6,7,8,18,2,3,19,10])),E_=U({method:`GET`}).handler(B(`278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7`)),D_=j(`/config/mcp`)({loader:()=>E_(),component:A(T_,`component`)}),O_=()=>M(()=>import(`./teams-DBIivGT7.js`),__vite__mapDeps([30,1,6,7,8,2,3,31,19])),k_=U({method:`GET`}).handler(B(`1bb12262aaa902fa208aafaa70b69c63da34c1fe523ab0322fe766903fc6b4c1`)),A_=j(`/templates/teams/`)({loader:()=>k_(),component:A(O_,`component`)}),j_=()=>M(()=>import(`./agents-C8OVKq3N.js`),__vite__mapDeps([32,1,6,7,8,10,2,3,31,19,33,34,35])),M_=U({method:`GET`}).handler(B(`bc31355f2be9889a616d03c35062d483ea77c3f967af9432d721626a81078ef3`)),N_=j(`/templates/agents/`)({loader:()=>M_(),component:A(j_,`component`)}),P_=()=>M(()=>import(`./_id-Cx7o4Zmf.js`),__vite__mapDeps([36,1,6,7,8,2,3,37,19,33,10])),F_=U({method:`POST`}).handler(B(`4773184b3ddd3656fb80ec74375a6d304e25acb56b79f1d349dcabf9f0914359`)),I_=j(`/teams/$id/`)({loader:async({params:e})=>{let t=await F_({data:{id:e.id}});if(!t)throw se({to:`/teams`});return t},component:A(P_,`component`)}),L_=()=>M(()=>import(`./_id-DIiVVxBl.js`),__vite__mapDeps([38,1,6,7,26,39,2,3,19,8,9,10])),R_=U({method:`POST`}).handler(B(`846c9081aed17057351730985f133b0aab67a5dabfca9562552829a90ff30849`)),z_=j(`/agents/$id/`)({validateSearch:e=>({...e.mode===`settings`?{mode:`settings`}:{},...typeof e.teamPolicy==`string`&&e.teamPolicy?{teamPolicy:e.teamPolicy}:{},...e.view===`matrix`||e.view===`flow`?{view:e.view}:{},...typeof e.selected==`string`?{selected:e.selected}:{},...Number.isFinite(Number(e.vx))?{vx:Number(e.vx)}:{},...Number.isFinite(Number(e.vy))?{vy:Number(e.vy)}:{},...Number.isFinite(Number(e.vz))?{vz:Number(e.vz)}:{}}),loader:async({params:e})=>{let t=await R_({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(L_,`component`)}),B_=()=>M(()=>import(`./policy-K4hIbbIN.js`),__vite__mapDeps([40,1,14,8])),V_=()=>M(()=>import(`./policy-TBGQffw5.js`),__vite__mapDeps([41,1,8,2,3,14,37,6,7,19,42,10,33,35,12,43])),H_=U({method:`POST`}).handler(B(`fc940d6dec5305aa64bdb9b9f5f7d4f925b2ba0608cb6d39af854a94872fc867`)),U_=j(`/teams/$id/policy`)({validateSearch:e=>({view:e.view===`matrix`?`matrix`:`flow`,selected:typeof e.selected==`string`?e.selected:null,vx:Number.isFinite(Number(e.vx))?Number(e.vx):0,vy:Number.isFinite(Number(e.vy))?Number(e.vy):0,vz:Number.isFinite(Number(e.vz))?Number(e.vz):.9}),loader:({params:e})=>H_({data:e}),component:A(V_,`component`),errorComponent:A(B_,`errorComponent`)}),W_=()=>M(()=>import(`./memory-DiGMI6FC.js`),__vite__mapDeps([44,1,8,10,7,2,3,37,6,19,33])),G_=U({method:`POST`}).handler(B(`b96a98e3ed6c8a3ab5f6a4ed8458e93da753ffd74e2912ef1724bb6e58030cb5`)),K_=j(`/teams/$id/memory`)({loader:async({params:e})=>{let t=await G_({data:{id:e.id}});if(!t)throw se({to:`/teams`});return t},component:A(W_,`component`)}),q_=()=>M(()=>import(`./members-9GuOiq6J.js`),__vite__mapDeps([45,1,2,3,37,6,7,19])),J_=U({method:`POST`}).handler(B(`0a6e766d2b4ea526da34cefed5342a6ecc5ff35ad1ce38fba4129b8c24d8e6e5`)),Y_=j(`/teams/$id/members`)({loader:({params:e})=>J_({data:e}),component:A(q_,`component`)}),X_=j(`/teams/$id/context`)({beforeLoad:({params:e})=>{throw se({to:`/teams/$id`,params:{id:e.id}})}}),Z_=()=>M(()=>import(`./activity-DJuhhQCb.js`),__vite__mapDeps([46,1,14,8])),Q_=()=>M(()=>import(`./activity-A_HrG1Tv.js`),__vite__mapDeps([47,1,8,2,3,37,6,7,19])),$_=U({method:`POST`}).handler(B(`5cdb81f2b930818ee9ab1d626ac99828ea652ff447fcbfc21b24dea415f8b39e`)),ev=j(`/teams/$id/activity`)({loader:({params:e})=>$_({data:e}),component:A(Q_,`component`),errorComponent:A(Z_,`errorComponent`)}),tv=()=>M(()=>import(`./telegram-CJG_DFdI.js`),__vite__mapDeps([48,1,6,7,8,18,2,3,19,10])),nv=U({method:`GET`}).handler(B(`00a157dd07824e1f126f06646effd1d876f280f6fc64c144d2f6429414a4e58a`)),rv=j(`/config/integrations/telegram`)({loader:()=>nv(),component:A(tv,`component`)}),iv=()=>M(()=>import(`./triggers-DZME3IcK.js`),__vite__mapDeps([49,1,6,7,39,2,3,19,8,10])),av=U({method:`POST`}).handler(B(`57ebf437fdb3fcfc63b176e796a55f04bdfec0b230059673196e98d413d15c4d`)),ov=j(`/agents/$id/triggers`)({loader:async({params:e})=>{let t=await av({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(iv,`component`)}),sv=()=>M(()=>import(`./learning-BqZIw2nA.js`),__vite__mapDeps([50,1,6,7,39,2,3,19,8,10])),cv=U({method:`POST`}).handler(B(`fcdd0f08b635c7c501caa840d01d1376ace6683e26cc5ac7dead28d7870f98b9`)),lv=j(`/agents/$id/learning`)({loader:async({params:e})=>{let t=await cv({data:{id:e.id}});if(!t)throw se({to:`/agents`});return t},component:A(sv,`component`)}),uv=()=>M(()=>import(`./inbox-DlXQCJLe.js`),__vite__mapDeps([51,1,39,2,3,19])),dv=U({method:`POST`}).handler(B(`2cd8c6ec40e2e2d9518b5f127a518ecd83a2222d85665cc61d5144bcf59ed4fb`)),fv=j(`/agents/$id/inbox`)({validateSearch:e=>({unread:e.unread===`1`?`1`:void 0,id:typeof e.id==`string`?e.id:void 0}),loaderDeps:({search:e})=>({unreadOnly:e.unread===`1`,selectedId:e.id??``}),loader:async({params:e,deps:t})=>{let n=await dv({data:{id:e.id,...t}});if(!n)throw se({to:`/agents`});return n},component:A(uv,`component`)}),pv=()=>M(()=>import(`./_id-DGyKURCp.js`),__vite__mapDeps([52,1,14,8])),mv=()=>M(()=>import(`./_id-3w4PFfma.js`),__vite__mapDeps([53,1,2,3,14,8,31,6,7,19,42,10,33,35,12,43])),hv=U({method:`POST`}).handler(B(`a0bbbee5d0c1240a05e35c04d56a0e95ec78f05265e4e937eec48c8ac2041e58`)),gv=j(`/templates/teams/$id/`)({loader:({params:e})=>hv({data:e}),component:A(mv,`component`),errorComponent:A(pv,`errorComponent`)}),_v=()=>M(()=>import(`./_id-BH3v_vI_.js`),__vite__mapDeps([54,1,6,7,2,3,31,19,33,10,8,34,35])),vv=U({method:`POST`}).handler(B(`032d74b7d41c718191dbdde6b06ba44993340ce1154af1fa6723a6d4f7a7236e`)),yv=j(`/templates/agents/$id/`)({loader:async({params:e})=>{let t=await vv({data:{id:e.id}});if(!t)throw se({to:`/templates/agents`});return t},component:A(_v,`component`)}),bv=Kg.update({id:`/welcome`,path:`/welcome`,getParentRoute:()=>$}),xv=qg.update({id:`/login`,path:`/login`,getParentRoute:()=>$}),Sv=Xg.update({id:`/`,path:`/`,getParentRoute:()=>$}),Cv=Zg.update({id:`/templates/`,path:`/templates/`,getParentRoute:()=>$}),wv=t_.update({id:`/teams/`,path:`/teams/`,getParentRoute:()=>$}),Tv=i_.update({id:`/skills/`,path:`/skills/`,getParentRoute:()=>$}),Ev=s_.update({id:`/config/`,path:`/config/`,getParentRoute:()=>$}),Dv=d_.update({id:`/attention/`,path:`/attention/`,getParentRoute:()=>$}),Ov=h_.update({id:`/approvals/`,path:`/approvals/`,getParentRoute:()=>$}),kv=v_.update({id:`/agents/`,path:`/agents/`,getParentRoute:()=>$}),Av=x_.update({id:`/config/tokens`,path:`/config/tokens`,getParentRoute:()=>$}),jv=w_.update({id:`/config/services`,path:`/config/services`,getParentRoute:()=>$}),Mv=D_.update({id:`/config/mcp`,path:`/config/mcp`,getParentRoute:()=>$}),Nv=A_.update({id:`/templates/teams/`,path:`/templates/teams/`,getParentRoute:()=>$}),Pv=N_.update({id:`/templates/agents/`,path:`/templates/agents/`,getParentRoute:()=>$}),Fv=I_.update({id:`/teams/$id/`,path:`/teams/$id/`,getParentRoute:()=>$}),Iv=z_.update({id:`/agents/$id/`,path:`/agents/$id/`,getParentRoute:()=>$}),Lv=U_.update({id:`/teams/$id/policy`,path:`/teams/$id/policy`,getParentRoute:()=>$}),Rv=K_.update({id:`/teams/$id/memory`,path:`/teams/$id/memory`,getParentRoute:()=>$}),zv=Y_.update({id:`/teams/$id/members`,path:`/teams/$id/members`,getParentRoute:()=>$}),Bv=X_.update({id:`/teams/$id/context`,path:`/teams/$id/context`,getParentRoute:()=>$}),Vv=ev.update({id:`/teams/$id/activity`,path:`/teams/$id/activity`,getParentRoute:()=>$}),Hv=rv.update({id:`/config/integrations/telegram`,path:`/config/integrations/telegram`,getParentRoute:()=>$}),Uv=ov.update({id:`/agents/$id/triggers`,path:`/agents/$id/triggers`,getParentRoute:()=>$}),Wv=lv.update({id:`/agents/$id/learning`,path:`/agents/$id/learning`,getParentRoute:()=>$}),Gv=fv.update({id:`/agents/$id/inbox`,path:`/agents/$id/inbox`,getParentRoute:()=>$}),Kv=gv.update({id:`/templates/teams/$id/`,path:`/templates/teams/$id/`,getParentRoute:()=>$}),qv={IndexRoute:Sv,LoginRoute:xv,WelcomeRoute:bv,ConfigMcpRoute:Mv,ConfigServicesRoute:jv,ConfigTokensRoute:Av,AgentsIndexRoute:kv,ApprovalsIndexRoute:Ov,AttentionIndexRoute:Dv,ConfigIndexRoute:Ev,SkillsIndexRoute:Tv,TeamsIndexRoute:wv,TemplatesIndexRoute:Cv,AgentsIdInboxRoute:Gv,AgentsIdLearningRoute:Wv,AgentsIdTriggersRoute:Uv,ConfigIntegrationsTelegramRoute:Hv,TeamsIdActivityRoute:Vv,TeamsIdContextRoute:Bv,TeamsIdMembersRoute:zv,TeamsIdMemoryRoute:Rv,TeamsIdPolicyRoute:Lv,AgentsIdIndexRoute:Iv,TeamsIdIndexRoute:Fv,TemplatesAgentsIndexRoute:Pv,TemplatesTeamsIndexRoute:Nv,TemplatesAgentsIdIndexRoute:yv.update({id:`/templates/agents/$id/`,path:`/templates/agents/$id/`,getParentRoute:()=>$}),TemplatesTeamsIdIndexRoute:Kv},Jv=$._addFileChildren(qv);function Yv(){return ys({routeTree:Jv,scrollRestoration:!0,defaultPreload:`intent`})}async function Xv(){let e=await Yv(),t;if(Us){let n=await Us.getOptions();n.serializationAdapters=n.serializationAdapters??[],window.__TSS_START_OPTIONS__=n,t=n.serializationAdapters,e.options.defaultSsr=n.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(Eo),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await Mo(e),e}var Zv=Xv;async function Qv(){let e=await Zv();return window.$_TSR?.h(),e}var $v;function ey(){return $v||=Qv(),(0,H.jsx)(Po,{promise:$v,children:e=>(0,H.jsx)(Ss,{router:e})})}var ty=Te();(0,V.startTransition)(()=>{(0,ty.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(ey,{})}))});export{Nl as A,bc as B,t_ as C,Yu as D,Og as E,Uc as F,ac as G,vc as H,zc as I,Gs as J,ic as K,W as L,cl as M,dl as N,Vu as O,Zc as P,Fc as R,i_ as S,qg as T,hc as U,yc as V,fc as W,Cs as X,Ws as Y,x_ as _,ov as a,d_ as b,Y_ as c,z_ as d,I_ as f,w_ as g,D_ as h,lv as i,bl as j,Il as k,K_ as l,A_ as m,gv as n,rv as o,N_ as p,nc as q,fv as r,ev as s,yv as t,U_ as u,v_ as v,Xg as w,s_ as x,h_ as y,Nc as z};