@tickernelz/wardmote-ui 2026.1118.0 → 2026.1118.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.
- package/dist/assets/{AdapterManager-Cz1qnS9X.js → AdapterManager-DvntZ2AW.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-7YTRdxju.js → AdvancedToolsRoute-CUW8D9Ux.js} +1 -1
- package/dist/assets/{AgentActionButtons-CE0nmrqG.js → AgentActionButtons-CQLGCtfu.js} +1 -1
- package/dist/assets/{AgentBubbleActionRow-Dqrx638X.js → AgentBubbleActionRow-CnkfFlB3.js} +1 -1
- package/dist/assets/{AgentChat-AunGdpGT.js → AgentChat-DCwwZA2b.js} +1 -1
- package/dist/assets/{AgentChats-T9fzOwzH.js → AgentChats-DMMLdo-o.js} +1 -1
- package/dist/assets/{AgentDefaults-C0WFwQky.js → AgentDefaults-Cu8O2iTJ.js} +1 -1
- package/dist/assets/{AgentDetail-DEmzneVa.js → AgentDetail-BMVWOVp-.js} +7 -7
- package/dist/assets/{AgentIconPicker-BJerBmcL.js → AgentIconPicker-DJaVz-Vx.js} +1 -1
- package/dist/assets/{AgentTodoCard-D1lORgGy.js → AgentTodoCard-C4BfJg4x.js} +1 -1
- package/dist/assets/Agents-C0IDC6KD.js +3 -0
- package/dist/assets/{AppDetail-BX1FNfWC.js → AppDetail-DzEGsx94.js} +1 -1
- package/dist/assets/{AppNotConnected-7VCE3fbW.js → AppNotConnected-BVL32B49.js} +1 -1
- package/dist/assets/{ApprovalCard-BFjlBJIl.js → ApprovalCard-DCQ49PuW.js} +1 -1
- package/dist/assets/{ApprovalDetail-nh-aAVQ1.js → ApprovalDetail-B0J70llD.js} +1 -1
- package/dist/assets/{ApprovalPayload-CrxNpWYr.js → ApprovalPayload-8lqBw-XQ.js} +1 -1
- package/dist/assets/{Approvals-T3qTJIwh.js → Approvals-BkiVjx0M.js} +1 -1
- package/dist/assets/{AppsConnect-D7l2xnv-.js → AppsConnect-B_hvpdTB.js} +1 -1
- package/dist/assets/{AppsReview-BQpLs2ic.js → AppsReview-CeXp22cE.js} +1 -1
- package/dist/assets/{ArtifactCard-9vsmkZzO.js → ArtifactCard-BV82tDLI.js} +1 -1
- package/dist/assets/{Artifacts-DN7vvCse.js → Artifacts-CL5ZmZ3m.js} +1 -1
- package/dist/assets/{AssistantConnection-DFVB49U5.js → AssistantConnection-C5rmoEsm.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-61BN1ky5.js → AttentionInteractionResolver-DxZpuIIF.js} +1 -1
- package/dist/assets/AuditHub-DDPFGvHG.js +1 -0
- package/dist/assets/{Auth-D0lGuVnd.js → Auth-CkILt4fl.js} +1 -1
- package/dist/assets/{BoardChat-CMIqWEbi.js → BoardChat-DlaNGzcQ.js} +3 -3
- package/dist/assets/{BoardClaim-CbYY66Qd.js → BoardClaim-B135Nebr.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-M3IOGjXI.js → BootstrapSetupUxLab-B2tOIzXd.js} +1 -1
- package/dist/assets/{Browse-AYCtuCFi.js → Browse-xEc9mGl7.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-Cwm5wpvU.js → BudgetPolicyCard-Ccr3EX5M.js} +1 -1
- package/dist/assets/{CaseDetail-CgZ4u934.js → CaseDetail-CvMk_M-F.js} +2 -2
- package/dist/assets/{Cases-BvCHo_JJ.js → Cases-H1Y4Oipe.js} +2 -2
- package/dist/assets/{ChatEndpointDetail-CM83nK2S.js → ChatEndpointDetail-CjDVQWl8.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-Dzm1h4LA.js → ChatEndpointSetup-BfohtKVM.js} +1 -1
- package/dist/assets/{ChatIdentityConfirm-Dc4AnYX8.js → ChatIdentityConfirm-tOTIxwjm.js} +1 -1
- package/dist/assets/{CliAuth-CatEsBxW.js → CliAuth-CE0EwTW_.js} +1 -1
- package/dist/assets/{Companies-BBdNER6U.js → Companies-C4ObCu9j.js} +1 -1
- package/dist/assets/{CompanyAccess-CX4qyiXc.js → CompanyAccess-J5Vwnko2.js} +1 -1
- package/dist/assets/{CompanyActivity-Csqqnldg.js → CompanyActivity-B7-kMNmz.js} +1 -1
- package/dist/assets/{CompanyConnections-Ds1e8fjb.js → CompanyConnections-D2N6UWXk.js} +1 -1
- package/dist/assets/{CompanyEnvironments-BQGpdLk1.js → CompanyEnvironments-ChSu4gxW.js} +1 -1
- package/dist/assets/{CompanyExport-CBJU6SZ5.js → CompanyExport-B_opHRSJ.js} +1 -1
- package/dist/assets/{CompanyImport-BtODUy1v.js → CompanyImport-DZAMEBBy.js} +1 -1
- package/dist/assets/{CompanySettings-x6CbuKeE.js → CompanySettings-Rz8cwgKC.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-CEDKNwLY.js → CompanySettingsPluginPage-CM-ViPwj.js} +1 -1
- package/dist/assets/{CompanySkills-C32TKvfI.js → CompanySkills-BnwPuZze.js} +2 -2
- package/dist/assets/{ComposerAddMenu-BPPkbm0o.js → ComposerAddMenu-jKf-6Yli.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-v8kbSAuE.js → ConfigureBuiltInAgentModal-BAfoTveX.js} +1 -1
- package/dist/assets/{ConnectionSetupFlow-g6asOGFg.js → ConnectionSetupFlow-8alK3I_h.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-DM4I2CJE.js → CopyableGatewayUrl-D90Bjxj0.js} +1 -1
- package/dist/assets/{Dashboard-4TvnZKHQ.js → Dashboard-DepIxrje.js} +2 -2
- package/dist/assets/{DecisionDateChips-H3AqvYWG.js → DecisionDateChips-89KkV4mo.js} +1 -1
- package/dist/assets/{DecisionModelSettings-HEZJ0E6n.js → DecisionModelSettings-CvVCBVCM.js} +1 -1
- package/dist/assets/{DecisionQueuePage-C--TNteA.js → DecisionQueuePage-nU9qXzln.js} +1 -1
- package/dist/assets/{DesignGuide-PDM2oacG.js → DesignGuide-40TixHZ-.js} +4 -4
- package/dist/assets/{EmailEndpointSetup-B0haS5AA.js → EmailEndpointSetup-D7-8f1XV.js} +1 -1
- package/dist/assets/{EntityRow-B24YmFE7.js → EntityRow-jUxCK6IM.js} +1 -1
- package/dist/assets/ExecutionWorkspaceDetail-CnUD3jLO.js +19 -0
- package/dist/assets/{GatewayDetail-CtpVgcnJ.js → GatewayDetail-Bg7GU-1a.js} +2 -2
- package/dist/assets/{GatewaysList-DCuMJisg.js → GatewaysList-4vvZCBkY.js} +1 -1
- package/dist/assets/{GoalDetail-B4Iw4vhL.js → GoalDetail-h7WsjaOO.js} +1 -1
- package/dist/assets/{GoalTree-Bxei53eI.js → GoalTree-yPtfejUx.js} +1 -1
- package/dist/assets/{Goals-CszzFpXF.js → Goals-DOi3E4DX.js} +1 -1
- package/dist/assets/{ImageGalleryModal-7mN3BVkG.js → ImageGalleryModal-D_VQgcBt.js} +1 -1
- package/dist/assets/{Inbox-Dzj03JZw.js → Inbox-COKxRKhR.js} +2 -2
- package/dist/assets/{InlineBanner-DYx7A02D.js → InlineBanner-DeTqU5Gp.js} +1 -1
- package/dist/assets/{InlineEditor-BJTE1pyF.js → InlineEditor-4ew5gxf0.js} +1 -1
- package/dist/assets/{InstanceAdvanced-HzNvpWAC.js → InstanceAdvanced-DlMlwZbU.js} +1 -1
- package/dist/assets/{InstanceFeatures-C1eqcxDI.js → InstanceFeatures-BbDE9waY.js} +1 -1
- package/dist/assets/{InviteLanding-BHDk8eVb.js → InviteLanding-BGvJMHKw.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-E61LYLEE.js → IssueChatLongThreadPerf-C3U2FZKJ.js} +1 -1
- package/dist/assets/{IssueChatThread-DERjeWcT.js → IssueChatThread-CDKaIB6v.js} +10 -10
- package/dist/assets/{IssueDetail--oKqoH82.js → IssueDetail-BCwHANTn.js} +6 -6
- package/dist/assets/{IssueDocumentAnnotations-DjcRXcEw.js → IssueDocumentAnnotations-DpFXlkRb.js} +1 -1
- package/dist/assets/{IssueOutputSection-Dvul0VAn.js → IssueOutputSection-BzXRmoV7.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-DpJjLu9A.js → IssueRecoveryActionCard-BYtbaP-M.js} +1 -1
- package/dist/assets/{IssueReferencePill-DIqTKSRc.js → IssueReferencePill-BT7NBEy_.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-PnjBaM8M.js → IssueThreadInteractionCard-Btd0rZ23.js} +1 -1
- package/dist/assets/{Issues-Dwcvbvvw.js → Issues-XKf7zemQ.js} +3 -3
- package/dist/assets/{LiveNowTodoLine-B3GKP4a7.js → LiveNowTodoLine-CoL6ZNuK.js} +1 -1
- package/dist/assets/ManagedAiConnectionDetails-CebBi-Tw.js +1 -0
- package/dist/assets/{MarkdownBody-D7qCQaU_.js → MarkdownBody-cPGkwwjq.js} +1 -1
- package/dist/assets/{McpConnect-CYz1a9lA.js → McpConnect-ByorZN7G.js} +1 -1
- package/dist/assets/{MembershipAction-BCf-FK7R.js → MembershipAction-De0MBfgb.js} +1 -1
- package/dist/assets/{MetricCard-DlcBTKQs.js → MetricCard-CTOmJVRL.js} +1 -1
- package/dist/assets/{MissingPluginTabPlaceholder-l1R-Q4nh.js → MissingPluginTabPlaceholder-D3N0rd-p.js} +1 -1
- package/dist/assets/{ModelsAndProviders-CI6zoBD9.js → ModelsAndProviders-BqM4UJc7.js} +1 -1
- package/dist/assets/{NewAgent-BWaZTy_v.js → NewAgent-pMTQYNxn.js} +1 -1
- package/dist/assets/{OmpAllSettings-DTJLATQL.js → OmpAllSettings-BeXrdLBc.js} +1 -1
- package/dist/assets/{PipelineSettings-pFkHM2Ns.js → PipelineSettings-C2k3BzLQ.js} +2 -2
- package/dist/assets/Pipelines-Cr6Xs32p.js +1 -0
- package/dist/assets/PixelsOffice-Dfd4XKSj.js +2 -0
- package/dist/assets/{PluginManager-DkADWuR8.js → PluginManager-7ZdeHrGQ.js} +1 -1
- package/dist/assets/{PluginPage-CBAkPwZs.js → PluginPage-fPlWyFSc.js} +1 -1
- package/dist/assets/{PluginSettings-CsXh8PMi.js → PluginSettings-X_VHvvo5.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-B6mZqIhS.js → ProfileDetailRoute-PAsWmN-1.js} +1 -1
- package/dist/assets/{ProfileSettings-BZG_OvIh.js → ProfileSettings-BACxlGZS.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-yUXZqjqr.js → ProfileWizardRoute-Dbq0n7If.js} +1 -1
- package/dist/assets/ProjectDetail-DOJZUIWu.js +1 -0
- package/dist/assets/{ProjectWorkspaceDetail-rSo7mMQc.js → ProjectWorkspaceDetail-ZNnaHnuA.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-DnGszD3v.js → ProjectWorkspacesContent-DrWfnTJY.js} +1 -1
- package/dist/assets/{Projects-kZ7Li_8n.js → Projects-CCzxmEZ8.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-DMy8nXt2.js → PublicIssueSharePage-BUSkP1Js.js} +1 -1
- package/dist/assets/{QuestionForm-DF6R7lYE.js → QuestionForm-MfSDsey7.js} +1 -1
- package/dist/assets/{RepositoryEditor-BuV4JRgV.js → RepositoryEditor-2QyuT99t.js} +1 -1
- package/dist/assets/{ReviewQueueCard-Bz8uXwnD.js → ReviewQueueCard-CrCN_30c.js} +1 -1
- package/dist/assets/{RichWorkProductCard-BCB8SaZp.js → RichWorkProductCard-DndJn4LV.js} +1 -1
- package/dist/assets/{RoutineDetail-C-gt9_NY.js → RoutineDetail-B5MzV_74.js} +2 -2
- package/dist/assets/{RoutineRunVariablesDialog-CrKptoDW.js → RoutineRunVariablesDialog-kGyQVBid.js} +1 -1
- package/dist/assets/Routines-B2zX9h3J.js +1 -0
- package/dist/assets/ScrollToBottom-Dd3SpeJi.js +1 -0
- package/dist/assets/{Search-B-8DqpI2.js → Search-D4W3cZZf.js} +1 -1
- package/dist/assets/{Secrets-CPNzZnuu.js → Secrets-C4nbuMIh.js} +3 -3
- package/dist/assets/{SidebarNavItem-afEXEFeo.js → SidebarNavItem-kYI7H9f3.js} +1 -1
- package/dist/assets/{SkillSourceTree-CR8rC1PY.js → SkillSourceTree-BvGzMa2u.js} +1 -1
- package/dist/assets/{SkillSources-3haDckt2.js → SkillSources-DL2tNkcr.js} +1 -1
- package/dist/assets/{SkillStudio-CXzQR1ws.js → SkillStudio-BnZ2cfDq.js} +1 -1
- package/dist/assets/{SourceTrustBadge-DNvpVd9i.js → SourceTrustBadge-CCPQEGrC.js} +1 -1
- package/dist/assets/{StatusCards-D-O7dS5f.js → StatusCards-BkE-9R8F.js} +1 -1
- package/dist/assets/{StatusIcon-Bx4H7RuA.js → StatusIcon-Cs1RbJGu.js} +1 -1
- package/dist/assets/{SummarySlotCard-CYpYMfTa.js → SummarySlotCard-D1EyiciB.js} +1 -1
- package/dist/assets/{TaskChatLab-BfxurxKS.js → TaskChatLab-D3PsNRr5.js} +1 -1
- package/dist/assets/{TaskChatMarker-Cj8k3l9N.js → TaskChatMarker-DEF88_sr.js} +2 -2
- package/dist/assets/{TaskChatProtocolCard-BsdB1fYv.js → TaskChatProtocolCard-Ba_vhDxn.js} +1 -1
- package/dist/assets/{TaskChatThreadView-B90tQ4X1.js → TaskChatThreadView-BsPvbxiA.js} +1 -1
- package/dist/assets/{TaskTreeControls-zoH_P07l.js → TaskTreeControls-BKOIbilg.js} +2 -2
- package/dist/assets/{Terminal-y6EdGsxY.js → Terminal-1uPX7VEe.js} +1 -1
- package/dist/assets/{TerminalView-CWvRC4uL.js → TerminalView-DDv6s-R_.js} +1 -1
- package/dist/assets/{ToolsAdminGate-C5dQpL4C.js → ToolsAdminGate-BzvfSwod.js} +1 -1
- package/dist/assets/{TrustPresetSection-gUExLKOq.js → TrustPresetSection-BDb0N4Pe.js} +1 -1
- package/dist/assets/{UserProfile-uUu_7SHc.js → UserProfile-DqPRuGWk.js} +1 -1
- package/dist/assets/{WebhookUrlWarning-CbkWHsPb.js → WebhookUrlWarning-CHx5gr2m.js} +1 -1
- package/dist/assets/WhatNeedsMe-DtBxgH24.js +1 -0
- package/dist/assets/{WorkspaceRuntimeControls-Cp5E1FME.js → WorkspaceRuntimeControls-Clk2nzU6.js} +1 -1
- package/dist/assets/{Workspaces-MhwqOigu.js → Workspaces-BQOyG5HK.js} +1 -1
- package/dist/assets/{connection-owner-CslVCQSM.js → connection-owner-CPrMcD3t.js} +1 -1
- package/dist/assets/{index-D1wQsid4.js → index-QhteFtm-.js} +16 -16
- package/dist/assets/{issue-properties-BXissCm1.js → issue-properties--M7WE6Ot.js} +3 -3
- package/dist/assets/{issue-workspace-selection-Ey-jzxzA.js → issue-workspace-selection-pUdSkrJA.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-B_etSYde.js → pipeline-stage-presentation-Dv1xgEPW.js} +1 -1
- package/dist/assets/router-CJbFZfVR.js +1 -0
- package/dist/assets/{shared-CSvxoeyx.js → shared-B75ClBUg.js} +1 -1
- package/dist/assets/{slots-DZ1hj5sG.js → slots-B7lwlN1w.js} +1 -1
- package/dist/assets/system-notice-comment-D0I6rz8Y.js +1 -0
- package/dist/assets/{task-chat-attachments-DNPQ-jOG.js → task-chat-attachments-2KmZkOL7.js} +1 -1
- package/dist/assets/{transcript-adapter-CppFOMQA.js → transcript-adapter-ClaGWYVL.js} +1 -1
- package/dist/assets/useSummaryDraftStream-BDuMgNcA.js +3 -0
- package/dist/index.html +12 -13
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Agents-BwRQ91d5.js +0 -3
- package/dist/assets/AuditHub-CPsJe_Bl.js +0 -1
- package/dist/assets/ExecutionWorkspaceDetail-BI4rAhvY.js +0 -19
- package/dist/assets/ManagedAiConnectionDetails-D7zoLLKJ.js +0 -1
- package/dist/assets/Pipelines-C8_wN0Sv.js +0 -1
- package/dist/assets/PixelsOffice-GHMNmVjR.js +0 -2
- package/dist/assets/ProjectDetail-CTwwSUZn.js +0 -1
- package/dist/assets/Routines-D3JG-gCI.js +0 -1
- package/dist/assets/ScrollToBottom-CYzcByH1.js +0 -1
- package/dist/assets/WhatNeedsMe-JNJ5uJyH.js +0 -1
- package/dist/assets/heartbeats-D96c9g2n.js +0 -1
- package/dist/assets/router-BKzUF9uf.js +0 -1
- package/dist/assets/system-notice-comment-DPCHQ4-Y.js +0 -1
- package/dist/assets/useSummaryDraftStream-DQYbVHb7.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Tf=Object.defineProperty;var r=(e,t)=>Tf(e,"name",{value:t,configurable:!0});import{i as hm}from"./rolldown-runtime-ZpX3ckPj.js";import{$r as Sn,$t as Pf,Br as Si,Cr as Tc,Dr as Ls,Er as pm,Gr as Rf,Hr as _f,Lr as fm,N as If,O as Mf,Oi as Of,Qr as Df,Sr as Pc,Tr as Lf,Ur as gm,Vr as Rc,Wr as Ff,Zr as Mr,_n as Vf,_r as Uf,a as Bf,ai as fi,ar as $f,br as zf,cr as xr,ct as Kf,ei as Wf,fr as xm,hr as _c,ii as qf,ir as Gf,l as Z,la as Hf,lr as Yf,lt as Ic,o as Mc,oi as yl,or as Oc,pn as Xf,pr as Dc,s as Lc,sr as Jf,t as ym,ti as po,ua as Qf,vr as fo,wr as Zf,wt as vm,xn as eg,yr as tg}from"./createLucideIcon-CgrPXnTY.js";import{a as go,n as ng,o as bm,v as jm,y as sa}from"./star-eem0qj3E.js";import{X as Bt,_ as qe,n as wt,r as rr,t as ge,v as ue}from"./queryKeys-BzT8CD34.js";import{r as sg,s as ig}from"./companies-query-BEdFiAhG.js";import{A as xo,C as vl,S as rg,b as Qt,d as ag,f as og,l as lg,m as Ra,n as Fc,u as Vc,w as cg,x as km,y as dg}from"./connection-identity-ch7QDvun.js";import{n as us}from"./CompanyContext-fQCNWI_f.js";import{gt as _a,o as wm,rt as ar,t as Pn}from"./router-BKzUF9uf.js";import{n as bl,r as jl,t as kl}from"./collapsible-D_rwONtV.js";import{a as ug,c as mg,i as hg,l as pg,n as fg,o as gg,r as xg,s as yg,t as vg}from"./alert-dialog-DNbnZgRz.js";import{t as bg}from"./checkbox-Cf2_HXDG.js";import{t as dn}from"./label-B707hSFt.js";import{t as Uc}from"./MarkdownEditor-ubJimjUH.js";import{n as jg,o as Ni,r as Bs,t as $s}from"./popover-CWlBonqy.js";import{n as kg,t as yo}from"./PathInstructionsModal-BJAqF7vQ.js";import{t as Cm}from"./arrow-left-CnGEiANj.js";import{t as Am}from"./arrow-right-W0iJ_-Zs.js";import{t as En}from"./arrow-up-right-CFNgVoQj.js";import{t as ai}from"./bot-kSfD9MPZ.js";import{t as ut}from"./check-Bis3vECb.js";import{t as ia}from"./chevron-down-nRcQ7bok.js";import{t as wl}from"./chevron-right-BP8JjEC_.js";import{n as wg}from"./SearchableSelect-BbuRtdzg.js";import{t as Bc}from"./circle-alert-C7T1cdKm.js";import{t as Cg}from"./circle-question-mark-CasEGiDp.js";import{t as Sm}from"./clock-D2UFngg7.js";import{t as ra}from"./copy-C1cfcpxY.js";import{n as Ag,r as Sg,t as Ng}from"./environment-variables-editor-D6Ylcd74.js";import{t as aa}from"./external-link-BIcMNNSN.js";import{_ as Eg,c as Tg,g as Cl,i as Pg,l as Rg,n as _g,o as Ig,s as Mg,v as vo,w as Og,x as Dg}from"./proposal-review-D9ye_2Px.js";import{t as Lg}from"./flask-conical-BxspRG7d.js";import{t as Fg}from"./folder-open-Dkshp3J4.js";import{t as Vg}from"./inbox-BbL3s2C7.js";import{t as $c}from"./key-round-CGxQxRtN.js";import{t as Nm}from"./link-2-Cn4f4xsG.js";import{r as He,t as D}from"./button-DI4w5WP7.js";import{t as Ug}from"./network-D_6qRf8m.js";import{t as Em}from"./play-Czm7OCYh.js";import{t as Al}from"./plus-CwNlqadt.js";import{t as Bg}from"./refresh-cw-CfzWP9se.js";import{t as oa}from"./search-CgZSuGC8.js";import{t as $g}from"./server-cog-cefxr54v.js";import{t as zg}from"./shield-alert-BAXWoBTh.js";import{t as Kg}from"./shield-check-RPyaLAc-.js";import{t as Tm}from"./shield-question-mark-Dl8dxzUU.js";import{t as Pm}from"./trash-QxFF084e.js";import{t as es}from"./triangle-alert-CnHMpmva.js";import{t as Wg}from"./upload-Dk7oXJof.js";import{t as bo}from"./user-round-B87hENhM.js";import{t as zc}from"./user-D5V640s5.js";import{t as qg}from"./SetupWizard-92wVRG6Y.js";import{i as Rm,n as _m,r as Gg,t as Im}from"./tooltip-CW50mEoC.js";import{t as oi}from"./badge-jeXr866I.js";import{t as yr}from"./AgentAvatar-BZiiDlCN.js";import{i as Hg}from"./ToastContext-DyVJ6bCh.js";import{t as Ee}from"./agents-B8n-p0aX.js";import{t as un}from"./instanceSettings-D1nNVWU0.js";import{a as jo,i as Yg,n as Or,r as Dr,s as Lr,t as Fr}from"./dialog-CeH7rDcv.js";import{t as Ce}from"./input-BBNGmECW.js";import{t as Xt}from"./skeleton-BAAoD7cz.js";import{t as _e}from"./tools-MhVvhrz_.js";import{t as cs}from"./AppLogo-BLq8BpKi.js";import{n as Xg}from"./BreadcrumbContext-DNbB7zWn.js";import{t as Es}from"./secrets-D17QEm13.js";import{t as Sl}from"./textarea-CTx68BDs.js";import{t as Jg}from"./assets-BOhIBphq.js";import{t as Nl}from"./toggle-switch-Dj5GORxn.js";import{c as Qg,d as Zg,f as Kc,g as ex,h as Wc,l as vr,m as tx,n as nx,p as sx,r as ix,s as qc,u as Gc,v as rx}from"./model-picker-fields-D_I_l2UI.js";import{t as dt}from"./InlineBanner-DYx7A02D.js";import{t as Mm}from"./AgentMultiSelect-BlUaNdZZ.js";import{t as gi}from"./radio-card-DCobJXTD.js";import{i as ht,l as ax,n as ss,o as is,r as rs,s as as,t as Om}from"./select-DNiRU1d9.js";import{n as ko,r as Dm,t as Lm}from"./JsonSchemaForm-Dkh3zdL9.js";import{t as ox}from"./chip-yHjfSD46.js";import{a as El,i as lx,n as xi,o as Hc,t as yi}from"./schema-config-fields-B8ha5h4A.js";import{n as wo,t as Fs}from"./adapter-display-registry-9qBBJi9B.js";import{a as ye,c as Yc,l as Ae,n as At,o as Ft,r as Ct,s as Xc,t as Ia,u as cx}from"./agent-config-primitives-BJlDiwaH.js";import{t as li}from"./environments-xuhuvnTt.js";import{t as Tl}from"./clipboard-CTLKYvRL.js";import{a as Ge,i as _t,n as Fm,r as dx,t as ux}from"./AgentSetupPrompt-CaafK5_w.js";import{t as Jc}from"./managed-sandbox-environment-B8DewKvK.js";import{n as Co,r as mx,t as hx}from"./dynamic-loader-ehitOaJV.js";import{n as ni,s as Ma,t as Qc,u as px}from"./model-DidtFy-U.js";import{t as Vm}from"./adapters-D3NHXckp.js";import{t as Um}from"./use-adapter-capabilities-BNfGiTEP.js";import{t as fx}from"./AgentCharacter-DAAMv7-c.js";import{t as Bm}from"./use-copy-action-DFzauB4H.js";import{a as gx,o as xx,r as yx,s as Oa,t as Zc}from"./app-connect-policy-DqQf5knn.js";import{n as vx,t as bx}from"./segmented-tuNVx49H.js";var JN="adapter_auth_missing";function ed(e){const t=e.split(".");return t.length!==4||!t.every(s=>/^\d{1,3}$/.test(s)&&Number(s)<=255)?!1:t[0]==="127"}r(ed,"isLoopbackIpv4");function jx(e){const t=e.replace(/^\[|\]$/g,"").toLowerCase();if(t==="localhost"||t.endsWith(".localhost")||t==="::1")return!0;const s=t.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/);return s?.[1]?ed(s[1]):ed(t)}r(jx,"isLoopbackHost");function kx(e){try{const t=new URL(e).origin;return t==="null"?null:t}catch{return null}}r(kx,"normalizedOrigin");function wx(e,t){return t.allowInsecureLoopback&&jx(e.hostname)?!0:(t.allowInsecureOrigins??[]).some(s=>kx(s)===e.origin)}r(wx,"insecureTransportAllowed");function $m(e,t={}){if(typeof e!="string"||e.trim().length===0)return{ok:!1,reason:"missing"};let s;try{s=new URL(e.trim())}catch{return{ok:!1,reason:"malformed"}}return s.protocol!=="https:"&&s.protocol!=="http:"?{ok:!1,reason:"unsupported_scheme"}:s.hostname?s.protocol==="http:"&&!wx(s,t)?{ok:!1,reason:"insecure_transport"}:s.username||s.password?{ok:!1,reason:"embedded_credentials"}:s.hash?{ok:!1,reason:"fragment"}:{ok:!0,url:s.toString(),host:s.host}:{ok:!1,reason:"malformed"}}r($m,"checkOAuthEndpointUrl");var Cx={authorization:"sign-in",token:"token",registration:"client registration",metadata:"metadata"};function Ax(e,t){const s=Cx[e];switch(t){case"missing":return`This server did not provide a ${s} address.`;case"malformed":return`This server's ${s} address is not a valid URL, so Wardmote stopped.`;case"unsupported_scheme":return`This server's ${s} address does not use https, so Wardmote stopped.`;case"insecure_transport":return`This server's ${s} address is not secure (https), so Wardmote stopped.`;case"embedded_credentials":return`This server's ${s} address hides a different site behind a username, so Wardmote stopped.`;case"fragment":return`This server's ${s} address is malformed for sign-in, so Wardmote stopped.`}}r(Ax,"oauthEndpointUrlRejectionMessage");var zm={name:"cable",size:24,node:[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]};zm.node;var Sx=ym(zm),Km={name:"users-round",size:24,node:[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],aliases:["users-2"]};Km.node;var Da=ym(Km),Wm=[{key:"permissions",label:"Permissions",icon:Kg},{key:"review",label:"Review",icon:Vg}];function vi(e,t){return`/apps/${e}/${t}`}r(vi,"appTabHref");function QN(e,t){return`/apps/app/${e}/${t}`}r(QN,"appApplicationTabHref");function ZN(e){return Wm.some(t=>t.key===e)}r(ZN,"isAppTabKey");function eE(e){return Wm.find(t=>t.key===e)?.label??"Permissions"}r(eE,"appTabLabel");var n=hm(Hf(),1);function Pl({host:e,className:t}){return(0,n.jsxs)("div",{className:Z("flex flex-wrap items-center gap-2 text-xs",t),children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 font-medium text-amber-700 dark:text-amber-400",children:[(0,n.jsx)(zg,{className:"h-3 w-3"}),"Unverified server"]}),e?(0,n.jsx)("span",{className:"font-mono text-ink-3",children:e}):null]})}r(Pl,"UnverifiedServerBadge");function Rl({title:e,headingRef:t,subtitle:s,step:i,activeIndex:a,labels:o,appIdentity:l,unverifiedHost:c,onCancel:d}){return(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[l?(0,n.jsx)(cs,{name:l.name,logoUrl:l.logoUrl,darkLogoUrl:l.darkLogoUrl,size:44}):null,(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{ref:t,tabIndex:t?-1:void 0,className:"text-2xl font-bold tracking-tight outline-none",children:e??(l?`Connect ${l.name}`:"Connect your own MCP server")}),s&&(0,n.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:s}),c?(0,n.jsx)(Pl,{host:c,className:"mt-2"}):null]})]}),d&&(0,n.jsx)(D,{variant:"ghost",size:"sm",onClick:d,children:"Cancel"})]}),i!=="gallery"&&o.length>1&&(0,n.jsxs)("nav",{className:"mt-4","aria-label":"Setup progress","data-testid":"wizard-stepper",children:[(0,n.jsx)("ol",{className:"flex gap-2","aria-hidden":"true",children:o.map((m,u)=>(0,n.jsx)("li",{"data-testid":"wizard-step-dot","data-step-active":u===a?"true":void 0,className:Z("h-1 w-20 rounded-full",u<=a?"bg-ink":"bg-line")},m))}),(0,n.jsx)("div",{className:"mt-2 text-xs text-ink-3","data-testid":"wizard-step-labels",children:o.join(" · ")})]})]})}r(Rl,"StepHeader");var f=hm(Qf(),1);function _l({provider:e,template:t,value:s,onChange:i,disabled:a=!1}){const o=(0,f.useId)(),[l,c]=(0,f.useState)(!1),d=s.text!==t.text||s.template?.id!==t.id||s.template?.version!==t.version;return(0,n.jsxs)("section",{className:"space-y-3","aria-label":"Agent instructions",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Agent instructions"}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("label",{htmlFor:o,className:"text-sm",children:["Tell agents to use ",e]}),(0,n.jsx)(Nl,{id:o,checked:s.enabled,disabled:a,onCheckedChange:r(m=>i({...s,enabled:m}),"onCheckedChange")})]}),!s.enabled&&(0,n.jsx)(dt,{tone:"warning",children:"Agents can still use this connection’s tools, but won’t receive these instructions."}),l?(0,n.jsx)(Sl,{"aria-label":"Instructions text",value:s.text,disabled:a,maxLength:Zf,className:"min-h-40",onChange:r(m=>i({...s,text:m.target.value}),"onChange")}):(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-ink-3",children:s.text}),!s.text.trim()&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-bad",children:"Enter instructions."}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(D,{variant:"ghost",size:"sm",disabled:a,onClick:r(()=>c(!l),"onClick"),children:l?"Done editing":"Edit instructions"}),d&&(0,n.jsx)(D,{variant:"ghost",size:"sm",disabled:a,onClick:r(()=>i({...Ls(t),enabled:s.enabled}),"onClick"),children:"Reset to default"})]})]})}r(_l,"ConnectionInstructionsEditor");function tE({connection:e,provider:t,template:s,canConfigure:i}){const a=Bt(),[o,l]=(0,f.useState)(null),c=e.agentInstructions??{...Ls(s),enabled:!1},d=o??c,m=qe({mutationFn:r(()=>_e.updateConnection(e.id,{agentInstructions:d}),"mutationFn"),onSuccess:r(async()=>{await a.invalidateQueries({queryKey:["tools"]}),l(null)},"onSuccess")}),u=JSON.stringify(d)!==JSON.stringify(c);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(_l,{provider:t,template:s,value:d,onChange:l,disabled:!i||m.isPending}),m.isError&&(0,n.jsx)("div",{role:"alert",children:(0,n.jsx)(dt,{tone:"danger",children:m.error instanceof Error?m.error.message:"Couldn’t save instructions. Try again."})}),u&&(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)(D,{variant:"ghost",disabled:m.isPending,onClick:r(()=>{l(null),m.reset()},"onClick"),children:"Cancel"}),(0,n.jsx)(D,{disabled:!i||m.isPending||!d.text.trim(),onClick:r(()=>m.mutate(),"onClick"),children:m.isPending?"Saving…":"Save instructions"})]})]})}r(tE,"ConnectionInstructionsSettings");function nE({companyId:e,agentId:t}){const s=ue({queryKey:ge.tools.effectiveProfilesForAgent(e,t),queryFn:r(()=>_e.getEffectiveProfilesForAgent(e,t),"queryFn")}),i=s.data?.installedConnections.filter(a=>a.agentInstructions&&a.enabled&&a.status==="active")??[];return s.isLoading?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Loading connection instructions…"}):s.isError?(0,n.jsx)(dt,{tone:"danger",actions:(0,n.jsx)(D,{variant:"ghost",onClick:r(()=>{s.refetch()},"onClick"),children:"Retry"}),children:"Couldn’t load connection instructions."}):i.length?(0,n.jsxs)("section",{className:"mt-8 space-y-4","aria-label":"From connections",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"From connections"}),(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Enabled instructions are included when the connection is available for the task. Access can depend on the task’s responsible person and action permissions."}),i.map(a=>{const o=pm(a),l=fi(String(o.sourceTemplateKey??"")),c=Lf(l,o);return(0,n.jsxs)("div",{className:"space-y-3 rounded-lg border border-line p-4",children:[(0,n.jsx)(Pn,{className:"text-sm font-medium underline underline-offset-2",to:`/apps/${a.id}/permissions`,children:a.name}),!a.agentInstructions.enabled&&(0,n.jsx)(dt,{tone:"warning",children:"These instructions are turned off for this connection."}),c===null?(0,n.jsx)(dt,{tone:"warning",children:"Complete this connection’s configuration before agents receive its instructions."}):(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-ink-3",children:a.agentInstructions.text})]},a.id)})]}):null}r(nE,"AgentConnectionInstructions");function qm(e,t){const s=new Set(Array.isArray(e.suggestedDefaults?.askFirstRiskLevels)?e.suggestedDefaults.askFirstRiskLevels.filter(i=>typeof i=="string"):[]);return s.size===0?[]:e.actions.canMakeChanges.filter(i=>t(i.catalogEntryId)&&s.has(i.riskLevel)).map(i=>i.catalogEntryId)}r(qm,"askFirstCatalogEntryIdsFor");function Il({choices:e,selectedId:t,pendingId:s,disabled:i,onSelect:a}){return(0,n.jsx)("div",{className:"space-y-2",children:e.map(o=>(0,n.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between gap-4 rounded-lg border border-line bg-bg-2 p-4 text-left transition-colors hover:bg-bg-3 disabled:cursor-not-allowed disabled:opacity-60","aria-label":o.name,"aria-pressed":t===void 0?void 0:t===o.id,disabled:i||!!s||o.disabled,onClick:r(()=>a(o.id),"onClick"),children:[o.icon&&(0,n.jsx)("span",{"aria-hidden":"true",className:"shrink-0",children:o.icon}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-medium text-ink",children:o.name}),(0,n.jsx)("span",{className:"mt-1 block text-xs text-ink-3",children:o.description})]}),s===o.id?(0,n.jsx)(He,{className:"h-4 w-4 shrink-0 animate-spin text-ink-3"}):t===o.id?(0,n.jsx)(ut,{className:"h-4 w-4 shrink-0 text-ink-3"}):(0,n.jsx)(wl,{className:"h-4 w-4 shrink-0 text-ink-3"})]},o.id))})}r(Il,"ConnectionChoiceList");function Nx({providerName:e,upstreamServiceName:t,connections:s,pendingId:i,error:a,onSelect:o,onCancel:l,onConnectNew:c}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-bold",children:t?`Connect ${t} through ${e}`:`Connect ${e}`}),(0,n.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an existing connection or connect a new account. Existing access stays unchanged."})]}),t&&(0,n.jsxs)(dt,{compact:!0,children:[e," is an external service that handles the connection and requests to ",t,". Reusing this account does not yet verify app access; the agent will check it and guide any additional authorization."]}),(0,n.jsx)(Il,{choices:s.map(d=>({...d,description:"Provider account available"})),pendingId:i,onSelect:o}),a&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-bad",children:a}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)(D,{variant:"ghost",disabled:!!i,onClick:l,children:"Cancel"}),(0,n.jsx)(D,{disabled:!!i,onClick:c,children:"Connect new"})]})]})}r(Nx,"RemoteMcpAccountChoice");function Gm(e){const t=typeof window<"u"&&window.location.protocol==="http:",s=$m(e??null,{allowInsecureLoopback:t,allowInsecureOrigins:typeof window<"u"?[window.location.origin]:[]});return s.ok?{ok:!0,url:s.url,host:s.host}:{ok:!1,message:Ax("authorization",s.reason)}}r(Gm,"resolveAuthorizationTarget");function Hm(e){window.location.assign(e)}r(Hm,"navigateTopLevel");function Ao(e){const t=[];let s=0;for(const i of e.split(/[\s,]+/g)){const a=i.trim().replace(/[),.;\]]+$/g,"");if(a)try{const o=new URL(a).pathname.match(/\/spreadsheets\/d\/([^/]+)/i);if(o?.[1]){t.push(decodeURIComponent(o[1]));continue}s+=1}catch{s+=1}}return{ids:Array.from(new Set(t)),invalidCount:s}}r(Ao,"parseGoogleSheetIds");function Ex({entries:e,disabled:t,onSubmit:s}){const[i,a]=(0,f.useState)(new Set),o=e.length,l=e.filter(c=>i.has(c.id)).map(c=>c.id);return(0,n.jsxs)("section",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"text-sm font-semibold text-amber-800 dark:text-amber-200",children:["Review ",o," new ",o===1?"action":"actions"]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-300",children:"Turn on the actions agents may use. Anything left off stays blocked when you save."})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",className:"text-xs font-medium text-amber-800 hover:text-amber-950 dark:text-amber-200 dark:hover:text-amber-50",disabled:t,onClick:r(()=>a(new Set(e.map(c=>c.id))),"onClick"),children:"Turn all on"}),(0,n.jsx)("button",{type:"button",className:"text-xs font-medium text-amber-800 hover:text-amber-950 dark:text-amber-200 dark:hover:text-amber-50",disabled:t,onClick:r(()=>a(new Set),"onClick"),children:"Turn all off"})]})]}),(0,n.jsx)("div",{className:"divide-y divide-line",children:e.map(c=>{const d=i.has(c.id),m=c.title??c.toolName;return(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-ink",children:m}),c.description&&(0,n.jsx)("div",{className:"truncate text-xs text-ink-3",children:c.description})]}),(0,n.jsx)(Nl,{"aria-label":`${m} allowed`,checked:d,disabled:t,onCheckedChange:r(u=>{a(p=>{const h=new Set(p);return u?h.add(c.id):h.delete(c.id),h})},"onCheckedChange")})]},c.id)})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsxs)("span",{className:"text-xs text-amber-700 dark:text-amber-300",children:[l.length," of ",o," will be on"]}),(0,n.jsx)(D,{size:"sm",disabled:t,onClick:r(()=>s(l),"onClick"),children:t?"Saving…":"Save choices"})]})]})}r(Ex,"QuarantinedActionsReview");function Vr(e){return`${(e/1e3).toFixed(1)}s`}r(Vr,"seconds");function la(e){const t=Mf(e);return t.charAt(0).toUpperCase()+t.slice(1)}r(la,"relTime");var Tx=3e5,Px=18e5;function Rx({connectionId:e,appName:t,entry:s,open:i,onOpenChange:a}){const o=ue({queryKey:ge.tools.testAgents(e),queryFn:r(()=>_e.listTestAgents(e),"queryFn"),enabled:i&&!!e}),l=(0,f.useMemo)(()=>[...o.data?.agents??[]].sort((j,k)=>j.orgDepth-k.orgDepth||j.name.localeCompare(k.name)),[o.data]),[c,d]=(0,f.useState)(null),m=c&&l.some(j=>j.id===c)?c:l[0]?.id??null,u=l.find(j=>j.id===m)??null,p=ue({queryKey:ge.tools.testAgentAccess(e,m??"__none__"),queryFn:r(()=>_e.getTestAgentAccess(e,m),"queryFn"),enabled:i&&!!e&&!!m,staleTime:Tx,gcTime:Px,refetchOnWindowFocus:!1}),h=(0,f.useMemo)(()=>u&&p.data?{...u,effectiveAccess:p.data.access}:null,[p.data,u]),x=(0,f.useMemo)(()=>h?.effectiveAccess.tools.find(j=>j.toolName===s.toolName||j.gatewayToolName===s.toolName)?.decision??"off",[s.toolName,h]),g=s.title??s.toolName;return(0,n.jsx)(Fr,{open:i,onOpenChange:a,children:(0,n.jsxs)(Or,{className:"max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl",children:[(0,n.jsxs)(jo,{children:[(0,n.jsxs)(Lr,{children:["Test ",g]}),(0,n.jsx)(Dr,{children:"Run a real action with the same permissions and credentials an agent would use."})]}),o.isLoading?(0,n.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-ink-3",role:"status",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin"}),"Loading agents…"]}):o.isError?(0,n.jsx)(td,{message:"We couldn't load the agents available for testing.",onRetry:r(()=>{o.refetch()},"onRetry")}):l.length===0?(0,n.jsx)("p",{className:"py-6 text-sm text-ink-3",children:"No agents are available to test as."}):p.isError&&!p.data?(0,n.jsx)(td,{message:`We couldn't load ${u?.name??"this agent"}'s permissions.`,onRetry:r(()=>{p.refetch()},"onRetry")}):h?(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/30 p-4",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-ink-3",children:"Act as"}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)(Ix,{agents:l,selectedAgent:h,onSelect:d,connectionId:e,appName:t}),(0,n.jsx)(Ym,{decision:x})]})]}),(0,n.jsx)(Lx,{entry:s,decision:x,connectionId:e,appName:t,agent:h,allAgents:l,onSelectAgent:d},`${s.id}:${h.id}`)]}):(0,n.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-ink-3",role:"status",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin"}),"Loading agent permissions…"]})]})})}r(Rx,"ActionTestDialog");var _x={allowed:{label:"Allowed",className:"border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"},ask_first:{label:"Ask first",className:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300"},off:{label:"Off",className:"border-line bg-bg-3 text-ink-3"}};function Ym({decision:e}){const t=_x[e];return(0,n.jsx)("span",{className:Z("inline-flex shrink-0 items-center rounded-full border px-2 py-0.5 text-xs font-medium",t.className),children:t.label})}r(Ym,"DecisionBadge");function td({message:e,onRetry:t}){return(0,n.jsxs)("div",{className:"py-8 text-center",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-ink",children:e}),(0,n.jsx)(D,{className:"mt-3",size:"sm",variant:"secondary",onClick:t,children:"Try again"})]})}r(td,"TestLoadError");function Ix({agents:e,selectedAgent:t,onSelect:s,connectionId:i,appName:a}){const[o,l]=(0,f.useState)(!1),[c,d]=(0,f.useState)(""),m=e.filter(u=>u.name.toLowerCase().includes(c.trim().toLowerCase()));return(0,n.jsxs)($s,{open:o,onOpenChange:r(u=>{l(u),u||d("")},"onOpenChange"),children:[(0,n.jsx)(Ni,{asChild:!0,children:(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 font-semibold text-ink underline-offset-2 outline-none hover:text-accent hover:underline focus-visible:text-accent","aria-label":"Choose which agent to test as",children:[t.name,(0,n.jsx)(wg,{className:"h-3.5 w-3.5 text-ink-3"})]})}),(0,n.jsxs)(Bs,{align:"start",className:"w-80 p-0",disablePortal:!0,children:[(0,n.jsx)("div",{className:"border-b border-line p-2",children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(oa,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,n.jsx)(Ce,{"aria-label":"Search agents",placeholder:"Search agents…",className:"h-8 pl-8 text-sm",value:c,onChange:r(u=>d(u.target.value),"onChange"),autoFocus:!0})]})}),(0,n.jsx)("div",{className:"max-h-60 overflow-y-auto p-1",children:m.length===0?(0,n.jsx)("p",{className:"px-3 py-4 text-center text-xs text-ink-3",children:"No agents match."}):m.map(u=>{const p=u.title?.trim()||u.role;return(0,n.jsxs)("button",{type:"button",onClick:r(()=>{s(u.id),l(!1),d("")},"onClick"),className:Z("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left hover:bg-bg-3",u.id===t.id&&"bg-bg-3"),children:[(0,n.jsx)(ut,{className:Z("mt-0.5 h-4 w-4 shrink-0",u.id===t.id?"text-accent":"text-transparent")}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm font-medium text-ink",children:u.name}),(0,n.jsx)("span",{className:"block truncate text-xs text-ink-3",children:p})]})]},u.id)})}),(0,n.jsxs)("div",{className:"border-t border-line px-3 py-2 text-(length:--text-micro) text-ink-3",children:[(0,n.jsx)("p",{children:"Only agents you can assign tasks to are listed."}),(0,n.jsxs)("p",{children:["Pick one to preview what they'd see in ",a,"."]})]}),(0,n.jsxs)("div",{className:"border-t border-line p-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold text-ink",children:"What the badges mean"}),(0,n.jsxs)("ul",{className:"mt-1.5 space-y-1 text-xs text-ink-3",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Allowed"})," — runs immediately when you press Run."]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Ask first"})," — Run is parked in Review for your OK."]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Off"})," — won't run. Change it in"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:vi(i,"permissions"),children:"Permissions"}),"."]})]}),(0,n.jsx)("p",{className:"mt-2 text-(length:--text-micro) text-ink-3",children:"Badges reflect this agent's current settings, not yours. Swap agents to see how an action would behave for each."})]})]})]})}r(Ix,"AgentPicker");function Xm(e,t,s){return`wardmote:test-call:${e}:${s}:${t.id}:${t.toolName}`}r(Xm,"testOutcomeStorageKey");function Mx(e,t,s){if(typeof window>"u")return null;try{const i=window.sessionStorage.getItem(Xm(e,t,s.id));if(!i)return null;const a=JSON.parse(i);return!a.result||a.result.decision!=="ask_first"||typeof a.result.actionRequestId!="string"?null:{result:a.result,agentName:a.agentName||s.name,durationMs:typeof a.durationMs=="number"?a.durationMs:0,ranAt:a.ranAt?new Date(a.ranAt):new Date}}catch{return null}}r(Mx,"loadStoredAskFirstOutcome");function nd(e,t,s,i){if(typeof window>"u")return;const a=Xm(e,t,s);try{if(!i||i.result.decision!=="ask_first"){window.sessionStorage.removeItem(a);return}window.sessionStorage.setItem(a,JSON.stringify({...i,ranAt:i.ranAt.toISOString()}))}catch{}}r(nd,"storeAskFirstOutcome");function Ox(e){const t=new Set(e.required??[]),s=e.properties??{},i={};for(const[a,o]of Object.entries(s)){const l=a==="code"&&o.type==="string"&&!o.format?{...o,format:"textarea"}:o;i[a]=t.has(a)?l:{...l,"x-wardmote-advanced":!0}}return{...e,properties:i}}r(Ox,"splitRequiredOptional");var Dx={allowed:r((e,t)=>`This runs a real call against ${e} as ${t}.`,"allowed"),ask_first:r(()=>"Waiting for your OK before this call leaves Wardmote.","ask_first"),off:r((e,t)=>`No call will be made — this action is off for ${t}.`,"off")};function Lx({entry:e,decision:t,connectionId:s,appName:i,agent:a,allAgents:o,onSelectAgent:l}){const c=Bt(),{selectedCompanyId:d}=us(),m=e.inputSchema??{type:"object",properties:{}},u=(0,f.useMemo)(()=>Ox(m),[m]),[p,h]=(0,f.useState)(()=>ko(m)),[x,g]=(0,f.useState)({}),[j,k]=(0,f.useState)(()=>Mx(s,e,a)),[v,w]=(0,f.useState)(!1),[_,N]=(0,f.useState)(0),P=(0,f.useRef)(0),b=(0,f.useRef)(!1),I=t==="off";(0,f.useEffect)(()=>{if(!v)return;const C=window.setInterval(()=>N(Date.now()-P.current),100);return()=>window.clearInterval(C)},[v]);const L=qe({mutationFn:r(async C=>await _e.runTestCall(s,{agentId:a.id,toolName:e.toolName,parameters:C}),"mutationFn"),onSuccess:r(C=>{if(b.current)return;const z=Date.now()-P.current,W=r(()=>{if(b.current)return;const V={result:C,agentName:a.name,durationMs:z,ranAt:new Date};w(!1),k(V),nd(s,e,a.id,V),c.invalidateQueries({queryKey:ge.tools.connectionActivity(s)}),d&&(c.invalidateQueries({queryKey:ge.tools.actionRequests(d,"pending")}),c.invalidateQueries({queryKey:ge.apps.attention(d)}))},"finish"),G=200-z;G>0?window.setTimeout(W,G):W()},"onSuccess"),onError:r(()=>{b.current||w(!1)},"onError")}),R=r(()=>{const C=Dm(m,p);g(C),!(Object.keys(C).length>0)&&(b.current=!1,P.current=Date.now(),N(0),k(null),w(!0),L.mutate(p))},"onRun"),F=r(()=>{b.current=!0,w(!1),k(null),nd(s,e,a.id,null),g({}),h(ko(m))},"onReset"),T=r(()=>{b.current=!0,w(!1)},"onCancelRunning");if(I)return(0,n.jsx)(Hx,{entry:e,connectionId:s,appName:i,agent:a,allAgents:o,onSelectAgent:l});const E=Object.keys(m.properties??{}).length>0;return(0,n.jsxs)("div",{className:"space-y-4",children:[E?(0,n.jsx)(Lm,{schema:u,values:p,onChange:h,errors:x,disabled:v,advancedLabel:"More options"}):(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"This action takes no inputs."}),(0,n.jsx)("p",{className:"text-xs text-ink-3",children:Dx[t](i,a.name)}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(D,{onClick:R,disabled:v||!!j?.result.upstreamPending?.resumeTool||j?.result.decision==="ask_first",size:"sm",children:v?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(He,{className:"h-3.5 w-3.5 animate-spin"})," Running…"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Em,{className:"h-3.5 w-3.5"})," ",j?"Run again":"Run"]})}),(0,n.jsx)(D,{onClick:F,disabled:v,size:"sm",variant:"ghost",children:"Reset"})]}),(j?.result.decision==="ask_first"||j?.result.upstreamPending?.resumeTool)&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"Finish the existing request below. Use Reset only when you intend to start a new call."}),v&&(0,n.jsx)(Fx,{entry:e,appName:i,agentName:a.name,elapsedMs:_,onCancel:T}),L.isError&&!v&&(0,n.jsxs)("div",{className:"rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:["Couldn't reach ",a.name,". ",L.error instanceof Error?L.error.message:"Please try again."]}),j&&!v&&(0,n.jsx)(Jm,{outcome:j,entry:e,appName:i,connectionId:s,agent:a})]})}r(Lx,"ActionTester");function Fx({entry:e,appName:t,agentName:s,elapsedMs:i,onCancel:a}){const o=e.isReadOnly?"Reading from":e.isWrite?"Writing to":"Calling";return(0,n.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/30 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin text-ink-3"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"Running…"})]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:[o," ",t," as ",s,"."]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,n.jsxs)("span",{className:"text-xs text-ink-3",children:["Started ",Vr(i)," ago · Press cancel to stop"]}),(0,n.jsx)(D,{onClick:a,size:"sm",variant:"secondary",children:"Cancel"})]})]})}r(Fx,"RunningCard");function Jm({outcome:e,entry:t,appName:s,connectionId:i,agent:a}){const{result:o}=e;if(o.upstreamPending)return(0,n.jsx)(Qm,{pending:o.upstreamPending,appName:s,connectionId:i,agent:a});if(o.decision==="ask_first")return(0,n.jsx)(Gx,{outcome:e,entry:t,appName:s,connectionId:i,agent:a});if(o.decision==="off")return(0,n.jsx)("div",{className:"rounded-md border border-line bg-bg-3/40 p-3 text-sm text-ink-3",children:o.error?.message??"This action is off and won't run."});const l=o.error??Ml(o.result);return l?(0,n.jsx)(sh,{outcome:e,appName:s,connectionId:i,error:l}):(0,n.jsx)(th,{outcome:e,entry:t,appName:s,connectionId:i})}r(Jm,"ResultPanel");function Qm({pending:e,appName:t,connectionId:s,agent:i}){const[a,o]=(0,f.useState)(null),l=a&&(a.outcome.result.error??Ml(a.outcome.result.result));return a&&l?.reasonCode==="tool_error"&&(a.action==="decline"&&/request was declined by the user/i.test(l.message)||a.action==="cancel"&&/request was cancelled by the user/i.test(l.message))?(0,n.jsxs)("div",{role:"status",className:"space-y-2 rounded-md border border-line bg-bg-3/40 p-4 text-sm",children:[(0,n.jsx)("p",{className:"font-medium",children:a.action==="decline"?"Request declined":"Request cancelled"}),(0,n.jsx)("p",{children:l.message}),(0,n.jsx)("p",{className:"text-ink-3",children:"The original call was not repeated."}),e.executionId&&(0,n.jsxs)("p",{children:["Execution: ",(0,n.jsx)("code",{className:"break-all",children:e.executionId})]})]}):a?(0,n.jsx)(Jm,{outcome:a.outcome,entry:a.entry,appName:t,connectionId:s,agent:i}):(0,n.jsxs)("div",{role:"status",className:"space-y-3 rounded-md border border-line bg-bg-3/40 p-4 text-sm",children:[(0,n.jsxs)("p",{className:"font-medium",children:[e.kind==="approval"?"Approval needed":"Authorization needed"," in ",t]}),(0,n.jsx)("p",{className:"text-ink-3",children:"Wardmote allowed this call. The provider needs your input before it can continue."}),e.links.map(c=>{const d=$m(c.url);return d.ok?(0,n.jsx)(D,{variant:"secondary",asChild:!0,children:(0,n.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",children:["Continue at ",d.host]})},d.url):null}),e.message&&(0,n.jsx)("p",{className:"whitespace-pre-wrap break-words",children:e.message}),e.links.length===0&&!e.resumeTool&&(0,n.jsx)("p",{children:"Open the provider dashboard to complete this request."}),e.executionId&&(0,n.jsxs)("p",{children:["Execution: ",(0,n.jsx)("code",{className:"break-all",children:e.executionId})]}),e.elicitationId&&(0,n.jsxs)("p",{children:["Request: ",(0,n.jsx)("code",{className:"break-all",children:e.elicitationId})]}),e.expiresAt&&(0,n.jsxs)("p",{children:["Approval expires ",new Date(e.expiresAt).toLocaleTimeString(),"."]}),e.resumeTool&&i?(0,n.jsx)(Vx,{pending:e,connectionId:s,agent:i,onResult:o}):(0,n.jsx)("p",{className:"text-ink-3",children:e.resumeTool?`After approval, test the ${e.resumeTool} action with this execution ID. Do not start the original action again.`:"After authorizing, check the provider's result before using Run again. Wardmote will not repeat the call automatically."})]})}r(Qm,"ProviderPendingResult");function Vx({pending:e,connectionId:t,agent:s,onResult:i}){const a=ue({queryKey:ge.tools.catalog(t),queryFn:r(()=>_e.listCatalog(t),"queryFn")}),o=a.data?.catalog.find(j=>j.toolName===e.resumeTool&&j.status==="active"),l=e.requestedSchema??{type:"object",properties:{}},[c,d]=(0,f.useState)(()=>ko(l)),[m,u]=(0,f.useState)({}),p=qe({mutationFn:r(async j=>{const k=Date.now();return{result:await _e.runTestCall(t,{agentId:s.id,toolName:o.toolName,parameters:{executionId:e.executionId,action:j,...j==="accept"?{content:JSON.stringify(c)}:{}}}),durationMs:Date.now()-k,agentName:s.name,ranAt:new Date}},"mutationFn"),onSuccess:r((j,k)=>{o&&i({outcome:j,entry:o,action:k})},"onSuccess")}),h=!!e.expiresAt&&Date.parse(e.expiresAt)<=Date.now(),x=s.effectiveAccess.tools.find(j=>j.toolName===o?.toolName)?.decision??"off",g=r(j=>{const k=j==="accept"?Dm(l,c):{};u(k),Object.keys(k).length||p.mutate(j)},"submit");return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("p",{className:"text-ink-3",children:["Review the provider's request, then resume this execution as ",s.name,". The original action will not be started again."]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{children:"Resume permission"}),(0,n.jsx)(Ym,{decision:x})]}),Object.keys(l.properties??{}).length>0&&(0,n.jsx)(Lm,{schema:l,values:c,onChange:d,errors:m,disabled:p.isPending}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(D,{disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("accept"),"onClick"),children:p.isPending?"Resuming…":"Approve and resume"}),(0,n.jsx)(D,{variant:"secondary",disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("decline"),"onClick"),children:"Decline"}),(0,n.jsx)(D,{variant:"ghost",disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("cancel"),"onClick"),children:"Cancel request"})]}),h&&(0,n.jsx)("p",{children:"This provider approval expired. Check the provider before starting a new action."}),x==="off"&&(0,n.jsx)("p",{children:"Allow the resume action in Permissions before continuing."}),a.isError&&(0,n.jsx)("p",{role:"alert",children:"Could not load the resume action. Close this test and try again."}),p.isError&&(0,n.jsx)("p",{role:"alert",children:p.error instanceof Error?p.error.message:"Could not resume. Check the provider before trying again."})]})}r(Vx,"ProviderResumeControls");function Ml(e){if(!e||typeof e!="object")return null;const t=e;return(t.data&&typeof t.data=="object"?t.data:null)?.isError===!0||t.isError===!0?{message:typeof t.content=="string"&&t.content.trim()!==""&&t.content||typeof t.error=="string"&&t.error.trim()!==""&&t.error||"The app returned an error result.",reasonCode:"tool_error"}:null}r(Ml,"mcpToolError");function Zm(e){const t=r(s=>Array.isArray(s)&&s.length>0&&s.every(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)),"isObjArray");if(t(e))return e;if(e&&typeof e=="object")for(const s of["rows","values","items","data","results"]){const i=e[s];if(t(i))return i}return null}r(Zm,"asRows");function eh(e){return e==null?!0:Array.isArray(e)?e.length===0:typeof e=="string"?e.trim()==="":typeof e=="object"?Object.keys(e).length===0:!1}r(eh,"isEmptyResult");function Ux(e){if(!e||typeof e!="object"||Array.isArray(e))return{items:[{label:null,value:e}],summary:e};const t=e,s=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:null,i=s&&(Array.isArray(s.content)||s.structuredContent!=null)?s:t,a=Array.isArray(i.content)?i.content:null;if(!a&&i.structuredContent==null)return{items:[{label:null,value:e}],summary:e};const o=r(m=>{try{return JSON.parse(m)}catch{return m}},"parseText"),l=i.structuredContent,c=[],d=typeof l=="string"?o(l):l;l!=null&&c.push({label:null,value:d});for(const m of a??[]){if(!m||typeof m!="object"||Array.isArray(m))return{items:[{label:null,value:e}],summary:e,rawFallback:!0};const u=m;if(u.type==="text"&&typeof u.text=="string"){const p=o(u.text);(l==null||bi(p)!==bi(d))&&c.push({label:(a?.length??0)>1||l!=null?"Text":null,value:p})}else if(u.type==="image"||u.type==="audio")c.push({label:u.type==="image"?"Image":"Audio",value:typeof u.mimeType=="string"?u.mimeType:"Media attachment"});else if(u.type==="resource_link")c.push({label:"Resource",value:u.title??u.name??u.uri??"Resource link"});else if(u.type==="resource"&&u.resource&&typeof u.resource=="object"){const p=u.resource;c.push({label:"Resource",value:typeof p.text=="string"?o(p.text):p.uri??"Embedded resource"})}else return{items:[{label:null,value:e}],summary:e,rawFallback:!0}}return c.length===0&&typeof t.content=="string"&&c.push({label:null,value:o(t.content)}),{items:c,summary:l!=null?d:c[0]?.value}}r(Ux,"resultPreview");function Bx(e){const t=`${e.toolName} ${e.title??""}`.toLowerCase();return/\b(append|add|insert|create|new)\b/.test(t)?"added":/\b(update|edit|set|patch|change|modify)\b/.test(t)?"updated":/\b(delete|remove|clear|trash)\b/.test(t)?"removed":null}r(Bx,"writeVerb");function $x(e,t,s){const i=Bx(t);if(!t.isReadOnly&&i)return`Worked. Row ${i}.`;const a=Zm(e);return a?`Worked. ${a.length} ${a.length===1?"row":"rows"} came back.`:eh(e)?"Worked. No data to show.":`Worked. ${s} sent back the result.`}r($x,"successHeadline");function th({outcome:e,entry:t,appName:s,connectionId:i}){const a=e.result.result,o=Ux(a);return(0,n.jsxs)("div",{className:"rounded-md border border-emerald-500/40 bg-emerald-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(ut,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:$x(o.summary,t,s)})]}),(0,n.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-ink-3",children:[(0,n.jsx)(Sm,{className:"h-3 w-3"}),"Ran as ",e.agentName," · ",Vr(e.durationMs)," · ",la(e.ranAt)]}),o.items.some(l=>!eh(l.value))&&(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Preview"}),(0,n.jsx)("div",{className:"mt-1.5",children:(0,n.jsx)("div",{className:"space-y-2",children:o.items.map((l,c)=>(0,n.jsxs)("div",{children:[l.label&&(0,n.jsx)("p",{className:"mb-1 text-xs font-medium text-ink-3",children:l.label}),(0,n.jsx)(zx,{value:l.value})]},c))})})]}),(0,n.jsx)(nh,{value:a,initiallyOpen:o.rawFallback}),(0,n.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["This call is in the"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:"/activity?mode=agents&action=tool_",children:"Audit log"}),"."]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:["Last run finished in ",Vr(e.durationMs),"."]})]})}r(th,"AllowedResult");function zx({value:e}){const t=Zm(e);if(t){const s=Array.from(new Set(t.flatMap(a=>Object.keys(a)))).slice(0,6),i=t.slice(0,6);return s.length>4||i.some(a=>s.some(o=>Os(a[o]).length>80))?(0,n.jsxs)("div",{className:"space-y-2",children:[i.map((a,o)=>(0,n.jsx)(Kx,{row:a,index:o},o)),t.length>i.length&&(0,n.jsxs)("p",{className:"text-(length:--text-micro) text-ink-3",children:["… ",t.length-i.length," more rows in the raw response"]})]}):(0,n.jsxs)("div",{className:"overflow-x-auto rounded-md border border-line",children:[(0,n.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,n.jsx)("thead",{className:"bg-bg-3/50 text-ink-3",children:(0,n.jsx)("tr",{children:s.map(a=>(0,n.jsx)("th",{className:"px-2.5 py-1.5 font-medium",children:a},a))})}),(0,n.jsx)("tbody",{className:"divide-y divide-line",children:i.map((a,o)=>(0,n.jsx)("tr",{children:s.map(l=>(0,n.jsx)("td",{className:"px-2.5 py-1.5 text-ink",children:Os(a[l])},l))},o))})]}),t.length>i.length&&(0,n.jsxs)("p",{className:"px-2.5 py-1.5 text-(length:--text-micro) text-ink-3",children:["… ",t.length-i.length," more rows"]})]})}return typeof e=="string"?(0,n.jsx)("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap rounded-md border border-line bg-bg p-3 text-xs text-ink",children:e}):e&&typeof e=="object"&&!Array.isArray(e)?(0,n.jsx)("dl",{className:"max-h-64 overflow-auto divide-y divide-line rounded-md border border-line bg-bg text-xs",children:Object.entries(e).map(([s,i])=>(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-3 py-2",children:[(0,n.jsx)("dt",{className:"min-w-0 break-words text-ink-3",children:s}),(0,n.jsx)("dd",{className:"col-span-2 min-w-0 break-words whitespace-pre-wrap text-ink",children:typeof i=="object"&&i!==null?bi(Ur(i,2)):Os(i)})]},s))}):(0,n.jsx)("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-bg p-3 text-xs text-ink",children:bi(Ur(e,2))})}r(zx,"PrettyPreview");function Kx({row:e,index:t}){const s=["title","name","label"].find(l=>typeof e[l]=="string"&&e[l]!==""),i=["highlight","description","summary"].find(l=>typeof e[l]=="string"&&e[l]!==""),a=typeof e.url=="string"&&/^https?:\/\//i.test(e.url)?e.url:null,o=Object.entries(e).filter(([l])=>l!==s&&l!==i&&(l!=="url"||!a)).sort(([l],[c])=>{const d=["url","type","status","timestamp","id"],m=d.indexOf(l),u=d.indexOf(c);return(m<0?d.length:m)-(u<0?d.length:u)});return(0,n.jsxs)("div",{className:"min-w-0 rounded-md border border-line bg-bg p-3 text-xs",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[(0,n.jsx)("p",{className:"min-w-0 break-words text-sm font-medium text-ink",children:s?Os(e[s]):`Result ${t+1}`}),a&&(0,n.jsx)("a",{className:"shrink-0 text-accent hover:underline",href:a,target:"_blank",rel:"noopener noreferrer",children:"Open link"})]}),i&&(0,n.jsx)("p",{className:"mt-1 line-clamp-2 break-words text-ink-3",children:Os(e[i]).replace(/\*\*(.*?)\*\*/g,"$1")}),o.length>0&&(0,n.jsx)("dl",{className:"mt-2 space-y-1",children:o.slice(0,3).map(([l,c])=>(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,n.jsx)("dt",{className:"min-w-0 break-words text-ink-3",children:l}),(0,n.jsx)("dd",{className:"col-span-2 min-w-0 break-all text-ink",children:Os(c)})]},l))}),o.length>3&&(0,n.jsxs)("p",{className:"mt-2 text-ink-3",children:[o.length-3," more ",o.length===4?"field":"fields"," in the raw response"]})]})}r(Kx,"PreviewRowCard");function Os(e){return e==null?"—":typeof e=="object"?Array.isArray(e)?`[${e.length}]`:"{…}":String(e)}r(Os,"cellText");function Ur(e,t,s=0){if(e===null||typeof e!="object")return e;if(s>=t)return Array.isArray(e)?"[…]":"{…}";if(Array.isArray(e))return e.map(a=>Ur(a,t,s+1));const i={};for(const[a,o]of Object.entries(e))i[a]=Ur(o,t,s+1);return i}r(Ur,"collapseDeep");function nh({value:e,initiallyOpen:t=!1}){const[s,i]=(0,f.useState)(t);return e==null?null:(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("button",{type:"button",onClick:r(()=>i(a=>!a),"onClick"),className:"text-xs font-semibold uppercase tracking-wide text-accent hover:underline",children:s?"Hide raw response":"Show raw response"}),s&&(0,n.jsx)("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md border border-line bg-bg p-3 text-xs text-ink",children:bi(e)})]})}r(nh,"RawResponseDisclosure");function sh({outcome:e,appName:t,connectionId:s,error:i}){const a=Xx(i.message,i.reasonCode),o=Yx(i.reasonCode);return(0,n.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(es,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"It didn't work."})]}),(0,n.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-ink-3",children:[(0,n.jsx)(Sm,{className:"h-3 w-3"}),"Tried as ",e.agentName," · ",Vr(e.durationMs)," · ",la(e.ranAt)]}),(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:["What ",t," said"]}),(0,n.jsx)("p",{className:"mt-1 break-words text-sm text-ink",children:i.message}),i.reasonCode&&(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-ink-3",children:["code: ",i.reasonCode]})]}),(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"What to try"}),(0,n.jsx)("ul",{className:"mt-1 list-disc space-y-0.5 pl-4 text-sm text-ink",children:a.map(l=>(0,n.jsx)("li",{children:l},l))})]}),e.result.result!==void 0&&(0,n.jsx)(nh,{value:e.result.result,initiallyOpen:!0}),(0,n.jsx)("p",{className:"mt-3 text-xs text-ink-3",children:o?"After reconnecting, run this action again.":"Adjust the input above and try again."}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:["Also visible in the"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:"/activity?mode=agents&action=tool_",children:"Audit log"}),"."]})]})}r(sh,"ErrorResult");var Wx=new Set(["done","denied","cancelled","expired"]);function qx(e){if(!e)return null;const t=[];for(const[s,i]of Object.entries(e))if(i!=null&&typeof i!="object"&&(t.push(`${s}: ${String(i)}`),t.length>=3))break;return t.length?t.join(" · "):null}r(qx,"formatWhere");function Gx({outcome:e,entry:t,appName:s,connectionId:i,agent:a}){const{selectedCompanyId:o}=us(),l=Bt(),c=e.result.actionRequestId,[d,m]=(0,f.useState)(!1),u=ue({queryKey:ge.tools.testCallStatus(i,c??"__none__"),queryFn:r(()=>_e.getTestCallStatus(i,c),"queryFn"),enabled:!!c&&!d,refetchInterval:r(w=>{const _=w.state.data?.phase;return _&&Wx.has(_)?!1:2e3},"refetchInterval")}),p=qe({mutationFn:r(()=>_e.declineActionRequest(o,c),"mutationFn"),onSuccess:r(()=>{m(!0),l.invalidateQueries({queryKey:ge.tools.actionRequests(o,"pending")}),o&&l.invalidateQueries({queryKey:ge.apps.attention(o)})},"onSuccess")}),h=u.data,x=d?"cancelled":h?.phase??"waiting";if(x==="done"&&h){if(h.upstreamPending)return(0,n.jsx)(Qm,{pending:h.upstreamPending,appName:s,connectionId:i,agent:a});const w=h.error??Ml(h.result);if(w){const N={result:{decision:"allowed",invocationId:h.invocationId,error:w},agentName:e.agentName,durationMs:h.durationMs??e.durationMs,ranAt:h.resolvedAt?new Date(h.resolvedAt):e.ranAt};return(0,n.jsx)(sh,{outcome:N,appName:s,connectionId:i,error:w})}const _={result:{decision:"allowed",invocationId:h.invocationId,result:h.result},agentName:e.agentName,durationMs:h.durationMs??e.durationMs,ranAt:h.resolvedAt?new Date(h.resolvedAt):e.ranAt};return(0,n.jsx)(th,{outcome:_,entry:t,appName:s,connectionId:i})}const g=h?.requestedAt?new Date(h.requestedAt):e.ranAt,j=qx(h?.parameters),k=x==="running"?"Approved · running":x==="denied"?"Denied — see Review for why":x==="cancelled"?"Cancelled":x==="expired"?"Expired — send it again":`Waiting · ${la(g)}`,v=x==="denied"||x==="cancelled"||x==="expired";return(0,n.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Tm,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"Sent for your OK."})]}),(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-ink-3",children:[e.agentName," needs your approval before this runs."]}),(0,n.jsxs)("dl",{className:"mt-3 space-y-1.5 text-sm",children:[(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Action"}),(0,n.jsx)("dd",{className:"text-ink",children:t.title??t.toolName})]}),j&&(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Where"}),(0,n.jsx)("dd",{className:"break-words text-ink",children:j})]}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Status"}),(0,n.jsxs)("dd",{className:Z("flex items-center gap-1.5 text-ink",v&&"text-ink-3"),children:[x==="running"&&(0,n.jsx)(He,{className:"h-3 w-3 animate-spin"}),k]})]})]}),!v&&(0,n.jsxs)("p",{className:"mt-3 text-sm text-ink",children:["Approve it in the"," ",(0,n.jsx)(Pn,{className:"font-medium text-accent hover:underline",to:vi(i,"review"),children:"Review tab"})," ","to finish the test. You can also cancel the request."]}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,n.jsx)(D,{asChild:!0,size:"sm",variant:"secondary",children:(0,n.jsx)(Pn,{to:vi(i,"review"),children:"Open Review tab"})}),x==="waiting"&&c&&o&&(0,n.jsx)(D,{size:"sm",variant:"ghost",onClick:r(()=>p.mutate(),"onClick"),disabled:p.isPending,children:p.isPending?"Cancelling…":"Cancel this request"})]})]})}r(Gx,"AskFirstResult");function Hx({entry:e,connectionId:t,agent:s,allAgents:i,onSelectAgent:a}){const o=e.title??e.toolName,l=`${vi(t,"permissions")}?focus=${encodeURIComponent(e.id)}`,c=i.filter(h=>h.id!==s.id),d=e.status==="quarantined"?"This action is new and hasn't been turned on yet.":`${s.name}'s access profile sets this action to Off.`,{lastChangedAt:m,lastChangedByName:u}=s.effectiveAccess,p=e.status!=="quarantined"&&m?`Last changed${u?` by ${u}`:""} · ${la(new Date(m))}`:null;return(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-(--gtc-62)",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(bm,{className:"mt-0.5 h-4 w-4 shrink-0 text-ink-3"}),(0,n.jsxs)("div",{className:"text-sm text-ink-3",children:[(0,n.jsxs)("p",{className:"font-medium text-ink",children:[o," is off for ",s.name,"."]}),(0,n.jsx)("p",{className:"mt-0.5",children:"It won't run here, and it won't run from a task either."}),(0,n.jsxs)("p",{className:"mt-2",children:["Want to test it? Turn it on for ",s.name," in"," ",(0,n.jsx)(Pn,{className:"font-medium text-accent hover:underline",to:vi(t,"permissions"),children:"Permissions"})," ","— set it to Allowed or Ask first."]})]})]}),(0,n.jsx)(D,{asChild:!0,size:"sm",children:(0,n.jsx)(Pn,{to:l,children:"Open Permissions →"})}),(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["No call will be made — this action is off for ",s.name,"."]})]}),(0,n.jsxs)("aside",{children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Why this is off"}),(0,n.jsx)("p",{className:"mt-1.5 text-xs text-ink-3",children:d}),p&&(0,n.jsx)("p",{className:"mt-1.5 text-(length:--text-micro) text-ink-3",children:p}),c.length>0&&(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-(length:--text-micro) font-medium text-ink-3",children:"Try as a different agent:"}),(0,n.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:c.slice(0,4).map(h=>(0,n.jsx)("button",{type:"button",onClick:r(()=>a(h.id),"onClick"),className:"rounded-full border border-line px-2.5 py-1 text-(length:--text-micro) font-medium text-ink hover:bg-bg-3",children:h.name},h.id))})]})]})]})}r(Hx,"OffExplanation");function bi(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}r(bi,"safeStringify");function Yx(e){return e==="grant_credential_invalid"||e==="oauth_insufficient_scope"}r(Yx,"isReconnectError");function Xx(e,t){if(t==="grant_credential_invalid")return["Ask the connection owner to reconnect it from Connectors with a fresh key or server URL."];if(t==="oauth_insufficient_scope")return["Reconnect the app and allow the permissions required for this action."];const s=`${t??""} ${e}`.toUpperCase();return s.includes("NOT_FOUND")?["Double-check the ID or name you entered — pick it from a dropdown if one is offered.","Make sure this agent has access to that resource in the connected account."]:s.includes("PERMISSION")||s.includes("FORBIDDEN")||s.includes("UNAUTHORIZED")?["The connected account may not have permission for this action.","Reconnect the app from Setup if its access was recently changed."]:s.includes("INVALID_ARGUMENT")||s.includes("INVALID")||s.includes("BAD_REQUEST")?["Check the field formats above — a value may be the wrong type or shape.","Open “More options” to confirm any advanced fields are filled in correctly."]:s.includes("RATE_LIMIT")||s.includes("RESOURCE_EXHAUSTED")||s.includes("429")?["The app is rate-limiting calls right now — wait a moment and run it again."]:["Check the inputs above and try again."]}r(Xx,"errorHints");function sE({afterAgentAccess:e,connectionId:t,appName:s,agents:i,access:a,install:o,readOnly:l,canChange:c,quarantined:d,enabledIds:m,askFirstIds:u,pending:p,onSaveAccess:h,onSetActionPermission:x,onReviewQuarantined:g,onRefreshActions:j,refreshPending:k,capabilities:v,permissionChangeWarning:w,actions:_}){const[N]=sa();return(0,n.jsxs)("div",{className:"space-y-10",children:[(0,n.jsx)(Jx,{agents:i,access:a,install:o,capabilities:v,disabled:p,onSave:h}),e,_!==void 0?_:(0,n.jsx)(ih,{connectionId:t,appName:s,readOnly:l,canChange:c,quarantined:d,enabledIds:m,askFirstIds:u,disabled:p,refreshPending:k,focusId:N.get("focus"),canConfigure:v?.canConfigure??!1,permissionChangeWarning:w,onSetPermission:x,onReviewQuarantined:g,onRefreshActions:j},t)]})}r(sE,"PermissionsPanel");function Jx({agents:e,access:t,install:s,capabilities:i,disabled:a,onSave:o}){const l=e.filter(h=>h.status!=="terminated"),c=i?.canConfigure??!1,d=i?.editableAgentIds,m=d?l.filter(h=>d.includes(h.id)):l,u=l.filter(h=>t.agentIds.has(h.id)),p=s.agentIds;return(0,n.jsxs)("section",{className:"space-y-4 border-t border-line pt-8",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Which agents can use this connection?"}),a?(0,n.jsx)("span",{className:"text-xs text-ink-3",children:"Saving…"}):null]}),c?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(gi,{ariaLabel:"Which agents can use this connection",value:t.mode,disabled:a,className:"sm:grid-cols-2",onValueChange:r(h=>{o(h==="all"?{mode:"all",agentIds:new Set}:{mode:"specific",agentIds:new Set([...t.agentIds,...p])})},"onValueChange"),options:[{value:"specific",title:"Just agents I pick",description:s.onAll?"Unavailable while this connection is installed for every agent.":"Available only to selected agents.",disabled:s.onAll},{value:"all",title:"Any agent",description:"Available across your company."}]}),t.mode==="specific"?(0,n.jsx)(Mm,{agents:m,selectedAgentIds:t.agentIds,disabled:a,triggerLabel:t.agentIds.size===0?"Choose agents":`${t.agentIds.size} ${t.agentIds.size===1?"agent":"agents"} selected`,emptyMessage:"You cannot edit any agents yet.",isAgentDisabled:r(h=>p.has(h.id),"isAgentDisabled"),getDescription:r(h=>p.has(h.id)?"Required by this connection's install setting":h.title,"getDescription"),onChange:r(h=>o({mode:"specific",agentIds:new Set([...h,...p])}),"onChange")}):null]}):t.mode==="all"?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Any agent can use this connection."}):u.length===0?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"No agents can use this connection."}):(0,n.jsx)("div",{className:"space-y-0.5",children:u.map(h=>(0,n.jsxs)("div",{className:"flex items-center gap-2 px-1.5 py-1 text-sm",children:[(0,n.jsx)(yr,{agent:h,size:16,className:"h-4 w-4 shrink-0 text-ink-3"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-ink",children:h.name})]},h.id))})]})}r(Jx,"AgentAccessSection");function ih({connectionId:e,appName:t,readOnly:s,canChange:i,quarantined:a,enabledIds:o,askFirstIds:l,disabled:c,refreshPending:d,focusId:m,canConfigure:u,permissionChangeWarning:p,onSetPermission:h,onReviewQuarantined:x,onRefreshActions:g}){const[j,k]=(0,f.useState)(""),[v,w]=(0,f.useState)("all"),[_,N]=(0,f.useState)(!1),P=r((E,C)=>(E.title??E.toolName).localeCompare(C.title??C.toolName),"byName"),b=(0,f.useMemo)(()=>[...s].sort(P),[s]),I=(0,f.useMemo)(()=>[...i].sort(P),[i]),L=r(E=>{const C=j.trim().toLowerCase();return C?(E.title??E.toolName).toLowerCase().includes(C)||(E.description??"").toLowerCase().includes(C):!0},"matches"),R=v==="write"?[]:b.filter(L),F=v==="read"?[]:I.filter(L),T=R.length+F.length;return(0,n.jsxs)("section",{className:"space-y-6 border-t border-line pt-8",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-ink",children:"Actions"}),u?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[c?(0,n.jsx)("span",{className:"text-xs text-ink-3",children:"Saving…"}):null,(0,n.jsxs)(D,{variant:"secondary",size:"sm",onClick:g,disabled:d||c,children:[d?(0,n.jsx)(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(Bg,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh actions"]})]}):null]}),u&&a.length>0?(0,n.jsx)(Ex,{entries:a,disabled:c,onSubmit:x}):null,p&&_?(0,n.jsx)(dt,{tone:"warning",compact:!0,children:p}):null,(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("div",{className:"relative min-w-(--sz-12rem) flex-1",children:[(0,n.jsx)(oa,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-3"}),(0,n.jsx)(Ce,{"aria-label":"Find an action",placeholder:"Find an action…",className:"pl-9",value:j,onChange:r(E=>k(E.target.value),"onChange")})]}),(0,n.jsx)(La,{label:`All ${s.length+i.length}`,active:v==="all",onClick:r(()=>w("all"),"onClick")}),(0,n.jsx)(La,{label:`Read ${s.length}`,active:v==="read",onClick:r(()=>w("read"),"onClick")}),(0,n.jsx)(La,{label:`Write ${i.length}`,active:v==="write",onClick:r(()=>w("write"),"onClick")})]}),(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:[T," matches · sorted A–Z"]})]}),T===0?(0,n.jsxs)("div",{className:"py-6 text-center text-sm text-ink-3",children:["No actions match “",j,"”. Clear the search to see them all."]}):(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)(sd,{title:`Read (${R.length})`,actions:R,connectionId:e,appName:t,enabledIds:o,askFirstIds:l,disabled:c,focusId:m,canConfigure:u,onSetPermission:r((E,C)=>{N(!0),h(E,C)},"onSetPermission")}),(0,n.jsx)(sd,{title:`Write (${F.length})`,actions:F,connectionId:e,appName:t,enabledIds:o,askFirstIds:l,disabled:c,focusId:m,canConfigure:u,onSetPermission:r((E,C)=>{N(!0),h(E,C)},"onSetPermission")})]})]})}r(ih,"ActionsSection");function La({label:e,active:t,onClick:s}){return(0,n.jsx)(ox,{selected:t,onClick:s,children:e})}r(La,"FilterChip");function sd({title:e,actions:t,connectionId:s,appName:i,enabledIds:a,askFirstIds:o,disabled:l,focusId:c,canConfigure:d,onSetPermission:m}){if(t.length===0)return null;const u=(()=>{const p=Fa(t[0].id,a,o);return t.every(h=>Fa(h.id,a,o)===p)?p:""})();return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:e}),d?(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,n.jsx)("span",{className:"sr-only",children:`Set every action in ${e}`}),(0,n.jsxs)("select",{"aria-label":`Set every action in ${e}`,value:u,disabled:l,onChange:r(p=>{m(t.map(h=>h.id),p.target.value)},"onChange"),className:"h-7 rounded-md border border-line-strong bg-bg px-2 text-xs text-ink outline-none focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus/30",children:[u===""?(0,n.jsx)("option",{value:"",children:"Mixed"}):null,So.map(p=>(0,n.jsx)("option",{value:p.value,children:`Set all: ${p.label}`},p.value))]})]}):null]}),(0,n.jsx)("div",{className:"divide-y divide-line",children:t.map(p=>(0,n.jsx)(Qx,{action:p,connectionId:s,appName:i,value:Fa(p.id,a,o),disabled:l,focused:c===p.id,canConfigure:d,onSetPermission:m},p.id))})]})}r(sd,"ActionGroup");var So=[{value:"off",label:"Off",description:"Agents cannot run this action.",icon:bm},{value:"ask",label:"Ask first",description:"A human must approve each call.",icon:Tm},{value:"allowed",label:"Allowed",description:"Runs without approval.",icon:ut}];function Qx({action:e,connectionId:t,appName:s,value:i,disabled:a,focused:o,canConfigure:l,onSetPermission:c}){const d=(0,f.useRef)(null),[m,u]=(0,f.useState)(!1),p=e.title??e.toolName;return(0,f.useEffect)(()=>{o&&d.current?.scrollIntoView({behavior:"smooth",block:"center"})},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{ref:d,className:Z("flex flex-col gap-3 py-3 sm:flex-row sm:items-center",o&&"rounded-md bg-accent/5 ring-2 ring-accent/40"),"data-action-id":e.id,children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:p}),(0,n.jsx)("span",{className:"rounded-full border border-line px-1.5 py-px text-xs font-medium uppercase tracking-wide text-ink-3",title:`Wardmote classified this action as ${e.riskLevel}`,children:e.riskLevel})]}),e.description?(0,n.jsx)("div",{className:"truncate text-xs text-ink-3",children:e.description}):null]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[l?(0,n.jsx)(Gg,{children:(0,n.jsx)("div",{role:"radiogroup","aria-label":`${p} permission`,className:"inline-flex rounded-md border border-line bg-bg-3/40 p-0.5",children:So.map(h=>{const x=h.icon,g=h.value===i;return(0,n.jsxs)(Im,{children:[(0,n.jsx)(Rm,{asChild:!0,children:(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":g,"aria-label":`${p}: ${h.label}`,disabled:a,onClick:r(()=>c([e.id],h.value),"onClick"),className:Z("flex h-8 w-8 items-center justify-center rounded-sm text-ink-3 outline-none transition-colors","hover:bg-bg hover:text-ink focus-visible:ring-2 focus-visible:ring-focus","disabled:cursor-not-allowed disabled:opacity-50",g&&"bg-bg text-ink shadow-xs"),children:(0,n.jsx)(x,{className:"h-3.5 w-3.5"})})}),(0,n.jsxs)(_m,{side:"top",children:[(0,n.jsx)("span",{className:"font-medium",children:h.label})," — ",h.description]})]},h.value)})})}):(0,n.jsx)("span",{className:"text-sm text-ink-3",children:So.find(h=>h.value===i)?.label}),(0,n.jsxs)(D,{type:"button",size:"sm",variant:"secondary",onClick:r(()=>u(!0),"onClick"),children:[(0,n.jsx)(Lg,{className:"mr-1.5 h-3.5 w-3.5"}),"Test"]})]})]}),(0,n.jsx)(Rx,{connectionId:t,appName:s,entry:e,open:m,onOpenChange:u})]})}r(Qx,"ActionRow");function Fa(e,t,s){return t.has(e)?s.has(e)?"ask":"allowed":"off"}r(Fa,"actionPermission");function Zx({providerName:e,connected:t=!0,canReconnect:s=!0,canDisconnect:i=!0,busy:a=!1,onReconnect:o,onManage:l,onDisconnect:c}){const[d,m]=(0,f.useState)(!1);return(0,n.jsxs)("section",{className:"space-y-4",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Connection settings"}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,n.jsx)(D,{variant:"secondary",disabled:!s||a,onClick:o,children:"Reconnect"}),(0,n.jsxs)(D,{variant:"secondary",onClick:l,children:["Manage in ",e]}),t&&i&&(0,n.jsxs)(vg,{open:d,onOpenChange:r(u=>{a||m(u)},"onOpenChange"),children:[(0,n.jsx)(pg,{asChild:!0,children:(0,n.jsx)(D,{variant:"danger",children:"Disconnect"})}),(0,n.jsxs)(hg,{children:[(0,n.jsxs)(yg,{children:[(0,n.jsxs)(mg,{children:["Disconnect ",e,"?"]}),(0,n.jsx)(ug,{children:"Delete this connection’s saved credentials and stop further calls through Wardmote. Other connections are unaffected. Actions already sent to the provider may still complete. Connecting again requires a new sign-in or key."})]}),(0,n.jsxs)(gg,{children:[(0,n.jsx)(xg,{disabled:a,children:"Cancel"}),(0,n.jsx)(fg,{disabled:a,onClick:r(async u=>{u.preventDefault();try{await c(),m(!1)}catch{}},"onClick"),children:a?"Disconnecting…":"Disconnect connection"})]})]})]})]})]})}r(Zx,"RemoteMcpManagement");var id=["connect"],e0="h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50";function Va({label:e,children:t}){const[s,i]=(0,f.useState)(!1);return(0,n.jsxs)(Im,{open:s,onOpenChange:i,children:[(0,n.jsx)(Rm,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":`Help with ${e}`,onClick:r(()=>i(!s),"onClick"),className:"rounded-sm text-ink-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,n.jsx)(Cg,{className:"size-4"})})}),(0,n.jsx)(_m,{className:"max-w-xs",children:t})]})}r(Va,"FieldHelp");function t0({provider:e,state:t,actions:s,agents:i,companyId:a,connectionId:o,fixedGrantKind:l,lockedAgentId:c,host:d="page",authorizationUrl:m,upstreamServiceName:u,onCancel:p,additionalSettings:h,settingsValid:x=!0}){const g=(0,f.useId)(),j=(0,f.useRef)(null),k=(0,f.useRef)(t.step),[v,w]=(0,f.useState)(()=>!!(e.defaultUrl&&t.url!==e.defaultUrl));(0,f.useEffect)(()=>{k.current!==t.step&&j.current?.focus(),k.current=t.step},[t.step]);const _=id.indexOf(t.step),N=t.connectStatus==="connecting",P=r(C=>s.edit(C),"change"),b=r((C,z)=>(0,n.jsxs)(D,{type:"button",variant:"link",className:"h-auto p-0 text-sm underline",onClick:r(()=>s.openProvider(C),"onClick"),children:[z,(0,n.jsx)(aa,{className:"size-3.5","aria-hidden":"true"})]}),"external"),I=(0,n.jsxs)(dt,{compact:!0,children:["Wardmote controls access to the tools listed here. App and action permissions inside these tools are managed in ",b("manage",e.name),"."]}),L=r(C=>(0,n.jsx)(qg,{onSaveExit:s.saveExit,disabled:N,children:C}),"footer"),R="oauth",F=r(C=>(0,n.jsx)(gc,{companyId:a,...a?{}:{agents:i},sentence:na({grantKind:t.grantKind,authKind:R,installChoice:t.allAgents?"all":"specific",installCount:t.agentIds.length,lockedAgentId:c,preserveAgentAccess:t.setupComplete}),extra:C,forceOpen:t.auth!==(e.supportsBrowserAuth?"auto":"none")||t.connectStatus==="rejected",disabled:N,authKind:R,grantKinds:l?[l]:void 0,grantKind:t.grantKind,setGrantKind:r(z=>{z!=="agent"&&P({grantKind:z})},"setGrantKind"),installChoice:t.allAgents?"all":"specific",setInstallChoice:r(z=>P({allAgents:z==="all"}),"setInstallChoice"),installAgentIds:new Set(t.agentIds),setInstallAgentIds:r(z=>P({agentIds:[...z]}),"setInstallAgentIds"),lockedAgentId:c,preserveAgentAccess:t.setupComplete}),"defaults"),T=t.connectStatus==="invalid_url"?{title:"Enter a valid MCP URL",body:"Paste the complete server URL, including https:// or http://. A dashboard page is not an MCP endpoint."}:t.connectStatus==="oauth_failed"?{title:`${e.name} couldn’t connect`,body:"Authorization did not complete. Your saved connection is still here, so you can try again."}:t.connectStatus==="rejected"?{title:"Credentials were rejected",body:`Check or replace the credentials from ${e.name}, then reconnect. Your agent access and tool choices are preserved.`}:t.connectStatus==="unreachable"?{title:"Wardmote could not reach this server",body:"Check that the endpoint is running and reachable from Wardmote, then try again. Your draft is still here."}:null,E=(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-url`,children:"MCP server URL"}),(0,n.jsx)(Va,{label:"MCP server URL",children:e.urlHelp})]}),(0,n.jsx)(Ce,{id:`${g}-url`,type:"password",autoComplete:"off",spellCheck:!1,placeholder:e.placeholder,value:t.url,"aria-invalid":t.connectStatus==="invalid_url","aria-describedby":`${g}-url-help`,onChange:r(C=>P({url:C.target.value}),"onChange")}),(0,n.jsx)("p",{id:`${g}-url-help`,className:"text-xs text-ink-3",children:e.urlHelp}),e.id==="executor"?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-management`,children:"Console URL (optional)"}),(0,n.jsx)(Va,{label:"Executor console URL",children:"The URL of your Executor organization’s integrations page. Used to open and manage imported accounts."})]}),(0,n.jsx)(Ce,{id:`${g}-management`,type:"url",value:t.managementUrl??"",placeholder:"https://executor.sh/your-organization/integrations",onChange:r(C=>P({managementUrl:C.target.value}),"onChange")})]}):null]});return(0,n.jsxs)("div",{className:d==="dialog"?"min-w-0 text-ink":"mx-auto max-w-6xl p-4 text-ink sm:p-8","data-remote-mcp-provider":e.id,children:[(0,n.jsx)(Rl,{headingRef:j,appIdentity:{name:e.name,logoUrl:null},title:u?`Connect ${u} through ${e.name}`:t.step==="draft"?"Continue your setup":t.setupComplete?t.step==="access"?"Who can use this connection":t.step==="connect"?`Reconnect ${e.name}`:e.name:void 0,subtitle:_>=0&&!t.setupComplete?`Wardmote will use ${e.name} on your behalf.`:t.step==="draft"?`Your ${e.name} setup is ready to resume.`:t.step==="permissions"?`Connected${t.identity?` as ${t.identity}`:""} · ${t.tools.length} actions available`:`Manage this ${e.name} connection.`,step:_>=0&&!t.setupComplete?"key":"gallery",activeIndex:_,labels:id.map(()=>"Connect"),onCancel:N||t.step==="management"||t.step==="permissions"||t.step==="draft"?void 0:p??s.saveExit}),(0,n.jsxs)("main",{className:"space-y-6",children:[u&&(0,n.jsxs)(dt,{compact:!0,children:[e.name," handles the connection and requests to ",u,". ",e.id==="composio"?"After connecting this account, sign in to the app in Composio.":"Manage app sign-in in the provider, then refresh your gateway here."]}),t.notice&&(0,n.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:t.notice}),t.step==="access"&&(0,n.jsx)(fc,{agents:i,lockedAgentId:c,authKind:"oauth",grantKinds:l?[l]:void 0,grantKind:t.grantKind,setGrantKind:r(C=>{C!=="agent"&&P({grantKind:C})},"setGrantKind"),installChoice:t.allAgents?"all":"specific",setInstallChoice:r(C=>P({allAgents:C==="all"}),"setInstallChoice"),installAgentIds:new Set(t.agentIds),setInstallAgentIds:r(C=>P({agentIds:[...C]}),"setInstallAgentIds"),submitLabel:t.setupComplete?"Done":"Continue",onBack:t.setupComplete?s.finish:s.saveExit,onContinue:t.setupComplete?s.finish:()=>s.navigate("connect")}),t.step==="permissions"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Permissions"}),(0,n.jsx)(D,{variant:"secondary",onClick:s.finish,children:"Connection settings"})]}),t.tools.some(C=>C.broad)&&I,(0,n.jsx)(ih,{connectionId:o,appName:e.name,readOnly:t.tools.filter(C=>C.isReadOnly),canChange:t.tools.filter(C=>!C.isReadOnly),quarantined:[],enabledIds:new Set(t.tools.filter(C=>t.permissions[C.id]!=="off").map(C=>C.id)),askFirstIds:new Set(t.tools.filter(C=>t.permissions[C.id]==="ask_first").map(C=>C.id)),disabled:!t.connected,refreshPending:t.refreshing,canConfigure:!0,onSetPermission:r((C,z)=>P({permissions:{...t.permissions,...Object.fromEntries(C.map(W=>[W,z==="ask"?"ask_first":z]))}}),"onSetPermission"),onReviewQuarantined:r(()=>{},"onReviewQuarantined"),onRefreshActions:s.refresh})]}),(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-6",children:[t.step==="connect"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("ol",{className:"list-decimal space-y-2 pl-5 text-sm",children:e.instructions.map(C=>(0,n.jsx)("li",{children:C},C))}),b("setup",`Open ${e.name} setup guide`)]}),t.connectStatus==="sign_in"&&e.supportsBrowserAuth?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{role:"status",children:(0,n.jsx)(dt,{title:`Finish signing in to ${e.name}`,children:"Complete sign-in in the provider window, then return here. Wardmote is waiting for confirmation."})}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:["If a window did not open, ",m?(0,n.jsx)("a",{className:"text-current underline",href:m,onClick:r(()=>s.openProvider("sign_in"),"onClick"),target:"_blank",rel:"noopener noreferrer",children:"open sign-in again"}):b("sign_in","open sign-in again"),"."]}),L((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D,{variant:"secondary",onClick:s.cancelConnect,children:"Cancel sign-in"}),(0,n.jsx)(D,{disabled:!0,children:"Waiting for sign-in"})]}))]}):(0,n.jsxs)("form",{className:"space-y-6",onSubmit:r(C=>{C.preventDefault(),s.connect()},"onSubmit"),children:[T&&(0,n.jsx)("div",{role:"alert",children:(0,n.jsx)(dt,{tone:"danger",title:T.title,children:T.body})}),t.connectStatus==="cancelled"&&(0,n.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Connection cancelled. Your setup details are preserved; try again when you are ready."}),(0,n.jsxs)("fieldset",{disabled:N,className:"min-w-0 space-y-5",children:[e.defaultUrl?(0,n.jsxs)(kl,{open:v||t.connectStatus==="invalid_url",onOpenChange:w,children:[(0,n.jsx)(jl,{asChild:!0,children:(0,n.jsx)(D,{type:"button",variant:"link",className:"h-auto p-0 text-sm underline underline-offset-2",children:"Reuse an existing session"})}),(0,n.jsx)(bl,{className:"mt-3",children:E})]}):E,F((0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-ink",children:"Authentication"}),(0,n.jsx)("p",{className:"text-sm text-ink-3",children:e.authHelp}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-auth`,children:"Sign-in method"}),(0,n.jsxs)("select",{id:`${g}-auth`,className:e0,value:t.auth,onChange:r(C=>P({auth:C.target.value}),"onChange"),children:[e.supportsBrowserAuth&&(0,n.jsx)("option",{value:"auto",children:"Automatic (sign in if required)"}),(0,n.jsx)("option",{value:"bearer",children:"Bearer token"}),(0,n.jsx)("option",{value:"headers",children:"Custom headers"}),(0,n.jsx)("option",{value:"none",children:"No additional authentication"})]})]}),t.auth==="bearer"&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-token`,children:"Bearer token"}),(0,n.jsx)(Va,{label:"bearer token",children:"Paste the token only, without the word Bearer. It is kept in the connection’s credentials."})]}),(0,n.jsx)(Ce,{id:`${g}-token`,type:"password",autoComplete:"off",value:t.token,onChange:r(C=>P({token:C.target.value}),"onChange")})]}),(t.auth==="bearer"||t.auth==="headers")&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:t.auth==="bearer"?"Additional headers":"Headers"}),t.headers.map((C,z)=>(0,n.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)(dn,{htmlFor:`${g}-${C.id}-name`,children:["Header ",z+1," name"]}),(0,n.jsx)(Ce,{id:`${g}-${C.id}-name`,value:C.name,placeholder:e.id==="arcade"?"Arcade-User-ID":"Header name",onChange:r(W=>P({headers:t.headers.map(G=>G.id===C.id?{...G,name:W.target.value}:G)}),"onChange")})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)(dn,{htmlFor:`${g}-${C.id}-value`,children:["Header ",z+1," value"]}),(0,n.jsx)(Ce,{id:`${g}-${C.id}-value`,type:"password",autoComplete:"off",value:C.value,onChange:r(W=>P({headers:t.headers.map(G=>G.id===C.id?{...G,value:W.target.value}:G)}),"onChange")})]}),(0,n.jsx)(D,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove header ${z+1}`,onClick:r(()=>P({headers:t.headers.filter(W=>W.id!==C.id)}),"onClick"),children:(0,n.jsx)(Pm,{className:"size-4"})})]},C.id)),(0,n.jsxs)(D,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>P({headers:[...t.headers,{id:crypto.randomUUID(),name:"",value:""}]}),"onClick"),children:[(0,n.jsx)(Al,{className:"size-4"}),"Add header"]})]})]}))]}),h,N&&(0,n.jsxs)("p",{role:"status",className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(He,{className:"size-4 animate-spin motion-reduce:animate-none"}),"Connecting and discovering tools…"]}),L((0,n.jsxs)(n.Fragment,{children:[t.setupComplete?(0,n.jsx)(D,{type:"button",variant:"secondary",disabled:N,onClick:s.finish,children:"Back"}):(0,n.jsx)("span",{}),(0,n.jsx)(D,{type:"submit",disabled:N||!t.url.trim()||!x,children:N?"Connecting…":T||t.connectStatus==="cancelled"?"Try again":`Connect ${e.name}`})]}))]})]}),t.step==="management"&&(0,n.jsxs)(n.Fragment,{children:[t.connected?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(go,{className:"size-4"}),"Connected",t.identity?` as ${t.identity}`:""]}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:[t.grantKind==="user"?"Just me":"Any human in the organization"," · ",t.tools.length," tools · ",t.allAgents?"Any agent":`${t.agentIds.length} agents with access`]})]}):(0,n.jsx)(dt,{tone:"warning",title:"Disconnected",children:"Agents cannot use this connection. Reconnect to restore access under the saved permission choices."}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(D,{onClick:r(()=>s.navigate("access"),"onClick"),children:"Who can use this connection"}),(0,n.jsx)(D,{variant:"secondary",disabled:!t.connected,onClick:r(()=>s.navigate("permissions"),"onClick"),children:"Permissions"})]}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:["Refresh the catalog after changing tools in ",e.name,". Existing Off and Ask first choices are preserved."]}),(0,n.jsx)(D,{variant:"secondary",disabled:!t.connected||t.refreshing,onClick:s.refresh,children:t.refreshing?"Refreshing…":"Refresh tools"}),(0,n.jsx)(Zx,{providerName:e.name,connected:t.connected,onReconnect:s.reconnect,onManage:r(()=>s.openProvider("manage"),"onManage"),onDisconnect:s.disconnect})]}),t.step==="draft"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm",children:"Your access choices and setup progress are kept with this connection."}),(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)(D,{onClick:s.resumeDraft,children:"Resume setup"})})]})]})]})]})}r(t0,"RemoteMcpConnectionSetup");function n0(e){try{const t=JSON.parse(sessionStorage.getItem(e)??"null");return!t||!["organization","user"].includes(t.grantKind)||typeof t.allAgents!="boolean"||!Array.isArray(t.agentIds)?{}:{grantKind:t.grantKind,allAgents:t.allAgents,agentIds:t.agentIds.filter(s=>typeof s=="string")}}catch{return{}}}r(n0,"readAccessDraft");function s0({providerId:e,connection:t,host:s="page",interactionId:i,upstreamServiceName:a,requestedAgentId:o,existingConnections:l=[],forceNewConnection:c,onUseExisting:d,onComplete:m,onCancel:u,onPhaseChange:p}){const h=rg[e],x=fi(e)?.agentInstructions,[g,j]=(0,f.useState)(()=>t?t.agentInstructions??(x?{...Ls(x),enabled:!1}:null):Ls(x)),k=!g||!!g.text.trim(),{selectedCompanyId:v}=us(),w=wm(),[_]=sa();let N=_.get("targetToolkit");if(!N&&t&&s==="page")try{N=sessionStorage.getItem(`wardmote:mcp-upstream-app:${v}:${t.id}`)}catch{}const P=vm(e,N),b=P?.routes.find(H=>H.provider===e);a??=P?.name;const I=t?_.get("oauth"):null,L=Bt(),R=`wardmote:mcp-access-draft:${v}:${i||e}`,F=`wardmote:mcp-intent-draft:${v}:${i}`,T=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>{T.current?.close(),T.current=null},[]);const[E,C]=(0,f.useState)(!t&&!c&&l.length>0&&!!d),[z,W]=(0,f.useState)(null),[G,V]=(0,f.useState)(null),B=(0,f.useRef)(t),O=(0,f.useRef)(!1),y=(0,f.useRef)(void 0),[M,q]=(0,f.useState)(()=>({step:"connect",grantKind:t?t.credentialPolicy==="per_user"?"user":"organization":o?"user":"organization",setupComplete:!!(t&&t.status!=="draft"),url:typeof t?.config?.url=="string"?t.config?.url:h.defaultUrl,managementUrl:typeof t?.config?.managementUrl=="string"?t.config.managementUrl:"",auth:t?.config?.mcpAuthMode==="bearer"?"bearer":t?.authKind==="api_key"?"headers":h.supportsBrowserAuth?"auto":"none",token:"",headers:[],connectStatus:I==="denied"?"cancelled":I==="failed"?"oauth_failed":"idle",connected:!1,identity:null,allAgents:!0,agentIds:[],permissions:{},tools:[],notice:t?.authKind==="api_key"?"Saved credentials are retained when these fields are left blank. Enter a replacement only to change them.":null,refreshing:!1,...t?{}:n0(R),...o?{allAgents:!1,agentIds:[o]}:{}})),ne=ue({queryKey:ge.tools.connectionInstalls(t?.id??"__new__"),queryFn:r(()=>_e.getConnectionInstalls(t.id),"queryFn"),enabled:!!t}),Ne=ue({queryKey:ge.agents.list(v),queryFn:r(()=>Ee.list(v),"queryFn"),enabled:!!v});(0,f.useEffect)(()=>{ne.data&&!o&&q(H=>({...H,allAgents:ne.data.installs.some(pe=>pe.targetType==="company"),agentIds:ne.data.installs.filter(pe=>pe.targetType==="agent").map(pe=>pe.targetId)}))},[ne.data,o]),(0,f.useEffect)(()=>{if(!t)try{sessionStorage.setItem(R,JSON.stringify({grantKind:M.grantKind,allAgents:M.allAgents,agentIds:M.agentIds}))}catch{}},[t,R,M.grantKind,M.allAgents,M.agentIds]),(0,f.useEffect)(()=>{if(s!=="dialog"||!i)return;const H=r(pe=>{const Se=yf(pe,window.location.origin,i);Se&&(Se==="connected"?m?.({resolvedByCallback:!0}):(q(ae=>({...ae,connectStatus:Se==="declined"?"cancelled":"oauth_failed"})),p?.("needs_retry")))},"receive");return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[s,i,m,p]);const we=r(H=>q(pe=>({...pe,...H})),"edit"),X=r(async H=>{try{sessionStorage.removeItem(R)}catch{}if(await L.invalidateQueries({queryKey:["tools"]}),Ic(e)&&sg(L).then(pe=>{const Se=ge.tools.aggregatorApps(H,pe);return L.fetchQuery({queryKey:[...Se,"sync"],queryFn:r(()=>_e.syncAggregatorApps(H),"queryFn"),staleTime:0}).then(ae=>L.setQueryData(Se,ae))}).catch(()=>{}),m)m({connectionId:H});else if(e==="composio"){try{sessionStorage.removeItem(`wardmote:mcp-upstream-app:${v}:${H}`)}catch{}w(`/apps/${H}/permissions`)}else if(s==="page"&&P&&b){try{sessionStorage.removeItem(`wardmote:mcp-upstream-app:${v}:${H}`)}catch{}w("/apps")}else Ic(e)?w("/apps"):w(`/apps/${H}/permissions`)},"finish"),ee=r(async(H=!1)=>{if(!(O.current||!v||!k||t&&!ne.data)){try{const pe=new URL(M.url.trim());if(!["http:","https:"].includes(pe.protocol))throw new Error}catch{we({connectStatus:"invalid_url"});return}if(!H&&s==="dialog"&&M.auth==="auto"&&(!T.current||T.current.closed))try{T.current=window.open("about:blank","wardmote-connection-oauth","popup,width=720,height=760,resizable=yes,scrollbars=yes")}catch{T.current=null}O.current=!0,we({connectStatus:"connecting",notice:null});try{const pe={};if(M.auth==="bearer"&&M.token.trim()&&(pe["credentials.authorization"]=M.token.trim()),M.auth==="headers"||M.auth==="bearer"){for(const te of M.headers)if(!(!te.name.trim()&&!te.value)){if(!te.name.trim()||!te.value)throw new Error("Enter both a name and value for each header.");pe[`headers.${te.name.trim()}`]=te.value}}const Se=e==="executor"&&M.managementUrl?.trim()?Kf("executor",M.managementUrl.trim()):null;if(e==="executor"&&M.managementUrl?.trim()&&!Se)throw new Error("Use an HTTPS console URL without credentials.");const ae=B.current,re=await _e.connectApp(v,{galleryKey:e,connectionMethodKey:Jf[e],name:h.name,link:M.url.trim(),grantKind:M.grantKind,authMode:M.auth==="headers"?"custom_headers":M.auth,credentialValues:pe,saveDraft:H,...x&&g?{agentInstructions:g}:{},...ae?ae.status==="draft"?{resumeConnectionId:ae.id}:{reconnectConnectionId:ae.id}:{}});if(Se&&(re.connection=await _e.updateConnection(re.connectionId,{config:{...re.connection.config,managementUrl:Se}})),B.current=re.connection,s==="page"&&b)try{sessionStorage.setItem(`wardmote:mcp-upstream-app:${v}:${re.connectionId}`,b.toolkit)}catch{}if(i)try{sessionStorage.setItem(F,re.connectionId)}catch{}if(!o&&(!ae||ae.status==="draft")&&await _e.putConnectionInstalls(re.connectionId,M.allAgents?[{targetType:"company",targetId:v}]:M.agentIds.map(te=>({targetType:"agent",targetId:te}))),H){u?u():w("/apps");return}if(re.auth?.kind==="oauth"){p?.("authorizing");const te=await _e.startOAuth(re.connectionId,{asCurrentUser:re.connection.credentialPolicy==="per_user",...i?{interactionId:i}:{}}),ve=Gm(te.authorizationUrl);if(!ve.ok)throw new Error(ve.message);y.current=ve.url,we({connectStatus:"sign_in",token:"",headers:[]});try{if(s==="dialog"){if(!T.current||T.current.closed)throw new Error("Sign-in window unavailable");T.current.location.assign(ve.url),T.current.focus()}else Hm(ve.url)}catch{we({notice:"Wardmote couldn’t open sign-in. Use the sign-in link below to continue."}),p?.("needs_retry")}return}T.current?.close(),T.current=null;{const te=new Set(re.catalog.filter(ve=>ve.status==="active").map(ve=>ve.id));await _e.finishApp(v,re.connectionId,{enabledCatalogEntryIds:[...te],askFirstCatalogEntryIds:qm(re,ve=>te.has(ve)),access:o?{agentIds:[o]}:M.allAgents?"all_agents":{agentIds:M.agentIds},...o?{preserveExistingAccess:!0}:{}})}await X(re.connectionId)}catch(pe){T.current?.close(),T.current=null,p?.("needs_retry"),we({connectStatus:"idle",notice:pe instanceof Error?pe.message:"Could not connect. Please try again."})}finally{O.current=!1}}},"submit"),le={edit:we,navigate:r(H=>we({step:H}),"navigate"),connect:r(()=>{ee()},"connect"),cancelConnect:r(()=>{O.current||(T.current?.close(),T.current=null,we({connectStatus:"cancelled"}),p?.("needs_retry"))},"cancelConnect"),openProvider:r(H=>{H==="sign_in"&&y.current?(T.current=null,we({connectStatus:"sign_in",notice:null}),p?.("authorizing")):window.open(h.setupUrl,"_blank","noopener,noreferrer")},"openProvider"),saveExit:r(()=>{O.current||(M.url.trim()?ee(!0):u?u():w("/apps"))},"saveExit"),resumeDraft:r(()=>we({step:"connect"}),"resumeDraft"),finish:r(()=>{B.current&&X(B.current.id)},"finish"),refresh:r(()=>{},"refresh"),reconnect:r(()=>we({step:"connect"}),"reconnect"),disconnect:r(()=>{},"disconnect")};return E&&d?(0,n.jsx)(Nx,{providerName:h.name,upstreamServiceName:a,connections:l,pendingId:z,error:G,onCancel:u,onConnectNew:r(()=>C(!1),"onConnectNew"),onSelect:r(H=>{W(H),V(null),d(H).catch(pe=>{V(pe instanceof Error?pe.message:"Could not use this connection."),W(null)})},"onSelect")}):t&&!ne.data?(0,n.jsxs)("div",{className:"space-y-3 p-8",children:[(0,n.jsx)("p",{children:ne.isError?"Could not load saved access. Retry before changing this connection.":"Loading saved access…"}),ne.isError&&(0,n.jsx)("button",{type:"button",className:"text-accent underline",onClick:r(()=>{ne.refetch()},"onClick"),children:"Try again"})]}):(0,n.jsx)(t0,{additionalSettings:x&&g?(0,n.jsx)(_l,{provider:h.name,template:x,value:g,onChange:j,disabled:M.connectStatus==="connecting"}):void 0,settingsValid:k,companyId:v,onCancel:u??(()=>w("/apps")),upstreamServiceName:a,host:s,lockedAgentId:o,authorizationUrl:y.current,provider:h,connectionId:B.current?.id??"",fixedGrantKind:B.current?B.current.credentialPolicy==="per_user"?"user":"organization":void 0,state:M,actions:le,agents:Ne.data??[]})}r(s0,"RemoteMcpProductionSetup");var Ol=(0,f.createContext)({});function Dl(e){const t=(0,f.useRef)(null);return t.current===null&&(t.current=e()),t.current}r(Dl,"useConstant");var i0=typeof window<"u",Br=i0?f.useLayoutEffect:f.useEffect,ca=(0,f.createContext)(null);function Ll(e,t){e.indexOf(t)===-1&&e.push(t)}r(Ll,"addUniqueItem");function $r(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}r($r,"removeItem");var en=r((e,t,s)=>s>t?t:s<e?e:s,"clamp"),da=r(()=>{},"warning"),ds=r(()=>{},"invariant"),Rn={},rh=r(e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),"isNumericalString"),ah=r(e=>typeof e=="object"&&e!==null,"isObject"),oh=r(e=>/^0[^.\s]+$/u.test(e),"isZeroValueString");function lh(e){let t;return()=>(t===void 0&&(t=e()),t)}r(lh,"memo");var It=r(e=>e,"noop"),Ei=r((...e)=>e.reduce((t,s)=>i=>s(t(i))),"pipe"),ji=r((e,t,s)=>{const i=t-e;return i?(s-e)/i:1},"progress"),Fl=class{static{r(this,"SubscriptionManager")}constructor(){this.subscriptions=[]}add(e){return Ll(this.subscriptions,e),()=>$r(this.subscriptions,e)}notify(e,t,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,t,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},St=r(e=>e*1e3,"secondsToMilliseconds"),Rt=r(e=>e/1e3,"millisecondsToSeconds"),ch=r((e,t)=>t?e*(1e3/t):0,"velocityPerSecond"),dh=r((e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,"calcBezier"),r0=1e-7,a0=12;function o0(e,t,s,i,a){let o,l,c=0;do l=t+(s-t)/2,o=dh(l,i,a)-e,o>0?s=l:t=l;while(Math.abs(o)>r0&&++c<a0);return l}r(o0,"binarySubdivide");function Ti(e,t,s,i){if(e===t&&s===i)return It;const a=r(o=>o0(o,0,1,e,s),"getTForX");return o=>o===0||o===1?o:dh(a(o),t,i)}r(Ti,"cubicBezier");var uh=r(e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,"mirrorEasing"),mh=r(e=>t=>1-e(1-t),"reverseEasing"),hh=Ti(.33,1.53,.69,.99),Vl=mh(hh),ph=uh(Vl),fh=r(e=>e>=1?1:(e*=2)<1?.5*Vl(e):.5*(2-Math.pow(2,-10*(e-1))),"anticipate"),Ul=r(e=>1-Math.sin(Math.acos(e)),"circIn"),gh=mh(Ul),xh=uh(Ul),l0=Ti(.42,0,1,1),c0=Ti(0,0,.58,1),yh=Ti(.42,0,.58,1),d0=r(e=>Array.isArray(e)&&typeof e[0]!="number","isEasingArray"),vh=r(e=>Array.isArray(e)&&typeof e[0]=="number","isBezierDefinition"),rd={linear:It,easeIn:l0,easeInOut:yh,easeOut:c0,circIn:Ul,circInOut:xh,circOut:gh,backIn:Vl,backInOut:ph,backOut:hh,anticipate:fh},u0=r(e=>typeof e=="string","isValidEasing"),ad=r(e=>{if(vh(e)){ds(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,s,i,a]=e;return Ti(t,s,i,a)}else if(u0(e))return ds(rd[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),rd[e];return e},"easingDefinitionToFunction"),or=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m0(e){let t=new Set,s=new Set,i=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(m){o.has(m)&&(d.schedule(m),e()),m(l)}r(c,"triggerCallback");const d={schedule:r((m,u=!1,p=!1)=>{const h=p&&i?t:s;return u&&o.add(m),h.add(m),m},"schedule"),cancel:r(m=>{s.delete(m),o.delete(m)},"cancel"),process:r(m=>{if(l=m,i){a=!0;return}i=!0;const u=t;t=s,s=u,t.forEach(c),t.clear(),i=!1,a&&(a=!1,d.process(m))},"process")};return d}r(m0,"createRenderStep");var h0=40;function bh(e,t){let s=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=r(()=>s=!0,"flagRunNextFrame"),l=or.reduce((_,N)=>(_[N]=m0(o),_),{}),{setup:c,read:d,resolveKeyframes:m,preUpdate:u,update:p,preRender:h,render:x,postRender:g}=l,j=r(()=>{const _=Rn.useManualTiming,N=_?a.timestamp:performance.now();s=!1,_||(a.delta=i?1e3/60:Math.max(Math.min(N-a.timestamp,h0),1)),a.timestamp=N,a.isProcessing=!0,c.process(a),d.process(a),m.process(a),u.process(a),p.process(a),h.process(a),x.process(a),g.process(a),a.isProcessing=!1,s&&t&&(i=!1,e(j))},"processBatch"),k=r(()=>{s=!0,i=!0,a.isProcessing||e(j)},"wake");return{schedule:or.reduce((_,N)=>{const P=l[N];return _[N]=(b,I=!1,L=!1)=>(s||k(),P.schedule(b,I,L)),_},{}),cancel:r(_=>{for(let N=0;N<or.length;N++)l[or[N]].cancel(_)},"cancel"),state:a,steps:l}}r(bh,"createRenderBatcher");var{schedule:Oe,cancel:_n,state:rt,steps:Ua}=bh(typeof requestAnimationFrame<"u"?requestAnimationFrame:It,!0),br;function p0(){br=void 0}r(p0,"clearTime");var pt={now:r(()=>(br===void 0&&pt.set(rt.isProcessing||Rn.useManualTiming?rt.timestamp:performance.now()),br),"now"),set:r(e=>{br=e,queueMicrotask(p0)},"set")},jh=r(e=>t=>typeof t=="string"&&t.startsWith(e),"checkStringStartsWith"),kh=jh("--"),f0=jh("var(--"),Bl=r(e=>f0(e)?g0.test(e.split("/*")[0].trim()):!1,"isCSSVariableToken"),g0=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function od(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}r(od,"containsCSSVariable");var zs={test:r(e=>typeof e=="number","test"),parse:parseFloat,transform:r(e=>e,"transform")},ki={...zs,transform:r(e=>en(0,1,e),"transform")},lr={...zs,default:1},ci=r(e=>Math.round(e*1e5)/1e5,"sanitize"),$l=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x0(e){return e==null}r(x0,"isNullish");var y0=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zl=r((e,t)=>s=>!!(typeof s=="string"&&y0.test(s)&&s.startsWith(e)||t&&!x0(s)&&Object.prototype.hasOwnProperty.call(s,t)),"isColorString"),wh=r((e,t,s)=>i=>{if(typeof i!="string")return i;const[a,o,l,c]=i.match($l);return{[e]:parseFloat(a),[t]:parseFloat(o),[s]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},"splitColor"),v0=r(e=>en(0,255,e),"clampRgbUnit"),Ba={...zs,transform:r(e=>Math.round(v0(e)),"transform")},ts={test:zl("rgb","red"),parse:wh("red","green","blue"),transform:r(({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+Ba.transform(e)+", "+Ba.transform(t)+", "+Ba.transform(s)+", "+ci(ki.transform(i))+")","transform")};function b0(e){let t="",s="",i="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}}r(b0,"parseHex");var No={test:zl("#"),parse:b0,transform:ts.transform},Pi=r(e=>({test:r(t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,"test"),parse:parseFloat,transform:r(t=>`${t}${e}`,"transform")}),"createUnitType"),cn=Pi("deg"),Zt=Pi("%"),ie=Pi("px"),j0=Pi("vh"),k0=Pi("vw"),ld={...Zt,parse:r(e=>Zt.parse(e)/100,"parse"),transform:r(e=>Zt.transform(e*100),"transform")},Ts={test:zl("hsl","hue"),parse:wh("hue","saturation","lightness"),transform:r(({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+Zt.transform(ci(t))+", "+Zt.transform(ci(s))+", "+ci(ki.transform(i))+")","transform")},Ze={test:r(e=>ts.test(e)||No.test(e)||Ts.test(e),"test"),parse:r(e=>ts.test(e)?ts.parse(e):Ts.test(e)?Ts.parse(e):No.parse(e),"parse"),transform:r(e=>typeof e=="string"?e:e.hasOwnProperty("red")?ts.transform(e):Ts.transform(e),"transform"),getAnimatableNone:r(e=>{const t=Ze.parse(e);return t.alpha=0,Ze.transform(t)},"getAnimatableNone")},w0=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C0(e){return isNaN(e)&&typeof e=="string"&&(e.match($l)?.length||0)+(e.match(w0)?.length||0)>0}r(C0,"test");var Ch="number",Ah="color",A0="var",S0="var(",cd="${}",N0=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vs(e){const t=e.toString(),s=[],i={color:[],number:[],var:[]},a=[];let o=0;return{values:s,split:t.replace(N0,l=>(Ze.test(l)?(i.color.push(o),a.push(Ah),s.push(Ze.parse(l))):l.startsWith(S0)?(i.var.push(o),a.push(A0),s.push(l)):(i.number.push(o),a.push(Ch),s.push(parseFloat(l))),++o,cd)).split(cd),indexes:i,types:a}}r(Vs,"analyseComplexValue");function E0(e){return Vs(e).values}r(E0,"parseComplexValue");function Sh({split:e,types:t}){const s=e.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=e[o],i[o]!==void 0){const l=t[o];l===Ch?a+=ci(i[o]):l===Ah?a+=Ze.transform(i[o]):a+=i[o]}return a}}r(Sh,"buildTransformer");function T0(e){return Sh(Vs(e))}r(T0,"createTransformer");var P0=r(e=>typeof e=="number"?0:Ze.test(e)?Ze.getAnimatableNone(e):e,"convertNumbersToZero"),R0=r((e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:P0(e),"convertToZero");function _0(e){const t=Vs(e);return Sh(t)(t.values.map((s,i)=>R0(s,t.split[i])))}r(_0,"getAnimatableNone$1");var Vt={test:C0,parse:E0,createTransformer:T0,getAnimatableNone:_0};function $a(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}r($a,"hueToRgb");function I0({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,t/=100,s/=100;let a=0,o=0,l=0;if(!t)a=o=l=s;else{const c=s<.5?s*(1+t):s+t-s*t,d=2*s-c;a=$a(d,c,e+1/3),o=$a(d,c,e),l=$a(d,c,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:i}}r(I0,"hslaToRgba");function zr(e,t){return s=>s>0?t:e}r(zr,"mixImmediate");var Me=r((e,t,s)=>e+(t-e)*s,"mixNumber$1"),za=r((e,t,s)=>{const i=e*e,a=s*(t*t-i)+i;return a<0?0:Math.sqrt(a)},"mixLinearColor"),M0=[No,ts,Ts],O0=r(e=>M0.find(t=>t.test(e)),"getColorType");function dd(e){const t=O0(e);if(da(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===Ts&&(s=I0(s)),s}r(dd,"asRGBA");var ud=r((e,t)=>{const s=dd(e),i=dd(t);if(!s||!i)return zr(e,t);const a={...s};return o=>(a.red=za(s.red,i.red,o),a.green=za(s.green,i.green,o),a.blue=za(s.blue,i.blue,o),a.alpha=Me(s.alpha,i.alpha,o),ts.transform(a))},"mixColor"),Eo=new Set(["none","hidden"]);function D0(e,t){return Eo.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}r(D0,"mixVisibility");function L0(e,t){return s=>Me(e,t,s)}r(L0,"mixNumber");function Kl(e){return typeof e=="number"?L0:typeof e=="string"?Bl(e)?zr:Ze.test(e)?ud:U0:Array.isArray(e)?Nh:typeof e=="object"?Ze.test(e)?ud:F0:zr}r(Kl,"getMixer");function Nh(e,t){const s=[...e],i=s.length,a=e.map((o,l)=>Kl(o)(o,t[l]));return o=>{for(let l=0;l<i;l++)s[l]=a[l](o);return s}}r(Nh,"mixArray");function F0(e,t){const s={...e,...t},i={};for(const a in s)e[a]!==void 0&&t[a]!==void 0&&(i[a]=Kl(e[a])(e[a],t[a]));return a=>{for(const o in i)s[o]=i[o](a);return s}}r(F0,"mixObject");function V0(e,t){const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=e.values[l]??0;s[a]=c,i[o]++}return s}r(V0,"matchOrder");var U0=r((e,t)=>{const s=Vt.createTransformer(t),i=Vs(e),a=Vs(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?Eo.has(e)&&!a.values.length||Eo.has(t)&&!i.values.length?D0(e,t):Ei(Nh(V0(i,a),a.values),s):(da(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),zr(e,t))},"mixComplex");function Eh(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?Me(e,t,s):Kl(e)(e,t)}r(Eh,"mix");var B0=r(e=>{const t=r(({timestamp:s})=>e(s),"passTimestamp");return{start:r((s=!0)=>Oe.update(t,s),"start"),stop:r(()=>_n(t),"stop"),now:r(()=>rt.isProcessing?rt.timestamp:pt.now(),"now")}},"frameloopDriver"),Th=r((e,t,s=10)=>{let i="";const a=Math.max(Math.round(t/s),2);for(let o=0;o<a;o++)i+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},"generateLinearEasing"),Wl=2e4;function ql(e,t=50,s=Wl,i){let a=0,o=e.next(a);for(i?.push(o.value);!o.done&&a<s;)a+=t,o=e.next(a),i?.push(o.value);return a>=s?1/0:a}r(ql,"calcGeneratorDuration");function $0(e,t=100,s){const i=s({...e,keyframes:[0,t]}),a=Math.min(ql(i),Wl);return{type:"keyframes",ease:r(o=>i.next(a*o).value/t,"ease"),duration:Rt(a)}}r($0,"createGeneratorEasing");var We={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function To(e,t){return e*Math.sqrt(1-t*t)}r(To,"calcAngularFreq");var z0=12;function K0(e,t,s){let i=s;for(let a=1;a<z0;a++)i=i-e(i)/t(i);return i}r(K0,"approximateRoot");var md=.001;function W0({duration:e=We.duration,bounce:t=We.bounce,velocity:s=We.velocity,mass:i=We.mass}){let a,o;da(e<=St(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-t;l=en(We.minDamping,We.maxDamping,l),e=en(We.minDuration,We.maxDuration,Rt(e)),l<1?(a=r(m=>{const u=m*l,p=u*e,h=u-s,x=To(m,l),g=Math.exp(-p);return md-h/x*g},"envelope"),o=r(m=>{const u=m*l*e,p=u*s+s,h=l*l*m*m*e,x=Math.exp(-u),g=To(m*m,l);return(-a(m)+md>0?-1:1)*((p-h)*x)/g},"derivative")):(a=r(m=>-.001+Math.exp(-m*e)*((m-s)*e+1),"envelope"),o=r(m=>Math.exp(-m*e)*((s-m)*(e*e)),"derivative"));const c=5/e,d=K0(a,o,c);if(e=St(e),isNaN(d))return{stiffness:We.stiffness,damping:We.damping,duration:e};{const m=d*d*i;return{stiffness:m,damping:l*2*Math.sqrt(i*m),duration:e}}}r(W0,"findSpring");var q0=["duration","bounce"],G0=["stiffness","damping","mass"];function hd(e,t){return t.some(s=>e[s]!==void 0)}r(hd,"isSpringType");function H0(e){let t={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:!1,...e};if(!hd(e,G0)&&hd(e,q0))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,i=2*Math.PI/(s*1.2),a=i*i,o=2*en(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:We.mass,stiffness:a,damping:o}}else{const s=W0({...e,velocity:0});t={...t,...s,mass:We.mass},t.isResolvedFromDuration=!0}return t}r(H0,"getSpringOptions");function Kr(e=We.visualDuration,t=We.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:a}=s;const o=s.keyframes[0],l=s.keyframes[s.keyframes.length-1],c={done:!1,value:o},{stiffness:d,damping:m,mass:u,duration:p,velocity:h,isResolvedFromDuration:x}=H0({...s,velocity:-Rt(s.velocity||0)}),g=h||0,j=m/(2*Math.sqrt(d*u)),k=l-o,v=Rt(Math.sqrt(d/u)),w=j*v,_=Math.abs(k)<5;i||(i=_?We.restSpeed.granular:We.restSpeed.default),a||(a=_?We.restDelta.granular:We.restDelta.default);let N,P;if(j<1){const I=To(v,j),L=(g+w*k)/I,R=w*L+k*I,F=w*k-L*I;let T=-1,E=0,C=0;const z=r(W=>{if(W!==T){T=W;const G=Math.exp(-w*W),V=Math.sin(I*W),B=Math.cos(I*W);E=l-G*(L*V+k*B),C=G*(R*V+F*B)}},"sample");N=r(W=>(z(W),E),"resolveSpring"),P=r(W=>(z(W),C),"resolveVelocity")}else if(j===1){N=r(L=>l-Math.exp(-v*L)*(k+(g+v*k)*L),"resolveSpring");const I=g+v*k;P=r(L=>Math.exp(-v*L)*(v*I*L-g),"resolveVelocity")}else{const I=v*Math.sqrt(j*j-1);N=r(T=>{const E=Math.exp(-w*T),C=Math.min(I*T,300);return l-E*((g+w*k)*Math.sinh(C)+I*k*Math.cosh(C))/I},"resolveSpring");const L=(g+w*k)/I,R=w*L-k*I,F=w*k-L*I;P=r(T=>{const E=Math.exp(-w*T),C=Math.min(I*T,300);return E*(R*Math.sinh(C)+F*Math.cosh(C))},"resolveVelocity")}const b={calculatedDuration:x&&p||null,velocity:r(I=>St(P(I)),"velocity"),next:r(I=>{const L=N(I);if(x)c.done=I>=p;else{const R=St(P(I));c.done=Math.abs(R)<=i&&Math.abs(l-L)<=a}return c.value=c.done?l:L,c},"next"),toString:r(()=>{const I=Math.min(ql(b),Wl),L=Th(R=>b.next(I*R).value,I,30);return I+"ms "+L},"toString"),toTransition:r(()=>{},"toTransition")};return b}r(Kr,"spring");Kr.applyToOptions=e=>{const t=$0(e,100,Kr);return e.ease=t.ease,e.duration=St(t.duration),e.type="keyframes",e};function Po({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:d,restDelta:m=.5,restSpeed:u}){const p=e[0],h={done:!1,value:p},x=r(I=>I<c||I>d,"isOutOfBounds"),g=r(I=>c===void 0?d:d===void 0||Math.abs(c-I)<Math.abs(d-I)?c:d,"nearestBoundary");let j=s*t;const k=p+j,v=l===void 0?k:l(k);v!==k&&(j=v-p);const w=r(I=>-j*Math.exp(-I/i),"calcDelta"),_=r(I=>{const L=w(I);h.done=Math.abs(L)<=m,h.value=h.done?v:v+L},"applyFriction");let N,P;const b=r(I=>{x(h.value)&&(N=I,P=Kr({keyframes:[h.value,g(h.value)],velocity:-w(I)/i*1e3,damping:a,stiffness:o,restDelta:m,restSpeed:u}))},"checkCatchBoundary");return b(0),{calculatedDuration:null,next:r(I=>{let L=!1;return!P&&N===void 0&&(L=!0,_(I),b(I)),N!==void 0&&I>=N?P.next(I-N):(!L&&_(I),h)},"next")}}r(Po,"inertia");function Y0(e,t,s){const i=[],a=s||Rn.mix||Eh,o=e.length-1;for(let l=0;l<o;l++){let c=a(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||It:t;c=Ei(d,c)}i.push(c)}return i}r(Y0,"createMixers");function X0(e,t,{clamp:s=!0,ease:i,mixer:a}={}){const o=e.length;if(ds(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=Y0(t,i,a),d=c.length,m=r(u=>{if(l&&u<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(u<e[p+1]);p++);const h=ji(e[p],e[p+1],u);return c[p](h)},"interpolator");return s?u=>m(en(e[0],e[o-1],u)):m}r(X0,"interpolate");function J0(e,t){const s=e[e.length-1];for(let i=1;i<=t;i++){const a=ji(0,t,i);e.push(Me(s,1,a))}}r(J0,"fillOffset");function Q0(e){const t=[0];return J0(t,e.length-1),t}r(Q0,"defaultOffset");function Z0(e,t){return e.map(s=>s*t)}r(Z0,"convertOffsetToTimes");function ey(e,t){return e.map(()=>t||yh).splice(0,e.length-1)}r(ey,"defaultEasing");function di({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){const a=d0(i)?i.map(ad):ad(i),o={done:!1,value:t[0]},l=Z0(s&&s.length===t.length?s:Q0(t),e),c=X0(l,t,{ease:Array.isArray(a)?a:ey(t,a)});return{calculatedDuration:e,next:r(d=>(o.value=c(d),o.done=d>=e,o),"next")}}r(di,"keyframes");var ty=5;function ny(e,t,s){const i=Math.max(t-ty,0);return ch(s-e(i),t-i)}r(ny,"getGeneratorVelocity");var sy=r(e=>e!==null,"isNotNull");function ua(e,{repeat:t,repeatType:s="loop"},i,a=1){const o=e.filter(sy),l=a<0||t&&s!=="loop"&&t%2===1?0:o.length-1;return!l||i===void 0?o[l]:i}r(ua,"getFinalKeyframe");var iy={decay:Po,inertia:Po,tween:di,keyframes:di,spring:Kr};function Ph(e){typeof e.type=="string"&&(e.type=iy[e.type])}r(Ph,"replaceTransitionType");var Gl=class{static{r(this,"WithPromise")}constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},ry=r(e=>e/100,"percentToProgress"),Wr=class extends Gl{static{r(this,"JSAnimation")}constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==pt.now()&&this.tick(pt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ph(e);const{type:t=di,repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:l}=e;const c=t||di;c!==di&&typeof l[0]!="number"&&(this.mixKeyframes=Ei(ry,Eh(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=ql(d));const{calculatedDuration:m}=d;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=d}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:s,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:d=0,keyframes:m,repeat:u,repeatType:p,repeatDelay:h,type:x,onUpdate:g,finalKeyframe:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const k=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?k<0:k>i;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,_=s;if(u){const I=Math.min(this.currentTime,i)/l;let L=Math.floor(I),R=I%1;!R&&I>=1&&(R=1),R===1&&L--,L=Math.min(L,u+1),L%2&&(p==="reverse"?(R=1-R,h&&(R-=h/l)):p==="mirror"&&(_=o)),w=en(0,1,R)*l}let N;v?(this.delayState.value=m[0],N=this.delayState):N=_.next(w),a&&!v&&(N.value=a(N.value));let{done:P}=N;!v&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return b&&x!==Po&&(N.value=ua(m,this.options,j,this.speed)),g&&g(N.value),b&&this.finish(),N}then(e,t){return this.finished.then(e,t)}get duration(){return Rt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Rt(e)}get time(){return Rt(this.currentTime)}set time(e){e=St(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return ny(s=>this.generator.next(s).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(pt.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Rt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=B0,startTime:t}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function ay(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}r(ay,"fillWildcards");var ns=r(e=>e*180/Math.PI,"radToDeg"),Ro=r(e=>{const t=ns(Math.atan2(e[1],e[0]));return _o(t)},"rotate"),oy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r(e=>(Math.abs(e[0])+Math.abs(e[3]))/2,"scale"),rotate:Ro,rotateZ:Ro,skewX:r(e=>ns(Math.atan(e[1])),"skewX"),skewY:r(e=>ns(Math.atan(e[2])),"skewY"),skew:r(e=>(Math.abs(e[1])+Math.abs(e[2]))/2,"skew")},_o=r(e=>(e=e%360,e<0&&(e+=360),e),"rebaseAngle"),pd=Ro,fd=r(e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),"scaleX"),gd=r(e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),"scaleY"),ly={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:fd,scaleY:gd,scale:r(e=>(fd(e)+gd(e))/2,"scale"),rotateX:r(e=>_o(ns(Math.atan2(e[6],e[5]))),"rotateX"),rotateY:r(e=>_o(ns(Math.atan2(-e[2],e[0]))),"rotateY"),rotateZ:pd,rotate:pd,skewX:r(e=>ns(Math.atan(e[4])),"skewX"),skewY:r(e=>ns(Math.atan(e[1])),"skewY"),skew:r(e=>(Math.abs(e[1])+Math.abs(e[4]))/2,"skew")};function Io(e){return e.includes("scale")?1:0}r(Io,"defaultTransformValue");function Mo(e,t){if(!e||e==="none")return Io(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(s)i=ly,a=s;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=oy,a=c}if(!a)return Io(t);const o=i[t],l=a[1].split(",").map(dy);return typeof o=="function"?o(l):l[o]}r(Mo,"parseValueFromTransform");var cy=r((e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Mo(s,t)},"readTransformValue");function dy(e){return parseFloat(e.trim())}r(dy,"convertTransformToNumber");var Ks=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ws=new Set([...Ks,"pathRotation"]),xd=r(e=>e===zs||e===ie,"isNumOrPxType"),uy=new Set(["x","y","z"]),my=Ks.filter(e=>!uy.has(e));function hy(e){const t=[];return my.forEach(s=>{const i=e.getValue(s);i!==void 0&&(t.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),t}r(hy,"removeNonTranslationalTransform");var Nn={width:r(({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},"width"),height:r(({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},"height"),top:r((e,{top:t})=>parseFloat(t),"top"),left:r((e,{left:t})=>parseFloat(t),"left"),bottom:r(({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),"bottom"),right:r(({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),"right"),x:r((e,{transform:t})=>Mo(t,"x"),"x"),y:r((e,{transform:t})=>Mo(t,"y"),"y")};Nn.translateX=Nn.x;Nn.translateY=Nn.y;var os=new Set,Oo=!1,Do=!1,Lo=!1;function Rh(){if(Do){const e=Array.from(os).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),s=new Map;t.forEach(i=>{const a=hy(i);a.length&&(s.set(i,a),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const a=s.get(i);a&&a.forEach(([o,l])=>{i.getValue(o)?.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Do=!1,Oo=!1,os.forEach(e=>e.complete(Lo)),os.clear()}r(Rh,"measureAllKeyframes");function _h(){os.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Do=!0)})}r(_h,"readAllKeyframes");function py(){Lo=!0,_h(),Rh(),Lo=!1}r(py,"flushKeyframeResolvers");var Hl=class{static{r(this,"KeyframeResolver")}constructor(e,t,s,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(os.add(this),Oo||(Oo=!0,Oe.read(_h),Oe.resolveKeyframes(Rh))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:s,motionValue:i}=this;if(e[0]===null){const a=i?.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&t){const l=s.readValue(t,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}ay(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),os.delete(this)}cancel(){this.state==="scheduled"&&(os.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}},fy=r(e=>e.startsWith("--"),"isCSSVar");function Ih(e,t,s){fy(t)?e.style.setProperty(t,s):e.style[t]=s}r(Ih,"setStyle");var gy={};function Mh(e,t){const s=lh(e);return()=>gy[t]??s()}r(Mh,"memoSupports");var xy=Mh(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Oh=Mh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),si=r(([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,"cubicBezierAsString"),yd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function Dh(e,t){if(e)return typeof e=="function"?Oh()?Th(e,t):"ease-out":vh(e)?si(e):Array.isArray(e)?e.map(s=>Dh(s,t)||yd.easeOut):yd[e]}r(Dh,"mapEasingToNativeEasing");function yy(e,t,s,{delay:i=0,duration:a=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:d}={},m=void 0){const u={[t]:s};d&&(u.offset=d);const p=Dh(c,a);Array.isArray(p)&&(u.easing=p);const h={delay:i,duration:a,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return m&&(h.pseudoElement=m),e.animate(u,h)}r(yy,"startWaapiAnimation");function Lh(e){return typeof e=="function"&&"applyToOptions"in e}r(Lh,"isGenerator");function vy({type:e,...t}){return Lh(e)&&Oh()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}r(vy,"applyGeneratorOptions");var Fh=class extends Gl{static{r(this,"NativeAnimation")}constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,ds(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=vy(e);this.animation=yy(t,s,i,d,a),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const m=ua(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Ih(t,s,m),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Rt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Rt(e)}get time(){return Rt(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=St(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&xy()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),s&&(this.animation.rangeEnd=s),It):i(this)}},Vh={anticipate:fh,backInOut:ph,circInOut:xh};function by(e){return e in Vh}r(by,"isUnsupportedEase");function jy(e){typeof e.ease=="string"&&by(e.ease)&&(e.ease=Vh[e.ease])}r(jy,"replaceStringEasing");var Ka=10,ky=class extends Fh{static{r(this,"NativeAnimationExtended")}constructor(e){jy(e),Ph(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:s,onComplete:i,element:a,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const l=new Wr({...o,autoplay:!1}),c=Math.max(Ka,pt.now()-this.startTime),d=en(0,Ka,c-Ka),m=l.sample(c).value,{name:u}=this.options;a&&u&&Ih(a,u,m),t.setWithVelocity(l.sample(Math.max(0,c-d)).value,m,d),l.stop()}},vd=r((e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vt.test(e)||e==="0")&&!e.startsWith("url(")),"isAnimatable");function wy(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}r(wy,"hasKeyframesChanged");function Cy(e,t,s,i){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],l=vd(a,t),c=vd(o,t);return da(l===c,`You are trying to animate ${t} from "${a}" to "${o}". "${l?o:a}" is not an animatable value.`,"value-not-animatable"),!l||!c?!1:wy(e)||(s==="spring"||Lh(s))&&i}r(Cy,"canAnimate");function Fo(e){e.duration=0,e.type="keyframes"}r(Fo,"makeAnimationInstant");var Uh=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Ay=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Sy(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Ay.test(e[t]))return!0;return!1}r(Sy,"hasBrowserOnlyColors");var Ny=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ey=lh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ty(e){const{motionValue:t,name:s,repeatDelay:i,repeatType:a,damping:o,type:l,keyframes:c}=e,d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:m,transformTemplate:u}=t.owner.getProps();return Ey()&&s&&(Uh.has(s)||Ny.has(s)&&Sy(c))&&(s!=="transform"||!u)&&!m&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}r(Ty,"supportsBrowserAnimation");var Py=40,Ry=class extends Gl{static{r(this,"AsyncMotionValueAnimation")}constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:m,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pt.now();const p={autoplay:e,delay:t,type:s,repeat:i,repeatDelay:a,repeatType:o,name:c,motionValue:d,element:m,...u},h=m?.KeyframeResolver||Hl;this.keyframeResolver=new h(l,(x,g,j)=>this.onKeyframesResolved(x,g,p,!j),c,d,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:m}=s;this.resolvedAt=pt.now();let u=!0;Cy(e,a,o,l)||(u=!1,(Rn.instantAnimations||!c)&&m?.(ua(e,s,t)),e[0]=e[e.length-1],Fo(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Py?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},h=u&&!d&&Ty(p),x=p.motionValue?.owner?.current;let g;if(h)try{g=new ky({...p,element:x})}catch{g=new Wr(p)}else g=new Wr(p);g.finished.then(()=>{this.notifyFinished()}).catch(It),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),py()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Bh(e,t,s,i=0,a=1){const o=Array.from(e).sort((d,m)=>d.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*i;return typeof s=="function"?s(o,l):a===1?o*i:c-o*i}r(Bh,"calcChildStagger");var bd=30,_y=r(e=>!isNaN(parseFloat(e)),"isFloat"),jd={current:void 0},Iy=class{static{r(this,"MotionValue")}constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=pt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=pt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_y(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Fl);const s=this.events[e].add(t);return e==="change"?()=>{s(),Oe.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jd.current&&jd.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=pt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bd)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,bd);return ch(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Us(e,t){return new Iy(e,t)}r(Us,"motionValue");function $h(e,t){if(e?.inherit&&t){const{inherit:s,...i}=e;return{...t,...i}}return e}r($h,"resolveTransition");function Yl(e,t){const s=e?.[t]??e?.default??e;return s!==e?$h(s,e):s}r(Yl,"getValueTransition");var My={type:"spring",stiffness:500,damping:25,restSpeed:10},Oy=r(e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),"criticallyDampedSpring"),Dy={type:"keyframes",duration:.8},Ly={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fy=r((e,{keyframes:t})=>t.length>2?Dy:Ws.has(e)?e.startsWith("scale")?Oy(t[1]):My:Ly,"getDefaultTransition"),Vy=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Uy(e){for(const t in e)if(!Vy.has(t))return!0;return!1}r(Uy,"isTransitionDefined");var Xl=r((e,t,s,i={},a,o)=>l=>{const c=Yl(i,e)||{},d=c.delay||i.delay||0;let{elapsed:m=0}=i;m=m-St(d);const u={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-m,onUpdate:r(h=>{t.set(h),c.onUpdate&&c.onUpdate(h)},"onUpdate"),onComplete:r(()=>{l(),c.onComplete&&c.onComplete()},"onComplete"),name:e,motionValue:t,element:o?void 0:a};Uy(c)||Object.assign(u,Fy(e,u)),u.duration&&(u.duration=St(u.duration)),u.repeatDelay&&(u.repeatDelay=St(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Fo(u),u.delay===0&&(p=!0)),(Rn.instantAnimations||Rn.skipAnimations||a?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,Fo(u),u.delay=0),u.allowFlatten=!c.type&&!c.ease,p&&!o&&t.get()!==void 0){const h=ua(u.keyframes,c);if(h!==void 0){Oe.update(()=>{u.onUpdate(h),u.onComplete()});return}}return c.isSync?new Wr(u):new Ry(u)},"animateMotionValue"),By=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $y(e){const t=By.exec(e);if(!t)return[,];const[,s,i,a]=t;return[`--${s??i}`,a]}r($y,"parseCSSVariable");var zy=4;function zh(e,t,s=1){ds(s<=zy,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,a]=$y(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const l=o.trim();return rh(l)?parseFloat(l):l}return Bl(a)?zh(a,t,s+1):a}r(zh,"getVariableValue");function kd(e){const t=[{},{}];return e?.values.forEach((s,i)=>{t[0][i]=s.get(),t[1][i]=s.getVelocity()}),t}r(kd,"getValueState");function Jl(e,t,s,i){if(typeof t=="function"){const[a,o]=kd(i);t=t(s!==void 0?s:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=kd(i);t=t(s!==void 0?s:e.custom,a,o)}return t}r(Jl,"resolveVariantFromProps");function ls(e,t,s){const i=e.getProps();return Jl(i,t,s!==void 0?s:i.custom,e)}r(ls,"resolveVariant");var Kh=new Set(["width","height","top","left","right","bottom",...Ks]),Vo=r(e=>Array.isArray(e),"isKeyframesTarget");function Ky(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Us(s))}r(Ky,"setMotionValue");function Wy(e){return Vo(e)?e[e.length-1]||0:e}r(Wy,"resolveFinalValueInKeyframes");function qy(e,t){let{transitionEnd:s={},transition:i={},...a}=ls(e,t)||{};a={...a,...s};for(const o in a)Ky(e,o,Wy(a[o]))}r(qy,"setTarget");var ot=r(e=>!!(e&&e.getVelocity),"isMotionValue");function Gy(e){return!!(ot(e)&&e.add)}r(Gy,"isWillChangeMotionValue");function Uo(e,t){const s=e.getValue("willChange");if(Gy(s))return s.add(t);if(!s&&Rn.WillChange){const i=new Rn.WillChange("auto");e.addValue("willChange",i),i.add(t)}}r(Uo,"addValueToWillChange");function Ql(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}r(Ql,"camelToDash");var Hy="framerAppearId",Wh="data-"+Ql(Hy);function qh(e){return e.props[Wh]}r(qh,"getOptimisedAppearId");var Yy=typeof window<"u";function Xy({protectedKeys:e,needsAnimating:t},s){const i=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,i}r(Xy,"shouldBlockAnimation");function Gh(e,t,{delay:s=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();o=o?$h(o,d):d;const m=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const p=[],h=a&&e.animationState&&e.animationState.getState()[a],x=o?.path;x&&x.animateVisualElement(e,c,o,s,p);for(const g in c){const j=e.getValue(g,e.latestValues[g]??null),k=c[g];if(k===void 0||h&&Xy(h,g))continue;const v={delay:s,...Yl(o||{},g)};u&&(v.skipAnimations=!0);const w=j.get();if(w!==void 0&&!j.isAnimating()&&!Array.isArray(k)&&k===w&&!v.velocity){Oe.update(()=>j.set(k));continue}let _=!1;if(Yy&&window.MotionHandoffAnimation){const b=qh(e);if(b){const I=window.MotionHandoffAnimation(b,g,Oe);I!==null&&(v.startTime=I,_=!0)}}Uo(e,g);const N=m??e.shouldReduceMotion;j.start(Xl(g,j,k,N&&Kh.has(g)?{type:!1}:v,e,_));const P=j.animation;P&&p.push(P)}if(l){const g=r(()=>Oe.update(()=>{l&&qy(e,l)}),"applyTransitionEnd");p.length?Promise.all(p).then(g):g()}return p}r(Gh,"animateTarget");function Bo(e,t,s={}){const i=ls(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(a=s.transitionOverride);const o=i?()=>Promise.all(Gh(e,i,s)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:m=0,staggerChildren:u,staggerDirection:p}=a;return Jy(e,t,d,m,u,p,s)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,m]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>m())}else return Promise.all([o(),l(s.delay)])}r(Bo,"animateVariant");function Jy(e,t,s=0,i=0,a=0,o=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(Bo(d,t,{...l,delay:s+(typeof i=="function"?0:i)+Bh(e.variantChildren,d,i,a,o)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}r(Jy,"animateChildren");function Qy(e,t,s={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const a=t.map(o=>Bo(e,o,s));i=Promise.all(a)}else if(typeof t=="string")i=Bo(e,t,s);else{const a=typeof t=="function"?ls(e,t,s.custom):t;i=Promise.all(Gh(e,a,s))}return i.then(()=>{e.notify("AnimationComplete",t)})}r(Qy,"animateVisualElement");var Zy={test:r(e=>e==="auto","test"),parse:r(e=>e,"parse")},Hh=r(e=>t=>t.test(e),"testValueType"),Yh=[zs,ie,Zt,cn,k0,j0,Zy],wd=r(e=>Yh.find(Hh(e)),"findDimensionValueType");function ev(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oh(e):!0}r(ev,"isNone");var tv=new Set(["brightness","contrast","saturate","opacity"]);function nv(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=s.match($l)||[];if(!i)return e;const a=s.replace(i,"");let o=tv.has(t)?1:0;return i!==s&&(o*=100),t+"("+o+a+")"}r(nv,"applyDefaultFilter");var sv=/\b([a-z-]*)\(.*?\)/gu,$o={...Vt,getAnimatableNone:r(e=>{const t=e.match(sv);return t?t.map(nv).join(" "):e},"getAnimatableNone")},zo={...Vt,getAnimatableNone:r(e=>{const t=Vt.parse(e);return Vt.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))},"getAnimatableNone")},Cd={...zs,transform:Math.round},iv={rotate:cn,pathRotation:cn,rotateX:cn,rotateY:cn,rotateZ:cn,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:cn,skewX:cn,skewY:cn,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:ki,originX:ld,originY:ld,originZ:ie},qr={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,inset:ie,insetBlock:ie,insetBlockStart:ie,insetBlockEnd:ie,insetInline:ie,insetInlineStart:ie,insetInlineEnd:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,paddingBlock:ie,paddingBlockStart:ie,paddingBlockEnd:ie,paddingInline:ie,paddingInlineStart:ie,paddingInlineEnd:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,marginBlock:ie,marginBlockStart:ie,marginBlockEnd:ie,marginInline:ie,marginInlineStart:ie,marginInlineEnd:ie,fontSize:ie,backgroundPositionX:ie,backgroundPositionY:ie,...iv,zIndex:Cd,fillOpacity:ki,strokeOpacity:ki,numOctaves:Cd},rv={...qr,color:Ze,backgroundColor:Ze,outlineColor:Ze,fill:Ze,stroke:Ze,borderColor:Ze,borderTopColor:Ze,borderRightColor:Ze,borderBottomColor:Ze,borderLeftColor:Ze,filter:$o,WebkitFilter:$o,mask:zo,WebkitMask:zo},Xh=r(e=>rv[e],"getDefaultValueType"),av=new Set([$o,zo]);function Jh(e,t){let s=Xh(e);return av.has(s)||(s=Vt),s.getAnimatableNone?s.getAnimatableNone(t):void 0}r(Jh,"getAnimatableNone");var ov=new Set(["auto","none","0"]);function lv(e,t,s){let i=0,a;for(;i<e.length&&!a;){const o=e[i];typeof o=="string"&&!ov.has(o)&&Vs(o).values.length&&(a=e[i]),i++}if(a&&s)for(const o of t)e[o]=Jh(s,a)}r(lv,"makeNoneKeyframesAnimatable");var cv=class extends Hl{static{r(this,"DOMKeyframesResolver")}constructor(e,t,s,i,a){super(e,t,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let d=e[c];if(typeof d=="string"&&(d=d.trim(),Bl(d))){const m=zh(d,t.current);m!==void 0&&(e[c]=m),c===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Kh.has(s)||e.length!==2)return;const[i,a]=e,o=wd(i),l=wd(a);if(od(i)!==od(a)&&Nn[s]){this.needsMeasurement=!0;return}if(o!==l)if(xd(o)&&xd(l))for(let c=0;c<e.length;c++){const d=e[c];typeof d=="string"&&(e[c]=parseFloat(d))}else Nn[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ev(e[i]))&&s.push(i);s.length&&lv(e,s,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Nn[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const i=t[t.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);const a=s.length-1,o=s[a];s[a]=Nn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}},Zl=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Qh(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);const a=s?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(i=>i!=null)}r(Qh,"resolveElements");var Ko=r((e,t)=>t&&typeof e=="number"?t.transform(e):e,"getValueAsType");function jr(e){return ah(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}r(jr,"isHTMLElement");var{schedule:ec,cancel:iE}=bh(queueMicrotask,!1),Lt={x:!1,y:!1};function Zh(){return Lt.x||Lt.y}r(Zh,"isDragActive");function dv(e){return e==="x"||e==="y"?Lt[e]?null:(Lt[e]=!0,()=>{Lt[e]=!1}):Lt.x||Lt.y?null:(Lt.x=Lt.y=!0,()=>{Lt.x=Lt.y=!1})}r(dv,"setDragLock");function ep(e,t){const s=Qh(e),i=new AbortController,a={passive:!0,...t,signal:i.signal};return[s,a,r(()=>i.abort(),"cancel")]}r(ep,"setupGesture");function uv(e){return!(e.pointerType==="touch"||Zh())}r(uv,"isValidHover");function mv(e,t,s={}){const[i,a,o]=ep(e,s);return i.forEach(l=>{let c=!1,d=!1,m;const u=r(()=>{l.removeEventListener("pointerleave",g)},"removePointerLeave"),p=r(k=>{m&&(m(k),m=void 0),u()},"endHover"),h=r(k=>{c=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),d&&(d=!1,p(k))},"onPointerUp"),x=r(()=>{c=!0,window.addEventListener("pointerup",h,a),window.addEventListener("pointercancel",h,a)},"onPointerDown"),g=r(k=>{if(k.pointerType!=="touch"){if(c){d=!0;return}p(k)}},"onPointerLeave"),j=r(k=>{if(!uv(k))return;d=!1;const v=t(l,k);typeof v=="function"&&(m=v,l.addEventListener("pointerleave",g,a))},"onPointerEnter");l.addEventListener("pointerenter",j,a),l.addEventListener("pointerdown",x,a)}),o}r(mv,"hover");var tp=r((e,t)=>t?e===t?!0:tp(e,t.parentElement):!1,"isNodeOrChild"),tc=r(e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,"isPrimaryPointer"),hv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pv(e){return hv.has(e.tagName)||e.isContentEditable===!0}r(pv,"isElementKeyboardAccessible");var fv=new Set(["INPUT","SELECT","TEXTAREA"]);function gv(e){return fv.has(e.tagName)||e.isContentEditable===!0}r(gv,"isElementTextInput");var kr=new WeakSet;function Ad(e){return t=>{t.key==="Enter"&&e(t)}}r(Ad,"filterEvents");function Wa(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}r(Wa,"firePointerEvent");var xv=r((e,t)=>{const s=e.currentTarget;if(!s)return;const i=Ad(()=>{if(kr.has(s))return;Wa(s,"down");const a=Ad(()=>{Wa(s,"up")}),o=r(()=>Wa(s,"cancel"),"handleBlur");s.addEventListener("keyup",a,t),s.addEventListener("blur",o,t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)},"enableKeyboardPress");function Sd(e){return tc(e)&&!Zh()}r(Sd,"isValidPressEvent");var Nd=new WeakSet;function yv(e,t,s={}){const[i,a,o]=ep(e,s),l=r(c=>{const d=c.currentTarget;if(!Sd(c)||Nd.has(c))return;kr.add(d),s.stopPropagation&&Nd.add(c);const m=t(d,c),u={...a,capture:!0},p=r((g,j)=>{window.removeEventListener("pointerup",h,u),window.removeEventListener("pointercancel",x,u),kr.has(d)&&kr.delete(d),Sd(g)&&typeof m=="function"&&m(g,{success:j})},"onPointerEnd"),h=r(g=>{p(g,d===window||d===document||s.useGlobalTarget||tp(d,g.target))},"onPointerUp"),x=r(g=>{p(g,!1)},"onPointerCancel");window.addEventListener("pointerup",h,u),window.addEventListener("pointercancel",x,u)},"startPress");return i.forEach(c=>{(s.useGlobalTarget?window:c).addEventListener("pointerdown",l,a),jr(c)&&(c.addEventListener("focus",d=>xv(d,a)),!pv(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}r(yv,"press");function nc(e){return ah(e)&&"ownerSVGElement"in e}r(nc,"isSVGElement");var wr=new WeakMap,Cr,np=r((e,t,s)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:nc(i)&&"getBBox"in i?i.getBBox()[t]:i[s],"getSize"),vv=np("inline","width","offsetWidth"),bv=np("block","height","offsetHeight");function jv({target:e,borderBoxSize:t}){wr.get(e)?.forEach(s=>{s(e,{get width(){return vv(e,t)},get height(){return bv(e,t)}})})}r(jv,"notifyTarget");function kv(e){e.forEach(jv)}r(kv,"notifyAll");function wv(){typeof ResizeObserver>"u"||(Cr=new ResizeObserver(kv))}r(wv,"createResizeObserver");function Cv(e,t){Cr||wv();const s=Qh(e);return s.forEach(i=>{let a=wr.get(i);a||(a=new Set,wr.set(i,a)),a.add(t),Cr?.observe(i)}),()=>{s.forEach(i=>{const a=wr.get(i);a?.delete(t),a?.size||Cr?.unobserve(i)})}}r(Cv,"resizeElement");var Ar=new Set,Ps;function Av(){Ps=r(()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ar.forEach(t=>t(e))},"windowResizeHandler"),window.addEventListener("resize",Ps)}r(Av,"createWindowResizeHandler");function Sv(e){return Ar.add(e),Ps||Av(),()=>{Ar.delete(e),!Ar.size&&typeof Ps=="function"&&(window.removeEventListener("resize",Ps),Ps=void 0)}}r(Sv,"resizeWindow");function Ed(e,t){return typeof e=="function"?Sv(e):Cv(e,t)}r(Ed,"resize");var As={value:null,addProjectionMetrics:null};function Nv(e){return nc(e)&&e.tagName==="svg"}r(Nv,"isSVGSVGElement");var Ev=[...Yh,Ze,Vt],Tv=r(e=>Ev.find(Hh(e)),"findValueType"),Td=r(()=>({translate:0,scale:1,origin:0,originPoint:0}),"createAxisDelta"),Rs=r(()=>({x:Td(),y:Td()}),"createDelta"),Pd=r(()=>({min:0,max:0}),"createAxis"),tt=r(()=>({x:Pd(),y:Pd()}),"createBox"),Pv=new WeakMap;function ma(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}r(ma,"isAnimationControls");function wi(e){return typeof e=="string"||Array.isArray(e)}r(wi,"isVariantLabel");var sc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ic=["initial",...sc];function ha(e){return ma(e.animate)||ic.some(t=>wi(e[t]))}r(ha,"isControllingVariants");function sp(e){return!!(ha(e)||e.variants)}r(sp,"isVariantNode");function Rv(e,t,s){for(const i in t){const a=t[i],o=s[i];if(ot(a))e.addValue(i,a);else if(ot(o))e.addValue(i,Us(a,{owner:e}));else if(o!==a)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(a):l.hasAnimated||l.set(a)}else{const l=e.getStaticValue(i);e.addValue(i,Us(l!==void 0?l:a,{owner:e}))}}for(const i in s)t[i]===void 0&&e.removeValue(i);return t}r(Rv,"updateMotionValuesFromProps");var Wo={current:null},ip={current:!1},_v=typeof window<"u";function Iv(){if(ip.current=!0,!!_v)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=r(()=>Wo.current=e.matches,"setReducedMotionPreferences");e.addEventListener("change",t),t()}else Wo.current=!1}r(Iv,"initPrefersReducedMotion");var Rd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Gr={};function rp(e){Gr=e}r(rp,"setFeatureDefinitions");function Mv(){return Gr}r(Mv,"getFeatureDefinitions");var Ov=class{static{r(this,"VisualElement")}scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Hl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=pt.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Oe.render(this.render,!1,!0))};const{latestValues:d,renderState:m}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=t.initial?{...d}:{},this.renderState=m,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=ha(t),this.isVariantNode=sp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(t,{},this);for(const h in p){const x=p[h];d[h]!==void 0&&ot(x)&&x.set(d[h])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,Pv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,s)=>this.bindToMotionValue(s,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ip.current||Iv(),this.shouldReduceMotion=Wo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),_n(this.notifyUpdate),_n(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Uh.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:m}=t.accelerate,u=new Fh({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:St(m)}),p=o(u);this.valueSubscriptions.set(e,()=>{p(),u.cancel()});return}const s=Ws.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Oe.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),a&&a()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Gr){const t=Gr[e];if(!t)continue;const{isEnabled:s,Feature:i}=t;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let s=0;s<Rd.length;s++){const i=Rd[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a=e["on"+i];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Rv(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&t!==void 0&&(s=Us(t===null?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(rh(s)||oh(s))?s=parseFloat(s):!Tv(s)&&Vt.test(t)&&(s=Jh(e,t)),this.setBaseTarget(e,ot(s)?s.get():s)),ot(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let s;if(typeof t=="string"||typeof t=="object"){const a=Jl(this.props,t,this.presenceContext?.custom);a&&(s=a[e])}if(t&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ot(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Fl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ec.render(this.render)}},ap=class extends Ov{static{r(this,"DOMVisualElement")}constructor(){super(...arguments),this.KeyframeResolver=cv}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ot(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}},Mn=class{static{r(this,"Feature")}constructor(e){this.isMounted=!1,this.node=e}update(){}};function op({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}r(op,"convertBoundingBoxToBox");function Dv({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}r(Dv,"convertBoxToBoundingBox");function Lv(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}r(Lv,"transformBoxPoints");function qa(e){return e===void 0||e===1}r(qa,"isIdentityScale");function qo({scale:e,scaleX:t,scaleY:s}){return!qa(e)||!qa(t)||!qa(s)}r(qo,"hasScale");function Jn(e){return qo(e)||lp(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}r(Jn,"hasTransform");function lp(e){return _d(e.x)||_d(e.y)}r(lp,"has2DTranslate");function _d(e){return e&&e!=="0%"}r(_d,"is2DTranslate");function Hr(e,t,s){return s+t*(e-s)}r(Hr,"scalePoint");function Id(e,t,s,i,a){return a!==void 0&&(e=Hr(e,a,i)),Hr(e,s,i)+t}r(Id,"applyPointDelta");function Go(e,t=0,s=1,i,a){e.min=Id(e.min,t,s,i,a),e.max=Id(e.max,t,s,i,a)}r(Go,"applyAxisDelta");function cp(e,{x:t,y:s}){Go(e.x,t.translate,t.scale,t.originPoint),Go(e.y,s.translate,s.scale,s.originPoint)}r(cp,"applyBoxDelta");var Md=.999999999999,Od=1.0000000000001;function Fv(e,t,s,i=!1){const a=s.length;if(!a)return;t.x=t.y=1;let o,l;for(let c=0;c<a;c++){o=s[c],l=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Jt(e.x,-o.scroll.offset.x),Jt(e.y,-o.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,cp(e,l)),i&&Jn(o.latestValues)&&Sr(e,o.latestValues,o.layout?.layoutBox))}t.x<Od&&t.x>Md&&(t.x=1),t.y<Od&&t.y>Md&&(t.y=1)}r(Fv,"applyTreeDeltas");function Jt(e,t){e.min+=t,e.max+=t}r(Jt,"translateAxis");function Dd(e,t,s,i,a=.5){Go(e,t,s,Me(e.min,e.max,a),i)}r(Dd,"transformAxis");function Ld(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}r(Ld,"resolveAxisTranslate");function Sr(e,t,s){const i=s??e;Dd(e.x,Ld(t.x,i.x),t.scaleX,t.scale,t.originX),Dd(e.y,Ld(t.y,i.y),t.scaleY,t.scale,t.originY)}r(Sr,"transformBox");function dp(e,t){return op(Lv(e.getBoundingClientRect(),t))}r(dp,"measureViewportBox");function Vv(e,t,s){const i=dp(e,s),{scroll:a}=t;return a&&(Jt(i.x,a.offset.x),Jt(i.y,a.offset.y)),i}r(Vv,"measurePageBox");var Uv={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bv=Ks.length;function $v(e,t,s){let i="",a=!0;for(let l=0;l<Bv;l++){const c=Ks[l],d=e[c];if(d===void 0)continue;let m=!0;if(typeof d=="number")m=d===(c.startsWith("scale")?1:0);else{const u=parseFloat(d);m=c.startsWith("scale")?u===1:u===0}if(!m||s){const u=Ko(d,qr[c]);if(!m){a=!1;const p=Uv[c]||c;i+=`${p}(${u}) `}s&&(t[c]=u)}}const o=e.pathRotation;return o&&(a=!1,i+=`rotate(${Ko(o,qr.pathRotation)}) `),i=i.trim(),s?i=s(t,a?"":i):a&&(i="none"),i}r($v,"buildTransform");function rc(e,t,s){const{style:i,vars:a,transformOrigin:o}=e;let l=!1,c=!1;for(const d in t){const m=t[d];if(Ws.has(d)){l=!0;continue}else if(kh(d)){a[d]=m;continue}else{const u=Ko(m,qr[d]);d.startsWith("origin")?(c=!0,o[d]=u):i[d]=u}}if(t.transform||(l||s?i.transform=$v(t,e.transform,s):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:m="50%",originZ:u=0}=o;i.transformOrigin=`${d} ${m} ${u}`}}r(rc,"buildHTMLStyles");function up(e,{style:t,vars:s},i,a){const o=e.style;let l;for(l in t)o[l]=t[l];a?.applyProjectionStyles(o,i);for(l in s)o.setProperty(l,s[l])}r(up,"renderHTML");function Fd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}r(Fd,"pixelsToPercent");var ei={correct:r((e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ie.test(e))e=parseFloat(e);else return e;return`${Fd(e,t.target.x)}% ${Fd(e,t.target.y)}%`},"correct")},zv={correct:r((e,{treeScale:t,projectionDelta:s})=>{const i=e,a=Vt.parse(e);if(a.length>5)return i;const o=Vt.createTransformer(e),l=typeof a[0]!="number"?1:0,c=s.x.scale*t.x,d=s.y.scale*t.y;a[0+l]/=c,a[1+l]/=d;const m=Me(c,d,.5);return typeof a[2+l]=="number"&&(a[2+l]/=m),typeof a[3+l]=="number"&&(a[3+l]/=m),o(a)},"correct")},Ho={borderRadius:{...ei,applyTo:[...Zl]},borderTopLeftRadius:ei,borderTopRightRadius:ei,borderBottomLeftRadius:ei,borderBottomRightRadius:ei,boxShadow:zv};function mp(e,{layout:t,layoutId:s}){return Ws.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Ho[e]||e==="opacity")}r(mp,"isForcedMotionValue");function ac(e,t,s){const i=e.style,a=t?.style,o={};if(!i)return o;for(const l in i)(ot(i[l])||a&&ot(a[l])||mp(l,e)||s?.getValue(l)?.liveStyle!==void 0)&&(o[l]=i[l]);return o}r(ac,"scrapeMotionValuesFromProps$1");function Kv(e){return window.getComputedStyle(e)}r(Kv,"getComputedStyle$1");var Wv=class extends ap{static{r(this,"HTMLVisualElement")}constructor(){super(...arguments),this.type="html",this.renderInstance=up}mount(e){ds(!!e.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(Ws.has(t))return this.projection?.isProjecting?Io(t):cy(e,t);{const s=Kv(e),i=(kh(t)?s.getPropertyValue(t):s[t])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:t}){return dp(e,t)}build(e,t,s){rc(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return ac(e,t,s)}},qv={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gv={offset:"strokeDashoffset",array:"strokeDasharray"};function Hv(e,t,s=1,i=0,a=!0){e.pathLength=1;const o=a?qv:Gv;e[o.offset]=`${-i}`,e[o.array]=`${t} ${s}`}r(Hv,"buildSVGPath");var hp=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pp(e,{attrX:t,attrY:s,attrScale:i,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...c},d,m,u){if(rc(e,c,m),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h}=e;for(const x of hp)p[x]!==void 0&&(h[x]=p[x],delete p[x]);(h.transform||p.transformOrigin)&&(h.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),h.transform&&(h.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),s!==void 0&&(p.y=s),i!==void 0&&(p.scale=i),a!==void 0&&Hv(p,a,o,l,!1)}r(pp,"buildSVGAttrs");var fp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gp=r(e=>typeof e=="string"&&e.toLowerCase()==="svg","isSVGTag");function Yv(e,t,s,i){up(e,t,void 0,i);for(const a in t.attrs)e.setAttribute(fp.has(a)?a:Ql(a),t.attrs[a])}r(Yv,"renderSVG");function xp(e,t,s){const i=ac(e,t,s);for(const a in e)if(ot(e[a])||ot(t[a])){const o=Ks.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;i[o]=e[a]}return i}r(xp,"scrapeMotionValuesFromProps");var Xv=class extends ap{static{r(this,"SVGVisualElement")}constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ws.has(t)){const s=Xh(t);return s&&s.default||0}if(hp.includes(t)){const s=getComputedStyle(e)[t];if(typeof s=="string"&&s)return s.trim()}return t=fp.has(t)?t:Ql(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return xp(e,t,s)}build(e,t,s){pp(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,i){Yv(e,t,s,i)}mount(e){this.isSVGTag=gp(e.tagName),super.mount(e)}},Jv=ic.length;function yp(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?yp(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<Jv;s++){const i=ic[s],a=e.props[i];(wi(a)||a===!1)&&(t[i]=a)}return t}r(yp,"getVariantContext");function vp(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}r(vp,"shallowCompare");var Qv=[...sc].reverse(),Zv=sc.length;function eb(e){return t=>Promise.all(t.map(({animation:s,options:i})=>Qy(e,s,i)))}r(eb,"createAnimateFunction");function tb(e){let t=eb(e),s=Vd(),i=!0,a=!1;const o=r(m=>(u,p)=>{const h=ls(e,p,m==="exit"?e.presenceContext?.custom:void 0);if(h){const{transition:x,transitionEnd:g,...j}=h;u={...u,...j,...g}}return u},"buildResolvedTypeValues");function l(m){t=m(e)}r(l,"setAnimateFunction");function c(m){const{props:u}=e,p=yp(e.parent)||{},h=[],x=new Set;let g={},j=1/0;for(let v=0;v<Zv;v++){const w=Qv[v],_=s[w],N=u[w]!==void 0?u[w]:p[w],P=wi(N),b=w===m?_.isActive:null;b===!1&&(j=v);let I=N===p[w]&&N!==u[w]&&P;if(I&&(i||a)&&e.manuallyAnimateOnMount&&(I=!1),_.protectedKeys={...g},!_.isActive&&b===null||!N&&!_.prevProp||ma(N)||typeof N=="boolean")continue;if(w==="exit"&&_.isActive&&b!==!0){_.prevResolvedValues&&(g={...g,..._.prevResolvedValues});continue}const L=nb(_.prevProp,N);let R=L||w===m&&_.isActive&&!I&&P||v>j&&P,F=!1;const T=Array.isArray(N)?N:[N];let E=T.reduce(o(w),{});b===!1&&(E={});const{prevResolvedValues:C={}}=_,z={...C,...E},W=r(V=>{R=!0,x.has(V)&&(F=!0,x.delete(V)),_.needsAnimating[V]=!0;const B=e.getValue(V);B&&(B.liveStyle=!1)},"markToAnimate");for(const V in z){const B=E[V],O=C[V];if(g.hasOwnProperty(V))continue;let y=!1;Vo(B)&&Vo(O)?y=!vp(B,O)||L:y=B!==O,y?B!=null?W(V):x.add(V):B!==void 0&&x.has(V)?W(V):_.protectedKeys[V]=!0}_.prevProp=N,_.prevResolvedValues=E,_.isActive&&(g={...g,...E}),(i||a)&&e.blockInitialAnimation&&(R=!1);const G=I&&L;R&&(!G||F)&&h.push(...T.map(V=>{const B={type:w};if(typeof V=="string"&&(i||a)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:O}=e,y=ls(O,V);if(O.enteringChildren&&y){const{delayChildren:M}=y.transition||{};B.delay=Bh(O.enteringChildren,e,M)}}return{animation:V,options:B}}))}if(x.size){const v={};if(typeof u.initial!="boolean"){const w=ls(e,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(v.transition=w.transition)}x.forEach(w=>{const _=e.getBaseTarget(w),N=e.getValue(w);N&&(N.liveStyle=!0),v[w]=_??null}),h.push({animation:v})}let k=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(k=!1),i=!1,a=!1,k?t(h):Promise.resolve()}r(c,"animateChanges");function d(m,u){if(s[m].isActive===u)return Promise.resolve();e.variantChildren?.forEach(h=>h.animationState?.setActive(m,u)),s[m].isActive=u;const p=c(m);for(const h in s)s[h].protectedKeys={};return p}return r(d,"setActive"),{animateChanges:c,setActive:d,setAnimateFunction:l,getState:r(()=>s,"getState"),reset:r(()=>{s=Vd(),a=!0},"reset")}}r(tb,"createAnimationState");function nb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!vp(t,e):!1}r(nb,"checkVariantsDidChange");function Xn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}r(Xn,"createTypeState");function Vd(){return{animate:Xn(!0),whileInView:Xn(),whileHover:Xn(),whileTap:Xn(),whileDrag:Xn(),whileFocus:Xn(),exit:Xn()}}r(Vd,"createState");function Yo(e,t){e.min=t.min,e.max=t.max}r(Yo,"copyAxisInto");function Dt(e,t){Yo(e.x,t.x),Yo(e.y,t.y)}r(Dt,"copyBoxInto");function Ud(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}r(Ud,"copyAxisDeltaInto");var sb=.9999,ib=1.0001,rb=-.01,ab=.01;function ft(e){return e.max-e.min}r(ft,"calcLength");function ob(e,t,s){return Math.abs(e-t)<=s}r(ob,"isNear");function Bd(e,t,s,i=.5){e.origin=i,e.originPoint=Me(t.min,t.max,e.origin),e.scale=ft(s)/ft(t),e.translate=Me(s.min,s.max,e.origin)-e.originPoint,(e.scale>=sb&&e.scale<=ib||isNaN(e.scale))&&(e.scale=1),(e.translate>=rb&&e.translate<=ab||isNaN(e.translate))&&(e.translate=0)}r(Bd,"calcAxisDelta");function ui(e,t,s,i){Bd(e.x,t.x,s.x,i?i.originX:void 0),Bd(e.y,t.y,s.y,i?i.originY:void 0)}r(ui,"calcBoxDelta");function $d(e,t,s,i=0){e.min=(i?Me(s.min,s.max,i):s.min)+t.min,e.max=e.min+ft(t)}r($d,"calcRelativeAxis");function lb(e,t,s,i){$d(e.x,t.x,s.x,i?.x),$d(e.y,t.y,s.y,i?.y)}r(lb,"calcRelativeBox");function zd(e,t,s,i=0){const a=i?Me(s.min,s.max,i):s.min;e.min=t.min-a,e.max=e.min+ft(t)}r(zd,"calcRelativeAxisPosition");function Yr(e,t,s,i){zd(e.x,t.x,s.x,i?.x),zd(e.y,t.y,s.y,i?.y)}r(Yr,"calcRelativePosition");function Kd(e,t,s,i,a){return e-=t,e=Hr(e,1/s,i),a!==void 0&&(e=Hr(e,1/a,i)),e}r(Kd,"removePointDelta");function cb(e,t=0,s=1,i=.5,a,o=e,l=e){if(Zt.test(t)&&(t=parseFloat(t),t=Me(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Me(o.min,o.max,i);e===o&&(c-=t),e.min=Kd(e.min,t,s,c,a),e.max=Kd(e.max,t,s,c,a)}r(cb,"removeAxisDelta");function Wd(e,t,[s,i,a],o,l){cb(e,t[s],t[i],t[a],t.scale,o,l)}r(Wd,"removeAxisTransforms");var db=["x","scaleX","originX"],ub=["y","scaleY","originY"];function qd(e,t,s,i){Wd(e.x,t,db,s?s.x:void 0,i?i.x:void 0),Wd(e.y,t,ub,s?s.y:void 0,i?i.y:void 0)}r(qd,"removeBoxTransforms");function Gd(e){return e.translate===0&&e.scale===1}r(Gd,"isAxisDeltaZero");function bp(e){return Gd(e.x)&&Gd(e.y)}r(bp,"isDeltaZero");function Hd(e,t){return e.min===t.min&&e.max===t.max}r(Hd,"axisEquals");function mb(e,t){return Hd(e.x,t.x)&&Hd(e.y,t.y)}r(mb,"boxEquals");function Yd(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}r(Yd,"axisEqualsRounded");function jp(e,t){return Yd(e.x,t.x)&&Yd(e.y,t.y)}r(jp,"boxEqualsRounded");function Xd(e){return ft(e.x)/ft(e.y)}r(Xd,"aspectRatio");function Jd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}r(Jd,"axisDeltaEquals");function Yt(e){return[e("x"),e("y")]}r(Yt,"eachAxis");function hb(e,t,s){let i="";const a=e.x.translate/t.x,o=e.y.translate/t.y,l=s?.z||0;if((a||o||l)&&(i=`translate3d(${a}px, ${o}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:m,rotate:u,pathRotation:p,rotateX:h,rotateY:x,skewX:g,skewY:j}=s;m&&(i=`perspective(${m}px) ${i}`),u&&(i+=`rotate(${u}deg) `),p&&(i+=`rotate(${p}deg) `),h&&(i+=`rotateX(${h}deg) `),x&&(i+=`rotateY(${x}deg) `),g&&(i+=`skewX(${g}deg) `),j&&(i+=`skewY(${j}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}r(hb,"buildProjectionTransform");var pb=Zl.length,Qd=r(e=>typeof e=="string"?parseFloat(e):e,"asNumber$3"),Zd=r(e=>typeof e=="number"||ie.test(e),"isPx");function fb(e,t,s,i,a,o){a?(e.opacity=Me(0,s.opacity??1,gb(i)),e.opacityExit=Me(t.opacity??1,0,xb(i))):o&&(e.opacity=Me(t.opacity??1,s.opacity??1,i));for(let l=0;l<pb;l++){const c=Zl[l];let d=eu(t,c),m=eu(s,c);d===void 0&&m===void 0||(d||(d=0),m||(m=0),d===0||m===0||Zd(d)===Zd(m)?(e[c]=Math.max(Me(Qd(d),Qd(m),i),0),(Zt.test(m)||Zt.test(d))&&(e[c]+="%")):e[c]=m)}(t.rotate||s.rotate)&&(e.rotate=Me(t.rotate||0,s.rotate||0,i))}r(fb,"mixValues");function eu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}r(eu,"getRadius");var gb=kp(0,.5,gh),xb=kp(.5,.95,It);function kp(e,t,s){return i=>i<e?0:i>t?1:s(ji(e,t,i))}r(kp,"compress");function yb(e,t,s){const i=ot(e)?e:Us(e);return i.start(Xl("",i,t,s)),i.animation}r(yb,"animateSingleValue");function Ci(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s,i)}r(Ci,"addDomEvent");var vb=r((e,t)=>e.depth-t.depth,"compareByDepth"),bb=class{static{r(this,"FlatTree")}constructor(){this.children=[],this.isDirty=!1}add(e){Ll(this.children,e),this.isDirty=!0}remove(e){$r(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(vb),this.isDirty=!1,this.children.forEach(e)}};function jb(e,t){const s=pt.now(),i=r(({timestamp:a})=>{const o=a-s;o>=t&&(_n(i),e(o-t))},"checkElapsed");return Oe.setup(i,!0),()=>_n(i)}r(jb,"delay");function Nr(e){return ot(e)?e.get():e}r(Nr,"resolveMotionValue");var kb=class{static{r(this,"NodeStack")}constructor(){this.members=[]}add(e){Ll(this.members,e);for(let t=this.members.length-1;t>=0;t--){const s=this.members[t];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&($r(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if($r(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const s=this.members[t];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,t){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:a}=e.options;(i===void 0||i!==a)&&(e.resumeFrom=s,t&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Er={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qn={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ga=["","X","Y","Z"],wb=1e3,Cb=0;function Ha(e,t,s,i){const{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}r(Ha,"resetDistortingTransform");function wp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=qh(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",Oe,!(a||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&wp(i)}r(wp,"cancelTreeOptimisedTransformAnimations");function Cp({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:a}){return class{static{r(this,"ProjectionNode")}constructor(l={},c=t?.()){this.id=Cb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,As.value&&(Qn.nodes=Qn.calculatedTargetDeltas=Qn.calculatedProjections=0),this.nodes.forEach(Nb),this.nodes.forEach(Ib),this.nodes.forEach(Mb),this.nodes.forEach(Eb),As.addProjectionMetrics&&As.addProjectionMetrics(Qn)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new bb)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Fl),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=nc(l)&&!Nv(l),this.instance=l;const{layoutId:c,layout:d,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let u,p=0;const h=r(()=>this.root.updateBlockedByResize=!1,"resizeUnblockUpdate");Oe.read(()=>{p=window.innerWidth}),e(l,()=>{const x=window.innerWidth;x!==p&&(p=x,this.root.updateBlockedByResize=!0,u&&u(),u=jb(h,250),Er.hasAnimatedSinceResize&&(Er.hasAnimatedSinceResize=!1,this.nodes.forEach(su)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&m&&(c||d)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||m.getDefaultTransition()||Vb,{onLayoutAnimationStart:j,onLayoutAnimationComplete:k}=m.getProps(),v=!this.targetLayout||!jp(this.targetLayout,x),w=!p&&h;if(this.options.layoutRoot||this.resumeFrom||w||p&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...Yl(g,"layout"),onPlay:j,onComplete:k};(m.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(u,w,_.path)}else p||su(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_n(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ob),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Pb),this.nodes.forEach(tu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rb),this.nodes.forEach(_b),this.nodes.forEach(Ab),this.nodes.forEach(Sb)):this.nodes.forEach(nu),this.clearAllSnapshots();const l=pt.now();rt.delta=en(0,1e3/60,l-rt.timestamp),rt.timestamp=l,rt.isProcessing=!0,Ua.update.process(rt),Ua.preRender.process(rt),Ua.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ec.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tb),this.sharedNodes.forEach(Db)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ft(this.snapshot.measuredBox.x)&&!ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=tt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!a)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!bp(this.projectionDelta),d=this.getTransformTemplate(),m=d?d(this.latestValues,""):void 0,u=m!==this.prevTransformTemplateValue;l&&this.instance&&(c||Jn(this.latestValues)||u)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),Ub(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return tt();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bb))){const{scroll:d}=this.root;d&&(Jt(c.x,d.offset.x),Jt(c.y,d.offset.y))}return c}removeElementScroll(l){const c=tt();if(Dt(c,l),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const m=this.path[d],{scroll:u,options:p}=m;m!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Dt(c,l),Jt(c.x,u.offset.x),Jt(c.y,u.offset.y))}return c}applyTransform(l,c=!1,d){const m=d||tt();Dt(m,l);for(let u=0;u<this.path.length;u++){const p=this.path[u];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Jt(m.x,-p.scroll.offset.x),Jt(m.y,-p.scroll.offset.y)),Jn(p.latestValues)&&Sr(m,p.latestValues,p.layout?.layoutBox)}return Jn(this.latestValues)&&Sr(m,this.latestValues,this.layout?.layoutBox),m}removeTransform(l){const c=tt();Dt(c,l);for(let d=0;d<this.path.length;d++){const m=this.path[d];if(!Jn(m.latestValues))continue;let u;m.instance&&(qo(m.latestValues)&&m.updateSnapshot(),u=tt(),Dt(u,m.measurePageBox())),qd(c,m.latestValues,m.snapshot?.layoutBox,u)}return Jn(this.latestValues)&&qd(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:u}=this.options;if(!this.layout||!(m||u))return;this.resolvedRelativeTargetAt=rt.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=tt(),this.targetWithTransforms=tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lb(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Dt(this.target,this.layout.layoutBox),cp(this.target,this.targetDelta)):Dt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0),As.value&&Qn.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qo(this.parent.latestValues)||lp(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tt(),this.relativeTargetOrigin=tt(),Yr(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),Dt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(d=!1),d)return;const{layout:m,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||u))return;Dt(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,h=this.treeScale.y;Fv(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=tt());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ud(this.prevProjectionDelta.x,this.projectionDelta.x),Ud(this.prevProjectionDelta.y,this.projectionDelta.y)),ui(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==h||!Jd(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),As.value&&Qn.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rs(),this.projectionDelta=Rs(),this.projectionDeltaWithTransform=Rs()}setAnimationOrigin(l,c=!1,d){const m=this.snapshot,u=m?m.latestValues:{},p={...this.latestValues},h=Rs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const x=tt(),g=(m?m.source:void 0)!==(this.layout?this.layout.source:void 0),j=this.getStack(),k=!j||j.members.length<=1,v=!!(g&&!k&&this.options.crossfade===!0&&!this.path.some(Fb));this.animationProgress=0;let w;const _=d?.interpolateProjection(l);this.mixTargetDelta=N=>{const P=N/1e3,b=_?.(P);b?(h.x.translate=b.x,h.x.scale=Me(l.x.scale,1,P),h.x.origin=l.x.origin,h.x.originPoint=l.x.originPoint,h.y.translate=b.y,h.y.scale=Me(l.y.scale,1,P),h.y.origin=l.y.origin,h.y.originPoint=l.y.originPoint):(iu(h.x,l.x,P),iu(h.y,l.y,P)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yr(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lb(this.relativeTarget,this.relativeTargetOrigin,x,P),w&&mb(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=tt()),Dt(w,this.relativeTarget)),g&&(this.animationValues=p,fb(p,u,this.latestValues,P,v,k)),b&&b.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=b.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(_n(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Oe.update(()=>{Er.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Us(0)),this.motionValue.jump(0,!1),this.currentAnimation=yb(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:r(c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},"onUpdate"),onComplete:r(()=>{l.onComplete&&l.onComplete(),this.completeAnimation()},"onComplete")}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:m,latestValues:u}=l;if(!(!c||!d||!m)){if(this!==l&&this.layout&&m&&Ap(this.options.animationType,this.layout.layoutBox,m.layoutBox)){d=this.target||tt();const p=ft(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+p;const h=ft(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+h}Dt(c,d),Sr(c,u),ui(this.projectionDeltaWithTransform,this.layoutCorrected,c,u)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new kb),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const m=this.getStack();m&&m.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const m={};d.z&&Ha("z",l,m,this.animationValues);for(let u=0;u<Ga.length;u++)Ha(`rotate${Ga[u]}`,l,m,this.animationValues),Ha(`skew${Ga[u]}`,l,m,this.animationValues);l.render();for(const u in m)l.setStaticValue(u,m[u]),this.animationValues&&(this.animationValues[u]=m[u]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Nr(c?.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Nr(c?.pointerEvents)||""),this.hasProjected&&!Jn(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const u=m.animationValues||m.latestValues;this.applyTransformsToTarget();let p=hb(this.projectionDeltaWithTransform,this.treeScale,u);d&&(p=d(u,p)),l.transform=p;const{x:h,y:x}=this.projectionDelta;l.transformOrigin=`${h.origin*100}% ${x.origin*100}% 0`,m.animationValues?l.opacity=m===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:l.opacity=m===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in Ho){if(u[g]===void 0)continue;const{correct:j,applyTo:k,isCSSVariable:v}=Ho[g],w=p==="none"?u[g]:j(u[g],m);if(k){const _=k.length;for(let N=0;N<_;N++)l[k[N]]=w}else v?this.options.visualElement.renderState.vars[g]=w:l[g]=w}this.options.layoutId&&(l.pointerEvents=m===this?Nr(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(tu),this.root.sharedNodes.clear()}}}r(Cp,"createProjectionNode$1");function Ab(e){e.updateLayout()}r(Ab,"updateLayout");function Sb(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")Yt(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=ft(p);p.min=s[u].min,p.max=p.min+h});else if(a==="x"||a==="y"){const u=a==="x"?"y":"x";Yo(o?t.measuredBox[u]:t.layoutBox[u],s[u])}else Ap(a,t.layoutBox,s)&&Yt(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=ft(s[u]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+h)});const l=Rs();ui(l,s,t.layoutBox);const c=Rs();o?ui(c,e.applyTransform(i,!0),t.measuredBox):ui(c,s,t.layoutBox);const d=!bp(l);let m=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:h}=u;if(p&&h){const x=e.options.layoutAnchor||void 0,g=tt();Yr(g,t.layoutBox,p.layoutBox,x);const j=tt();Yr(j,s,h.layoutBox,x),jp(g,j)||(m=!0),u.options.layoutRoot&&(e.relativeTarget=j,e.relativeTargetOrigin=g,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}r(Sb,"notifyLayoutUpdate");function Nb(e){As.value&&Qn.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}r(Nb,"propagateDirtyNodes");function Eb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}r(Eb,"cleanDirtyNodes");function Tb(e){e.clearSnapshot()}r(Tb,"clearSnapshot");function tu(e){e.clearMeasurements()}r(tu,"clearMeasurements");function Pb(e){e.isLayoutDirty=!0,e.updateLayout()}r(Pb,"forceLayoutMeasure");function nu(e){e.isLayoutDirty=!1}r(nu,"clearIsLayoutDirty");function Rb(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}r(Rb,"ensureDraggedNodesSnapshotted");function _b(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}r(_b,"resetTransformStyle");function su(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}r(su,"finishAnimation");function Ib(e){e.resolveTargetDelta()}r(Ib,"resolveTargetDelta");function Mb(e){e.calcProjection()}r(Mb,"calcProjection");function Ob(e){e.resetSkewAndRotation()}r(Ob,"resetSkewAndRotation");function Db(e){e.removeLeadSnapshot()}r(Db,"removeLeadSnapshots");function iu(e,t,s){e.translate=Me(t.translate,0,s),e.scale=Me(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}r(iu,"mixAxisDeltaLinear");function ru(e,t,s,i){e.min=Me(t.min,s.min,i),e.max=Me(t.max,s.max,i)}r(ru,"mixAxis");function Lb(e,t,s,i){ru(e.x,t.x,s.x,i),ru(e.y,t.y,s.y,i)}r(Lb,"mixBox");function Fb(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}r(Fb,"hasOpacityCrossfade");var Vb={duration:.45,ease:[.4,0,.1,1]},au=r(e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),"userAgentContains"),ou=au("applewebkit/")&&!au("chrome/")?Math.round:It;function lu(e){e.min=ou(e.min),e.max=ou(e.max)}r(lu,"roundAxis");function Ub(e){lu(e.x),lu(e.y)}r(Ub,"roundBox");function Ap(e,t,s){return e==="position"||e==="preserve-aspect"&&!ob(Xd(t),Xd(s),.2)}r(Ap,"shouldAnimatePositionOnly");function Bb(e){return e!==e.root&&e.scroll?.wasRoot}r(Bb,"checkNodeWasScrollRoot");var $b=Cp({attachResizeListener:r((e,t)=>Ci(e,"resize",t),"attachResizeListener"),measureScroll:r(()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),"measureScroll"),checkIsScrollRoot:r(()=>!0,"checkIsScrollRoot")}),Ya={current:void 0},Sp=Cp({measureScroll:r(e=>({x:e.scrollLeft,y:e.scrollTop}),"measureScroll"),defaultParent:r(()=>{if(!Ya.current){const e=new $b({});e.mount(window),e.setOptions({layoutScroll:!0}),Ya.current=e}return Ya.current},"defaultParent"),resetTransform:r((e,t)=>{e.style.transform=t!==void 0?t:"none"},"resetTransform"),checkIsScrollRoot:r(e=>window.getComputedStyle(e).position==="fixed","checkIsScrollRoot")}),oc=(0,f.createContext)({transformPagePoint:r(e=>e,"transformPagePoint"),isStatic:!1,reducedMotion:"never"});function cu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}r(cu,"setRef");function zb(...e){return t=>{let s=!1;const i=e.map(a=>{const o=cu(a,t);return!s&&typeof o=="function"&&(s=!0),o});if(s)return()=>{for(let a=0;a<i.length;a++){const o=i[a];typeof o=="function"?o():cu(e[a],null)}}}}r(zb,"composeRefs");function Kb(...e){return f.useCallback(zb(...e),e)}r(Kb,"useComposedRefs");var Wb=class extends f.Component{static{r(this,"PopChildMeasure")}getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(jr(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=t.offsetParent,i=jr(s)&&s.offsetWidth||0,a=jr(s)&&s.offsetHeight||0,o=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=i-l.width-l.left,l.bottom=a-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function qb({children:e,isPresent:t,anchorX:s,anchorY:i,root:a,pop:o}){const l=(0,f.useId)(),c=(0,f.useRef)(null),d=(0,f.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=(0,f.useContext)(oc),u=o!==!1?e.props?.ref??e?.ref:void 0,p=Kb(c,u);return(0,f.useInsertionEffect)(()=>{const{width:h,height:x,top:g,left:j,right:k,bottom:v,direction:w}=d.current;if(t||o===!1||!c.current||!h||!x)return;const _=w==="rtl",N=s==="left"?_?`right: ${k}`:`left: ${j}`:_?`left: ${j}`:`right: ${k}`,P=i==="bottom"?`bottom: ${v}`:`top: ${g}`;c.current.dataset.motionPopId=l;const b=document.createElement("style");m&&(b.nonce=m);const I=a??document.head;return I.appendChild(b),b.sheet&&b.sheet.insertRule(`
|
|
1
|
+
var Tf=Object.defineProperty;var r=(e,t)=>Tf(e,"name",{value:t,configurable:!0});import{i as hm}from"./rolldown-runtime-ZpX3ckPj.js";import{$r as Sn,$t as Pf,Br as Si,Cr as Tc,Dr as Ls,Er as pm,Gr as Rf,Hr as _f,Lr as fm,N as If,O as Mf,Oi as Of,Qr as Df,Sr as Pc,Tr as Lf,Ur as gm,Vr as Rc,Wr as Ff,Zr as Mr,_n as Vf,_r as Uf,a as Bf,ai as fi,ar as $f,br as zf,cr as xr,ct as Kf,ei as Wf,fr as xm,hr as _c,ii as qf,ir as Gf,l as Z,la as Hf,lr as Yf,lt as Ic,o as Mc,oi as yl,or as Oc,pn as Xf,pr as Dc,s as Lc,sr as Jf,t as ym,ti as po,ua as Qf,vr as fo,wr as Zf,wt as vm,xn as eg,yr as tg}from"./createLucideIcon-CgrPXnTY.js";import{a as go,n as ng,o as bm,v as jm,y as sa}from"./star-eem0qj3E.js";import{X as Bt,_ as qe,n as wt,r as rr,t as ge,v as ue}from"./queryKeys-BzT8CD34.js";import{r as sg,s as ig}from"./companies-query-BEdFiAhG.js";import{A as xo,C as vl,S as rg,b as Qt,d as ag,f as og,l as lg,m as Ra,n as Fc,u as Vc,w as cg,x as km,y as dg}from"./connection-identity-ch7QDvun.js";import{n as us}from"./CompanyContext-fQCNWI_f.js";import{gt as _a,o as wm,rt as ar,t as Pn}from"./router-CJbFZfVR.js";import{n as bl,r as jl,t as kl}from"./collapsible-D_rwONtV.js";import{a as ug,c as mg,i as hg,l as pg,n as fg,o as gg,r as xg,s as yg,t as vg}from"./alert-dialog-DNbnZgRz.js";import{t as bg}from"./checkbox-Cf2_HXDG.js";import{t as dn}from"./label-B707hSFt.js";import{t as Uc}from"./MarkdownEditor-ubJimjUH.js";import{n as jg,o as Ni,r as Bs,t as $s}from"./popover-CWlBonqy.js";import{n as kg,t as yo}from"./PathInstructionsModal-BJAqF7vQ.js";import{t as Cm}from"./arrow-left-CnGEiANj.js";import{t as Am}from"./arrow-right-W0iJ_-Zs.js";import{t as En}from"./arrow-up-right-CFNgVoQj.js";import{t as ai}from"./bot-kSfD9MPZ.js";import{t as ut}from"./check-Bis3vECb.js";import{t as ia}from"./chevron-down-nRcQ7bok.js";import{t as wl}from"./chevron-right-BP8JjEC_.js";import{n as wg}from"./SearchableSelect-BbuRtdzg.js";import{t as Bc}from"./circle-alert-C7T1cdKm.js";import{t as Cg}from"./circle-question-mark-CasEGiDp.js";import{t as Sm}from"./clock-D2UFngg7.js";import{t as ra}from"./copy-C1cfcpxY.js";import{n as Ag,r as Sg,t as Ng}from"./environment-variables-editor-D6Ylcd74.js";import{t as aa}from"./external-link-BIcMNNSN.js";import{_ as Eg,c as Tg,g as Cl,i as Pg,l as Rg,n as _g,o as Ig,s as Mg,v as vo,w as Og,x as Dg}from"./proposal-review-D9ye_2Px.js";import{t as Lg}from"./flask-conical-BxspRG7d.js";import{t as Fg}from"./folder-open-Dkshp3J4.js";import{t as Vg}from"./inbox-BbL3s2C7.js";import{t as $c}from"./key-round-CGxQxRtN.js";import{t as Nm}from"./link-2-Cn4f4xsG.js";import{r as He,t as D}from"./button-DI4w5WP7.js";import{t as Ug}from"./network-D_6qRf8m.js";import{t as Em}from"./play-Czm7OCYh.js";import{t as Al}from"./plus-CwNlqadt.js";import{t as Bg}from"./refresh-cw-CfzWP9se.js";import{t as oa}from"./search-CgZSuGC8.js";import{t as $g}from"./server-cog-cefxr54v.js";import{t as zg}from"./shield-alert-BAXWoBTh.js";import{t as Kg}from"./shield-check-RPyaLAc-.js";import{t as Tm}from"./shield-question-mark-Dl8dxzUU.js";import{t as Pm}from"./trash-QxFF084e.js";import{t as es}from"./triangle-alert-CnHMpmva.js";import{t as Wg}from"./upload-Dk7oXJof.js";import{t as bo}from"./user-round-B87hENhM.js";import{t as zc}from"./user-D5V640s5.js";import{t as qg}from"./SetupWizard-92wVRG6Y.js";import{i as Rm,n as _m,r as Gg,t as Im}from"./tooltip-CW50mEoC.js";import{t as oi}from"./badge-jeXr866I.js";import{t as yr}from"./AgentAvatar-BZiiDlCN.js";import{i as Hg}from"./ToastContext-DyVJ6bCh.js";import{t as Ee}from"./agents-B8n-p0aX.js";import{t as un}from"./instanceSettings-D1nNVWU0.js";import{a as jo,i as Yg,n as Or,r as Dr,s as Lr,t as Fr}from"./dialog-CeH7rDcv.js";import{t as Ce}from"./input-BBNGmECW.js";import{t as Xt}from"./skeleton-BAAoD7cz.js";import{t as _e}from"./tools-MhVvhrz_.js";import{t as cs}from"./AppLogo-BLq8BpKi.js";import{n as Xg}from"./BreadcrumbContext-DNbB7zWn.js";import{t as Es}from"./secrets-D17QEm13.js";import{t as Sl}from"./textarea-CTx68BDs.js";import{t as Jg}from"./assets-BOhIBphq.js";import{t as Nl}from"./toggle-switch-Dj5GORxn.js";import{c as Qg,d as Zg,f as Kc,g as ex,h as Wc,l as vr,m as tx,n as nx,p as sx,r as ix,s as qc,u as Gc,v as rx}from"./model-picker-fields-D_I_l2UI.js";import{t as dt}from"./InlineBanner-DeTqU5Gp.js";import{t as Mm}from"./AgentMultiSelect-BlUaNdZZ.js";import{t as gi}from"./radio-card-DCobJXTD.js";import{i as ht,l as ax,n as ss,o as is,r as rs,s as as,t as Om}from"./select-DNiRU1d9.js";import{n as ko,r as Dm,t as Lm}from"./JsonSchemaForm-Dkh3zdL9.js";import{t as ox}from"./chip-yHjfSD46.js";import{a as El,i as lx,n as xi,o as Hc,t as yi}from"./schema-config-fields-B8ha5h4A.js";import{n as wo,t as Fs}from"./adapter-display-registry-9qBBJi9B.js";import{a as ye,c as Yc,l as Ae,n as At,o as Ft,r as Ct,s as Xc,t as Ia,u as cx}from"./agent-config-primitives-BJlDiwaH.js";import{t as li}from"./environments-xuhuvnTt.js";import{t as Tl}from"./clipboard-CTLKYvRL.js";import{a as Ge,i as _t,n as Fm,r as dx,t as ux}from"./AgentSetupPrompt-CaafK5_w.js";import{t as Jc}from"./managed-sandbox-environment-B8DewKvK.js";import{n as Co,r as mx,t as hx}from"./dynamic-loader-ehitOaJV.js";import{n as ni,s as Ma,t as Qc,u as px}from"./model-DidtFy-U.js";import{t as Vm}from"./adapters-D3NHXckp.js";import{t as Um}from"./use-adapter-capabilities-BNfGiTEP.js";import{t as fx}from"./AgentCharacter-DAAMv7-c.js";import{t as Bm}from"./use-copy-action-DFzauB4H.js";import{a as gx,o as xx,r as yx,s as Oa,t as Zc}from"./app-connect-policy-DqQf5knn.js";import{n as vx,t as bx}from"./segmented-tuNVx49H.js";var JN="adapter_auth_missing";function ed(e){const t=e.split(".");return t.length!==4||!t.every(s=>/^\d{1,3}$/.test(s)&&Number(s)<=255)?!1:t[0]==="127"}r(ed,"isLoopbackIpv4");function jx(e){const t=e.replace(/^\[|\]$/g,"").toLowerCase();if(t==="localhost"||t.endsWith(".localhost")||t==="::1")return!0;const s=t.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/);return s?.[1]?ed(s[1]):ed(t)}r(jx,"isLoopbackHost");function kx(e){try{const t=new URL(e).origin;return t==="null"?null:t}catch{return null}}r(kx,"normalizedOrigin");function wx(e,t){return t.allowInsecureLoopback&&jx(e.hostname)?!0:(t.allowInsecureOrigins??[]).some(s=>kx(s)===e.origin)}r(wx,"insecureTransportAllowed");function $m(e,t={}){if(typeof e!="string"||e.trim().length===0)return{ok:!1,reason:"missing"};let s;try{s=new URL(e.trim())}catch{return{ok:!1,reason:"malformed"}}return s.protocol!=="https:"&&s.protocol!=="http:"?{ok:!1,reason:"unsupported_scheme"}:s.hostname?s.protocol==="http:"&&!wx(s,t)?{ok:!1,reason:"insecure_transport"}:s.username||s.password?{ok:!1,reason:"embedded_credentials"}:s.hash?{ok:!1,reason:"fragment"}:{ok:!0,url:s.toString(),host:s.host}:{ok:!1,reason:"malformed"}}r($m,"checkOAuthEndpointUrl");var Cx={authorization:"sign-in",token:"token",registration:"client registration",metadata:"metadata"};function Ax(e,t){const s=Cx[e];switch(t){case"missing":return`This server did not provide a ${s} address.`;case"malformed":return`This server's ${s} address is not a valid URL, so Wardmote stopped.`;case"unsupported_scheme":return`This server's ${s} address does not use https, so Wardmote stopped.`;case"insecure_transport":return`This server's ${s} address is not secure (https), so Wardmote stopped.`;case"embedded_credentials":return`This server's ${s} address hides a different site behind a username, so Wardmote stopped.`;case"fragment":return`This server's ${s} address is malformed for sign-in, so Wardmote stopped.`}}r(Ax,"oauthEndpointUrlRejectionMessage");var zm={name:"cable",size:24,node:[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]};zm.node;var Sx=ym(zm),Km={name:"users-round",size:24,node:[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],aliases:["users-2"]};Km.node;var Da=ym(Km),Wm=[{key:"permissions",label:"Permissions",icon:Kg},{key:"review",label:"Review",icon:Vg}];function vi(e,t){return`/apps/${e}/${t}`}r(vi,"appTabHref");function QN(e,t){return`/apps/app/${e}/${t}`}r(QN,"appApplicationTabHref");function ZN(e){return Wm.some(t=>t.key===e)}r(ZN,"isAppTabKey");function eE(e){return Wm.find(t=>t.key===e)?.label??"Permissions"}r(eE,"appTabLabel");var n=hm(Hf(),1);function Pl({host:e,className:t}){return(0,n.jsxs)("div",{className:Z("flex flex-wrap items-center gap-2 text-xs",t),children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 font-medium text-amber-700 dark:text-amber-400",children:[(0,n.jsx)(zg,{className:"h-3 w-3"}),"Unverified server"]}),e?(0,n.jsx)("span",{className:"font-mono text-ink-3",children:e}):null]})}r(Pl,"UnverifiedServerBadge");function Rl({title:e,headingRef:t,subtitle:s,step:i,activeIndex:a,labels:o,appIdentity:l,unverifiedHost:c,onCancel:d}){return(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[l?(0,n.jsx)(cs,{name:l.name,logoUrl:l.logoUrl,darkLogoUrl:l.darkLogoUrl,size:44}):null,(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{ref:t,tabIndex:t?-1:void 0,className:"text-2xl font-bold tracking-tight outline-none",children:e??(l?`Connect ${l.name}`:"Connect your own MCP server")}),s&&(0,n.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:s}),c?(0,n.jsx)(Pl,{host:c,className:"mt-2"}):null]})]}),d&&(0,n.jsx)(D,{variant:"ghost",size:"sm",onClick:d,children:"Cancel"})]}),i!=="gallery"&&o.length>1&&(0,n.jsxs)("nav",{className:"mt-4","aria-label":"Setup progress","data-testid":"wizard-stepper",children:[(0,n.jsx)("ol",{className:"flex gap-2","aria-hidden":"true",children:o.map((m,u)=>(0,n.jsx)("li",{"data-testid":"wizard-step-dot","data-step-active":u===a?"true":void 0,className:Z("h-1 w-20 rounded-full",u<=a?"bg-ink":"bg-line")},m))}),(0,n.jsx)("div",{className:"mt-2 text-xs text-ink-3","data-testid":"wizard-step-labels",children:o.join(" · ")})]})]})}r(Rl,"StepHeader");var f=hm(Qf(),1);function _l({provider:e,template:t,value:s,onChange:i,disabled:a=!1}){const o=(0,f.useId)(),[l,c]=(0,f.useState)(!1),d=s.text!==t.text||s.template?.id!==t.id||s.template?.version!==t.version;return(0,n.jsxs)("section",{className:"space-y-3","aria-label":"Agent instructions",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Agent instructions"}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("label",{htmlFor:o,className:"text-sm",children:["Tell agents to use ",e]}),(0,n.jsx)(Nl,{id:o,checked:s.enabled,disabled:a,onCheckedChange:r(m=>i({...s,enabled:m}),"onCheckedChange")})]}),!s.enabled&&(0,n.jsx)(dt,{tone:"warning",children:"Agents can still use this connection’s tools, but won’t receive these instructions."}),l?(0,n.jsx)(Sl,{"aria-label":"Instructions text",value:s.text,disabled:a,maxLength:Zf,className:"min-h-40",onChange:r(m=>i({...s,text:m.target.value}),"onChange")}):(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-ink-3",children:s.text}),!s.text.trim()&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-bad",children:"Enter instructions."}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(D,{variant:"ghost",size:"sm",disabled:a,onClick:r(()=>c(!l),"onClick"),children:l?"Done editing":"Edit instructions"}),d&&(0,n.jsx)(D,{variant:"ghost",size:"sm",disabled:a,onClick:r(()=>i({...Ls(t),enabled:s.enabled}),"onClick"),children:"Reset to default"})]})]})}r(_l,"ConnectionInstructionsEditor");function tE({connection:e,provider:t,template:s,canConfigure:i}){const a=Bt(),[o,l]=(0,f.useState)(null),c=e.agentInstructions??{...Ls(s),enabled:!1},d=o??c,m=qe({mutationFn:r(()=>_e.updateConnection(e.id,{agentInstructions:d}),"mutationFn"),onSuccess:r(async()=>{await a.invalidateQueries({queryKey:["tools"]}),l(null)},"onSuccess")}),u=JSON.stringify(d)!==JSON.stringify(c);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(_l,{provider:t,template:s,value:d,onChange:l,disabled:!i||m.isPending}),m.isError&&(0,n.jsx)("div",{role:"alert",children:(0,n.jsx)(dt,{tone:"danger",children:m.error instanceof Error?m.error.message:"Couldn’t save instructions. Try again."})}),u&&(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)(D,{variant:"ghost",disabled:m.isPending,onClick:r(()=>{l(null),m.reset()},"onClick"),children:"Cancel"}),(0,n.jsx)(D,{disabled:!i||m.isPending||!d.text.trim(),onClick:r(()=>m.mutate(),"onClick"),children:m.isPending?"Saving…":"Save instructions"})]})]})}r(tE,"ConnectionInstructionsSettings");function nE({companyId:e,agentId:t}){const s=ue({queryKey:ge.tools.effectiveProfilesForAgent(e,t),queryFn:r(()=>_e.getEffectiveProfilesForAgent(e,t),"queryFn")}),i=s.data?.installedConnections.filter(a=>a.agentInstructions&&a.enabled&&a.status==="active")??[];return s.isLoading?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Loading connection instructions…"}):s.isError?(0,n.jsx)(dt,{tone:"danger",actions:(0,n.jsx)(D,{variant:"ghost",onClick:r(()=>{s.refetch()},"onClick"),children:"Retry"}),children:"Couldn’t load connection instructions."}):i.length?(0,n.jsxs)("section",{className:"mt-8 space-y-4","aria-label":"From connections",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"From connections"}),(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Enabled instructions are included when the connection is available for the task. Access can depend on the task’s responsible person and action permissions."}),i.map(a=>{const o=pm(a),l=fi(String(o.sourceTemplateKey??"")),c=Lf(l,o);return(0,n.jsxs)("div",{className:"space-y-3 rounded-lg border border-line p-4",children:[(0,n.jsx)(Pn,{className:"text-sm font-medium underline underline-offset-2",to:`/apps/${a.id}/permissions`,children:a.name}),!a.agentInstructions.enabled&&(0,n.jsx)(dt,{tone:"warning",children:"These instructions are turned off for this connection."}),c===null?(0,n.jsx)(dt,{tone:"warning",children:"Complete this connection’s configuration before agents receive its instructions."}):(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-ink-3",children:a.agentInstructions.text})]},a.id)})]}):null}r(nE,"AgentConnectionInstructions");function qm(e,t){const s=new Set(Array.isArray(e.suggestedDefaults?.askFirstRiskLevels)?e.suggestedDefaults.askFirstRiskLevels.filter(i=>typeof i=="string"):[]);return s.size===0?[]:e.actions.canMakeChanges.filter(i=>t(i.catalogEntryId)&&s.has(i.riskLevel)).map(i=>i.catalogEntryId)}r(qm,"askFirstCatalogEntryIdsFor");function Il({choices:e,selectedId:t,pendingId:s,disabled:i,onSelect:a}){return(0,n.jsx)("div",{className:"space-y-2",children:e.map(o=>(0,n.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between gap-4 rounded-lg border border-line bg-bg-2 p-4 text-left transition-colors hover:bg-bg-3 disabled:cursor-not-allowed disabled:opacity-60","aria-label":o.name,"aria-pressed":t===void 0?void 0:t===o.id,disabled:i||!!s||o.disabled,onClick:r(()=>a(o.id),"onClick"),children:[o.icon&&(0,n.jsx)("span",{"aria-hidden":"true",className:"shrink-0",children:o.icon}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-medium text-ink",children:o.name}),(0,n.jsx)("span",{className:"mt-1 block text-xs text-ink-3",children:o.description})]}),s===o.id?(0,n.jsx)(He,{className:"h-4 w-4 shrink-0 animate-spin text-ink-3"}):t===o.id?(0,n.jsx)(ut,{className:"h-4 w-4 shrink-0 text-ink-3"}):(0,n.jsx)(wl,{className:"h-4 w-4 shrink-0 text-ink-3"})]},o.id))})}r(Il,"ConnectionChoiceList");function Nx({providerName:e,upstreamServiceName:t,connections:s,pendingId:i,error:a,onSelect:o,onCancel:l,onConnectNew:c}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-bold",children:t?`Connect ${t} through ${e}`:`Connect ${e}`}),(0,n.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an existing connection or connect a new account. Existing access stays unchanged."})]}),t&&(0,n.jsxs)(dt,{compact:!0,children:[e," is an external service that handles the connection and requests to ",t,". Reusing this account does not yet verify app access; the agent will check it and guide any additional authorization."]}),(0,n.jsx)(Il,{choices:s.map(d=>({...d,description:"Provider account available"})),pendingId:i,onSelect:o}),a&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-bad",children:a}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)(D,{variant:"ghost",disabled:!!i,onClick:l,children:"Cancel"}),(0,n.jsx)(D,{disabled:!!i,onClick:c,children:"Connect new"})]})]})}r(Nx,"RemoteMcpAccountChoice");function Gm(e){const t=typeof window<"u"&&window.location.protocol==="http:",s=$m(e??null,{allowInsecureLoopback:t,allowInsecureOrigins:typeof window<"u"?[window.location.origin]:[]});return s.ok?{ok:!0,url:s.url,host:s.host}:{ok:!1,message:Ax("authorization",s.reason)}}r(Gm,"resolveAuthorizationTarget");function Hm(e){window.location.assign(e)}r(Hm,"navigateTopLevel");function Ao(e){const t=[];let s=0;for(const i of e.split(/[\s,]+/g)){const a=i.trim().replace(/[),.;\]]+$/g,"");if(a)try{const o=new URL(a).pathname.match(/\/spreadsheets\/d\/([^/]+)/i);if(o?.[1]){t.push(decodeURIComponent(o[1]));continue}s+=1}catch{s+=1}}return{ids:Array.from(new Set(t)),invalidCount:s}}r(Ao,"parseGoogleSheetIds");function Ex({entries:e,disabled:t,onSubmit:s}){const[i,a]=(0,f.useState)(new Set),o=e.length,l=e.filter(c=>i.has(c.id)).map(c=>c.id);return(0,n.jsxs)("section",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"text-sm font-semibold text-amber-800 dark:text-amber-200",children:["Review ",o," new ",o===1?"action":"actions"]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-300",children:"Turn on the actions agents may use. Anything left off stays blocked when you save."})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",className:"text-xs font-medium text-amber-800 hover:text-amber-950 dark:text-amber-200 dark:hover:text-amber-50",disabled:t,onClick:r(()=>a(new Set(e.map(c=>c.id))),"onClick"),children:"Turn all on"}),(0,n.jsx)("button",{type:"button",className:"text-xs font-medium text-amber-800 hover:text-amber-950 dark:text-amber-200 dark:hover:text-amber-50",disabled:t,onClick:r(()=>a(new Set),"onClick"),children:"Turn all off"})]})]}),(0,n.jsx)("div",{className:"divide-y divide-line",children:e.map(c=>{const d=i.has(c.id),m=c.title??c.toolName;return(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-ink",children:m}),c.description&&(0,n.jsx)("div",{className:"truncate text-xs text-ink-3",children:c.description})]}),(0,n.jsx)(Nl,{"aria-label":`${m} allowed`,checked:d,disabled:t,onCheckedChange:r(u=>{a(p=>{const h=new Set(p);return u?h.add(c.id):h.delete(c.id),h})},"onCheckedChange")})]},c.id)})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsxs)("span",{className:"text-xs text-amber-700 dark:text-amber-300",children:[l.length," of ",o," will be on"]}),(0,n.jsx)(D,{size:"sm",disabled:t,onClick:r(()=>s(l),"onClick"),children:t?"Saving…":"Save choices"})]})]})}r(Ex,"QuarantinedActionsReview");function Vr(e){return`${(e/1e3).toFixed(1)}s`}r(Vr,"seconds");function la(e){const t=Mf(e);return t.charAt(0).toUpperCase()+t.slice(1)}r(la,"relTime");var Tx=3e5,Px=18e5;function Rx({connectionId:e,appName:t,entry:s,open:i,onOpenChange:a}){const o=ue({queryKey:ge.tools.testAgents(e),queryFn:r(()=>_e.listTestAgents(e),"queryFn"),enabled:i&&!!e}),l=(0,f.useMemo)(()=>[...o.data?.agents??[]].sort((j,k)=>j.orgDepth-k.orgDepth||j.name.localeCompare(k.name)),[o.data]),[c,d]=(0,f.useState)(null),m=c&&l.some(j=>j.id===c)?c:l[0]?.id??null,u=l.find(j=>j.id===m)??null,p=ue({queryKey:ge.tools.testAgentAccess(e,m??"__none__"),queryFn:r(()=>_e.getTestAgentAccess(e,m),"queryFn"),enabled:i&&!!e&&!!m,staleTime:Tx,gcTime:Px,refetchOnWindowFocus:!1}),h=(0,f.useMemo)(()=>u&&p.data?{...u,effectiveAccess:p.data.access}:null,[p.data,u]),x=(0,f.useMemo)(()=>h?.effectiveAccess.tools.find(j=>j.toolName===s.toolName||j.gatewayToolName===s.toolName)?.decision??"off",[s.toolName,h]),g=s.title??s.toolName;return(0,n.jsx)(Fr,{open:i,onOpenChange:a,children:(0,n.jsxs)(Or,{className:"max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl",children:[(0,n.jsxs)(jo,{children:[(0,n.jsxs)(Lr,{children:["Test ",g]}),(0,n.jsx)(Dr,{children:"Run a real action with the same permissions and credentials an agent would use."})]}),o.isLoading?(0,n.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-ink-3",role:"status",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin"}),"Loading agents…"]}):o.isError?(0,n.jsx)(td,{message:"We couldn't load the agents available for testing.",onRetry:r(()=>{o.refetch()},"onRetry")}):l.length===0?(0,n.jsx)("p",{className:"py-6 text-sm text-ink-3",children:"No agents are available to test as."}):p.isError&&!p.data?(0,n.jsx)(td,{message:`We couldn't load ${u?.name??"this agent"}'s permissions.`,onRetry:r(()=>{p.refetch()},"onRetry")}):h?(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/30 p-4",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-ink-3",children:"Act as"}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)(Ix,{agents:l,selectedAgent:h,onSelect:d,connectionId:e,appName:t}),(0,n.jsx)(Ym,{decision:x})]})]}),(0,n.jsx)(Lx,{entry:s,decision:x,connectionId:e,appName:t,agent:h,allAgents:l,onSelectAgent:d},`${s.id}:${h.id}`)]}):(0,n.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-ink-3",role:"status",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin"}),"Loading agent permissions…"]})]})})}r(Rx,"ActionTestDialog");var _x={allowed:{label:"Allowed",className:"border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"},ask_first:{label:"Ask first",className:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300"},off:{label:"Off",className:"border-line bg-bg-3 text-ink-3"}};function Ym({decision:e}){const t=_x[e];return(0,n.jsx)("span",{className:Z("inline-flex shrink-0 items-center rounded-full border px-2 py-0.5 text-xs font-medium",t.className),children:t.label})}r(Ym,"DecisionBadge");function td({message:e,onRetry:t}){return(0,n.jsxs)("div",{className:"py-8 text-center",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-ink",children:e}),(0,n.jsx)(D,{className:"mt-3",size:"sm",variant:"secondary",onClick:t,children:"Try again"})]})}r(td,"TestLoadError");function Ix({agents:e,selectedAgent:t,onSelect:s,connectionId:i,appName:a}){const[o,l]=(0,f.useState)(!1),[c,d]=(0,f.useState)(""),m=e.filter(u=>u.name.toLowerCase().includes(c.trim().toLowerCase()));return(0,n.jsxs)($s,{open:o,onOpenChange:r(u=>{l(u),u||d("")},"onOpenChange"),children:[(0,n.jsx)(Ni,{asChild:!0,children:(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 font-semibold text-ink underline-offset-2 outline-none hover:text-accent hover:underline focus-visible:text-accent","aria-label":"Choose which agent to test as",children:[t.name,(0,n.jsx)(wg,{className:"h-3.5 w-3.5 text-ink-3"})]})}),(0,n.jsxs)(Bs,{align:"start",className:"w-80 p-0",disablePortal:!0,children:[(0,n.jsx)("div",{className:"border-b border-line p-2",children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(oa,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,n.jsx)(Ce,{"aria-label":"Search agents",placeholder:"Search agents…",className:"h-8 pl-8 text-sm",value:c,onChange:r(u=>d(u.target.value),"onChange"),autoFocus:!0})]})}),(0,n.jsx)("div",{className:"max-h-60 overflow-y-auto p-1",children:m.length===0?(0,n.jsx)("p",{className:"px-3 py-4 text-center text-xs text-ink-3",children:"No agents match."}):m.map(u=>{const p=u.title?.trim()||u.role;return(0,n.jsxs)("button",{type:"button",onClick:r(()=>{s(u.id),l(!1),d("")},"onClick"),className:Z("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left hover:bg-bg-3",u.id===t.id&&"bg-bg-3"),children:[(0,n.jsx)(ut,{className:Z("mt-0.5 h-4 w-4 shrink-0",u.id===t.id?"text-accent":"text-transparent")}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm font-medium text-ink",children:u.name}),(0,n.jsx)("span",{className:"block truncate text-xs text-ink-3",children:p})]})]},u.id)})}),(0,n.jsxs)("div",{className:"border-t border-line px-3 py-2 text-(length:--text-micro) text-ink-3",children:[(0,n.jsx)("p",{children:"Only agents you can assign tasks to are listed."}),(0,n.jsxs)("p",{children:["Pick one to preview what they'd see in ",a,"."]})]}),(0,n.jsxs)("div",{className:"border-t border-line p-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold text-ink",children:"What the badges mean"}),(0,n.jsxs)("ul",{className:"mt-1.5 space-y-1 text-xs text-ink-3",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Allowed"})," — runs immediately when you press Run."]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Ask first"})," — Run is parked in Review for your OK."]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-medium text-ink",children:"Off"})," — won't run. Change it in"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:vi(i,"permissions"),children:"Permissions"}),"."]})]}),(0,n.jsx)("p",{className:"mt-2 text-(length:--text-micro) text-ink-3",children:"Badges reflect this agent's current settings, not yours. Swap agents to see how an action would behave for each."})]})]})]})}r(Ix,"AgentPicker");function Xm(e,t,s){return`wardmote:test-call:${e}:${s}:${t.id}:${t.toolName}`}r(Xm,"testOutcomeStorageKey");function Mx(e,t,s){if(typeof window>"u")return null;try{const i=window.sessionStorage.getItem(Xm(e,t,s.id));if(!i)return null;const a=JSON.parse(i);return!a.result||a.result.decision!=="ask_first"||typeof a.result.actionRequestId!="string"?null:{result:a.result,agentName:a.agentName||s.name,durationMs:typeof a.durationMs=="number"?a.durationMs:0,ranAt:a.ranAt?new Date(a.ranAt):new Date}}catch{return null}}r(Mx,"loadStoredAskFirstOutcome");function nd(e,t,s,i){if(typeof window>"u")return;const a=Xm(e,t,s);try{if(!i||i.result.decision!=="ask_first"){window.sessionStorage.removeItem(a);return}window.sessionStorage.setItem(a,JSON.stringify({...i,ranAt:i.ranAt.toISOString()}))}catch{}}r(nd,"storeAskFirstOutcome");function Ox(e){const t=new Set(e.required??[]),s=e.properties??{},i={};for(const[a,o]of Object.entries(s)){const l=a==="code"&&o.type==="string"&&!o.format?{...o,format:"textarea"}:o;i[a]=t.has(a)?l:{...l,"x-wardmote-advanced":!0}}return{...e,properties:i}}r(Ox,"splitRequiredOptional");var Dx={allowed:r((e,t)=>`This runs a real call against ${e} as ${t}.`,"allowed"),ask_first:r(()=>"Waiting for your OK before this call leaves Wardmote.","ask_first"),off:r((e,t)=>`No call will be made — this action is off for ${t}.`,"off")};function Lx({entry:e,decision:t,connectionId:s,appName:i,agent:a,allAgents:o,onSelectAgent:l}){const c=Bt(),{selectedCompanyId:d}=us(),m=e.inputSchema??{type:"object",properties:{}},u=(0,f.useMemo)(()=>Ox(m),[m]),[p,h]=(0,f.useState)(()=>ko(m)),[x,g]=(0,f.useState)({}),[j,k]=(0,f.useState)(()=>Mx(s,e,a)),[v,w]=(0,f.useState)(!1),[_,N]=(0,f.useState)(0),P=(0,f.useRef)(0),b=(0,f.useRef)(!1),I=t==="off";(0,f.useEffect)(()=>{if(!v)return;const C=window.setInterval(()=>N(Date.now()-P.current),100);return()=>window.clearInterval(C)},[v]);const L=qe({mutationFn:r(async C=>await _e.runTestCall(s,{agentId:a.id,toolName:e.toolName,parameters:C}),"mutationFn"),onSuccess:r(C=>{if(b.current)return;const z=Date.now()-P.current,W=r(()=>{if(b.current)return;const V={result:C,agentName:a.name,durationMs:z,ranAt:new Date};w(!1),k(V),nd(s,e,a.id,V),c.invalidateQueries({queryKey:ge.tools.connectionActivity(s)}),d&&(c.invalidateQueries({queryKey:ge.tools.actionRequests(d,"pending")}),c.invalidateQueries({queryKey:ge.apps.attention(d)}))},"finish"),G=200-z;G>0?window.setTimeout(W,G):W()},"onSuccess"),onError:r(()=>{b.current||w(!1)},"onError")}),R=r(()=>{const C=Dm(m,p);g(C),!(Object.keys(C).length>0)&&(b.current=!1,P.current=Date.now(),N(0),k(null),w(!0),L.mutate(p))},"onRun"),F=r(()=>{b.current=!0,w(!1),k(null),nd(s,e,a.id,null),g({}),h(ko(m))},"onReset"),T=r(()=>{b.current=!0,w(!1)},"onCancelRunning");if(I)return(0,n.jsx)(Hx,{entry:e,connectionId:s,appName:i,agent:a,allAgents:o,onSelectAgent:l});const E=Object.keys(m.properties??{}).length>0;return(0,n.jsxs)("div",{className:"space-y-4",children:[E?(0,n.jsx)(Lm,{schema:u,values:p,onChange:h,errors:x,disabled:v,advancedLabel:"More options"}):(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"This action takes no inputs."}),(0,n.jsx)("p",{className:"text-xs text-ink-3",children:Dx[t](i,a.name)}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(D,{onClick:R,disabled:v||!!j?.result.upstreamPending?.resumeTool||j?.result.decision==="ask_first",size:"sm",children:v?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(He,{className:"h-3.5 w-3.5 animate-spin"})," Running…"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Em,{className:"h-3.5 w-3.5"})," ",j?"Run again":"Run"]})}),(0,n.jsx)(D,{onClick:F,disabled:v,size:"sm",variant:"ghost",children:"Reset"})]}),(j?.result.decision==="ask_first"||j?.result.upstreamPending?.resumeTool)&&(0,n.jsx)("p",{className:"text-xs text-ink-3",children:"Finish the existing request below. Use Reset only when you intend to start a new call."}),v&&(0,n.jsx)(Fx,{entry:e,appName:i,agentName:a.name,elapsedMs:_,onCancel:T}),L.isError&&!v&&(0,n.jsxs)("div",{className:"rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:["Couldn't reach ",a.name,". ",L.error instanceof Error?L.error.message:"Please try again."]}),j&&!v&&(0,n.jsx)(Jm,{outcome:j,entry:e,appName:i,connectionId:s,agent:a})]})}r(Lx,"ActionTester");function Fx({entry:e,appName:t,agentName:s,elapsedMs:i,onCancel:a}){const o=e.isReadOnly?"Reading from":e.isWrite?"Writing to":"Calling";return(0,n.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/30 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(He,{className:"h-4 w-4 animate-spin text-ink-3"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"Running…"})]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:[o," ",t," as ",s,"."]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,n.jsxs)("span",{className:"text-xs text-ink-3",children:["Started ",Vr(i)," ago · Press cancel to stop"]}),(0,n.jsx)(D,{onClick:a,size:"sm",variant:"secondary",children:"Cancel"})]})]})}r(Fx,"RunningCard");function Jm({outcome:e,entry:t,appName:s,connectionId:i,agent:a}){const{result:o}=e;if(o.upstreamPending)return(0,n.jsx)(Qm,{pending:o.upstreamPending,appName:s,connectionId:i,agent:a});if(o.decision==="ask_first")return(0,n.jsx)(Gx,{outcome:e,entry:t,appName:s,connectionId:i,agent:a});if(o.decision==="off")return(0,n.jsx)("div",{className:"rounded-md border border-line bg-bg-3/40 p-3 text-sm text-ink-3",children:o.error?.message??"This action is off and won't run."});const l=o.error??Ml(o.result);return l?(0,n.jsx)(sh,{outcome:e,appName:s,connectionId:i,error:l}):(0,n.jsx)(th,{outcome:e,entry:t,appName:s,connectionId:i})}r(Jm,"ResultPanel");function Qm({pending:e,appName:t,connectionId:s,agent:i}){const[a,o]=(0,f.useState)(null),l=a&&(a.outcome.result.error??Ml(a.outcome.result.result));return a&&l?.reasonCode==="tool_error"&&(a.action==="decline"&&/request was declined by the user/i.test(l.message)||a.action==="cancel"&&/request was cancelled by the user/i.test(l.message))?(0,n.jsxs)("div",{role:"status",className:"space-y-2 rounded-md border border-line bg-bg-3/40 p-4 text-sm",children:[(0,n.jsx)("p",{className:"font-medium",children:a.action==="decline"?"Request declined":"Request cancelled"}),(0,n.jsx)("p",{children:l.message}),(0,n.jsx)("p",{className:"text-ink-3",children:"The original call was not repeated."}),e.executionId&&(0,n.jsxs)("p",{children:["Execution: ",(0,n.jsx)("code",{className:"break-all",children:e.executionId})]})]}):a?(0,n.jsx)(Jm,{outcome:a.outcome,entry:a.entry,appName:t,connectionId:s,agent:i}):(0,n.jsxs)("div",{role:"status",className:"space-y-3 rounded-md border border-line bg-bg-3/40 p-4 text-sm",children:[(0,n.jsxs)("p",{className:"font-medium",children:[e.kind==="approval"?"Approval needed":"Authorization needed"," in ",t]}),(0,n.jsx)("p",{className:"text-ink-3",children:"Wardmote allowed this call. The provider needs your input before it can continue."}),e.links.map(c=>{const d=$m(c.url);return d.ok?(0,n.jsx)(D,{variant:"secondary",asChild:!0,children:(0,n.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",children:["Continue at ",d.host]})},d.url):null}),e.message&&(0,n.jsx)("p",{className:"whitespace-pre-wrap break-words",children:e.message}),e.links.length===0&&!e.resumeTool&&(0,n.jsx)("p",{children:"Open the provider dashboard to complete this request."}),e.executionId&&(0,n.jsxs)("p",{children:["Execution: ",(0,n.jsx)("code",{className:"break-all",children:e.executionId})]}),e.elicitationId&&(0,n.jsxs)("p",{children:["Request: ",(0,n.jsx)("code",{className:"break-all",children:e.elicitationId})]}),e.expiresAt&&(0,n.jsxs)("p",{children:["Approval expires ",new Date(e.expiresAt).toLocaleTimeString(),"."]}),e.resumeTool&&i?(0,n.jsx)(Vx,{pending:e,connectionId:s,agent:i,onResult:o}):(0,n.jsx)("p",{className:"text-ink-3",children:e.resumeTool?`After approval, test the ${e.resumeTool} action with this execution ID. Do not start the original action again.`:"After authorizing, check the provider's result before using Run again. Wardmote will not repeat the call automatically."})]})}r(Qm,"ProviderPendingResult");function Vx({pending:e,connectionId:t,agent:s,onResult:i}){const a=ue({queryKey:ge.tools.catalog(t),queryFn:r(()=>_e.listCatalog(t),"queryFn")}),o=a.data?.catalog.find(j=>j.toolName===e.resumeTool&&j.status==="active"),l=e.requestedSchema??{type:"object",properties:{}},[c,d]=(0,f.useState)(()=>ko(l)),[m,u]=(0,f.useState)({}),p=qe({mutationFn:r(async j=>{const k=Date.now();return{result:await _e.runTestCall(t,{agentId:s.id,toolName:o.toolName,parameters:{executionId:e.executionId,action:j,...j==="accept"?{content:JSON.stringify(c)}:{}}}),durationMs:Date.now()-k,agentName:s.name,ranAt:new Date}},"mutationFn"),onSuccess:r((j,k)=>{o&&i({outcome:j,entry:o,action:k})},"onSuccess")}),h=!!e.expiresAt&&Date.parse(e.expiresAt)<=Date.now(),x=s.effectiveAccess.tools.find(j=>j.toolName===o?.toolName)?.decision??"off",g=r(j=>{const k=j==="accept"?Dm(l,c):{};u(k),Object.keys(k).length||p.mutate(j)},"submit");return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("p",{className:"text-ink-3",children:["Review the provider's request, then resume this execution as ",s.name,". The original action will not be started again."]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{children:"Resume permission"}),(0,n.jsx)(Ym,{decision:x})]}),Object.keys(l.properties??{}).length>0&&(0,n.jsx)(Lm,{schema:l,values:c,onChange:d,errors:m,disabled:p.isPending}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(D,{disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("accept"),"onClick"),children:p.isPending?"Resuming…":"Approve and resume"}),(0,n.jsx)(D,{variant:"secondary",disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("decline"),"onClick"),children:"Decline"}),(0,n.jsx)(D,{variant:"ghost",disabled:!o||h||x==="off"||p.isPending,onClick:r(()=>g("cancel"),"onClick"),children:"Cancel request"})]}),h&&(0,n.jsx)("p",{children:"This provider approval expired. Check the provider before starting a new action."}),x==="off"&&(0,n.jsx)("p",{children:"Allow the resume action in Permissions before continuing."}),a.isError&&(0,n.jsx)("p",{role:"alert",children:"Could not load the resume action. Close this test and try again."}),p.isError&&(0,n.jsx)("p",{role:"alert",children:p.error instanceof Error?p.error.message:"Could not resume. Check the provider before trying again."})]})}r(Vx,"ProviderResumeControls");function Ml(e){if(!e||typeof e!="object")return null;const t=e;return(t.data&&typeof t.data=="object"?t.data:null)?.isError===!0||t.isError===!0?{message:typeof t.content=="string"&&t.content.trim()!==""&&t.content||typeof t.error=="string"&&t.error.trim()!==""&&t.error||"The app returned an error result.",reasonCode:"tool_error"}:null}r(Ml,"mcpToolError");function Zm(e){const t=r(s=>Array.isArray(s)&&s.length>0&&s.every(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)),"isObjArray");if(t(e))return e;if(e&&typeof e=="object")for(const s of["rows","values","items","data","results"]){const i=e[s];if(t(i))return i}return null}r(Zm,"asRows");function eh(e){return e==null?!0:Array.isArray(e)?e.length===0:typeof e=="string"?e.trim()==="":typeof e=="object"?Object.keys(e).length===0:!1}r(eh,"isEmptyResult");function Ux(e){if(!e||typeof e!="object"||Array.isArray(e))return{items:[{label:null,value:e}],summary:e};const t=e,s=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:null,i=s&&(Array.isArray(s.content)||s.structuredContent!=null)?s:t,a=Array.isArray(i.content)?i.content:null;if(!a&&i.structuredContent==null)return{items:[{label:null,value:e}],summary:e};const o=r(m=>{try{return JSON.parse(m)}catch{return m}},"parseText"),l=i.structuredContent,c=[],d=typeof l=="string"?o(l):l;l!=null&&c.push({label:null,value:d});for(const m of a??[]){if(!m||typeof m!="object"||Array.isArray(m))return{items:[{label:null,value:e}],summary:e,rawFallback:!0};const u=m;if(u.type==="text"&&typeof u.text=="string"){const p=o(u.text);(l==null||bi(p)!==bi(d))&&c.push({label:(a?.length??0)>1||l!=null?"Text":null,value:p})}else if(u.type==="image"||u.type==="audio")c.push({label:u.type==="image"?"Image":"Audio",value:typeof u.mimeType=="string"?u.mimeType:"Media attachment"});else if(u.type==="resource_link")c.push({label:"Resource",value:u.title??u.name??u.uri??"Resource link"});else if(u.type==="resource"&&u.resource&&typeof u.resource=="object"){const p=u.resource;c.push({label:"Resource",value:typeof p.text=="string"?o(p.text):p.uri??"Embedded resource"})}else return{items:[{label:null,value:e}],summary:e,rawFallback:!0}}return c.length===0&&typeof t.content=="string"&&c.push({label:null,value:o(t.content)}),{items:c,summary:l!=null?d:c[0]?.value}}r(Ux,"resultPreview");function Bx(e){const t=`${e.toolName} ${e.title??""}`.toLowerCase();return/\b(append|add|insert|create|new)\b/.test(t)?"added":/\b(update|edit|set|patch|change|modify)\b/.test(t)?"updated":/\b(delete|remove|clear|trash)\b/.test(t)?"removed":null}r(Bx,"writeVerb");function $x(e,t,s){const i=Bx(t);if(!t.isReadOnly&&i)return`Worked. Row ${i}.`;const a=Zm(e);return a?`Worked. ${a.length} ${a.length===1?"row":"rows"} came back.`:eh(e)?"Worked. No data to show.":`Worked. ${s} sent back the result.`}r($x,"successHeadline");function th({outcome:e,entry:t,appName:s,connectionId:i}){const a=e.result.result,o=Ux(a);return(0,n.jsxs)("div",{className:"rounded-md border border-emerald-500/40 bg-emerald-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(ut,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:$x(o.summary,t,s)})]}),(0,n.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-ink-3",children:[(0,n.jsx)(Sm,{className:"h-3 w-3"}),"Ran as ",e.agentName," · ",Vr(e.durationMs)," · ",la(e.ranAt)]}),o.items.some(l=>!eh(l.value))&&(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Preview"}),(0,n.jsx)("div",{className:"mt-1.5",children:(0,n.jsx)("div",{className:"space-y-2",children:o.items.map((l,c)=>(0,n.jsxs)("div",{children:[l.label&&(0,n.jsx)("p",{className:"mb-1 text-xs font-medium text-ink-3",children:l.label}),(0,n.jsx)(zx,{value:l.value})]},c))})})]}),(0,n.jsx)(nh,{value:a,initiallyOpen:o.rawFallback}),(0,n.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["This call is in the"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:"/activity?mode=agents&action=tool_",children:"Audit log"}),"."]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:["Last run finished in ",Vr(e.durationMs),"."]})]})}r(th,"AllowedResult");function zx({value:e}){const t=Zm(e);if(t){const s=Array.from(new Set(t.flatMap(a=>Object.keys(a)))).slice(0,6),i=t.slice(0,6);return s.length>4||i.some(a=>s.some(o=>Os(a[o]).length>80))?(0,n.jsxs)("div",{className:"space-y-2",children:[i.map((a,o)=>(0,n.jsx)(Kx,{row:a,index:o},o)),t.length>i.length&&(0,n.jsxs)("p",{className:"text-(length:--text-micro) text-ink-3",children:["… ",t.length-i.length," more rows in the raw response"]})]}):(0,n.jsxs)("div",{className:"overflow-x-auto rounded-md border border-line",children:[(0,n.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,n.jsx)("thead",{className:"bg-bg-3/50 text-ink-3",children:(0,n.jsx)("tr",{children:s.map(a=>(0,n.jsx)("th",{className:"px-2.5 py-1.5 font-medium",children:a},a))})}),(0,n.jsx)("tbody",{className:"divide-y divide-line",children:i.map((a,o)=>(0,n.jsx)("tr",{children:s.map(l=>(0,n.jsx)("td",{className:"px-2.5 py-1.5 text-ink",children:Os(a[l])},l))},o))})]}),t.length>i.length&&(0,n.jsxs)("p",{className:"px-2.5 py-1.5 text-(length:--text-micro) text-ink-3",children:["… ",t.length-i.length," more rows"]})]})}return typeof e=="string"?(0,n.jsx)("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap rounded-md border border-line bg-bg p-3 text-xs text-ink",children:e}):e&&typeof e=="object"&&!Array.isArray(e)?(0,n.jsx)("dl",{className:"max-h-64 overflow-auto divide-y divide-line rounded-md border border-line bg-bg text-xs",children:Object.entries(e).map(([s,i])=>(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-3 py-2",children:[(0,n.jsx)("dt",{className:"min-w-0 break-words text-ink-3",children:s}),(0,n.jsx)("dd",{className:"col-span-2 min-w-0 break-words whitespace-pre-wrap text-ink",children:typeof i=="object"&&i!==null?bi(Ur(i,2)):Os(i)})]},s))}):(0,n.jsx)("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-bg p-3 text-xs text-ink",children:bi(Ur(e,2))})}r(zx,"PrettyPreview");function Kx({row:e,index:t}){const s=["title","name","label"].find(l=>typeof e[l]=="string"&&e[l]!==""),i=["highlight","description","summary"].find(l=>typeof e[l]=="string"&&e[l]!==""),a=typeof e.url=="string"&&/^https?:\/\//i.test(e.url)?e.url:null,o=Object.entries(e).filter(([l])=>l!==s&&l!==i&&(l!=="url"||!a)).sort(([l],[c])=>{const d=["url","type","status","timestamp","id"],m=d.indexOf(l),u=d.indexOf(c);return(m<0?d.length:m)-(u<0?d.length:u)});return(0,n.jsxs)("div",{className:"min-w-0 rounded-md border border-line bg-bg p-3 text-xs",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[(0,n.jsx)("p",{className:"min-w-0 break-words text-sm font-medium text-ink",children:s?Os(e[s]):`Result ${t+1}`}),a&&(0,n.jsx)("a",{className:"shrink-0 text-accent hover:underline",href:a,target:"_blank",rel:"noopener noreferrer",children:"Open link"})]}),i&&(0,n.jsx)("p",{className:"mt-1 line-clamp-2 break-words text-ink-3",children:Os(e[i]).replace(/\*\*(.*?)\*\*/g,"$1")}),o.length>0&&(0,n.jsx)("dl",{className:"mt-2 space-y-1",children:o.slice(0,3).map(([l,c])=>(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,n.jsx)("dt",{className:"min-w-0 break-words text-ink-3",children:l}),(0,n.jsx)("dd",{className:"col-span-2 min-w-0 break-all text-ink",children:Os(c)})]},l))}),o.length>3&&(0,n.jsxs)("p",{className:"mt-2 text-ink-3",children:[o.length-3," more ",o.length===4?"field":"fields"," in the raw response"]})]})}r(Kx,"PreviewRowCard");function Os(e){return e==null?"—":typeof e=="object"?Array.isArray(e)?`[${e.length}]`:"{…}":String(e)}r(Os,"cellText");function Ur(e,t,s=0){if(e===null||typeof e!="object")return e;if(s>=t)return Array.isArray(e)?"[…]":"{…}";if(Array.isArray(e))return e.map(a=>Ur(a,t,s+1));const i={};for(const[a,o]of Object.entries(e))i[a]=Ur(o,t,s+1);return i}r(Ur,"collapseDeep");function nh({value:e,initiallyOpen:t=!1}){const[s,i]=(0,f.useState)(t);return e==null?null:(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("button",{type:"button",onClick:r(()=>i(a=>!a),"onClick"),className:"text-xs font-semibold uppercase tracking-wide text-accent hover:underline",children:s?"Hide raw response":"Show raw response"}),s&&(0,n.jsx)("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md border border-line bg-bg p-3 text-xs text-ink",children:bi(e)})]})}r(nh,"RawResponseDisclosure");function sh({outcome:e,appName:t,connectionId:s,error:i}){const a=Xx(i.message,i.reasonCode),o=Yx(i.reasonCode);return(0,n.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(es,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"It didn't work."})]}),(0,n.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-ink-3",children:[(0,n.jsx)(Sm,{className:"h-3 w-3"}),"Tried as ",e.agentName," · ",Vr(e.durationMs)," · ",la(e.ranAt)]}),(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:["What ",t," said"]}),(0,n.jsx)("p",{className:"mt-1 break-words text-sm text-ink",children:i.message}),i.reasonCode&&(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-ink-3",children:["code: ",i.reasonCode]})]}),(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"What to try"}),(0,n.jsx)("ul",{className:"mt-1 list-disc space-y-0.5 pl-4 text-sm text-ink",children:a.map(l=>(0,n.jsx)("li",{children:l},l))})]}),e.result.result!==void 0&&(0,n.jsx)(nh,{value:e.result.result,initiallyOpen:!0}),(0,n.jsx)("p",{className:"mt-3 text-xs text-ink-3",children:o?"After reconnecting, run this action again.":"Adjust the input above and try again."}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:["Also visible in the"," ",(0,n.jsx)(Pn,{className:"text-accent hover:underline",to:"/activity?mode=agents&action=tool_",children:"Audit log"}),"."]})]})}r(sh,"ErrorResult");var Wx=new Set(["done","denied","cancelled","expired"]);function qx(e){if(!e)return null;const t=[];for(const[s,i]of Object.entries(e))if(i!=null&&typeof i!="object"&&(t.push(`${s}: ${String(i)}`),t.length>=3))break;return t.length?t.join(" · "):null}r(qx,"formatWhere");function Gx({outcome:e,entry:t,appName:s,connectionId:i,agent:a}){const{selectedCompanyId:o}=us(),l=Bt(),c=e.result.actionRequestId,[d,m]=(0,f.useState)(!1),u=ue({queryKey:ge.tools.testCallStatus(i,c??"__none__"),queryFn:r(()=>_e.getTestCallStatus(i,c),"queryFn"),enabled:!!c&&!d,refetchInterval:r(w=>{const _=w.state.data?.phase;return _&&Wx.has(_)?!1:2e3},"refetchInterval")}),p=qe({mutationFn:r(()=>_e.declineActionRequest(o,c),"mutationFn"),onSuccess:r(()=>{m(!0),l.invalidateQueries({queryKey:ge.tools.actionRequests(o,"pending")}),o&&l.invalidateQueries({queryKey:ge.apps.attention(o)})},"onSuccess")}),h=u.data,x=d?"cancelled":h?.phase??"waiting";if(x==="done"&&h){if(h.upstreamPending)return(0,n.jsx)(Qm,{pending:h.upstreamPending,appName:s,connectionId:i,agent:a});const w=h.error??Ml(h.result);if(w){const N={result:{decision:"allowed",invocationId:h.invocationId,error:w},agentName:e.agentName,durationMs:h.durationMs??e.durationMs,ranAt:h.resolvedAt?new Date(h.resolvedAt):e.ranAt};return(0,n.jsx)(sh,{outcome:N,appName:s,connectionId:i,error:w})}const _={result:{decision:"allowed",invocationId:h.invocationId,result:h.result},agentName:e.agentName,durationMs:h.durationMs??e.durationMs,ranAt:h.resolvedAt?new Date(h.resolvedAt):e.ranAt};return(0,n.jsx)(th,{outcome:_,entry:t,appName:s,connectionId:i})}const g=h?.requestedAt?new Date(h.requestedAt):e.ranAt,j=qx(h?.parameters),k=x==="running"?"Approved · running":x==="denied"?"Denied — see Review for why":x==="cancelled"?"Cancelled":x==="expired"?"Expired — send it again":`Waiting · ${la(g)}`,v=x==="denied"||x==="cancelled"||x==="expired";return(0,n.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Tm,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:"Sent for your OK."})]}),(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-ink-3",children:[e.agentName," needs your approval before this runs."]}),(0,n.jsxs)("dl",{className:"mt-3 space-y-1.5 text-sm",children:[(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Action"}),(0,n.jsx)("dd",{className:"text-ink",children:t.title??t.toolName})]}),j&&(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Where"}),(0,n.jsx)("dd",{className:"break-words text-ink",children:j})]}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("dt",{className:"w-16 shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Status"}),(0,n.jsxs)("dd",{className:Z("flex items-center gap-1.5 text-ink",v&&"text-ink-3"),children:[x==="running"&&(0,n.jsx)(He,{className:"h-3 w-3 animate-spin"}),k]})]})]}),!v&&(0,n.jsxs)("p",{className:"mt-3 text-sm text-ink",children:["Approve it in the"," ",(0,n.jsx)(Pn,{className:"font-medium text-accent hover:underline",to:vi(i,"review"),children:"Review tab"})," ","to finish the test. You can also cancel the request."]}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,n.jsx)(D,{asChild:!0,size:"sm",variant:"secondary",children:(0,n.jsx)(Pn,{to:vi(i,"review"),children:"Open Review tab"})}),x==="waiting"&&c&&o&&(0,n.jsx)(D,{size:"sm",variant:"ghost",onClick:r(()=>p.mutate(),"onClick"),disabled:p.isPending,children:p.isPending?"Cancelling…":"Cancel this request"})]})]})}r(Gx,"AskFirstResult");function Hx({entry:e,connectionId:t,agent:s,allAgents:i,onSelectAgent:a}){const o=e.title??e.toolName,l=`${vi(t,"permissions")}?focus=${encodeURIComponent(e.id)}`,c=i.filter(h=>h.id!==s.id),d=e.status==="quarantined"?"This action is new and hasn't been turned on yet.":`${s.name}'s access profile sets this action to Off.`,{lastChangedAt:m,lastChangedByName:u}=s.effectiveAccess,p=e.status!=="quarantined"&&m?`Last changed${u?` by ${u}`:""} · ${la(new Date(m))}`:null;return(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-(--gtc-62)",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(bm,{className:"mt-0.5 h-4 w-4 shrink-0 text-ink-3"}),(0,n.jsxs)("div",{className:"text-sm text-ink-3",children:[(0,n.jsxs)("p",{className:"font-medium text-ink",children:[o," is off for ",s.name,"."]}),(0,n.jsx)("p",{className:"mt-0.5",children:"It won't run here, and it won't run from a task either."}),(0,n.jsxs)("p",{className:"mt-2",children:["Want to test it? Turn it on for ",s.name," in"," ",(0,n.jsx)(Pn,{className:"font-medium text-accent hover:underline",to:vi(t,"permissions"),children:"Permissions"})," ","— set it to Allowed or Ask first."]})]})]}),(0,n.jsx)(D,{asChild:!0,size:"sm",children:(0,n.jsx)(Pn,{to:l,children:"Open Permissions →"})}),(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["No call will be made — this action is off for ",s.name,"."]})]}),(0,n.jsxs)("aside",{children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Why this is off"}),(0,n.jsx)("p",{className:"mt-1.5 text-xs text-ink-3",children:d}),p&&(0,n.jsx)("p",{className:"mt-1.5 text-(length:--text-micro) text-ink-3",children:p}),c.length>0&&(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-(length:--text-micro) font-medium text-ink-3",children:"Try as a different agent:"}),(0,n.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:c.slice(0,4).map(h=>(0,n.jsx)("button",{type:"button",onClick:r(()=>a(h.id),"onClick"),className:"rounded-full border border-line px-2.5 py-1 text-(length:--text-micro) font-medium text-ink hover:bg-bg-3",children:h.name},h.id))})]})]})]})}r(Hx,"OffExplanation");function bi(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}r(bi,"safeStringify");function Yx(e){return e==="grant_credential_invalid"||e==="oauth_insufficient_scope"}r(Yx,"isReconnectError");function Xx(e,t){if(t==="grant_credential_invalid")return["Ask the connection owner to reconnect it from Connectors with a fresh key or server URL."];if(t==="oauth_insufficient_scope")return["Reconnect the app and allow the permissions required for this action."];const s=`${t??""} ${e}`.toUpperCase();return s.includes("NOT_FOUND")?["Double-check the ID or name you entered — pick it from a dropdown if one is offered.","Make sure this agent has access to that resource in the connected account."]:s.includes("PERMISSION")||s.includes("FORBIDDEN")||s.includes("UNAUTHORIZED")?["The connected account may not have permission for this action.","Reconnect the app from Setup if its access was recently changed."]:s.includes("INVALID_ARGUMENT")||s.includes("INVALID")||s.includes("BAD_REQUEST")?["Check the field formats above — a value may be the wrong type or shape.","Open “More options” to confirm any advanced fields are filled in correctly."]:s.includes("RATE_LIMIT")||s.includes("RESOURCE_EXHAUSTED")||s.includes("429")?["The app is rate-limiting calls right now — wait a moment and run it again."]:["Check the inputs above and try again."]}r(Xx,"errorHints");function sE({afterAgentAccess:e,connectionId:t,appName:s,agents:i,access:a,install:o,readOnly:l,canChange:c,quarantined:d,enabledIds:m,askFirstIds:u,pending:p,onSaveAccess:h,onSetActionPermission:x,onReviewQuarantined:g,onRefreshActions:j,refreshPending:k,capabilities:v,permissionChangeWarning:w,actions:_}){const[N]=sa();return(0,n.jsxs)("div",{className:"space-y-10",children:[(0,n.jsx)(Jx,{agents:i,access:a,install:o,capabilities:v,disabled:p,onSave:h}),e,_!==void 0?_:(0,n.jsx)(ih,{connectionId:t,appName:s,readOnly:l,canChange:c,quarantined:d,enabledIds:m,askFirstIds:u,disabled:p,refreshPending:k,focusId:N.get("focus"),canConfigure:v?.canConfigure??!1,permissionChangeWarning:w,onSetPermission:x,onReviewQuarantined:g,onRefreshActions:j},t)]})}r(sE,"PermissionsPanel");function Jx({agents:e,access:t,install:s,capabilities:i,disabled:a,onSave:o}){const l=e.filter(h=>h.status!=="terminated"),c=i?.canConfigure??!1,d=i?.editableAgentIds,m=d?l.filter(h=>d.includes(h.id)):l,u=l.filter(h=>t.agentIds.has(h.id)),p=s.agentIds;return(0,n.jsxs)("section",{className:"space-y-4 border-t border-line pt-8",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Which agents can use this connection?"}),a?(0,n.jsx)("span",{className:"text-xs text-ink-3",children:"Saving…"}):null]}),c?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(gi,{ariaLabel:"Which agents can use this connection",value:t.mode,disabled:a,className:"sm:grid-cols-2",onValueChange:r(h=>{o(h==="all"?{mode:"all",agentIds:new Set}:{mode:"specific",agentIds:new Set([...t.agentIds,...p])})},"onValueChange"),options:[{value:"specific",title:"Just agents I pick",description:s.onAll?"Unavailable while this connection is installed for every agent.":"Available only to selected agents.",disabled:s.onAll},{value:"all",title:"Any agent",description:"Available across your company."}]}),t.mode==="specific"?(0,n.jsx)(Mm,{agents:m,selectedAgentIds:t.agentIds,disabled:a,triggerLabel:t.agentIds.size===0?"Choose agents":`${t.agentIds.size} ${t.agentIds.size===1?"agent":"agents"} selected`,emptyMessage:"You cannot edit any agents yet.",isAgentDisabled:r(h=>p.has(h.id),"isAgentDisabled"),getDescription:r(h=>p.has(h.id)?"Required by this connection's install setting":h.title,"getDescription"),onChange:r(h=>o({mode:"specific",agentIds:new Set([...h,...p])}),"onChange")}):null]}):t.mode==="all"?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Any agent can use this connection."}):u.length===0?(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"No agents can use this connection."}):(0,n.jsx)("div",{className:"space-y-0.5",children:u.map(h=>(0,n.jsxs)("div",{className:"flex items-center gap-2 px-1.5 py-1 text-sm",children:[(0,n.jsx)(yr,{agent:h,size:16,className:"h-4 w-4 shrink-0 text-ink-3"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-ink",children:h.name})]},h.id))})]})}r(Jx,"AgentAccessSection");function ih({connectionId:e,appName:t,readOnly:s,canChange:i,quarantined:a,enabledIds:o,askFirstIds:l,disabled:c,refreshPending:d,focusId:m,canConfigure:u,permissionChangeWarning:p,onSetPermission:h,onReviewQuarantined:x,onRefreshActions:g}){const[j,k]=(0,f.useState)(""),[v,w]=(0,f.useState)("all"),[_,N]=(0,f.useState)(!1),P=r((E,C)=>(E.title??E.toolName).localeCompare(C.title??C.toolName),"byName"),b=(0,f.useMemo)(()=>[...s].sort(P),[s]),I=(0,f.useMemo)(()=>[...i].sort(P),[i]),L=r(E=>{const C=j.trim().toLowerCase();return C?(E.title??E.toolName).toLowerCase().includes(C)||(E.description??"").toLowerCase().includes(C):!0},"matches"),R=v==="write"?[]:b.filter(L),F=v==="read"?[]:I.filter(L),T=R.length+F.length;return(0,n.jsxs)("section",{className:"space-y-6 border-t border-line pt-8",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-ink",children:"Actions"}),u?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[c?(0,n.jsx)("span",{className:"text-xs text-ink-3",children:"Saving…"}):null,(0,n.jsxs)(D,{variant:"secondary",size:"sm",onClick:g,disabled:d||c,children:[d?(0,n.jsx)(He,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(Bg,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh actions"]})]}):null]}),u&&a.length>0?(0,n.jsx)(Ex,{entries:a,disabled:c,onSubmit:x}):null,p&&_?(0,n.jsx)(dt,{tone:"warning",compact:!0,children:p}):null,(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("div",{className:"relative min-w-(--sz-12rem) flex-1",children:[(0,n.jsx)(oa,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-3"}),(0,n.jsx)(Ce,{"aria-label":"Find an action",placeholder:"Find an action…",className:"pl-9",value:j,onChange:r(E=>k(E.target.value),"onChange")})]}),(0,n.jsx)(La,{label:`All ${s.length+i.length}`,active:v==="all",onClick:r(()=>w("all"),"onClick")}),(0,n.jsx)(La,{label:`Read ${s.length}`,active:v==="read",onClick:r(()=>w("read"),"onClick")}),(0,n.jsx)(La,{label:`Write ${i.length}`,active:v==="write",onClick:r(()=>w("write"),"onClick")})]}),(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:[T," matches · sorted A–Z"]})]}),T===0?(0,n.jsxs)("div",{className:"py-6 text-center text-sm text-ink-3",children:["No actions match “",j,"”. Clear the search to see them all."]}):(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)(sd,{title:`Read (${R.length})`,actions:R,connectionId:e,appName:t,enabledIds:o,askFirstIds:l,disabled:c,focusId:m,canConfigure:u,onSetPermission:r((E,C)=>{N(!0),h(E,C)},"onSetPermission")}),(0,n.jsx)(sd,{title:`Write (${F.length})`,actions:F,connectionId:e,appName:t,enabledIds:o,askFirstIds:l,disabled:c,focusId:m,canConfigure:u,onSetPermission:r((E,C)=>{N(!0),h(E,C)},"onSetPermission")})]})]})}r(ih,"ActionsSection");function La({label:e,active:t,onClick:s}){return(0,n.jsx)(ox,{selected:t,onClick:s,children:e})}r(La,"FilterChip");function sd({title:e,actions:t,connectionId:s,appName:i,enabledIds:a,askFirstIds:o,disabled:l,focusId:c,canConfigure:d,onSetPermission:m}){if(t.length===0)return null;const u=(()=>{const p=Fa(t[0].id,a,o);return t.every(h=>Fa(h.id,a,o)===p)?p:""})();return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:e}),d?(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,n.jsx)("span",{className:"sr-only",children:`Set every action in ${e}`}),(0,n.jsxs)("select",{"aria-label":`Set every action in ${e}`,value:u,disabled:l,onChange:r(p=>{m(t.map(h=>h.id),p.target.value)},"onChange"),className:"h-7 rounded-md border border-line-strong bg-bg px-2 text-xs text-ink outline-none focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus/30",children:[u===""?(0,n.jsx)("option",{value:"",children:"Mixed"}):null,So.map(p=>(0,n.jsx)("option",{value:p.value,children:`Set all: ${p.label}`},p.value))]})]}):null]}),(0,n.jsx)("div",{className:"divide-y divide-line",children:t.map(p=>(0,n.jsx)(Qx,{action:p,connectionId:s,appName:i,value:Fa(p.id,a,o),disabled:l,focused:c===p.id,canConfigure:d,onSetPermission:m},p.id))})]})}r(sd,"ActionGroup");var So=[{value:"off",label:"Off",description:"Agents cannot run this action.",icon:bm},{value:"ask",label:"Ask first",description:"A human must approve each call.",icon:Tm},{value:"allowed",label:"Allowed",description:"Runs without approval.",icon:ut}];function Qx({action:e,connectionId:t,appName:s,value:i,disabled:a,focused:o,canConfigure:l,onSetPermission:c}){const d=(0,f.useRef)(null),[m,u]=(0,f.useState)(!1),p=e.title??e.toolName;return(0,f.useEffect)(()=>{o&&d.current?.scrollIntoView({behavior:"smooth",block:"center"})},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{ref:d,className:Z("flex flex-col gap-3 py-3 sm:flex-row sm:items-center",o&&"rounded-md bg-accent/5 ring-2 ring-accent/40"),"data-action-id":e.id,children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-ink",children:p}),(0,n.jsx)("span",{className:"rounded-full border border-line px-1.5 py-px text-xs font-medium uppercase tracking-wide text-ink-3",title:`Wardmote classified this action as ${e.riskLevel}`,children:e.riskLevel})]}),e.description?(0,n.jsx)("div",{className:"truncate text-xs text-ink-3",children:e.description}):null]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[l?(0,n.jsx)(Gg,{children:(0,n.jsx)("div",{role:"radiogroup","aria-label":`${p} permission`,className:"inline-flex rounded-md border border-line bg-bg-3/40 p-0.5",children:So.map(h=>{const x=h.icon,g=h.value===i;return(0,n.jsxs)(Im,{children:[(0,n.jsx)(Rm,{asChild:!0,children:(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":g,"aria-label":`${p}: ${h.label}`,disabled:a,onClick:r(()=>c([e.id],h.value),"onClick"),className:Z("flex h-8 w-8 items-center justify-center rounded-sm text-ink-3 outline-none transition-colors","hover:bg-bg hover:text-ink focus-visible:ring-2 focus-visible:ring-focus","disabled:cursor-not-allowed disabled:opacity-50",g&&"bg-bg text-ink shadow-xs"),children:(0,n.jsx)(x,{className:"h-3.5 w-3.5"})})}),(0,n.jsxs)(_m,{side:"top",children:[(0,n.jsx)("span",{className:"font-medium",children:h.label})," — ",h.description]})]},h.value)})})}):(0,n.jsx)("span",{className:"text-sm text-ink-3",children:So.find(h=>h.value===i)?.label}),(0,n.jsxs)(D,{type:"button",size:"sm",variant:"secondary",onClick:r(()=>u(!0),"onClick"),children:[(0,n.jsx)(Lg,{className:"mr-1.5 h-3.5 w-3.5"}),"Test"]})]})]}),(0,n.jsx)(Rx,{connectionId:t,appName:s,entry:e,open:m,onOpenChange:u})]})}r(Qx,"ActionRow");function Fa(e,t,s){return t.has(e)?s.has(e)?"ask":"allowed":"off"}r(Fa,"actionPermission");function Zx({providerName:e,connected:t=!0,canReconnect:s=!0,canDisconnect:i=!0,busy:a=!1,onReconnect:o,onManage:l,onDisconnect:c}){const[d,m]=(0,f.useState)(!1);return(0,n.jsxs)("section",{className:"space-y-4",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Connection settings"}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,n.jsx)(D,{variant:"secondary",disabled:!s||a,onClick:o,children:"Reconnect"}),(0,n.jsxs)(D,{variant:"secondary",onClick:l,children:["Manage in ",e]}),t&&i&&(0,n.jsxs)(vg,{open:d,onOpenChange:r(u=>{a||m(u)},"onOpenChange"),children:[(0,n.jsx)(pg,{asChild:!0,children:(0,n.jsx)(D,{variant:"danger",children:"Disconnect"})}),(0,n.jsxs)(hg,{children:[(0,n.jsxs)(yg,{children:[(0,n.jsxs)(mg,{children:["Disconnect ",e,"?"]}),(0,n.jsx)(ug,{children:"Delete this connection’s saved credentials and stop further calls through Wardmote. Other connections are unaffected. Actions already sent to the provider may still complete. Connecting again requires a new sign-in or key."})]}),(0,n.jsxs)(gg,{children:[(0,n.jsx)(xg,{disabled:a,children:"Cancel"}),(0,n.jsx)(fg,{disabled:a,onClick:r(async u=>{u.preventDefault();try{await c(),m(!1)}catch{}},"onClick"),children:a?"Disconnecting…":"Disconnect connection"})]})]})]})]})]})}r(Zx,"RemoteMcpManagement");var id=["connect"],e0="h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50";function Va({label:e,children:t}){const[s,i]=(0,f.useState)(!1);return(0,n.jsxs)(Im,{open:s,onOpenChange:i,children:[(0,n.jsx)(Rm,{asChild:!0,children:(0,n.jsx)("button",{type:"button","aria-label":`Help with ${e}`,onClick:r(()=>i(!s),"onClick"),className:"rounded-sm text-ink-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,n.jsx)(Cg,{className:"size-4"})})}),(0,n.jsx)(_m,{className:"max-w-xs",children:t})]})}r(Va,"FieldHelp");function t0({provider:e,state:t,actions:s,agents:i,companyId:a,connectionId:o,fixedGrantKind:l,lockedAgentId:c,host:d="page",authorizationUrl:m,upstreamServiceName:u,onCancel:p,additionalSettings:h,settingsValid:x=!0}){const g=(0,f.useId)(),j=(0,f.useRef)(null),k=(0,f.useRef)(t.step),[v,w]=(0,f.useState)(()=>!!(e.defaultUrl&&t.url!==e.defaultUrl));(0,f.useEffect)(()=>{k.current!==t.step&&j.current?.focus(),k.current=t.step},[t.step]);const _=id.indexOf(t.step),N=t.connectStatus==="connecting",P=r(C=>s.edit(C),"change"),b=r((C,z)=>(0,n.jsxs)(D,{type:"button",variant:"link",className:"h-auto p-0 text-sm underline",onClick:r(()=>s.openProvider(C),"onClick"),children:[z,(0,n.jsx)(aa,{className:"size-3.5","aria-hidden":"true"})]}),"external"),I=(0,n.jsxs)(dt,{compact:!0,children:["Wardmote controls access to the tools listed here. App and action permissions inside these tools are managed in ",b("manage",e.name),"."]}),L=r(C=>(0,n.jsx)(qg,{onSaveExit:s.saveExit,disabled:N,children:C}),"footer"),R="oauth",F=r(C=>(0,n.jsx)(gc,{companyId:a,...a?{}:{agents:i},sentence:na({grantKind:t.grantKind,authKind:R,installChoice:t.allAgents?"all":"specific",installCount:t.agentIds.length,lockedAgentId:c,preserveAgentAccess:t.setupComplete}),extra:C,forceOpen:t.auth!==(e.supportsBrowserAuth?"auto":"none")||t.connectStatus==="rejected",disabled:N,authKind:R,grantKinds:l?[l]:void 0,grantKind:t.grantKind,setGrantKind:r(z=>{z!=="agent"&&P({grantKind:z})},"setGrantKind"),installChoice:t.allAgents?"all":"specific",setInstallChoice:r(z=>P({allAgents:z==="all"}),"setInstallChoice"),installAgentIds:new Set(t.agentIds),setInstallAgentIds:r(z=>P({agentIds:[...z]}),"setInstallAgentIds"),lockedAgentId:c,preserveAgentAccess:t.setupComplete}),"defaults"),T=t.connectStatus==="invalid_url"?{title:"Enter a valid MCP URL",body:"Paste the complete server URL, including https:// or http://. A dashboard page is not an MCP endpoint."}:t.connectStatus==="oauth_failed"?{title:`${e.name} couldn’t connect`,body:"Authorization did not complete. Your saved connection is still here, so you can try again."}:t.connectStatus==="rejected"?{title:"Credentials were rejected",body:`Check or replace the credentials from ${e.name}, then reconnect. Your agent access and tool choices are preserved.`}:t.connectStatus==="unreachable"?{title:"Wardmote could not reach this server",body:"Check that the endpoint is running and reachable from Wardmote, then try again. Your draft is still here."}:null,E=(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-url`,children:"MCP server URL"}),(0,n.jsx)(Va,{label:"MCP server URL",children:e.urlHelp})]}),(0,n.jsx)(Ce,{id:`${g}-url`,type:"password",autoComplete:"off",spellCheck:!1,placeholder:e.placeholder,value:t.url,"aria-invalid":t.connectStatus==="invalid_url","aria-describedby":`${g}-url-help`,onChange:r(C=>P({url:C.target.value}),"onChange")}),(0,n.jsx)("p",{id:`${g}-url-help`,className:"text-xs text-ink-3",children:e.urlHelp}),e.id==="executor"?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-management`,children:"Console URL (optional)"}),(0,n.jsx)(Va,{label:"Executor console URL",children:"The URL of your Executor organization’s integrations page. Used to open and manage imported accounts."})]}),(0,n.jsx)(Ce,{id:`${g}-management`,type:"url",value:t.managementUrl??"",placeholder:"https://executor.sh/your-organization/integrations",onChange:r(C=>P({managementUrl:C.target.value}),"onChange")})]}):null]});return(0,n.jsxs)("div",{className:d==="dialog"?"min-w-0 text-ink":"mx-auto max-w-6xl p-4 text-ink sm:p-8","data-remote-mcp-provider":e.id,children:[(0,n.jsx)(Rl,{headingRef:j,appIdentity:{name:e.name,logoUrl:null},title:u?`Connect ${u} through ${e.name}`:t.step==="draft"?"Continue your setup":t.setupComplete?t.step==="access"?"Who can use this connection":t.step==="connect"?`Reconnect ${e.name}`:e.name:void 0,subtitle:_>=0&&!t.setupComplete?`Wardmote will use ${e.name} on your behalf.`:t.step==="draft"?`Your ${e.name} setup is ready to resume.`:t.step==="permissions"?`Connected${t.identity?` as ${t.identity}`:""} · ${t.tools.length} actions available`:`Manage this ${e.name} connection.`,step:_>=0&&!t.setupComplete?"key":"gallery",activeIndex:_,labels:id.map(()=>"Connect"),onCancel:N||t.step==="management"||t.step==="permissions"||t.step==="draft"?void 0:p??s.saveExit}),(0,n.jsxs)("main",{className:"space-y-6",children:[u&&(0,n.jsxs)(dt,{compact:!0,children:[e.name," handles the connection and requests to ",u,". ",e.id==="composio"?"After connecting this account, sign in to the app in Composio.":"Manage app sign-in in the provider, then refresh your gateway here."]}),t.notice&&(0,n.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:t.notice}),t.step==="access"&&(0,n.jsx)(fc,{agents:i,lockedAgentId:c,authKind:"oauth",grantKinds:l?[l]:void 0,grantKind:t.grantKind,setGrantKind:r(C=>{C!=="agent"&&P({grantKind:C})},"setGrantKind"),installChoice:t.allAgents?"all":"specific",setInstallChoice:r(C=>P({allAgents:C==="all"}),"setInstallChoice"),installAgentIds:new Set(t.agentIds),setInstallAgentIds:r(C=>P({agentIds:[...C]}),"setInstallAgentIds"),submitLabel:t.setupComplete?"Done":"Continue",onBack:t.setupComplete?s.finish:s.saveExit,onContinue:t.setupComplete?s.finish:()=>s.navigate("connect")}),t.step==="permissions"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Permissions"}),(0,n.jsx)(D,{variant:"secondary",onClick:s.finish,children:"Connection settings"})]}),t.tools.some(C=>C.broad)&&I,(0,n.jsx)(ih,{connectionId:o,appName:e.name,readOnly:t.tools.filter(C=>C.isReadOnly),canChange:t.tools.filter(C=>!C.isReadOnly),quarantined:[],enabledIds:new Set(t.tools.filter(C=>t.permissions[C.id]!=="off").map(C=>C.id)),askFirstIds:new Set(t.tools.filter(C=>t.permissions[C.id]==="ask_first").map(C=>C.id)),disabled:!t.connected,refreshPending:t.refreshing,canConfigure:!0,onSetPermission:r((C,z)=>P({permissions:{...t.permissions,...Object.fromEntries(C.map(W=>[W,z==="ask"?"ask_first":z]))}}),"onSetPermission"),onReviewQuarantined:r(()=>{},"onReviewQuarantined"),onRefreshActions:s.refresh})]}),(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-6",children:[t.step==="connect"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("ol",{className:"list-decimal space-y-2 pl-5 text-sm",children:e.instructions.map(C=>(0,n.jsx)("li",{children:C},C))}),b("setup",`Open ${e.name} setup guide`)]}),t.connectStatus==="sign_in"&&e.supportsBrowserAuth?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{role:"status",children:(0,n.jsx)(dt,{title:`Finish signing in to ${e.name}`,children:"Complete sign-in in the provider window, then return here. Wardmote is waiting for confirmation."})}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:["If a window did not open, ",m?(0,n.jsx)("a",{className:"text-current underline",href:m,onClick:r(()=>s.openProvider("sign_in"),"onClick"),target:"_blank",rel:"noopener noreferrer",children:"open sign-in again"}):b("sign_in","open sign-in again"),"."]}),L((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D,{variant:"secondary",onClick:s.cancelConnect,children:"Cancel sign-in"}),(0,n.jsx)(D,{disabled:!0,children:"Waiting for sign-in"})]}))]}):(0,n.jsxs)("form",{className:"space-y-6",onSubmit:r(C=>{C.preventDefault(),s.connect()},"onSubmit"),children:[T&&(0,n.jsx)("div",{role:"alert",children:(0,n.jsx)(dt,{tone:"danger",title:T.title,children:T.body})}),t.connectStatus==="cancelled"&&(0,n.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Connection cancelled. Your setup details are preserved; try again when you are ready."}),(0,n.jsxs)("fieldset",{disabled:N,className:"min-w-0 space-y-5",children:[e.defaultUrl?(0,n.jsxs)(kl,{open:v||t.connectStatus==="invalid_url",onOpenChange:w,children:[(0,n.jsx)(jl,{asChild:!0,children:(0,n.jsx)(D,{type:"button",variant:"link",className:"h-auto p-0 text-sm underline underline-offset-2",children:"Reuse an existing session"})}),(0,n.jsx)(bl,{className:"mt-3",children:E})]}):E,F((0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-ink",children:"Authentication"}),(0,n.jsx)("p",{className:"text-sm text-ink-3",children:e.authHelp}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-auth`,children:"Sign-in method"}),(0,n.jsxs)("select",{id:`${g}-auth`,className:e0,value:t.auth,onChange:r(C=>P({auth:C.target.value}),"onChange"),children:[e.supportsBrowserAuth&&(0,n.jsx)("option",{value:"auto",children:"Automatic (sign in if required)"}),(0,n.jsx)("option",{value:"bearer",children:"Bearer token"}),(0,n.jsx)("option",{value:"headers",children:"Custom headers"}),(0,n.jsx)("option",{value:"none",children:"No additional authentication"})]})]}),t.auth==="bearer"&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(dn,{htmlFor:`${g}-token`,children:"Bearer token"}),(0,n.jsx)(Va,{label:"bearer token",children:"Paste the token only, without the word Bearer. It is kept in the connection’s credentials."})]}),(0,n.jsx)(Ce,{id:`${g}-token`,type:"password",autoComplete:"off",value:t.token,onChange:r(C=>P({token:C.target.value}),"onChange")})]}),(t.auth==="bearer"||t.auth==="headers")&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:t.auth==="bearer"?"Additional headers":"Headers"}),t.headers.map((C,z)=>(0,n.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)(dn,{htmlFor:`${g}-${C.id}-name`,children:["Header ",z+1," name"]}),(0,n.jsx)(Ce,{id:`${g}-${C.id}-name`,value:C.name,placeholder:e.id==="arcade"?"Arcade-User-ID":"Header name",onChange:r(W=>P({headers:t.headers.map(G=>G.id===C.id?{...G,name:W.target.value}:G)}),"onChange")})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)(dn,{htmlFor:`${g}-${C.id}-value`,children:["Header ",z+1," value"]}),(0,n.jsx)(Ce,{id:`${g}-${C.id}-value`,type:"password",autoComplete:"off",value:C.value,onChange:r(W=>P({headers:t.headers.map(G=>G.id===C.id?{...G,value:W.target.value}:G)}),"onChange")})]}),(0,n.jsx)(D,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove header ${z+1}`,onClick:r(()=>P({headers:t.headers.filter(W=>W.id!==C.id)}),"onClick"),children:(0,n.jsx)(Pm,{className:"size-4"})})]},C.id)),(0,n.jsxs)(D,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>P({headers:[...t.headers,{id:crypto.randomUUID(),name:"",value:""}]}),"onClick"),children:[(0,n.jsx)(Al,{className:"size-4"}),"Add header"]})]})]}))]}),h,N&&(0,n.jsxs)("p",{role:"status",className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(He,{className:"size-4 animate-spin motion-reduce:animate-none"}),"Connecting and discovering tools…"]}),L((0,n.jsxs)(n.Fragment,{children:[t.setupComplete?(0,n.jsx)(D,{type:"button",variant:"secondary",disabled:N,onClick:s.finish,children:"Back"}):(0,n.jsx)("span",{}),(0,n.jsx)(D,{type:"submit",disabled:N||!t.url.trim()||!x,children:N?"Connecting…":T||t.connectStatus==="cancelled"?"Try again":`Connect ${e.name}`})]}))]})]}),t.step==="management"&&(0,n.jsxs)(n.Fragment,{children:[t.connected?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(go,{className:"size-4"}),"Connected",t.identity?` as ${t.identity}`:""]}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:[t.grantKind==="user"?"Just me":"Any human in the organization"," · ",t.tools.length," tools · ",t.allAgents?"Any agent":`${t.agentIds.length} agents with access`]})]}):(0,n.jsx)(dt,{tone:"warning",title:"Disconnected",children:"Agents cannot use this connection. Reconnect to restore access under the saved permission choices."}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(D,{onClick:r(()=>s.navigate("access"),"onClick"),children:"Who can use this connection"}),(0,n.jsx)(D,{variant:"secondary",disabled:!t.connected,onClick:r(()=>s.navigate("permissions"),"onClick"),children:"Permissions"})]}),(0,n.jsxs)("p",{className:"text-sm text-ink-3",children:["Refresh the catalog after changing tools in ",e.name,". Existing Off and Ask first choices are preserved."]}),(0,n.jsx)(D,{variant:"secondary",disabled:!t.connected||t.refreshing,onClick:s.refresh,children:t.refreshing?"Refreshing…":"Refresh tools"}),(0,n.jsx)(Zx,{providerName:e.name,connected:t.connected,onReconnect:s.reconnect,onManage:r(()=>s.openProvider("manage"),"onManage"),onDisconnect:s.disconnect})]}),t.step==="draft"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm",children:"Your access choices and setup progress are kept with this connection."}),(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)(D,{onClick:s.resumeDraft,children:"Resume setup"})})]})]})]})]})}r(t0,"RemoteMcpConnectionSetup");function n0(e){try{const t=JSON.parse(sessionStorage.getItem(e)??"null");return!t||!["organization","user"].includes(t.grantKind)||typeof t.allAgents!="boolean"||!Array.isArray(t.agentIds)?{}:{grantKind:t.grantKind,allAgents:t.allAgents,agentIds:t.agentIds.filter(s=>typeof s=="string")}}catch{return{}}}r(n0,"readAccessDraft");function s0({providerId:e,connection:t,host:s="page",interactionId:i,upstreamServiceName:a,requestedAgentId:o,existingConnections:l=[],forceNewConnection:c,onUseExisting:d,onComplete:m,onCancel:u,onPhaseChange:p}){const h=rg[e],x=fi(e)?.agentInstructions,[g,j]=(0,f.useState)(()=>t?t.agentInstructions??(x?{...Ls(x),enabled:!1}:null):Ls(x)),k=!g||!!g.text.trim(),{selectedCompanyId:v}=us(),w=wm(),[_]=sa();let N=_.get("targetToolkit");if(!N&&t&&s==="page")try{N=sessionStorage.getItem(`wardmote:mcp-upstream-app:${v}:${t.id}`)}catch{}const P=vm(e,N),b=P?.routes.find(H=>H.provider===e);a??=P?.name;const I=t?_.get("oauth"):null,L=Bt(),R=`wardmote:mcp-access-draft:${v}:${i||e}`,F=`wardmote:mcp-intent-draft:${v}:${i}`,T=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>{T.current?.close(),T.current=null},[]);const[E,C]=(0,f.useState)(!t&&!c&&l.length>0&&!!d),[z,W]=(0,f.useState)(null),[G,V]=(0,f.useState)(null),B=(0,f.useRef)(t),O=(0,f.useRef)(!1),y=(0,f.useRef)(void 0),[M,q]=(0,f.useState)(()=>({step:"connect",grantKind:t?t.credentialPolicy==="per_user"?"user":"organization":o?"user":"organization",setupComplete:!!(t&&t.status!=="draft"),url:typeof t?.config?.url=="string"?t.config?.url:h.defaultUrl,managementUrl:typeof t?.config?.managementUrl=="string"?t.config.managementUrl:"",auth:t?.config?.mcpAuthMode==="bearer"?"bearer":t?.authKind==="api_key"?"headers":h.supportsBrowserAuth?"auto":"none",token:"",headers:[],connectStatus:I==="denied"?"cancelled":I==="failed"?"oauth_failed":"idle",connected:!1,identity:null,allAgents:!0,agentIds:[],permissions:{},tools:[],notice:t?.authKind==="api_key"?"Saved credentials are retained when these fields are left blank. Enter a replacement only to change them.":null,refreshing:!1,...t?{}:n0(R),...o?{allAgents:!1,agentIds:[o]}:{}})),ne=ue({queryKey:ge.tools.connectionInstalls(t?.id??"__new__"),queryFn:r(()=>_e.getConnectionInstalls(t.id),"queryFn"),enabled:!!t}),Ne=ue({queryKey:ge.agents.list(v),queryFn:r(()=>Ee.list(v),"queryFn"),enabled:!!v});(0,f.useEffect)(()=>{ne.data&&!o&&q(H=>({...H,allAgents:ne.data.installs.some(pe=>pe.targetType==="company"),agentIds:ne.data.installs.filter(pe=>pe.targetType==="agent").map(pe=>pe.targetId)}))},[ne.data,o]),(0,f.useEffect)(()=>{if(!t)try{sessionStorage.setItem(R,JSON.stringify({grantKind:M.grantKind,allAgents:M.allAgents,agentIds:M.agentIds}))}catch{}},[t,R,M.grantKind,M.allAgents,M.agentIds]),(0,f.useEffect)(()=>{if(s!=="dialog"||!i)return;const H=r(pe=>{const Se=yf(pe,window.location.origin,i);Se&&(Se==="connected"?m?.({resolvedByCallback:!0}):(q(ae=>({...ae,connectStatus:Se==="declined"?"cancelled":"oauth_failed"})),p?.("needs_retry")))},"receive");return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[s,i,m,p]);const we=r(H=>q(pe=>({...pe,...H})),"edit"),X=r(async H=>{try{sessionStorage.removeItem(R)}catch{}if(await L.invalidateQueries({queryKey:["tools"]}),Ic(e)&&sg(L).then(pe=>{const Se=ge.tools.aggregatorApps(H,pe);return L.fetchQuery({queryKey:[...Se,"sync"],queryFn:r(()=>_e.syncAggregatorApps(H),"queryFn"),staleTime:0}).then(ae=>L.setQueryData(Se,ae))}).catch(()=>{}),m)m({connectionId:H});else if(e==="composio"){try{sessionStorage.removeItem(`wardmote:mcp-upstream-app:${v}:${H}`)}catch{}w(`/apps/${H}/permissions`)}else if(s==="page"&&P&&b){try{sessionStorage.removeItem(`wardmote:mcp-upstream-app:${v}:${H}`)}catch{}w("/apps")}else Ic(e)?w("/apps"):w(`/apps/${H}/permissions`)},"finish"),ee=r(async(H=!1)=>{if(!(O.current||!v||!k||t&&!ne.data)){try{const pe=new URL(M.url.trim());if(!["http:","https:"].includes(pe.protocol))throw new Error}catch{we({connectStatus:"invalid_url"});return}if(!H&&s==="dialog"&&M.auth==="auto"&&(!T.current||T.current.closed))try{T.current=window.open("about:blank","wardmote-connection-oauth","popup,width=720,height=760,resizable=yes,scrollbars=yes")}catch{T.current=null}O.current=!0,we({connectStatus:"connecting",notice:null});try{const pe={};if(M.auth==="bearer"&&M.token.trim()&&(pe["credentials.authorization"]=M.token.trim()),M.auth==="headers"||M.auth==="bearer"){for(const te of M.headers)if(!(!te.name.trim()&&!te.value)){if(!te.name.trim()||!te.value)throw new Error("Enter both a name and value for each header.");pe[`headers.${te.name.trim()}`]=te.value}}const Se=e==="executor"&&M.managementUrl?.trim()?Kf("executor",M.managementUrl.trim()):null;if(e==="executor"&&M.managementUrl?.trim()&&!Se)throw new Error("Use an HTTPS console URL without credentials.");const ae=B.current,re=await _e.connectApp(v,{galleryKey:e,connectionMethodKey:Jf[e],name:h.name,link:M.url.trim(),grantKind:M.grantKind,authMode:M.auth==="headers"?"custom_headers":M.auth,credentialValues:pe,saveDraft:H,...x&&g?{agentInstructions:g}:{},...ae?ae.status==="draft"?{resumeConnectionId:ae.id}:{reconnectConnectionId:ae.id}:{}});if(Se&&(re.connection=await _e.updateConnection(re.connectionId,{config:{...re.connection.config,managementUrl:Se}})),B.current=re.connection,s==="page"&&b)try{sessionStorage.setItem(`wardmote:mcp-upstream-app:${v}:${re.connectionId}`,b.toolkit)}catch{}if(i)try{sessionStorage.setItem(F,re.connectionId)}catch{}if(!o&&(!ae||ae.status==="draft")&&await _e.putConnectionInstalls(re.connectionId,M.allAgents?[{targetType:"company",targetId:v}]:M.agentIds.map(te=>({targetType:"agent",targetId:te}))),H){u?u():w("/apps");return}if(re.auth?.kind==="oauth"){p?.("authorizing");const te=await _e.startOAuth(re.connectionId,{asCurrentUser:re.connection.credentialPolicy==="per_user",...i?{interactionId:i}:{}}),ve=Gm(te.authorizationUrl);if(!ve.ok)throw new Error(ve.message);y.current=ve.url,we({connectStatus:"sign_in",token:"",headers:[]});try{if(s==="dialog"){if(!T.current||T.current.closed)throw new Error("Sign-in window unavailable");T.current.location.assign(ve.url),T.current.focus()}else Hm(ve.url)}catch{we({notice:"Wardmote couldn’t open sign-in. Use the sign-in link below to continue."}),p?.("needs_retry")}return}T.current?.close(),T.current=null;{const te=new Set(re.catalog.filter(ve=>ve.status==="active").map(ve=>ve.id));await _e.finishApp(v,re.connectionId,{enabledCatalogEntryIds:[...te],askFirstCatalogEntryIds:qm(re,ve=>te.has(ve)),access:o?{agentIds:[o]}:M.allAgents?"all_agents":{agentIds:M.agentIds},...o?{preserveExistingAccess:!0}:{}})}await X(re.connectionId)}catch(pe){T.current?.close(),T.current=null,p?.("needs_retry"),we({connectStatus:"idle",notice:pe instanceof Error?pe.message:"Could not connect. Please try again."})}finally{O.current=!1}}},"submit"),le={edit:we,navigate:r(H=>we({step:H}),"navigate"),connect:r(()=>{ee()},"connect"),cancelConnect:r(()=>{O.current||(T.current?.close(),T.current=null,we({connectStatus:"cancelled"}),p?.("needs_retry"))},"cancelConnect"),openProvider:r(H=>{H==="sign_in"&&y.current?(T.current=null,we({connectStatus:"sign_in",notice:null}),p?.("authorizing")):window.open(h.setupUrl,"_blank","noopener,noreferrer")},"openProvider"),saveExit:r(()=>{O.current||(M.url.trim()?ee(!0):u?u():w("/apps"))},"saveExit"),resumeDraft:r(()=>we({step:"connect"}),"resumeDraft"),finish:r(()=>{B.current&&X(B.current.id)},"finish"),refresh:r(()=>{},"refresh"),reconnect:r(()=>we({step:"connect"}),"reconnect"),disconnect:r(()=>{},"disconnect")};return E&&d?(0,n.jsx)(Nx,{providerName:h.name,upstreamServiceName:a,connections:l,pendingId:z,error:G,onCancel:u,onConnectNew:r(()=>C(!1),"onConnectNew"),onSelect:r(H=>{W(H),V(null),d(H).catch(pe=>{V(pe instanceof Error?pe.message:"Could not use this connection."),W(null)})},"onSelect")}):t&&!ne.data?(0,n.jsxs)("div",{className:"space-y-3 p-8",children:[(0,n.jsx)("p",{children:ne.isError?"Could not load saved access. Retry before changing this connection.":"Loading saved access…"}),ne.isError&&(0,n.jsx)("button",{type:"button",className:"text-accent underline",onClick:r(()=>{ne.refetch()},"onClick"),children:"Try again"})]}):(0,n.jsx)(t0,{additionalSettings:x&&g?(0,n.jsx)(_l,{provider:h.name,template:x,value:g,onChange:j,disabled:M.connectStatus==="connecting"}):void 0,settingsValid:k,companyId:v,onCancel:u??(()=>w("/apps")),upstreamServiceName:a,host:s,lockedAgentId:o,authorizationUrl:y.current,provider:h,connectionId:B.current?.id??"",fixedGrantKind:B.current?B.current.credentialPolicy==="per_user"?"user":"organization":void 0,state:M,actions:le,agents:Ne.data??[]})}r(s0,"RemoteMcpProductionSetup");var Ol=(0,f.createContext)({});function Dl(e){const t=(0,f.useRef)(null);return t.current===null&&(t.current=e()),t.current}r(Dl,"useConstant");var i0=typeof window<"u",Br=i0?f.useLayoutEffect:f.useEffect,ca=(0,f.createContext)(null);function Ll(e,t){e.indexOf(t)===-1&&e.push(t)}r(Ll,"addUniqueItem");function $r(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}r($r,"removeItem");var en=r((e,t,s)=>s>t?t:s<e?e:s,"clamp"),da=r(()=>{},"warning"),ds=r(()=>{},"invariant"),Rn={},rh=r(e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),"isNumericalString"),ah=r(e=>typeof e=="object"&&e!==null,"isObject"),oh=r(e=>/^0[^.\s]+$/u.test(e),"isZeroValueString");function lh(e){let t;return()=>(t===void 0&&(t=e()),t)}r(lh,"memo");var It=r(e=>e,"noop"),Ei=r((...e)=>e.reduce((t,s)=>i=>s(t(i))),"pipe"),ji=r((e,t,s)=>{const i=t-e;return i?(s-e)/i:1},"progress"),Fl=class{static{r(this,"SubscriptionManager")}constructor(){this.subscriptions=[]}add(e){return Ll(this.subscriptions,e),()=>$r(this.subscriptions,e)}notify(e,t,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,t,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},St=r(e=>e*1e3,"secondsToMilliseconds"),Rt=r(e=>e/1e3,"millisecondsToSeconds"),ch=r((e,t)=>t?e*(1e3/t):0,"velocityPerSecond"),dh=r((e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,"calcBezier"),r0=1e-7,a0=12;function o0(e,t,s,i,a){let o,l,c=0;do l=t+(s-t)/2,o=dh(l,i,a)-e,o>0?s=l:t=l;while(Math.abs(o)>r0&&++c<a0);return l}r(o0,"binarySubdivide");function Ti(e,t,s,i){if(e===t&&s===i)return It;const a=r(o=>o0(o,0,1,e,s),"getTForX");return o=>o===0||o===1?o:dh(a(o),t,i)}r(Ti,"cubicBezier");var uh=r(e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,"mirrorEasing"),mh=r(e=>t=>1-e(1-t),"reverseEasing"),hh=Ti(.33,1.53,.69,.99),Vl=mh(hh),ph=uh(Vl),fh=r(e=>e>=1?1:(e*=2)<1?.5*Vl(e):.5*(2-Math.pow(2,-10*(e-1))),"anticipate"),Ul=r(e=>1-Math.sin(Math.acos(e)),"circIn"),gh=mh(Ul),xh=uh(Ul),l0=Ti(.42,0,1,1),c0=Ti(0,0,.58,1),yh=Ti(.42,0,.58,1),d0=r(e=>Array.isArray(e)&&typeof e[0]!="number","isEasingArray"),vh=r(e=>Array.isArray(e)&&typeof e[0]=="number","isBezierDefinition"),rd={linear:It,easeIn:l0,easeInOut:yh,easeOut:c0,circIn:Ul,circInOut:xh,circOut:gh,backIn:Vl,backInOut:ph,backOut:hh,anticipate:fh},u0=r(e=>typeof e=="string","isValidEasing"),ad=r(e=>{if(vh(e)){ds(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,s,i,a]=e;return Ti(t,s,i,a)}else if(u0(e))return ds(rd[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),rd[e];return e},"easingDefinitionToFunction"),or=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m0(e){let t=new Set,s=new Set,i=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(m){o.has(m)&&(d.schedule(m),e()),m(l)}r(c,"triggerCallback");const d={schedule:r((m,u=!1,p=!1)=>{const h=p&&i?t:s;return u&&o.add(m),h.add(m),m},"schedule"),cancel:r(m=>{s.delete(m),o.delete(m)},"cancel"),process:r(m=>{if(l=m,i){a=!0;return}i=!0;const u=t;t=s,s=u,t.forEach(c),t.clear(),i=!1,a&&(a=!1,d.process(m))},"process")};return d}r(m0,"createRenderStep");var h0=40;function bh(e,t){let s=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=r(()=>s=!0,"flagRunNextFrame"),l=or.reduce((_,N)=>(_[N]=m0(o),_),{}),{setup:c,read:d,resolveKeyframes:m,preUpdate:u,update:p,preRender:h,render:x,postRender:g}=l,j=r(()=>{const _=Rn.useManualTiming,N=_?a.timestamp:performance.now();s=!1,_||(a.delta=i?1e3/60:Math.max(Math.min(N-a.timestamp,h0),1)),a.timestamp=N,a.isProcessing=!0,c.process(a),d.process(a),m.process(a),u.process(a),p.process(a),h.process(a),x.process(a),g.process(a),a.isProcessing=!1,s&&t&&(i=!1,e(j))},"processBatch"),k=r(()=>{s=!0,i=!0,a.isProcessing||e(j)},"wake");return{schedule:or.reduce((_,N)=>{const P=l[N];return _[N]=(b,I=!1,L=!1)=>(s||k(),P.schedule(b,I,L)),_},{}),cancel:r(_=>{for(let N=0;N<or.length;N++)l[or[N]].cancel(_)},"cancel"),state:a,steps:l}}r(bh,"createRenderBatcher");var{schedule:Oe,cancel:_n,state:rt,steps:Ua}=bh(typeof requestAnimationFrame<"u"?requestAnimationFrame:It,!0),br;function p0(){br=void 0}r(p0,"clearTime");var pt={now:r(()=>(br===void 0&&pt.set(rt.isProcessing||Rn.useManualTiming?rt.timestamp:performance.now()),br),"now"),set:r(e=>{br=e,queueMicrotask(p0)},"set")},jh=r(e=>t=>typeof t=="string"&&t.startsWith(e),"checkStringStartsWith"),kh=jh("--"),f0=jh("var(--"),Bl=r(e=>f0(e)?g0.test(e.split("/*")[0].trim()):!1,"isCSSVariableToken"),g0=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function od(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}r(od,"containsCSSVariable");var zs={test:r(e=>typeof e=="number","test"),parse:parseFloat,transform:r(e=>e,"transform")},ki={...zs,transform:r(e=>en(0,1,e),"transform")},lr={...zs,default:1},ci=r(e=>Math.round(e*1e5)/1e5,"sanitize"),$l=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x0(e){return e==null}r(x0,"isNullish");var y0=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zl=r((e,t)=>s=>!!(typeof s=="string"&&y0.test(s)&&s.startsWith(e)||t&&!x0(s)&&Object.prototype.hasOwnProperty.call(s,t)),"isColorString"),wh=r((e,t,s)=>i=>{if(typeof i!="string")return i;const[a,o,l,c]=i.match($l);return{[e]:parseFloat(a),[t]:parseFloat(o),[s]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},"splitColor"),v0=r(e=>en(0,255,e),"clampRgbUnit"),Ba={...zs,transform:r(e=>Math.round(v0(e)),"transform")},ts={test:zl("rgb","red"),parse:wh("red","green","blue"),transform:r(({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+Ba.transform(e)+", "+Ba.transform(t)+", "+Ba.transform(s)+", "+ci(ki.transform(i))+")","transform")};function b0(e){let t="",s="",i="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}}r(b0,"parseHex");var No={test:zl("#"),parse:b0,transform:ts.transform},Pi=r(e=>({test:r(t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,"test"),parse:parseFloat,transform:r(t=>`${t}${e}`,"transform")}),"createUnitType"),cn=Pi("deg"),Zt=Pi("%"),ie=Pi("px"),j0=Pi("vh"),k0=Pi("vw"),ld={...Zt,parse:r(e=>Zt.parse(e)/100,"parse"),transform:r(e=>Zt.transform(e*100),"transform")},Ts={test:zl("hsl","hue"),parse:wh("hue","saturation","lightness"),transform:r(({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+Zt.transform(ci(t))+", "+Zt.transform(ci(s))+", "+ci(ki.transform(i))+")","transform")},Ze={test:r(e=>ts.test(e)||No.test(e)||Ts.test(e),"test"),parse:r(e=>ts.test(e)?ts.parse(e):Ts.test(e)?Ts.parse(e):No.parse(e),"parse"),transform:r(e=>typeof e=="string"?e:e.hasOwnProperty("red")?ts.transform(e):Ts.transform(e),"transform"),getAnimatableNone:r(e=>{const t=Ze.parse(e);return t.alpha=0,Ze.transform(t)},"getAnimatableNone")},w0=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C0(e){return isNaN(e)&&typeof e=="string"&&(e.match($l)?.length||0)+(e.match(w0)?.length||0)>0}r(C0,"test");var Ch="number",Ah="color",A0="var",S0="var(",cd="${}",N0=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vs(e){const t=e.toString(),s=[],i={color:[],number:[],var:[]},a=[];let o=0;return{values:s,split:t.replace(N0,l=>(Ze.test(l)?(i.color.push(o),a.push(Ah),s.push(Ze.parse(l))):l.startsWith(S0)?(i.var.push(o),a.push(A0),s.push(l)):(i.number.push(o),a.push(Ch),s.push(parseFloat(l))),++o,cd)).split(cd),indexes:i,types:a}}r(Vs,"analyseComplexValue");function E0(e){return Vs(e).values}r(E0,"parseComplexValue");function Sh({split:e,types:t}){const s=e.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=e[o],i[o]!==void 0){const l=t[o];l===Ch?a+=ci(i[o]):l===Ah?a+=Ze.transform(i[o]):a+=i[o]}return a}}r(Sh,"buildTransformer");function T0(e){return Sh(Vs(e))}r(T0,"createTransformer");var P0=r(e=>typeof e=="number"?0:Ze.test(e)?Ze.getAnimatableNone(e):e,"convertNumbersToZero"),R0=r((e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:P0(e),"convertToZero");function _0(e){const t=Vs(e);return Sh(t)(t.values.map((s,i)=>R0(s,t.split[i])))}r(_0,"getAnimatableNone$1");var Vt={test:C0,parse:E0,createTransformer:T0,getAnimatableNone:_0};function $a(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}r($a,"hueToRgb");function I0({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,t/=100,s/=100;let a=0,o=0,l=0;if(!t)a=o=l=s;else{const c=s<.5?s*(1+t):s+t-s*t,d=2*s-c;a=$a(d,c,e+1/3),o=$a(d,c,e),l=$a(d,c,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:i}}r(I0,"hslaToRgba");function zr(e,t){return s=>s>0?t:e}r(zr,"mixImmediate");var Me=r((e,t,s)=>e+(t-e)*s,"mixNumber$1"),za=r((e,t,s)=>{const i=e*e,a=s*(t*t-i)+i;return a<0?0:Math.sqrt(a)},"mixLinearColor"),M0=[No,ts,Ts],O0=r(e=>M0.find(t=>t.test(e)),"getColorType");function dd(e){const t=O0(e);if(da(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===Ts&&(s=I0(s)),s}r(dd,"asRGBA");var ud=r((e,t)=>{const s=dd(e),i=dd(t);if(!s||!i)return zr(e,t);const a={...s};return o=>(a.red=za(s.red,i.red,o),a.green=za(s.green,i.green,o),a.blue=za(s.blue,i.blue,o),a.alpha=Me(s.alpha,i.alpha,o),ts.transform(a))},"mixColor"),Eo=new Set(["none","hidden"]);function D0(e,t){return Eo.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}r(D0,"mixVisibility");function L0(e,t){return s=>Me(e,t,s)}r(L0,"mixNumber");function Kl(e){return typeof e=="number"?L0:typeof e=="string"?Bl(e)?zr:Ze.test(e)?ud:U0:Array.isArray(e)?Nh:typeof e=="object"?Ze.test(e)?ud:F0:zr}r(Kl,"getMixer");function Nh(e,t){const s=[...e],i=s.length,a=e.map((o,l)=>Kl(o)(o,t[l]));return o=>{for(let l=0;l<i;l++)s[l]=a[l](o);return s}}r(Nh,"mixArray");function F0(e,t){const s={...e,...t},i={};for(const a in s)e[a]!==void 0&&t[a]!==void 0&&(i[a]=Kl(e[a])(e[a],t[a]));return a=>{for(const o in i)s[o]=i[o](a);return s}}r(F0,"mixObject");function V0(e,t){const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=e.values[l]??0;s[a]=c,i[o]++}return s}r(V0,"matchOrder");var U0=r((e,t)=>{const s=Vt.createTransformer(t),i=Vs(e),a=Vs(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?Eo.has(e)&&!a.values.length||Eo.has(t)&&!i.values.length?D0(e,t):Ei(Nh(V0(i,a),a.values),s):(da(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),zr(e,t))},"mixComplex");function Eh(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?Me(e,t,s):Kl(e)(e,t)}r(Eh,"mix");var B0=r(e=>{const t=r(({timestamp:s})=>e(s),"passTimestamp");return{start:r((s=!0)=>Oe.update(t,s),"start"),stop:r(()=>_n(t),"stop"),now:r(()=>rt.isProcessing?rt.timestamp:pt.now(),"now")}},"frameloopDriver"),Th=r((e,t,s=10)=>{let i="";const a=Math.max(Math.round(t/s),2);for(let o=0;o<a;o++)i+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},"generateLinearEasing"),Wl=2e4;function ql(e,t=50,s=Wl,i){let a=0,o=e.next(a);for(i?.push(o.value);!o.done&&a<s;)a+=t,o=e.next(a),i?.push(o.value);return a>=s?1/0:a}r(ql,"calcGeneratorDuration");function $0(e,t=100,s){const i=s({...e,keyframes:[0,t]}),a=Math.min(ql(i),Wl);return{type:"keyframes",ease:r(o=>i.next(a*o).value/t,"ease"),duration:Rt(a)}}r($0,"createGeneratorEasing");var We={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function To(e,t){return e*Math.sqrt(1-t*t)}r(To,"calcAngularFreq");var z0=12;function K0(e,t,s){let i=s;for(let a=1;a<z0;a++)i=i-e(i)/t(i);return i}r(K0,"approximateRoot");var md=.001;function W0({duration:e=We.duration,bounce:t=We.bounce,velocity:s=We.velocity,mass:i=We.mass}){let a,o;da(e<=St(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-t;l=en(We.minDamping,We.maxDamping,l),e=en(We.minDuration,We.maxDuration,Rt(e)),l<1?(a=r(m=>{const u=m*l,p=u*e,h=u-s,x=To(m,l),g=Math.exp(-p);return md-h/x*g},"envelope"),o=r(m=>{const u=m*l*e,p=u*s+s,h=l*l*m*m*e,x=Math.exp(-u),g=To(m*m,l);return(-a(m)+md>0?-1:1)*((p-h)*x)/g},"derivative")):(a=r(m=>-.001+Math.exp(-m*e)*((m-s)*e+1),"envelope"),o=r(m=>Math.exp(-m*e)*((s-m)*(e*e)),"derivative"));const c=5/e,d=K0(a,o,c);if(e=St(e),isNaN(d))return{stiffness:We.stiffness,damping:We.damping,duration:e};{const m=d*d*i;return{stiffness:m,damping:l*2*Math.sqrt(i*m),duration:e}}}r(W0,"findSpring");var q0=["duration","bounce"],G0=["stiffness","damping","mass"];function hd(e,t){return t.some(s=>e[s]!==void 0)}r(hd,"isSpringType");function H0(e){let t={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:!1,...e};if(!hd(e,G0)&&hd(e,q0))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,i=2*Math.PI/(s*1.2),a=i*i,o=2*en(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:We.mass,stiffness:a,damping:o}}else{const s=W0({...e,velocity:0});t={...t,...s,mass:We.mass},t.isResolvedFromDuration=!0}return t}r(H0,"getSpringOptions");function Kr(e=We.visualDuration,t=We.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:a}=s;const o=s.keyframes[0],l=s.keyframes[s.keyframes.length-1],c={done:!1,value:o},{stiffness:d,damping:m,mass:u,duration:p,velocity:h,isResolvedFromDuration:x}=H0({...s,velocity:-Rt(s.velocity||0)}),g=h||0,j=m/(2*Math.sqrt(d*u)),k=l-o,v=Rt(Math.sqrt(d/u)),w=j*v,_=Math.abs(k)<5;i||(i=_?We.restSpeed.granular:We.restSpeed.default),a||(a=_?We.restDelta.granular:We.restDelta.default);let N,P;if(j<1){const I=To(v,j),L=(g+w*k)/I,R=w*L+k*I,F=w*k-L*I;let T=-1,E=0,C=0;const z=r(W=>{if(W!==T){T=W;const G=Math.exp(-w*W),V=Math.sin(I*W),B=Math.cos(I*W);E=l-G*(L*V+k*B),C=G*(R*V+F*B)}},"sample");N=r(W=>(z(W),E),"resolveSpring"),P=r(W=>(z(W),C),"resolveVelocity")}else if(j===1){N=r(L=>l-Math.exp(-v*L)*(k+(g+v*k)*L),"resolveSpring");const I=g+v*k;P=r(L=>Math.exp(-v*L)*(v*I*L-g),"resolveVelocity")}else{const I=v*Math.sqrt(j*j-1);N=r(T=>{const E=Math.exp(-w*T),C=Math.min(I*T,300);return l-E*((g+w*k)*Math.sinh(C)+I*k*Math.cosh(C))/I},"resolveSpring");const L=(g+w*k)/I,R=w*L-k*I,F=w*k-L*I;P=r(T=>{const E=Math.exp(-w*T),C=Math.min(I*T,300);return E*(R*Math.sinh(C)+F*Math.cosh(C))},"resolveVelocity")}const b={calculatedDuration:x&&p||null,velocity:r(I=>St(P(I)),"velocity"),next:r(I=>{const L=N(I);if(x)c.done=I>=p;else{const R=St(P(I));c.done=Math.abs(R)<=i&&Math.abs(l-L)<=a}return c.value=c.done?l:L,c},"next"),toString:r(()=>{const I=Math.min(ql(b),Wl),L=Th(R=>b.next(I*R).value,I,30);return I+"ms "+L},"toString"),toTransition:r(()=>{},"toTransition")};return b}r(Kr,"spring");Kr.applyToOptions=e=>{const t=$0(e,100,Kr);return e.ease=t.ease,e.duration=St(t.duration),e.type="keyframes",e};function Po({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:d,restDelta:m=.5,restSpeed:u}){const p=e[0],h={done:!1,value:p},x=r(I=>I<c||I>d,"isOutOfBounds"),g=r(I=>c===void 0?d:d===void 0||Math.abs(c-I)<Math.abs(d-I)?c:d,"nearestBoundary");let j=s*t;const k=p+j,v=l===void 0?k:l(k);v!==k&&(j=v-p);const w=r(I=>-j*Math.exp(-I/i),"calcDelta"),_=r(I=>{const L=w(I);h.done=Math.abs(L)<=m,h.value=h.done?v:v+L},"applyFriction");let N,P;const b=r(I=>{x(h.value)&&(N=I,P=Kr({keyframes:[h.value,g(h.value)],velocity:-w(I)/i*1e3,damping:a,stiffness:o,restDelta:m,restSpeed:u}))},"checkCatchBoundary");return b(0),{calculatedDuration:null,next:r(I=>{let L=!1;return!P&&N===void 0&&(L=!0,_(I),b(I)),N!==void 0&&I>=N?P.next(I-N):(!L&&_(I),h)},"next")}}r(Po,"inertia");function Y0(e,t,s){const i=[],a=s||Rn.mix||Eh,o=e.length-1;for(let l=0;l<o;l++){let c=a(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||It:t;c=Ei(d,c)}i.push(c)}return i}r(Y0,"createMixers");function X0(e,t,{clamp:s=!0,ease:i,mixer:a}={}){const o=e.length;if(ds(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=Y0(t,i,a),d=c.length,m=r(u=>{if(l&&u<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(u<e[p+1]);p++);const h=ji(e[p],e[p+1],u);return c[p](h)},"interpolator");return s?u=>m(en(e[0],e[o-1],u)):m}r(X0,"interpolate");function J0(e,t){const s=e[e.length-1];for(let i=1;i<=t;i++){const a=ji(0,t,i);e.push(Me(s,1,a))}}r(J0,"fillOffset");function Q0(e){const t=[0];return J0(t,e.length-1),t}r(Q0,"defaultOffset");function Z0(e,t){return e.map(s=>s*t)}r(Z0,"convertOffsetToTimes");function ey(e,t){return e.map(()=>t||yh).splice(0,e.length-1)}r(ey,"defaultEasing");function di({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){const a=d0(i)?i.map(ad):ad(i),o={done:!1,value:t[0]},l=Z0(s&&s.length===t.length?s:Q0(t),e),c=X0(l,t,{ease:Array.isArray(a)?a:ey(t,a)});return{calculatedDuration:e,next:r(d=>(o.value=c(d),o.done=d>=e,o),"next")}}r(di,"keyframes");var ty=5;function ny(e,t,s){const i=Math.max(t-ty,0);return ch(s-e(i),t-i)}r(ny,"getGeneratorVelocity");var sy=r(e=>e!==null,"isNotNull");function ua(e,{repeat:t,repeatType:s="loop"},i,a=1){const o=e.filter(sy),l=a<0||t&&s!=="loop"&&t%2===1?0:o.length-1;return!l||i===void 0?o[l]:i}r(ua,"getFinalKeyframe");var iy={decay:Po,inertia:Po,tween:di,keyframes:di,spring:Kr};function Ph(e){typeof e.type=="string"&&(e.type=iy[e.type])}r(Ph,"replaceTransitionType");var Gl=class{static{r(this,"WithPromise")}constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},ry=r(e=>e/100,"percentToProgress"),Wr=class extends Gl{static{r(this,"JSAnimation")}constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==pt.now()&&this.tick(pt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ph(e);const{type:t=di,repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:l}=e;const c=t||di;c!==di&&typeof l[0]!="number"&&(this.mixKeyframes=Ei(ry,Eh(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=ql(d));const{calculatedDuration:m}=d;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=d}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:s,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:d=0,keyframes:m,repeat:u,repeatType:p,repeatDelay:h,type:x,onUpdate:g,finalKeyframe:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const k=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?k<0:k>i;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,_=s;if(u){const I=Math.min(this.currentTime,i)/l;let L=Math.floor(I),R=I%1;!R&&I>=1&&(R=1),R===1&&L--,L=Math.min(L,u+1),L%2&&(p==="reverse"?(R=1-R,h&&(R-=h/l)):p==="mirror"&&(_=o)),w=en(0,1,R)*l}let N;v?(this.delayState.value=m[0],N=this.delayState):N=_.next(w),a&&!v&&(N.value=a(N.value));let{done:P}=N;!v&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return b&&x!==Po&&(N.value=ua(m,this.options,j,this.speed)),g&&g(N.value),b&&this.finish(),N}then(e,t){return this.finished.then(e,t)}get duration(){return Rt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Rt(e)}get time(){return Rt(this.currentTime)}set time(e){e=St(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return ny(s=>this.generator.next(s).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(pt.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Rt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=B0,startTime:t}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function ay(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}r(ay,"fillWildcards");var ns=r(e=>e*180/Math.PI,"radToDeg"),Ro=r(e=>{const t=ns(Math.atan2(e[1],e[0]));return _o(t)},"rotate"),oy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r(e=>(Math.abs(e[0])+Math.abs(e[3]))/2,"scale"),rotate:Ro,rotateZ:Ro,skewX:r(e=>ns(Math.atan(e[1])),"skewX"),skewY:r(e=>ns(Math.atan(e[2])),"skewY"),skew:r(e=>(Math.abs(e[1])+Math.abs(e[2]))/2,"skew")},_o=r(e=>(e=e%360,e<0&&(e+=360),e),"rebaseAngle"),pd=Ro,fd=r(e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),"scaleX"),gd=r(e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),"scaleY"),ly={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:fd,scaleY:gd,scale:r(e=>(fd(e)+gd(e))/2,"scale"),rotateX:r(e=>_o(ns(Math.atan2(e[6],e[5]))),"rotateX"),rotateY:r(e=>_o(ns(Math.atan2(-e[2],e[0]))),"rotateY"),rotateZ:pd,rotate:pd,skewX:r(e=>ns(Math.atan(e[4])),"skewX"),skewY:r(e=>ns(Math.atan(e[1])),"skewY"),skew:r(e=>(Math.abs(e[1])+Math.abs(e[4]))/2,"skew")};function Io(e){return e.includes("scale")?1:0}r(Io,"defaultTransformValue");function Mo(e,t){if(!e||e==="none")return Io(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(s)i=ly,a=s;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=oy,a=c}if(!a)return Io(t);const o=i[t],l=a[1].split(",").map(dy);return typeof o=="function"?o(l):l[o]}r(Mo,"parseValueFromTransform");var cy=r((e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Mo(s,t)},"readTransformValue");function dy(e){return parseFloat(e.trim())}r(dy,"convertTransformToNumber");var Ks=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ws=new Set([...Ks,"pathRotation"]),xd=r(e=>e===zs||e===ie,"isNumOrPxType"),uy=new Set(["x","y","z"]),my=Ks.filter(e=>!uy.has(e));function hy(e){const t=[];return my.forEach(s=>{const i=e.getValue(s);i!==void 0&&(t.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),t}r(hy,"removeNonTranslationalTransform");var Nn={width:r(({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},"width"),height:r(({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:i})=>{const a=e.max-e.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(s)},"height"),top:r((e,{top:t})=>parseFloat(t),"top"),left:r((e,{left:t})=>parseFloat(t),"left"),bottom:r(({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),"bottom"),right:r(({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),"right"),x:r((e,{transform:t})=>Mo(t,"x"),"x"),y:r((e,{transform:t})=>Mo(t,"y"),"y")};Nn.translateX=Nn.x;Nn.translateY=Nn.y;var os=new Set,Oo=!1,Do=!1,Lo=!1;function Rh(){if(Do){const e=Array.from(os).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),s=new Map;t.forEach(i=>{const a=hy(i);a.length&&(s.set(i,a),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const a=s.get(i);a&&a.forEach(([o,l])=>{i.getValue(o)?.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Do=!1,Oo=!1,os.forEach(e=>e.complete(Lo)),os.clear()}r(Rh,"measureAllKeyframes");function _h(){os.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Do=!0)})}r(_h,"readAllKeyframes");function py(){Lo=!0,_h(),Rh(),Lo=!1}r(py,"flushKeyframeResolvers");var Hl=class{static{r(this,"KeyframeResolver")}constructor(e,t,s,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(os.add(this),Oo||(Oo=!0,Oe.read(_h),Oe.resolveKeyframes(Rh))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:s,motionValue:i}=this;if(e[0]===null){const a=i?.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&t){const l=s.readValue(t,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}ay(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),os.delete(this)}cancel(){this.state==="scheduled"&&(os.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}},fy=r(e=>e.startsWith("--"),"isCSSVar");function Ih(e,t,s){fy(t)?e.style.setProperty(t,s):e.style[t]=s}r(Ih,"setStyle");var gy={};function Mh(e,t){const s=lh(e);return()=>gy[t]??s()}r(Mh,"memoSupports");var xy=Mh(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Oh=Mh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),si=r(([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,"cubicBezierAsString"),yd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function Dh(e,t){if(e)return typeof e=="function"?Oh()?Th(e,t):"ease-out":vh(e)?si(e):Array.isArray(e)?e.map(s=>Dh(s,t)||yd.easeOut):yd[e]}r(Dh,"mapEasingToNativeEasing");function yy(e,t,s,{delay:i=0,duration:a=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:d}={},m=void 0){const u={[t]:s};d&&(u.offset=d);const p=Dh(c,a);Array.isArray(p)&&(u.easing=p);const h={delay:i,duration:a,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return m&&(h.pseudoElement=m),e.animate(u,h)}r(yy,"startWaapiAnimation");function Lh(e){return typeof e=="function"&&"applyToOptions"in e}r(Lh,"isGenerator");function vy({type:e,...t}){return Lh(e)&&Oh()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}r(vy,"applyGeneratorOptions");var Fh=class extends Gl{static{r(this,"NativeAnimation")}constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,ds(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=vy(e);this.animation=yy(t,s,i,d,a),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const m=ua(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Ih(t,s,m),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Rt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Rt(e)}get time(){return Rt(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=St(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&xy()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),s&&(this.animation.rangeEnd=s),It):i(this)}},Vh={anticipate:fh,backInOut:ph,circInOut:xh};function by(e){return e in Vh}r(by,"isUnsupportedEase");function jy(e){typeof e.ease=="string"&&by(e.ease)&&(e.ease=Vh[e.ease])}r(jy,"replaceStringEasing");var Ka=10,ky=class extends Fh{static{r(this,"NativeAnimationExtended")}constructor(e){jy(e),Ph(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:s,onComplete:i,element:a,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const l=new Wr({...o,autoplay:!1}),c=Math.max(Ka,pt.now()-this.startTime),d=en(0,Ka,c-Ka),m=l.sample(c).value,{name:u}=this.options;a&&u&&Ih(a,u,m),t.setWithVelocity(l.sample(Math.max(0,c-d)).value,m,d),l.stop()}},vd=r((e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vt.test(e)||e==="0")&&!e.startsWith("url(")),"isAnimatable");function wy(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}r(wy,"hasKeyframesChanged");function Cy(e,t,s,i){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],l=vd(a,t),c=vd(o,t);return da(l===c,`You are trying to animate ${t} from "${a}" to "${o}". "${l?o:a}" is not an animatable value.`,"value-not-animatable"),!l||!c?!1:wy(e)||(s==="spring"||Lh(s))&&i}r(Cy,"canAnimate");function Fo(e){e.duration=0,e.type="keyframes"}r(Fo,"makeAnimationInstant");var Uh=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Ay=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Sy(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Ay.test(e[t]))return!0;return!1}r(Sy,"hasBrowserOnlyColors");var Ny=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ey=lh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ty(e){const{motionValue:t,name:s,repeatDelay:i,repeatType:a,damping:o,type:l,keyframes:c}=e,d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:m,transformTemplate:u}=t.owner.getProps();return Ey()&&s&&(Uh.has(s)||Ny.has(s)&&Sy(c))&&(s!=="transform"||!u)&&!m&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}r(Ty,"supportsBrowserAnimation");var Py=40,Ry=class extends Gl{static{r(this,"AsyncMotionValueAnimation")}constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:m,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pt.now();const p={autoplay:e,delay:t,type:s,repeat:i,repeatDelay:a,repeatType:o,name:c,motionValue:d,element:m,...u},h=m?.KeyframeResolver||Hl;this.keyframeResolver=new h(l,(x,g,j)=>this.onKeyframesResolved(x,g,p,!j),c,d,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:m}=s;this.resolvedAt=pt.now();let u=!0;Cy(e,a,o,l)||(u=!1,(Rn.instantAnimations||!c)&&m?.(ua(e,s,t)),e[0]=e[e.length-1],Fo(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Py?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},h=u&&!d&&Ty(p),x=p.motionValue?.owner?.current;let g;if(h)try{g=new ky({...p,element:x})}catch{g=new Wr(p)}else g=new Wr(p);g.finished.then(()=>{this.notifyFinished()}).catch(It),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),py()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Bh(e,t,s,i=0,a=1){const o=Array.from(e).sort((d,m)=>d.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*i;return typeof s=="function"?s(o,l):a===1?o*i:c-o*i}r(Bh,"calcChildStagger");var bd=30,_y=r(e=>!isNaN(parseFloat(e)),"isFloat"),jd={current:void 0},Iy=class{static{r(this,"MotionValue")}constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=pt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=pt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_y(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Fl);const s=this.events[e].add(t);return e==="change"?()=>{s(),Oe.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jd.current&&jd.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=pt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bd)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,bd);return ch(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Us(e,t){return new Iy(e,t)}r(Us,"motionValue");function $h(e,t){if(e?.inherit&&t){const{inherit:s,...i}=e;return{...t,...i}}return e}r($h,"resolveTransition");function Yl(e,t){const s=e?.[t]??e?.default??e;return s!==e?$h(s,e):s}r(Yl,"getValueTransition");var My={type:"spring",stiffness:500,damping:25,restSpeed:10},Oy=r(e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),"criticallyDampedSpring"),Dy={type:"keyframes",duration:.8},Ly={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fy=r((e,{keyframes:t})=>t.length>2?Dy:Ws.has(e)?e.startsWith("scale")?Oy(t[1]):My:Ly,"getDefaultTransition"),Vy=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Uy(e){for(const t in e)if(!Vy.has(t))return!0;return!1}r(Uy,"isTransitionDefined");var Xl=r((e,t,s,i={},a,o)=>l=>{const c=Yl(i,e)||{},d=c.delay||i.delay||0;let{elapsed:m=0}=i;m=m-St(d);const u={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-m,onUpdate:r(h=>{t.set(h),c.onUpdate&&c.onUpdate(h)},"onUpdate"),onComplete:r(()=>{l(),c.onComplete&&c.onComplete()},"onComplete"),name:e,motionValue:t,element:o?void 0:a};Uy(c)||Object.assign(u,Fy(e,u)),u.duration&&(u.duration=St(u.duration)),u.repeatDelay&&(u.repeatDelay=St(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Fo(u),u.delay===0&&(p=!0)),(Rn.instantAnimations||Rn.skipAnimations||a?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,Fo(u),u.delay=0),u.allowFlatten=!c.type&&!c.ease,p&&!o&&t.get()!==void 0){const h=ua(u.keyframes,c);if(h!==void 0){Oe.update(()=>{u.onUpdate(h),u.onComplete()});return}}return c.isSync?new Wr(u):new Ry(u)},"animateMotionValue"),By=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $y(e){const t=By.exec(e);if(!t)return[,];const[,s,i,a]=t;return[`--${s??i}`,a]}r($y,"parseCSSVariable");var zy=4;function zh(e,t,s=1){ds(s<=zy,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,a]=$y(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const l=o.trim();return rh(l)?parseFloat(l):l}return Bl(a)?zh(a,t,s+1):a}r(zh,"getVariableValue");function kd(e){const t=[{},{}];return e?.values.forEach((s,i)=>{t[0][i]=s.get(),t[1][i]=s.getVelocity()}),t}r(kd,"getValueState");function Jl(e,t,s,i){if(typeof t=="function"){const[a,o]=kd(i);t=t(s!==void 0?s:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=kd(i);t=t(s!==void 0?s:e.custom,a,o)}return t}r(Jl,"resolveVariantFromProps");function ls(e,t,s){const i=e.getProps();return Jl(i,t,s!==void 0?s:i.custom,e)}r(ls,"resolveVariant");var Kh=new Set(["width","height","top","left","right","bottom",...Ks]),Vo=r(e=>Array.isArray(e),"isKeyframesTarget");function Ky(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Us(s))}r(Ky,"setMotionValue");function Wy(e){return Vo(e)?e[e.length-1]||0:e}r(Wy,"resolveFinalValueInKeyframes");function qy(e,t){let{transitionEnd:s={},transition:i={},...a}=ls(e,t)||{};a={...a,...s};for(const o in a)Ky(e,o,Wy(a[o]))}r(qy,"setTarget");var ot=r(e=>!!(e&&e.getVelocity),"isMotionValue");function Gy(e){return!!(ot(e)&&e.add)}r(Gy,"isWillChangeMotionValue");function Uo(e,t){const s=e.getValue("willChange");if(Gy(s))return s.add(t);if(!s&&Rn.WillChange){const i=new Rn.WillChange("auto");e.addValue("willChange",i),i.add(t)}}r(Uo,"addValueToWillChange");function Ql(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}r(Ql,"camelToDash");var Hy="framerAppearId",Wh="data-"+Ql(Hy);function qh(e){return e.props[Wh]}r(qh,"getOptimisedAppearId");var Yy=typeof window<"u";function Xy({protectedKeys:e,needsAnimating:t},s){const i=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,i}r(Xy,"shouldBlockAnimation");function Gh(e,t,{delay:s=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();o=o?$h(o,d):d;const m=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const p=[],h=a&&e.animationState&&e.animationState.getState()[a],x=o?.path;x&&x.animateVisualElement(e,c,o,s,p);for(const g in c){const j=e.getValue(g,e.latestValues[g]??null),k=c[g];if(k===void 0||h&&Xy(h,g))continue;const v={delay:s,...Yl(o||{},g)};u&&(v.skipAnimations=!0);const w=j.get();if(w!==void 0&&!j.isAnimating()&&!Array.isArray(k)&&k===w&&!v.velocity){Oe.update(()=>j.set(k));continue}let _=!1;if(Yy&&window.MotionHandoffAnimation){const b=qh(e);if(b){const I=window.MotionHandoffAnimation(b,g,Oe);I!==null&&(v.startTime=I,_=!0)}}Uo(e,g);const N=m??e.shouldReduceMotion;j.start(Xl(g,j,k,N&&Kh.has(g)?{type:!1}:v,e,_));const P=j.animation;P&&p.push(P)}if(l){const g=r(()=>Oe.update(()=>{l&&qy(e,l)}),"applyTransitionEnd");p.length?Promise.all(p).then(g):g()}return p}r(Gh,"animateTarget");function Bo(e,t,s={}){const i=ls(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(a=s.transitionOverride);const o=i?()=>Promise.all(Gh(e,i,s)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:m=0,staggerChildren:u,staggerDirection:p}=a;return Jy(e,t,d,m,u,p,s)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,m]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>m())}else return Promise.all([o(),l(s.delay)])}r(Bo,"animateVariant");function Jy(e,t,s=0,i=0,a=0,o=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(Bo(d,t,{...l,delay:s+(typeof i=="function"?0:i)+Bh(e.variantChildren,d,i,a,o)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}r(Jy,"animateChildren");function Qy(e,t,s={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const a=t.map(o=>Bo(e,o,s));i=Promise.all(a)}else if(typeof t=="string")i=Bo(e,t,s);else{const a=typeof t=="function"?ls(e,t,s.custom):t;i=Promise.all(Gh(e,a,s))}return i.then(()=>{e.notify("AnimationComplete",t)})}r(Qy,"animateVisualElement");var Zy={test:r(e=>e==="auto","test"),parse:r(e=>e,"parse")},Hh=r(e=>t=>t.test(e),"testValueType"),Yh=[zs,ie,Zt,cn,k0,j0,Zy],wd=r(e=>Yh.find(Hh(e)),"findDimensionValueType");function ev(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oh(e):!0}r(ev,"isNone");var tv=new Set(["brightness","contrast","saturate","opacity"]);function nv(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=s.match($l)||[];if(!i)return e;const a=s.replace(i,"");let o=tv.has(t)?1:0;return i!==s&&(o*=100),t+"("+o+a+")"}r(nv,"applyDefaultFilter");var sv=/\b([a-z-]*)\(.*?\)/gu,$o={...Vt,getAnimatableNone:r(e=>{const t=e.match(sv);return t?t.map(nv).join(" "):e},"getAnimatableNone")},zo={...Vt,getAnimatableNone:r(e=>{const t=Vt.parse(e);return Vt.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))},"getAnimatableNone")},Cd={...zs,transform:Math.round},iv={rotate:cn,pathRotation:cn,rotateX:cn,rotateY:cn,rotateZ:cn,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:cn,skewX:cn,skewY:cn,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:ki,originX:ld,originY:ld,originZ:ie},qr={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,inset:ie,insetBlock:ie,insetBlockStart:ie,insetBlockEnd:ie,insetInline:ie,insetInlineStart:ie,insetInlineEnd:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,paddingBlock:ie,paddingBlockStart:ie,paddingBlockEnd:ie,paddingInline:ie,paddingInlineStart:ie,paddingInlineEnd:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,marginBlock:ie,marginBlockStart:ie,marginBlockEnd:ie,marginInline:ie,marginInlineStart:ie,marginInlineEnd:ie,fontSize:ie,backgroundPositionX:ie,backgroundPositionY:ie,...iv,zIndex:Cd,fillOpacity:ki,strokeOpacity:ki,numOctaves:Cd},rv={...qr,color:Ze,backgroundColor:Ze,outlineColor:Ze,fill:Ze,stroke:Ze,borderColor:Ze,borderTopColor:Ze,borderRightColor:Ze,borderBottomColor:Ze,borderLeftColor:Ze,filter:$o,WebkitFilter:$o,mask:zo,WebkitMask:zo},Xh=r(e=>rv[e],"getDefaultValueType"),av=new Set([$o,zo]);function Jh(e,t){let s=Xh(e);return av.has(s)||(s=Vt),s.getAnimatableNone?s.getAnimatableNone(t):void 0}r(Jh,"getAnimatableNone");var ov=new Set(["auto","none","0"]);function lv(e,t,s){let i=0,a;for(;i<e.length&&!a;){const o=e[i];typeof o=="string"&&!ov.has(o)&&Vs(o).values.length&&(a=e[i]),i++}if(a&&s)for(const o of t)e[o]=Jh(s,a)}r(lv,"makeNoneKeyframesAnimatable");var cv=class extends Hl{static{r(this,"DOMKeyframesResolver")}constructor(e,t,s,i,a){super(e,t,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let d=e[c];if(typeof d=="string"&&(d=d.trim(),Bl(d))){const m=zh(d,t.current);m!==void 0&&(e[c]=m),c===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Kh.has(s)||e.length!==2)return;const[i,a]=e,o=wd(i),l=wd(a);if(od(i)!==od(a)&&Nn[s]){this.needsMeasurement=!0;return}if(o!==l)if(xd(o)&&xd(l))for(let c=0;c<e.length;c++){const d=e[c];typeof d=="string"&&(e[c]=parseFloat(d))}else Nn[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ev(e[i]))&&s.push(i);s.length&&lv(e,s,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Nn[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const i=t[t.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);const a=s.length-1,o=s[a];s[a]=Nn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}},Zl=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Qh(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);const a=s?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(i=>i!=null)}r(Qh,"resolveElements");var Ko=r((e,t)=>t&&typeof e=="number"?t.transform(e):e,"getValueAsType");function jr(e){return ah(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}r(jr,"isHTMLElement");var{schedule:ec,cancel:iE}=bh(queueMicrotask,!1),Lt={x:!1,y:!1};function Zh(){return Lt.x||Lt.y}r(Zh,"isDragActive");function dv(e){return e==="x"||e==="y"?Lt[e]?null:(Lt[e]=!0,()=>{Lt[e]=!1}):Lt.x||Lt.y?null:(Lt.x=Lt.y=!0,()=>{Lt.x=Lt.y=!1})}r(dv,"setDragLock");function ep(e,t){const s=Qh(e),i=new AbortController,a={passive:!0,...t,signal:i.signal};return[s,a,r(()=>i.abort(),"cancel")]}r(ep,"setupGesture");function uv(e){return!(e.pointerType==="touch"||Zh())}r(uv,"isValidHover");function mv(e,t,s={}){const[i,a,o]=ep(e,s);return i.forEach(l=>{let c=!1,d=!1,m;const u=r(()=>{l.removeEventListener("pointerleave",g)},"removePointerLeave"),p=r(k=>{m&&(m(k),m=void 0),u()},"endHover"),h=r(k=>{c=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),d&&(d=!1,p(k))},"onPointerUp"),x=r(()=>{c=!0,window.addEventListener("pointerup",h,a),window.addEventListener("pointercancel",h,a)},"onPointerDown"),g=r(k=>{if(k.pointerType!=="touch"){if(c){d=!0;return}p(k)}},"onPointerLeave"),j=r(k=>{if(!uv(k))return;d=!1;const v=t(l,k);typeof v=="function"&&(m=v,l.addEventListener("pointerleave",g,a))},"onPointerEnter");l.addEventListener("pointerenter",j,a),l.addEventListener("pointerdown",x,a)}),o}r(mv,"hover");var tp=r((e,t)=>t?e===t?!0:tp(e,t.parentElement):!1,"isNodeOrChild"),tc=r(e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,"isPrimaryPointer"),hv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pv(e){return hv.has(e.tagName)||e.isContentEditable===!0}r(pv,"isElementKeyboardAccessible");var fv=new Set(["INPUT","SELECT","TEXTAREA"]);function gv(e){return fv.has(e.tagName)||e.isContentEditable===!0}r(gv,"isElementTextInput");var kr=new WeakSet;function Ad(e){return t=>{t.key==="Enter"&&e(t)}}r(Ad,"filterEvents");function Wa(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}r(Wa,"firePointerEvent");var xv=r((e,t)=>{const s=e.currentTarget;if(!s)return;const i=Ad(()=>{if(kr.has(s))return;Wa(s,"down");const a=Ad(()=>{Wa(s,"up")}),o=r(()=>Wa(s,"cancel"),"handleBlur");s.addEventListener("keyup",a,t),s.addEventListener("blur",o,t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)},"enableKeyboardPress");function Sd(e){return tc(e)&&!Zh()}r(Sd,"isValidPressEvent");var Nd=new WeakSet;function yv(e,t,s={}){const[i,a,o]=ep(e,s),l=r(c=>{const d=c.currentTarget;if(!Sd(c)||Nd.has(c))return;kr.add(d),s.stopPropagation&&Nd.add(c);const m=t(d,c),u={...a,capture:!0},p=r((g,j)=>{window.removeEventListener("pointerup",h,u),window.removeEventListener("pointercancel",x,u),kr.has(d)&&kr.delete(d),Sd(g)&&typeof m=="function"&&m(g,{success:j})},"onPointerEnd"),h=r(g=>{p(g,d===window||d===document||s.useGlobalTarget||tp(d,g.target))},"onPointerUp"),x=r(g=>{p(g,!1)},"onPointerCancel");window.addEventListener("pointerup",h,u),window.addEventListener("pointercancel",x,u)},"startPress");return i.forEach(c=>{(s.useGlobalTarget?window:c).addEventListener("pointerdown",l,a),jr(c)&&(c.addEventListener("focus",d=>xv(d,a)),!pv(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}r(yv,"press");function nc(e){return ah(e)&&"ownerSVGElement"in e}r(nc,"isSVGElement");var wr=new WeakMap,Cr,np=r((e,t,s)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:nc(i)&&"getBBox"in i?i.getBBox()[t]:i[s],"getSize"),vv=np("inline","width","offsetWidth"),bv=np("block","height","offsetHeight");function jv({target:e,borderBoxSize:t}){wr.get(e)?.forEach(s=>{s(e,{get width(){return vv(e,t)},get height(){return bv(e,t)}})})}r(jv,"notifyTarget");function kv(e){e.forEach(jv)}r(kv,"notifyAll");function wv(){typeof ResizeObserver>"u"||(Cr=new ResizeObserver(kv))}r(wv,"createResizeObserver");function Cv(e,t){Cr||wv();const s=Qh(e);return s.forEach(i=>{let a=wr.get(i);a||(a=new Set,wr.set(i,a)),a.add(t),Cr?.observe(i)}),()=>{s.forEach(i=>{const a=wr.get(i);a?.delete(t),a?.size||Cr?.unobserve(i)})}}r(Cv,"resizeElement");var Ar=new Set,Ps;function Av(){Ps=r(()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ar.forEach(t=>t(e))},"windowResizeHandler"),window.addEventListener("resize",Ps)}r(Av,"createWindowResizeHandler");function Sv(e){return Ar.add(e),Ps||Av(),()=>{Ar.delete(e),!Ar.size&&typeof Ps=="function"&&(window.removeEventListener("resize",Ps),Ps=void 0)}}r(Sv,"resizeWindow");function Ed(e,t){return typeof e=="function"?Sv(e):Cv(e,t)}r(Ed,"resize");var As={value:null,addProjectionMetrics:null};function Nv(e){return nc(e)&&e.tagName==="svg"}r(Nv,"isSVGSVGElement");var Ev=[...Yh,Ze,Vt],Tv=r(e=>Ev.find(Hh(e)),"findValueType"),Td=r(()=>({translate:0,scale:1,origin:0,originPoint:0}),"createAxisDelta"),Rs=r(()=>({x:Td(),y:Td()}),"createDelta"),Pd=r(()=>({min:0,max:0}),"createAxis"),tt=r(()=>({x:Pd(),y:Pd()}),"createBox"),Pv=new WeakMap;function ma(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}r(ma,"isAnimationControls");function wi(e){return typeof e=="string"||Array.isArray(e)}r(wi,"isVariantLabel");var sc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ic=["initial",...sc];function ha(e){return ma(e.animate)||ic.some(t=>wi(e[t]))}r(ha,"isControllingVariants");function sp(e){return!!(ha(e)||e.variants)}r(sp,"isVariantNode");function Rv(e,t,s){for(const i in t){const a=t[i],o=s[i];if(ot(a))e.addValue(i,a);else if(ot(o))e.addValue(i,Us(a,{owner:e}));else if(o!==a)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(a):l.hasAnimated||l.set(a)}else{const l=e.getStaticValue(i);e.addValue(i,Us(l!==void 0?l:a,{owner:e}))}}for(const i in s)t[i]===void 0&&e.removeValue(i);return t}r(Rv,"updateMotionValuesFromProps");var Wo={current:null},ip={current:!1},_v=typeof window<"u";function Iv(){if(ip.current=!0,!!_v)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=r(()=>Wo.current=e.matches,"setReducedMotionPreferences");e.addEventListener("change",t),t()}else Wo.current=!1}r(Iv,"initPrefersReducedMotion");var Rd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Gr={};function rp(e){Gr=e}r(rp,"setFeatureDefinitions");function Mv(){return Gr}r(Mv,"getFeatureDefinitions");var Ov=class{static{r(this,"VisualElement")}scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Hl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=pt.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Oe.render(this.render,!1,!0))};const{latestValues:d,renderState:m}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=t.initial?{...d}:{},this.renderState=m,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=ha(t),this.isVariantNode=sp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(t,{},this);for(const h in p){const x=p[h];d[h]!==void 0&&ot(x)&&x.set(d[h])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,Pv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,s)=>this.bindToMotionValue(s,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ip.current||Iv(),this.shouldReduceMotion=Wo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),_n(this.notifyUpdate),_n(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Uh.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:m}=t.accelerate,u=new Fh({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:St(m)}),p=o(u);this.valueSubscriptions.set(e,()=>{p(),u.cancel()});return}const s=Ws.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Oe.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),a&&a()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Gr){const t=Gr[e];if(!t)continue;const{isEnabled:s,Feature:i}=t;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let s=0;s<Rd.length;s++){const i=Rd[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a=e["on"+i];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Rv(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&t!==void 0&&(s=Us(t===null?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(rh(s)||oh(s))?s=parseFloat(s):!Tv(s)&&Vt.test(t)&&(s=Jh(e,t)),this.setBaseTarget(e,ot(s)?s.get():s)),ot(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let s;if(typeof t=="string"||typeof t=="object"){const a=Jl(this.props,t,this.presenceContext?.custom);a&&(s=a[e])}if(t&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ot(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Fl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ec.render(this.render)}},ap=class extends Ov{static{r(this,"DOMVisualElement")}constructor(){super(...arguments),this.KeyframeResolver=cv}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ot(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}},Mn=class{static{r(this,"Feature")}constructor(e){this.isMounted=!1,this.node=e}update(){}};function op({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}r(op,"convertBoundingBoxToBox");function Dv({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}r(Dv,"convertBoxToBoundingBox");function Lv(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}r(Lv,"transformBoxPoints");function qa(e){return e===void 0||e===1}r(qa,"isIdentityScale");function qo({scale:e,scaleX:t,scaleY:s}){return!qa(e)||!qa(t)||!qa(s)}r(qo,"hasScale");function Jn(e){return qo(e)||lp(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}r(Jn,"hasTransform");function lp(e){return _d(e.x)||_d(e.y)}r(lp,"has2DTranslate");function _d(e){return e&&e!=="0%"}r(_d,"is2DTranslate");function Hr(e,t,s){return s+t*(e-s)}r(Hr,"scalePoint");function Id(e,t,s,i,a){return a!==void 0&&(e=Hr(e,a,i)),Hr(e,s,i)+t}r(Id,"applyPointDelta");function Go(e,t=0,s=1,i,a){e.min=Id(e.min,t,s,i,a),e.max=Id(e.max,t,s,i,a)}r(Go,"applyAxisDelta");function cp(e,{x:t,y:s}){Go(e.x,t.translate,t.scale,t.originPoint),Go(e.y,s.translate,s.scale,s.originPoint)}r(cp,"applyBoxDelta");var Md=.999999999999,Od=1.0000000000001;function Fv(e,t,s,i=!1){const a=s.length;if(!a)return;t.x=t.y=1;let o,l;for(let c=0;c<a;c++){o=s[c],l=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Jt(e.x,-o.scroll.offset.x),Jt(e.y,-o.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,cp(e,l)),i&&Jn(o.latestValues)&&Sr(e,o.latestValues,o.layout?.layoutBox))}t.x<Od&&t.x>Md&&(t.x=1),t.y<Od&&t.y>Md&&(t.y=1)}r(Fv,"applyTreeDeltas");function Jt(e,t){e.min+=t,e.max+=t}r(Jt,"translateAxis");function Dd(e,t,s,i,a=.5){Go(e,t,s,Me(e.min,e.max,a),i)}r(Dd,"transformAxis");function Ld(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}r(Ld,"resolveAxisTranslate");function Sr(e,t,s){const i=s??e;Dd(e.x,Ld(t.x,i.x),t.scaleX,t.scale,t.originX),Dd(e.y,Ld(t.y,i.y),t.scaleY,t.scale,t.originY)}r(Sr,"transformBox");function dp(e,t){return op(Lv(e.getBoundingClientRect(),t))}r(dp,"measureViewportBox");function Vv(e,t,s){const i=dp(e,s),{scroll:a}=t;return a&&(Jt(i.x,a.offset.x),Jt(i.y,a.offset.y)),i}r(Vv,"measurePageBox");var Uv={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bv=Ks.length;function $v(e,t,s){let i="",a=!0;for(let l=0;l<Bv;l++){const c=Ks[l],d=e[c];if(d===void 0)continue;let m=!0;if(typeof d=="number")m=d===(c.startsWith("scale")?1:0);else{const u=parseFloat(d);m=c.startsWith("scale")?u===1:u===0}if(!m||s){const u=Ko(d,qr[c]);if(!m){a=!1;const p=Uv[c]||c;i+=`${p}(${u}) `}s&&(t[c]=u)}}const o=e.pathRotation;return o&&(a=!1,i+=`rotate(${Ko(o,qr.pathRotation)}) `),i=i.trim(),s?i=s(t,a?"":i):a&&(i="none"),i}r($v,"buildTransform");function rc(e,t,s){const{style:i,vars:a,transformOrigin:o}=e;let l=!1,c=!1;for(const d in t){const m=t[d];if(Ws.has(d)){l=!0;continue}else if(kh(d)){a[d]=m;continue}else{const u=Ko(m,qr[d]);d.startsWith("origin")?(c=!0,o[d]=u):i[d]=u}}if(t.transform||(l||s?i.transform=$v(t,e.transform,s):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:m="50%",originZ:u=0}=o;i.transformOrigin=`${d} ${m} ${u}`}}r(rc,"buildHTMLStyles");function up(e,{style:t,vars:s},i,a){const o=e.style;let l;for(l in t)o[l]=t[l];a?.applyProjectionStyles(o,i);for(l in s)o.setProperty(l,s[l])}r(up,"renderHTML");function Fd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}r(Fd,"pixelsToPercent");var ei={correct:r((e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ie.test(e))e=parseFloat(e);else return e;return`${Fd(e,t.target.x)}% ${Fd(e,t.target.y)}%`},"correct")},zv={correct:r((e,{treeScale:t,projectionDelta:s})=>{const i=e,a=Vt.parse(e);if(a.length>5)return i;const o=Vt.createTransformer(e),l=typeof a[0]!="number"?1:0,c=s.x.scale*t.x,d=s.y.scale*t.y;a[0+l]/=c,a[1+l]/=d;const m=Me(c,d,.5);return typeof a[2+l]=="number"&&(a[2+l]/=m),typeof a[3+l]=="number"&&(a[3+l]/=m),o(a)},"correct")},Ho={borderRadius:{...ei,applyTo:[...Zl]},borderTopLeftRadius:ei,borderTopRightRadius:ei,borderBottomLeftRadius:ei,borderBottomRightRadius:ei,boxShadow:zv};function mp(e,{layout:t,layoutId:s}){return Ws.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Ho[e]||e==="opacity")}r(mp,"isForcedMotionValue");function ac(e,t,s){const i=e.style,a=t?.style,o={};if(!i)return o;for(const l in i)(ot(i[l])||a&&ot(a[l])||mp(l,e)||s?.getValue(l)?.liveStyle!==void 0)&&(o[l]=i[l]);return o}r(ac,"scrapeMotionValuesFromProps$1");function Kv(e){return window.getComputedStyle(e)}r(Kv,"getComputedStyle$1");var Wv=class extends ap{static{r(this,"HTMLVisualElement")}constructor(){super(...arguments),this.type="html",this.renderInstance=up}mount(e){ds(!!e.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(Ws.has(t))return this.projection?.isProjecting?Io(t):cy(e,t);{const s=Kv(e),i=(kh(t)?s.getPropertyValue(t):s[t])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:t}){return dp(e,t)}build(e,t,s){rc(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return ac(e,t,s)}},qv={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gv={offset:"strokeDashoffset",array:"strokeDasharray"};function Hv(e,t,s=1,i=0,a=!0){e.pathLength=1;const o=a?qv:Gv;e[o.offset]=`${-i}`,e[o.array]=`${t} ${s}`}r(Hv,"buildSVGPath");var hp=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pp(e,{attrX:t,attrY:s,attrScale:i,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...c},d,m,u){if(rc(e,c,m),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h}=e;for(const x of hp)p[x]!==void 0&&(h[x]=p[x],delete p[x]);(h.transform||p.transformOrigin)&&(h.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),h.transform&&(h.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),s!==void 0&&(p.y=s),i!==void 0&&(p.scale=i),a!==void 0&&Hv(p,a,o,l,!1)}r(pp,"buildSVGAttrs");var fp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gp=r(e=>typeof e=="string"&&e.toLowerCase()==="svg","isSVGTag");function Yv(e,t,s,i){up(e,t,void 0,i);for(const a in t.attrs)e.setAttribute(fp.has(a)?a:Ql(a),t.attrs[a])}r(Yv,"renderSVG");function xp(e,t,s){const i=ac(e,t,s);for(const a in e)if(ot(e[a])||ot(t[a])){const o=Ks.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;i[o]=e[a]}return i}r(xp,"scrapeMotionValuesFromProps");var Xv=class extends ap{static{r(this,"SVGVisualElement")}constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ws.has(t)){const s=Xh(t);return s&&s.default||0}if(hp.includes(t)){const s=getComputedStyle(e)[t];if(typeof s=="string"&&s)return s.trim()}return t=fp.has(t)?t:Ql(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return xp(e,t,s)}build(e,t,s){pp(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,i){Yv(e,t,s,i)}mount(e){this.isSVGTag=gp(e.tagName),super.mount(e)}},Jv=ic.length;function yp(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?yp(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<Jv;s++){const i=ic[s],a=e.props[i];(wi(a)||a===!1)&&(t[i]=a)}return t}r(yp,"getVariantContext");function vp(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}r(vp,"shallowCompare");var Qv=[...sc].reverse(),Zv=sc.length;function eb(e){return t=>Promise.all(t.map(({animation:s,options:i})=>Qy(e,s,i)))}r(eb,"createAnimateFunction");function tb(e){let t=eb(e),s=Vd(),i=!0,a=!1;const o=r(m=>(u,p)=>{const h=ls(e,p,m==="exit"?e.presenceContext?.custom:void 0);if(h){const{transition:x,transitionEnd:g,...j}=h;u={...u,...j,...g}}return u},"buildResolvedTypeValues");function l(m){t=m(e)}r(l,"setAnimateFunction");function c(m){const{props:u}=e,p=yp(e.parent)||{},h=[],x=new Set;let g={},j=1/0;for(let v=0;v<Zv;v++){const w=Qv[v],_=s[w],N=u[w]!==void 0?u[w]:p[w],P=wi(N),b=w===m?_.isActive:null;b===!1&&(j=v);let I=N===p[w]&&N!==u[w]&&P;if(I&&(i||a)&&e.manuallyAnimateOnMount&&(I=!1),_.protectedKeys={...g},!_.isActive&&b===null||!N&&!_.prevProp||ma(N)||typeof N=="boolean")continue;if(w==="exit"&&_.isActive&&b!==!0){_.prevResolvedValues&&(g={...g,..._.prevResolvedValues});continue}const L=nb(_.prevProp,N);let R=L||w===m&&_.isActive&&!I&&P||v>j&&P,F=!1;const T=Array.isArray(N)?N:[N];let E=T.reduce(o(w),{});b===!1&&(E={});const{prevResolvedValues:C={}}=_,z={...C,...E},W=r(V=>{R=!0,x.has(V)&&(F=!0,x.delete(V)),_.needsAnimating[V]=!0;const B=e.getValue(V);B&&(B.liveStyle=!1)},"markToAnimate");for(const V in z){const B=E[V],O=C[V];if(g.hasOwnProperty(V))continue;let y=!1;Vo(B)&&Vo(O)?y=!vp(B,O)||L:y=B!==O,y?B!=null?W(V):x.add(V):B!==void 0&&x.has(V)?W(V):_.protectedKeys[V]=!0}_.prevProp=N,_.prevResolvedValues=E,_.isActive&&(g={...g,...E}),(i||a)&&e.blockInitialAnimation&&(R=!1);const G=I&&L;R&&(!G||F)&&h.push(...T.map(V=>{const B={type:w};if(typeof V=="string"&&(i||a)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:O}=e,y=ls(O,V);if(O.enteringChildren&&y){const{delayChildren:M}=y.transition||{};B.delay=Bh(O.enteringChildren,e,M)}}return{animation:V,options:B}}))}if(x.size){const v={};if(typeof u.initial!="boolean"){const w=ls(e,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(v.transition=w.transition)}x.forEach(w=>{const _=e.getBaseTarget(w),N=e.getValue(w);N&&(N.liveStyle=!0),v[w]=_??null}),h.push({animation:v})}let k=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(k=!1),i=!1,a=!1,k?t(h):Promise.resolve()}r(c,"animateChanges");function d(m,u){if(s[m].isActive===u)return Promise.resolve();e.variantChildren?.forEach(h=>h.animationState?.setActive(m,u)),s[m].isActive=u;const p=c(m);for(const h in s)s[h].protectedKeys={};return p}return r(d,"setActive"),{animateChanges:c,setActive:d,setAnimateFunction:l,getState:r(()=>s,"getState"),reset:r(()=>{s=Vd(),a=!0},"reset")}}r(tb,"createAnimationState");function nb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!vp(t,e):!1}r(nb,"checkVariantsDidChange");function Xn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}r(Xn,"createTypeState");function Vd(){return{animate:Xn(!0),whileInView:Xn(),whileHover:Xn(),whileTap:Xn(),whileDrag:Xn(),whileFocus:Xn(),exit:Xn()}}r(Vd,"createState");function Yo(e,t){e.min=t.min,e.max=t.max}r(Yo,"copyAxisInto");function Dt(e,t){Yo(e.x,t.x),Yo(e.y,t.y)}r(Dt,"copyBoxInto");function Ud(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}r(Ud,"copyAxisDeltaInto");var sb=.9999,ib=1.0001,rb=-.01,ab=.01;function ft(e){return e.max-e.min}r(ft,"calcLength");function ob(e,t,s){return Math.abs(e-t)<=s}r(ob,"isNear");function Bd(e,t,s,i=.5){e.origin=i,e.originPoint=Me(t.min,t.max,e.origin),e.scale=ft(s)/ft(t),e.translate=Me(s.min,s.max,e.origin)-e.originPoint,(e.scale>=sb&&e.scale<=ib||isNaN(e.scale))&&(e.scale=1),(e.translate>=rb&&e.translate<=ab||isNaN(e.translate))&&(e.translate=0)}r(Bd,"calcAxisDelta");function ui(e,t,s,i){Bd(e.x,t.x,s.x,i?i.originX:void 0),Bd(e.y,t.y,s.y,i?i.originY:void 0)}r(ui,"calcBoxDelta");function $d(e,t,s,i=0){e.min=(i?Me(s.min,s.max,i):s.min)+t.min,e.max=e.min+ft(t)}r($d,"calcRelativeAxis");function lb(e,t,s,i){$d(e.x,t.x,s.x,i?.x),$d(e.y,t.y,s.y,i?.y)}r(lb,"calcRelativeBox");function zd(e,t,s,i=0){const a=i?Me(s.min,s.max,i):s.min;e.min=t.min-a,e.max=e.min+ft(t)}r(zd,"calcRelativeAxisPosition");function Yr(e,t,s,i){zd(e.x,t.x,s.x,i?.x),zd(e.y,t.y,s.y,i?.y)}r(Yr,"calcRelativePosition");function Kd(e,t,s,i,a){return e-=t,e=Hr(e,1/s,i),a!==void 0&&(e=Hr(e,1/a,i)),e}r(Kd,"removePointDelta");function cb(e,t=0,s=1,i=.5,a,o=e,l=e){if(Zt.test(t)&&(t=parseFloat(t),t=Me(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Me(o.min,o.max,i);e===o&&(c-=t),e.min=Kd(e.min,t,s,c,a),e.max=Kd(e.max,t,s,c,a)}r(cb,"removeAxisDelta");function Wd(e,t,[s,i,a],o,l){cb(e,t[s],t[i],t[a],t.scale,o,l)}r(Wd,"removeAxisTransforms");var db=["x","scaleX","originX"],ub=["y","scaleY","originY"];function qd(e,t,s,i){Wd(e.x,t,db,s?s.x:void 0,i?i.x:void 0),Wd(e.y,t,ub,s?s.y:void 0,i?i.y:void 0)}r(qd,"removeBoxTransforms");function Gd(e){return e.translate===0&&e.scale===1}r(Gd,"isAxisDeltaZero");function bp(e){return Gd(e.x)&&Gd(e.y)}r(bp,"isDeltaZero");function Hd(e,t){return e.min===t.min&&e.max===t.max}r(Hd,"axisEquals");function mb(e,t){return Hd(e.x,t.x)&&Hd(e.y,t.y)}r(mb,"boxEquals");function Yd(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}r(Yd,"axisEqualsRounded");function jp(e,t){return Yd(e.x,t.x)&&Yd(e.y,t.y)}r(jp,"boxEqualsRounded");function Xd(e){return ft(e.x)/ft(e.y)}r(Xd,"aspectRatio");function Jd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}r(Jd,"axisDeltaEquals");function Yt(e){return[e("x"),e("y")]}r(Yt,"eachAxis");function hb(e,t,s){let i="";const a=e.x.translate/t.x,o=e.y.translate/t.y,l=s?.z||0;if((a||o||l)&&(i=`translate3d(${a}px, ${o}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:m,rotate:u,pathRotation:p,rotateX:h,rotateY:x,skewX:g,skewY:j}=s;m&&(i=`perspective(${m}px) ${i}`),u&&(i+=`rotate(${u}deg) `),p&&(i+=`rotate(${p}deg) `),h&&(i+=`rotateX(${h}deg) `),x&&(i+=`rotateY(${x}deg) `),g&&(i+=`skewX(${g}deg) `),j&&(i+=`skewY(${j}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}r(hb,"buildProjectionTransform");var pb=Zl.length,Qd=r(e=>typeof e=="string"?parseFloat(e):e,"asNumber$3"),Zd=r(e=>typeof e=="number"||ie.test(e),"isPx");function fb(e,t,s,i,a,o){a?(e.opacity=Me(0,s.opacity??1,gb(i)),e.opacityExit=Me(t.opacity??1,0,xb(i))):o&&(e.opacity=Me(t.opacity??1,s.opacity??1,i));for(let l=0;l<pb;l++){const c=Zl[l];let d=eu(t,c),m=eu(s,c);d===void 0&&m===void 0||(d||(d=0),m||(m=0),d===0||m===0||Zd(d)===Zd(m)?(e[c]=Math.max(Me(Qd(d),Qd(m),i),0),(Zt.test(m)||Zt.test(d))&&(e[c]+="%")):e[c]=m)}(t.rotate||s.rotate)&&(e.rotate=Me(t.rotate||0,s.rotate||0,i))}r(fb,"mixValues");function eu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}r(eu,"getRadius");var gb=kp(0,.5,gh),xb=kp(.5,.95,It);function kp(e,t,s){return i=>i<e?0:i>t?1:s(ji(e,t,i))}r(kp,"compress");function yb(e,t,s){const i=ot(e)?e:Us(e);return i.start(Xl("",i,t,s)),i.animation}r(yb,"animateSingleValue");function Ci(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s,i)}r(Ci,"addDomEvent");var vb=r((e,t)=>e.depth-t.depth,"compareByDepth"),bb=class{static{r(this,"FlatTree")}constructor(){this.children=[],this.isDirty=!1}add(e){Ll(this.children,e),this.isDirty=!0}remove(e){$r(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(vb),this.isDirty=!1,this.children.forEach(e)}};function jb(e,t){const s=pt.now(),i=r(({timestamp:a})=>{const o=a-s;o>=t&&(_n(i),e(o-t))},"checkElapsed");return Oe.setup(i,!0),()=>_n(i)}r(jb,"delay");function Nr(e){return ot(e)?e.get():e}r(Nr,"resolveMotionValue");var kb=class{static{r(this,"NodeStack")}constructor(){this.members=[]}add(e){Ll(this.members,e);for(let t=this.members.length-1;t>=0;t--){const s=this.members[t];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&($r(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if($r(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const s=this.members[t];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,t){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:a}=e.options;(i===void 0||i!==a)&&(e.resumeFrom=s,t&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Er={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qn={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ga=["","X","Y","Z"],wb=1e3,Cb=0;function Ha(e,t,s,i){const{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}r(Ha,"resetDistortingTransform");function wp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=qh(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",Oe,!(a||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&wp(i)}r(wp,"cancelTreeOptimisedTransformAnimations");function Cp({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:a}){return class{static{r(this,"ProjectionNode")}constructor(l={},c=t?.()){this.id=Cb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,As.value&&(Qn.nodes=Qn.calculatedTargetDeltas=Qn.calculatedProjections=0),this.nodes.forEach(Nb),this.nodes.forEach(Ib),this.nodes.forEach(Mb),this.nodes.forEach(Eb),As.addProjectionMetrics&&As.addProjectionMetrics(Qn)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new bb)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Fl),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=nc(l)&&!Nv(l),this.instance=l;const{layoutId:c,layout:d,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let u,p=0;const h=r(()=>this.root.updateBlockedByResize=!1,"resizeUnblockUpdate");Oe.read(()=>{p=window.innerWidth}),e(l,()=>{const x=window.innerWidth;x!==p&&(p=x,this.root.updateBlockedByResize=!0,u&&u(),u=jb(h,250),Er.hasAnimatedSinceResize&&(Er.hasAnimatedSinceResize=!1,this.nodes.forEach(su)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&m&&(c||d)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||m.getDefaultTransition()||Vb,{onLayoutAnimationStart:j,onLayoutAnimationComplete:k}=m.getProps(),v=!this.targetLayout||!jp(this.targetLayout,x),w=!p&&h;if(this.options.layoutRoot||this.resumeFrom||w||p&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...Yl(g,"layout"),onPlay:j,onComplete:k};(m.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(u,w,_.path)}else p||su(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_n(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ob),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Pb),this.nodes.forEach(tu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rb),this.nodes.forEach(_b),this.nodes.forEach(Ab),this.nodes.forEach(Sb)):this.nodes.forEach(nu),this.clearAllSnapshots();const l=pt.now();rt.delta=en(0,1e3/60,l-rt.timestamp),rt.timestamp=l,rt.isProcessing=!0,Ua.update.process(rt),Ua.preRender.process(rt),Ua.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ec.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tb),this.sharedNodes.forEach(Db)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ft(this.snapshot.measuredBox.x)&&!ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=tt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!a)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!bp(this.projectionDelta),d=this.getTransformTemplate(),m=d?d(this.latestValues,""):void 0,u=m!==this.prevTransformTemplateValue;l&&this.instance&&(c||Jn(this.latestValues)||u)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),Ub(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return tt();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bb))){const{scroll:d}=this.root;d&&(Jt(c.x,d.offset.x),Jt(c.y,d.offset.y))}return c}removeElementScroll(l){const c=tt();if(Dt(c,l),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const m=this.path[d],{scroll:u,options:p}=m;m!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Dt(c,l),Jt(c.x,u.offset.x),Jt(c.y,u.offset.y))}return c}applyTransform(l,c=!1,d){const m=d||tt();Dt(m,l);for(let u=0;u<this.path.length;u++){const p=this.path[u];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Jt(m.x,-p.scroll.offset.x),Jt(m.y,-p.scroll.offset.y)),Jn(p.latestValues)&&Sr(m,p.latestValues,p.layout?.layoutBox)}return Jn(this.latestValues)&&Sr(m,this.latestValues,this.layout?.layoutBox),m}removeTransform(l){const c=tt();Dt(c,l);for(let d=0;d<this.path.length;d++){const m=this.path[d];if(!Jn(m.latestValues))continue;let u;m.instance&&(qo(m.latestValues)&&m.updateSnapshot(),u=tt(),Dt(u,m.measurePageBox())),qd(c,m.latestValues,m.snapshot?.layoutBox,u)}return Jn(this.latestValues)&&qd(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:u}=this.options;if(!this.layout||!(m||u))return;this.resolvedRelativeTargetAt=rt.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=tt(),this.targetWithTransforms=tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lb(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Dt(this.target,this.layout.layoutBox),cp(this.target,this.targetDelta)):Dt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0),As.value&&Qn.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qo(this.parent.latestValues)||lp(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tt(),this.relativeTargetOrigin=tt(),Yr(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),Dt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(d=!1),d)return;const{layout:m,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||u))return;Dt(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,h=this.treeScale.y;Fv(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=tt());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ud(this.prevProjectionDelta.x,this.projectionDelta.x),Ud(this.prevProjectionDelta.y,this.projectionDelta.y)),ui(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==h||!Jd(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),As.value&&Qn.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rs(),this.projectionDelta=Rs(),this.projectionDeltaWithTransform=Rs()}setAnimationOrigin(l,c=!1,d){const m=this.snapshot,u=m?m.latestValues:{},p={...this.latestValues},h=Rs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const x=tt(),g=(m?m.source:void 0)!==(this.layout?this.layout.source:void 0),j=this.getStack(),k=!j||j.members.length<=1,v=!!(g&&!k&&this.options.crossfade===!0&&!this.path.some(Fb));this.animationProgress=0;let w;const _=d?.interpolateProjection(l);this.mixTargetDelta=N=>{const P=N/1e3,b=_?.(P);b?(h.x.translate=b.x,h.x.scale=Me(l.x.scale,1,P),h.x.origin=l.x.origin,h.x.originPoint=l.x.originPoint,h.y.translate=b.y,h.y.scale=Me(l.y.scale,1,P),h.y.origin=l.y.origin,h.y.originPoint=l.y.originPoint):(iu(h.x,l.x,P),iu(h.y,l.y,P)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yr(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lb(this.relativeTarget,this.relativeTargetOrigin,x,P),w&&mb(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=tt()),Dt(w,this.relativeTarget)),g&&(this.animationValues=p,fb(p,u,this.latestValues,P,v,k)),b&&b.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=b.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(_n(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Oe.update(()=>{Er.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Us(0)),this.motionValue.jump(0,!1),this.currentAnimation=yb(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:r(c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},"onUpdate"),onComplete:r(()=>{l.onComplete&&l.onComplete(),this.completeAnimation()},"onComplete")}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:m,latestValues:u}=l;if(!(!c||!d||!m)){if(this!==l&&this.layout&&m&&Ap(this.options.animationType,this.layout.layoutBox,m.layoutBox)){d=this.target||tt();const p=ft(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+p;const h=ft(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+h}Dt(c,d),Sr(c,u),ui(this.projectionDeltaWithTransform,this.layoutCorrected,c,u)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new kb),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const m=this.getStack();m&&m.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const m={};d.z&&Ha("z",l,m,this.animationValues);for(let u=0;u<Ga.length;u++)Ha(`rotate${Ga[u]}`,l,m,this.animationValues),Ha(`skew${Ga[u]}`,l,m,this.animationValues);l.render();for(const u in m)l.setStaticValue(u,m[u]),this.animationValues&&(this.animationValues[u]=m[u]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Nr(c?.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Nr(c?.pointerEvents)||""),this.hasProjected&&!Jn(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const u=m.animationValues||m.latestValues;this.applyTransformsToTarget();let p=hb(this.projectionDeltaWithTransform,this.treeScale,u);d&&(p=d(u,p)),l.transform=p;const{x:h,y:x}=this.projectionDelta;l.transformOrigin=`${h.origin*100}% ${x.origin*100}% 0`,m.animationValues?l.opacity=m===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:l.opacity=m===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in Ho){if(u[g]===void 0)continue;const{correct:j,applyTo:k,isCSSVariable:v}=Ho[g],w=p==="none"?u[g]:j(u[g],m);if(k){const _=k.length;for(let N=0;N<_;N++)l[k[N]]=w}else v?this.options.visualElement.renderState.vars[g]=w:l[g]=w}this.options.layoutId&&(l.pointerEvents=m===this?Nr(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(tu),this.root.sharedNodes.clear()}}}r(Cp,"createProjectionNode$1");function Ab(e){e.updateLayout()}r(Ab,"updateLayout");function Sb(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")Yt(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=ft(p);p.min=s[u].min,p.max=p.min+h});else if(a==="x"||a==="y"){const u=a==="x"?"y":"x";Yo(o?t.measuredBox[u]:t.layoutBox[u],s[u])}else Ap(a,t.layoutBox,s)&&Yt(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=ft(s[u]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+h)});const l=Rs();ui(l,s,t.layoutBox);const c=Rs();o?ui(c,e.applyTransform(i,!0),t.measuredBox):ui(c,s,t.layoutBox);const d=!bp(l);let m=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:h}=u;if(p&&h){const x=e.options.layoutAnchor||void 0,g=tt();Yr(g,t.layoutBox,p.layoutBox,x);const j=tt();Yr(j,s,h.layoutBox,x),jp(g,j)||(m=!0),u.options.layoutRoot&&(e.relativeTarget=j,e.relativeTargetOrigin=g,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}r(Sb,"notifyLayoutUpdate");function Nb(e){As.value&&Qn.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}r(Nb,"propagateDirtyNodes");function Eb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}r(Eb,"cleanDirtyNodes");function Tb(e){e.clearSnapshot()}r(Tb,"clearSnapshot");function tu(e){e.clearMeasurements()}r(tu,"clearMeasurements");function Pb(e){e.isLayoutDirty=!0,e.updateLayout()}r(Pb,"forceLayoutMeasure");function nu(e){e.isLayoutDirty=!1}r(nu,"clearIsLayoutDirty");function Rb(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}r(Rb,"ensureDraggedNodesSnapshotted");function _b(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}r(_b,"resetTransformStyle");function su(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}r(su,"finishAnimation");function Ib(e){e.resolveTargetDelta()}r(Ib,"resolveTargetDelta");function Mb(e){e.calcProjection()}r(Mb,"calcProjection");function Ob(e){e.resetSkewAndRotation()}r(Ob,"resetSkewAndRotation");function Db(e){e.removeLeadSnapshot()}r(Db,"removeLeadSnapshots");function iu(e,t,s){e.translate=Me(t.translate,0,s),e.scale=Me(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}r(iu,"mixAxisDeltaLinear");function ru(e,t,s,i){e.min=Me(t.min,s.min,i),e.max=Me(t.max,s.max,i)}r(ru,"mixAxis");function Lb(e,t,s,i){ru(e.x,t.x,s.x,i),ru(e.y,t.y,s.y,i)}r(Lb,"mixBox");function Fb(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}r(Fb,"hasOpacityCrossfade");var Vb={duration:.45,ease:[.4,0,.1,1]},au=r(e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),"userAgentContains"),ou=au("applewebkit/")&&!au("chrome/")?Math.round:It;function lu(e){e.min=ou(e.min),e.max=ou(e.max)}r(lu,"roundAxis");function Ub(e){lu(e.x),lu(e.y)}r(Ub,"roundBox");function Ap(e,t,s){return e==="position"||e==="preserve-aspect"&&!ob(Xd(t),Xd(s),.2)}r(Ap,"shouldAnimatePositionOnly");function Bb(e){return e!==e.root&&e.scroll?.wasRoot}r(Bb,"checkNodeWasScrollRoot");var $b=Cp({attachResizeListener:r((e,t)=>Ci(e,"resize",t),"attachResizeListener"),measureScroll:r(()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),"measureScroll"),checkIsScrollRoot:r(()=>!0,"checkIsScrollRoot")}),Ya={current:void 0},Sp=Cp({measureScroll:r(e=>({x:e.scrollLeft,y:e.scrollTop}),"measureScroll"),defaultParent:r(()=>{if(!Ya.current){const e=new $b({});e.mount(window),e.setOptions({layoutScroll:!0}),Ya.current=e}return Ya.current},"defaultParent"),resetTransform:r((e,t)=>{e.style.transform=t!==void 0?t:"none"},"resetTransform"),checkIsScrollRoot:r(e=>window.getComputedStyle(e).position==="fixed","checkIsScrollRoot")}),oc=(0,f.createContext)({transformPagePoint:r(e=>e,"transformPagePoint"),isStatic:!1,reducedMotion:"never"});function cu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}r(cu,"setRef");function zb(...e){return t=>{let s=!1;const i=e.map(a=>{const o=cu(a,t);return!s&&typeof o=="function"&&(s=!0),o});if(s)return()=>{for(let a=0;a<i.length;a++){const o=i[a];typeof o=="function"?o():cu(e[a],null)}}}}r(zb,"composeRefs");function Kb(...e){return f.useCallback(zb(...e),e)}r(Kb,"useComposedRefs");var Wb=class extends f.Component{static{r(this,"PopChildMeasure")}getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(jr(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=t.offsetParent,i=jr(s)&&s.offsetWidth||0,a=jr(s)&&s.offsetHeight||0,o=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=i-l.width-l.left,l.bottom=a-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function qb({children:e,isPresent:t,anchorX:s,anchorY:i,root:a,pop:o}){const l=(0,f.useId)(),c=(0,f.useRef)(null),d=(0,f.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=(0,f.useContext)(oc),u=o!==!1?e.props?.ref??e?.ref:void 0,p=Kb(c,u);return(0,f.useInsertionEffect)(()=>{const{width:h,height:x,top:g,left:j,right:k,bottom:v,direction:w}=d.current;if(t||o===!1||!c.current||!h||!x)return;const _=w==="rtl",N=s==="left"?_?`right: ${k}`:`left: ${j}`:_?`left: ${j}`:`right: ${k}`,P=i==="bottom"?`bottom: ${v}`:`top: ${g}`;c.current.dataset.motionPopId=l;const b=document.createElement("style");m&&(b.nonce=m);const I=a??document.head;return I.appendChild(b),b.sheet&&b.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${l}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${h}px !important;
|