@opentig/cli 0.2.3 → 0.2.4
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/LICENSE +1 -1
- package/README.md +14 -14
- package/dist/bin.mjs +25 -10
- package/dist/chunks/{cli-L6lvCZdX.mjs → cli-gyjD1t0O.mjs} +611 -268
- package/dist/chunks/network-settings-CdFeKFRB.mjs +142 -0
- package/dist/chunks/{server-Cz0gvydn.mjs → server-DMk8-Xxt.mjs} +557 -105
- package/dist/chunks/{service-manager-Jyx-MWo-.mjs → service-manager-BxSmV_8Z.mjs} +88 -14
- package/dist/client/assets/App-Bfw_TX8q.js +132 -0
- package/dist/client/assets/CreatePullRequestDialog-DyPd6SKH.js +2 -0
- package/dist/client/assets/DiffWorkspace-DCo89dF1.js +7 -0
- package/dist/client/assets/EditableFileViewer-Dotntfij.js +1 -0
- package/dist/client/assets/EditableFileViewer-svutjHZv.css +1 -0
- package/dist/client/assets/ExternalLink-jdtpN_yL.js +1 -0
- package/dist/client/assets/{File-BPxtFxHC.js → File-DHnVtIhS.js} +1 -1
- package/dist/client/assets/FilesView-D6f1hPVy.js +1 -0
- package/dist/client/assets/GitHubAvatar-B6vyoVlh.js +1 -0
- package/dist/client/assets/HistoryView-D9RhzCPY.js +1 -0
- package/dist/client/assets/HtmlFileViewer-Bwmj5umg.js +2 -0
- package/dist/client/assets/{IconAlertTriangle-C1OX2bTH.js → IconAlertTriangle-B9iDJKvP.js} +1 -1
- package/dist/client/assets/IconCheck-C-G-IA13.js +1 -0
- package/dist/client/assets/IconChevronDown-DU5i40lD.js +1 -0
- package/dist/client/assets/{IconEdit-BP5Emwzw.js → IconEdit-CZe-EJxX.js} +1 -1
- package/dist/client/assets/{IconFolderSymlink-BNWI0eXB.js → IconFolderSymlink-DkLEuUb6.js} +1 -1
- package/dist/client/assets/IconGitMerge-D9KEj1cE.js +1 -0
- package/dist/client/assets/IconGitPullRequest-ClaUqyVa.js +1 -0
- package/dist/client/assets/{IconLoader4-Bk6G4Bls.js → IconLoader4-D2VN7u1V.js} +1 -1
- package/dist/client/assets/{IconPlus-DUFNSK_i.js → IconPlus-DJCoD3wt.js} +1 -1
- package/dist/client/assets/{IconSearch-ZL3YVslZ.js → IconSearch-1VQ4P4kW.js} +1 -1
- package/dist/client/assets/{IconSelector-BGwY84R8.js → IconSelector-BVMU1PEt.js} +1 -1
- package/dist/client/assets/ImageFileViewer-3izbFVTw.css +1 -0
- package/dist/client/assets/ImageFileViewer-CdFLl_in.js +1 -0
- package/dist/client/assets/LinkedMarkdown-Bnc2OA63.js +1 -0
- package/dist/client/assets/LinkedText-BD6K3d1t.js +1 -0
- package/dist/client/assets/LocalRefsDialog-Bl-fddap.js +1 -0
- package/dist/client/assets/MarkdownFileViewer-NUAoQmv5.js +2 -0
- package/dist/client/assets/PairingPage-CqrxpC3_.js +1 -0
- package/dist/client/assets/PierreDiffViewer-CDfQ32e0.js +1 -0
- package/dist/client/assets/{PierreEditBoundary-Bt0q7SXc.js → PierreEditBoundary-DAdYNYZ3.js} +1 -1
- package/dist/client/assets/{PierreWorkerPool-DMFigp0u.js → PierreWorkerPool-mIDzTMB9.js} +3 -3
- package/dist/client/assets/PullRequestDiff-n1NZFHKN.js +1 -0
- package/dist/client/assets/PullRequestViewer-u89zl169.js +2 -0
- package/dist/client/assets/PullRequestsView-D6BqvB4E.js +1 -0
- package/dist/client/assets/QuickOpenDialog-BbEifGRi.js +1 -0
- package/dist/client/assets/RepositoryProjectsDialog-EGAsXL-Z.js +1 -0
- package/dist/client/assets/{SearchView-BYz1K1Ta.js → SearchView-BMz7qOdc.js} +1 -1
- package/dist/client/assets/SettingsDialog-DmD7HvhX.js +9 -0
- package/dist/client/assets/Viewer-CDj_vo6w.js +3 -0
- package/dist/client/assets/{abnfDiagram-YUKMZFIV-CpKAN_8n.js → abnfDiagram-YUKMZFIV-It6tW-4v.js} +1 -1
- package/dist/client/assets/{architecture-WOLXFQ4H-DrizVopY.js → architecture-WOLXFQ4H-CaOaChND.js} +1 -1
- package/dist/client/assets/{architectureDiagram-47P4ROYG-gvUijB3H.js → architectureDiagram-47P4ROYG-COtncecA.js} +1 -1
- package/dist/client/assets/{blockDiagram-E7TT5TSB-CdcXmnf_.js → blockDiagram-E7TT5TSB-NU4wFrfP.js} +1 -1
- package/dist/client/assets/{c4Diagram-CRA5TL53-DtoD1jKt.js → c4Diagram-CRA5TL53-0xzM4S8q.js} +1 -1
- package/dist/client/assets/channel-QED-4ACa.js +1 -0
- package/dist/client/assets/checkbox-Dh4T0bCe.js +1 -0
- package/dist/client/assets/{chunk-2BW5OAIV-Bxqf2dFQ.js → chunk-2BW5OAIV-BQMxlSNI.js} +1 -1
- package/dist/client/assets/{chunk-3YJQHVM4-BhzXJiq0.js → chunk-3YJQHVM4-CdP15KtA.js} +1 -1
- package/dist/client/assets/{chunk-4EA7E6EY-CvEILf8c.js → chunk-4EA7E6EY-xRPCCZLU.js} +1 -1
- package/dist/client/assets/{chunk-7TKQ45FW-pTEdzVz3.js → chunk-7TKQ45FW-Cr_UAObV.js} +1 -1
- package/dist/client/assets/{chunk-AW2ZBBNX-LVROkcXk.js → chunk-AW2ZBBNX-DBqqxF2h.js} +1 -1
- package/dist/client/assets/{chunk-DBDB3WZW-FCGrB-q8.js → chunk-DBDB3WZW-BonEIRP2.js} +1 -1
- package/dist/client/assets/{chunk-E2ZNV5FY-B3rGXPn-.js → chunk-E2ZNV5FY-DnKvxSiA.js} +1 -1
- package/dist/client/assets/{chunk-EU5HNXII-D6a_Ly_W.js → chunk-EU5HNXII-DLK0K3sR.js} +1 -1
- package/dist/client/assets/{chunk-FVRAUYC3-B5hy0Ket.js → chunk-FVRAUYC3-DmjKoYAh.js} +1 -1
- package/dist/client/assets/{chunk-HJ2JQQFS-CKHFz1Wl.js → chunk-HJ2JQQFS-AF4phse0.js} +1 -1
- package/dist/client/assets/{chunk-HTAEGDNF-CtwDuO27.js → chunk-HTAEGDNF-CG4pBnUZ.js} +1 -1
- package/dist/client/assets/{chunk-KQW6MTUR-BN3uxLYf.js → chunk-KQW6MTUR-Dd87yj5r.js} +1 -1
- package/dist/client/assets/{chunk-NTY3LDVX-CfXSvyIC.js → chunk-NTY3LDVX-OolU2PaP.js} +1 -1
- package/dist/client/assets/{chunk-VPRB5NB3-LAggcSji.js → chunk-VPRB5NB3-Dnr3edxV.js} +3 -3
- package/dist/client/assets/{chunk-XC4XBNZT-BksIPWQU.js → chunk-XC4XBNZT-CIqGRxkD.js} +1 -1
- package/dist/client/assets/{classDiagram-v2-K4WV4PDN-DH78Maqm.js → classDiagram-v2-K4WV4PDN-CPGawm8n.js} +1 -1
- package/dist/client/assets/createReactComponent-Ctub7J3a.js +1 -0
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DozKlDV1.js → cynefin-EF2NZ3EQ-OA2R9WCH.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-3GCD6N5R-A1yS7NKN.js → cynefinDiagram-3GCD6N5R-DqCVtoKt.js} +1 -1
- package/dist/client/assets/{dagre-W4DXFKR2-DRJ1mmbe.js → dagre-W4DXFKR2-kc3-tkAQ.js} +1 -1
- package/dist/client/assets/{diagram-2UJZ2QOL-B1sI2b2o.js → diagram-2UJZ2QOL-DoBZKT3s.js} +1 -1
- package/dist/client/assets/{diagram-OVF4WLC6-DLE1o4-P.js → diagram-OVF4WLC6-DGkyha_F.js} +1 -1
- package/dist/client/assets/{diagram-PFPMY2P6-UtIEsv14.js → diagram-PFPMY2P6-DpRDDgdV.js} +1 -1
- package/dist/client/assets/{diagram-UMYRVEAY-BwTyzVap.js → diagram-UMYRVEAY-DlsfhYv3.js} +1 -1
- package/dist/client/assets/{diagram-YEKJPTXX-DNPUQqu0.js → diagram-YEKJPTXX-BIhRZzBM.js} +1 -1
- package/dist/client/assets/{diagram-ZIFT7M5P-ClXykQ3I.js → diagram-ZIFT7M5P-mweJcgBZ.js} +1 -1
- package/dist/client/assets/diff-parse.worker-C1IFRYY9.js +13 -0
- package/dist/client/assets/{ebnfDiagram-VR2GEFS7-Dm8VAviu.js → ebnfDiagram-VR2GEFS7-Dn5zyIbZ.js} +1 -1
- package/dist/client/assets/{elk-IJKZMXRS-CEEoPARn.js → elk-IJKZMXRS-eBPlf1-o.js} +1 -1
- package/dist/client/assets/{erDiagram-O2IAPWRE-CaDE4obX.js → erDiagram-O2IAPWRE-WEE519yZ.js} +1 -1
- package/dist/client/assets/{eventmodeling-K75KTNOO-PjYgMkPC.js → eventmodeling-K75KTNOO-BgE_VmNy.js} +1 -1
- package/dist/client/assets/external-url-IUS7RmYD.js +1 -0
- package/dist/client/assets/flowDiagram-OXPTDLAJ-CHQYfkMg.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7TSEDQI-CmkBarBi.js → ganttDiagram-R7TSEDQI-D_1KyJZU.js} +1 -1
- package/dist/client/assets/{gitGraph-VSP46ZUC-DeotTdHj.js → gitGraph-VSP46ZUC-CEbT7DA4.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-XJZIOB7I-uV1hPaZT.js → gitGraphDiagram-XJZIOB7I-QQyYc1gM.js} +1 -1
- package/dist/client/assets/index-DsKvWsTs.js +47 -0
- package/dist/client/assets/index-kyWCnbkb.css +2 -0
- package/dist/client/assets/{info-OHQRW6UA-BQDsGvSl.js → info-OHQRW6UA-ChHAnveo.js} +1 -1
- package/dist/client/assets/{infoDiagram-5W2HQ5XZ-CDfEPsgZ.js → infoDiagram-5W2HQ5XZ-BaxAE7UA.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-K3B6WC7H-Bb7PQGe6.js → ishikawaDiagram-K3B6WC7H-vhUflBE_.js} +1 -1
- package/dist/client/assets/{journeyDiagram-COXZFDF6-BDythglw.js → journeyDiagram-COXZFDF6-C8WWosVa.js} +1 -1
- package/dist/client/assets/{kanban-definition-P3RFRI5V-CvY5kXhh.js → kanban-definition-P3RFRI5V-CU6W9Yi3.js} +1 -1
- package/dist/client/assets/katex-CQfTPFh0.js +1 -0
- package/dist/client/assets/{line-99p2yFnB.js → line-Axq4vVX-.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-BjZYtoJ8.js → mermaid-parser.core-DNeaCX12.js} +3 -3
- package/dist/client/assets/{mermaid.core-DRcXnUox.js → mermaid.core-Dtt7rXw0.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LZFPQGKD-t9LoCpnW.js → mindmap-definition-LZFPQGKD-D_8ZqQot.js} +1 -1
- package/dist/client/assets/{packet-JDAUHWVQ-BlR-5V7K.js → packet-JDAUHWVQ-6z7ujmGF.js} +1 -1
- package/dist/client/assets/{pegDiagram-BGZESJAR-CWeGI-T9.js → pegDiagram-BGZESJAR-3ujyk-bt.js} +1 -1
- package/dist/client/assets/{pie-XZMESJXO-BkvYHWgl.js → pie-XZMESJXO-DvpLy2DB.js} +1 -1
- package/dist/client/assets/{pieDiagram-CAPJLFHJ-CY5PPIr3.js → pieDiagram-CAPJLFHJ-BPMPWyc7.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-GDMTTRAM-kqj-z271.js → quadrantDiagram-GDMTTRAM-BVUCR_lf.js} +1 -1
- package/dist/client/assets/{radar-ABXABTNO-DuEtYatv.js → radar-ABXABTNO-lu14X99R.js} +1 -1
- package/dist/client/assets/{railroad-I3PHUGI6-CVlnj2j9.js → railroad-I3PHUGI6-DI_WtDmt.js} +1 -1
- package/dist/client/assets/{railroad-abnf-LNEFI6M7-9Qiczw4d.js → railroad-abnf-LNEFI6M7-CmWAKZ2T.js} +1 -1
- package/dist/client/assets/{railroad-ebnf-DWYD2UWJ-BNL7TMEg.js → railroad-ebnf-DWYD2UWJ-BWKFU_UH.js} +1 -1
- package/dist/client/assets/{railroad-peg-JR7BVNR7-DdpRxgk6.js → railroad-peg-JR7BVNR7-9wkgzxMB.js} +1 -1
- package/dist/client/assets/{railroadDiagram-SM67HX2B-CDXvYNqW.js → railroadDiagram-SM67HX2B-4JnRbxl_.js} +1 -1
- package/dist/client/assets/{render-markdown-DF9Fy7MD.js → render-markdown-CQi2yKYQ.js} +2 -2
- package/dist/client/assets/{requirementDiagram-X7JNWC4A-BDdhqnZA.js → requirementDiagram-X7JNWC4A-CVJiZZsi.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-UM26HJRW-Rkyk5oEf.js → sankeyDiagram-UM26HJRW-BmlWQdkv.js} +1 -1
- package/dist/client/assets/select-Dq3KDX2O.js +1 -0
- package/dist/client/assets/{sequenceDiagram-ZO4K6R2Y-Coj9ap7h.js → sequenceDiagram-ZO4K6R2Y-zUx3LmPj.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-TBUQTH76-BucWlahR.js → stateDiagram-v2-TBUQTH76-o_ci-2bu.js} +1 -1
- package/dist/client/assets/{swimlanes-N4OXWK64-tEECcFP9.js → swimlanes-N4OXWK64-BlI0GC5-.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-BEeJLN8d.js +8 -0
- package/dist/client/assets/tanstack-CVAt_k_T.js +1 -0
- package/dist/client/assets/{timeline-definition-YOQAKGHF-XvIbGO4d.js → timeline-definition-YOQAKGHF-DLnvF__o.js} +1 -1
- package/dist/client/assets/{treeView-D4JQ5SDB-DuhJpfXe.js → treeView-D4JQ5SDB-DPuMLQhB.js} +1 -1
- package/dist/client/assets/{treemap-SAJKECNS-CLiUWfZh.js → treemap-SAJKECNS-DjxqxJ8-.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-VIAY4XPW-BuwkpV9w.js → usecaseDiagram-VIAY4XPW-BtnFNltN.js} +1 -1
- package/dist/client/assets/utils-D0T3A-kS.js +1 -0
- package/dist/client/assets/{vennDiagram-BLWOH2XV-kfza5Rxq.js → vennDiagram-BLWOH2XV-CAiF2FKz.js} +1 -1
- package/dist/client/assets/viewer-tabs-DkkqN9MD.js +1 -0
- package/dist/client/assets/{wardley-7MLQ67FV-CcbU_Ykg.js → wardley-7MLQ67FV-DAWySamq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YMQ3BMBF-DnxlEg3a.js → wardleyDiagram-YMQ3BMBF-DiBCclEL.js} +1 -1
- package/dist/client/assets/{xychartDiagram-TAQBALBS-BzgtwtvK.js → xychartDiagram-TAQBALBS-B0NgfXz6.js} +1 -1
- package/dist/client/index.html +6 -4
- package/dist/dev.mjs +6 -6
- package/dist/manifest.json +1 -1
- package/dist/server.mjs +1 -1
- package/dist/service-update.mjs +11 -3
- package/dist/utility.mjs +25 -4
- package/package.json +4 -4
- package/dist/client/assets/App-DEIZhWJG.js +0 -132
- package/dist/client/assets/CreatePullRequestDialog-BceOUbYK.js +0 -2
- package/dist/client/assets/DiffWorkspace-BMtV4MMc.js +0 -6
- package/dist/client/assets/EditableFileViewer-B44TSuFu.css +0 -1
- package/dist/client/assets/EditableFileViewer-BE3AsnVa.js +0 -1
- package/dist/client/assets/FilesView-DoVhRfi1.js +0 -1
- package/dist/client/assets/GitHubAvatar-RiePq1Yf.js +0 -1
- package/dist/client/assets/HistoryView-Dl8uqmKe.js +0 -1
- package/dist/client/assets/HtmlFileViewer-xfjY1Swc.js +0 -2
- package/dist/client/assets/IconCheck-BPhxw_LS.js +0 -1
- package/dist/client/assets/IconChevronDown-C3FplJL8.js +0 -1
- package/dist/client/assets/ImageFileViewer-BJBOmpsf.css +0 -1
- package/dist/client/assets/ImageFileViewer-DXaIo7_d.js +0 -1
- package/dist/client/assets/LocalRefsDialog-C5J3kgTe.js +0 -1
- package/dist/client/assets/MarkdownFileViewer-18mvm0f2.js +0 -2
- package/dist/client/assets/PairingPage-BEUj3t0V.js +0 -1
- package/dist/client/assets/PierreDiffViewer-p29h7lW_.js +0 -1
- package/dist/client/assets/PullRequestDiff-C17JA4ko.js +0 -1
- package/dist/client/assets/PullRequestViewer-DaMtkESD.js +0 -2
- package/dist/client/assets/PullRequestsView-44f03VLC.js +0 -1
- package/dist/client/assets/QuickOpenDialog-Bi-L68PU.js +0 -1
- package/dist/client/assets/RepositoryProjectsDialog-DFGn74fe.js +0 -1
- package/dist/client/assets/SettingsDialog-CruoIiyN.js +0 -9
- package/dist/client/assets/Viewer-3WKpwRzo.js +0 -3
- package/dist/client/assets/channel-BqKQxg-1.js +0 -1
- package/dist/client/assets/checkbox-MDl2t9_3.js +0 -1
- package/dist/client/assets/createReactComponent-BfrD_oQK.js +0 -1
- package/dist/client/assets/flowDiagram-OXPTDLAJ-DSokwYKA.js +0 -1
- package/dist/client/assets/index-CoZCJqTQ.js +0 -47
- package/dist/client/assets/index-DUERTTRS.css +0 -2
- package/dist/client/assets/katex-C6e6EqXB.js +0 -1
- package/dist/client/assets/select-pZpCy7qn.js +0 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-DEFKR6Vf.js +0 -8
- package/dist/client/assets/tanstack-CYi5knVJ.js +0 -1
- package/dist/client/assets/viewer-tabs-MMNrJqGE.js +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-Bfw_TX8q.js","assets/rolldown-runtime-C0FnF6B9.js","assets/base-ui-DDpgJXgO.js","assets/tanstack-CVAt_k_T.js","assets/utils-D0T3A-kS.js","assets/createReactComponent-Ctub7J3a.js","assets/IconAlertTriangle-B9iDJKvP.js","assets/IconPlus-DJCoD3wt.js","assets/IconCheck-C-G-IA13.js","assets/select-Dq3KDX2O.js","assets/IconChevronDown-DU5i40lD.js","assets/IconSelector-BVMU1PEt.js","assets/IconGitMerge-D9KEj1cE.js","assets/IconGitPullRequest-ClaUqyVa.js","assets/IconLoader4-D2VN7u1V.js","assets/IconSearch-1VQ4P4kW.js","assets/shortcuts-BzIlT01I.js","assets/PairingPage-CqrxpC3_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,n as t,o as n,r}from"./rolldown-runtime-C0FnF6B9.js";import{Ct as i,_t as a,dt as o,ft as s,gt as c,ht as l,mt as u,pt as d,xt as f,yt as p}from"./base-ui-DDpgJXgO.js";import{t as m}from"./react-BlQ_XOQu.js";import{h,p as g}from"./tanstack-CVAt_k_T.js";import{n as _,t as v}from"./utils-D0T3A-kS.js";import{n as y,t as b}from"./createReactComponent-Ctub7J3a.js";import{t as x}from"./external-url-IUS7RmYD.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var S=`opentig.theme`;function C(e){try{let t=e?.getItem(S);return t===`light`||t===`dark`||t===`system`?t:null}catch{return null}}function ee(e,t=globalThis.localStorage){try{t?.setItem(S,e)}catch{}}function te(e,t){return e===`light`?!1:e===`dark`||t}function ne(e={}){let t=e.root??(typeof document>`u`?null:document.documentElement);if(!t)return!1;let n=e.storage??(typeof localStorage>`u`?null:localStorage),r=e.prefersDark??(typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches),i=te(C(n),r);return t.classList.toggle(`dark`,i),t.classList.toggle(`light`,!i),i}ne();var w=n(i(),1),re=m();function T(){return T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}function ie(e,t){if(e==null)return{};for(var n={},r=Object.getOwnPropertyNames(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}var ae=(0,w.createContext)({});function oe(e){let t=(0,w.useRef)(null);return t.current===null&&(t.current=e()),t.current}var se=typeof window<`u`?w.useLayoutEffect:w.useEffect,ce=(0,w.createContext)(null);function le(e,t){e.indexOf(t)===-1&&e.push(t)}function E(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var D=(e,t,n)=>n>t?t:n<e?e:n,O={},ue=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),de=e=>typeof e==`object`&&!!e,fe=e=>/^0[^.\s]+$/u.test(e);function pe(e){let t;return()=>(t===void 0&&(t=e()),t)}var k=e=>e,me=(...e)=>e.reduce((e,t)=>n=>t(e(n))),he=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ge=class{constructor(){this.subscriptions=[]}add(e){return le(this.subscriptions,e),()=>E(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},A=e=>e*1e3,j=e=>e/1e3,_e=(e,t)=>t?1e3/t*e:0,ve=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ye=1e-7,M=12;function be(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ve(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>ye&&++s<M);return o}function xe(e,t,n,r){if(e===t&&n===r)return k;let i=t=>be(t,0,1,e,n);return e=>e===0||e===1?e:ve(i(e),t,r)}var Se=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ce=e=>t=>1-e(1-t),we=xe(.33,1.53,.69,.99),Te=Ce(we),Ee=Se(Te),De=e=>e>=1?1:(e*=2)<1?.5*Te(e):.5*(2-2**(-10*(e-1))),Oe=e=>1-Math.sin(Math.acos(e)),ke=Ce(Oe),Ae=Se(Oe),je=xe(.42,0,1,1),Me=xe(0,0,.58,1),Ne=xe(.42,0,.58,1),Pe=e=>Array.isArray(e)&&typeof e[0]!=`number`,Fe=e=>Array.isArray(e)&&typeof e[0]==`number`,Ie={linear:k,easeIn:je,easeInOut:Ne,easeOut:Me,circIn:Oe,circInOut:Ae,circOut:ke,backIn:Te,backInOut:Ee,backOut:we,anticipate:De},Le=e=>typeof e==`string`,Re=e=>{if(Fe(e)){e.length;let[t,n,r,i]=e;return xe(t,n,r,i)}return Le(e)?(Ie[e],`${e}`,Ie[e]):e},ze=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Be(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Ve=40;function He(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ze.reduce((e,t)=>(e[t]=Be(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=O.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Ve),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ze.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ze.length;t++)o[ze[t]].cancel(e)},state:i,steps:o}}var{schedule:N,cancel:Ue,state:P,steps:We}=He(typeof requestAnimationFrame<`u`?requestAnimationFrame:k,!0),Ge;function Ke(){Ge=void 0}var F={now:()=>(Ge===void 0&&F.set(P.isProcessing||O.useManualTiming?P.timestamp:performance.now()),Ge),set:e=>{Ge=e,queueMicrotask(Ke)}},qe=e=>t=>typeof t==`string`&&t.startsWith(e),Je=qe(`--`),Ye=qe(`var(--`),Xe=e=>Ye(e)?Ze.test(e.split(`/*`)[0].trim()):!1,Ze=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qe(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var $e={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},et={...$e,transform:e=>D(0,1,e)},tt={...$e,default:1},nt=e=>Math.round(e*1e5)/1e5,rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function it(e){return e==null}var at=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(e,t)=>n=>!!(typeof n==`string`&&at.test(n)&&n.startsWith(e)||t&&!it(n)&&Object.prototype.hasOwnProperty.call(n,t)),st=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(rt);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},ct=e=>D(0,255,e),lt={...$e,transform:e=>Math.round(ct(e))},ut={test:ot(`rgb`,`red`),parse:st(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+lt.transform(e)+`, `+lt.transform(t)+`, `+lt.transform(n)+`, `+nt(et.transform(r))+`)`};function dt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ft={test:ot(`#`),parse:dt,transform:ut.transform},pt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mt=pt(`deg`),I=pt(`%`),L=pt(`px`),ht=pt(`vh`),gt=pt(`vw`),_t={...I,parse:e=>I.parse(e)/100,transform:e=>I.transform(e*100)},vt={test:ot(`hsl`,`hue`),parse:st(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+I.transform(nt(t))+`, `+I.transform(nt(n))+`, `+nt(et.transform(r))+`)`},R={test:e=>ut.test(e)||ft.test(e)||vt.test(e),parse:e=>ut.test(e)?ut.parse(e):vt.test(e)?vt.parse(e):ft.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?ut.transform(e):vt.transform(e),getAnimatableNone:e=>{let t=R.parse(e);return t.alpha=0,R.transform(t)}},yt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bt(e){return isNaN(e)&&typeof e==`string`&&(e.match(rt)?.length||0)+(e.match(yt)?.length||0)>0}var xt=`number`,St=`color`,Ct=`var`,wt=`var(`,Tt="${}",Et=/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 Dt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Et,e=>(R.test(e)?(r.color.push(a),i.push(St),n.push(R.parse(e))):e.startsWith(wt)?(r.var.push(a),i.push(Ct),n.push(e)):(r.number.push(a),i.push(xt),n.push(parseFloat(e))),++a,Tt)).split(Tt),indexes:r,types:i}}function Ot(e){return Dt(e).values}function kt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===xt?nt(r[a]):e===St?R.transform(r[a]):r[a]}return i}}function At(e){return kt(Dt(e))}var jt=e=>typeof e==`number`?0:R.test(e)?R.getAnimatableNone(e):e,Mt=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:jt(e);function Nt(e){let t=Dt(e);return kt(t)(t.values.map((e,n)=>Mt(e,t.split[n])))}var z={test:bt,parse:Ot,createTransformer:At,getAnimatableNone:Nt};function Pt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ft({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Pt(s,r,e+1/3),a=Pt(s,r,e),o=Pt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function It(e,t){return n=>n>0?t:e}var B=(e,t,n)=>e+(t-e)*n,Lt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Rt=[ft,ut,vt],zt=e=>Rt.find(t=>t.test(e));function Bt(e){let t=zt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===vt&&(n=Ft(n)),n}var Vt=(e,t)=>{let n=Bt(e),r=Bt(t);if(!n||!r)return It(e,t);let i={...n};return e=>(i.red=Lt(n.red,r.red,e),i.green=Lt(n.green,r.green,e),i.blue=Lt(n.blue,r.blue,e),i.alpha=B(n.alpha,r.alpha,e),ut.transform(i))},Ht=new Set([`none`,`hidden`]);function Ut(e,t){return Ht.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Wt(e,t){return n=>B(e,t,n)}function Gt(e){return typeof e==`number`?Wt:typeof e==`string`?Xe(e)?It:R.test(e)?Vt:Yt:Array.isArray(e)?Kt:typeof e==`object`?R.test(e)?Vt:qt:It}function Kt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Gt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function qt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Gt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Jt(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Yt=(e,t)=>{let n=z.createTransformer(t),r=Dt(e),i=Dt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ht.has(e)&&!i.values.length||Ht.has(t)&&!r.values.length?Ut(e,t):me(Kt(Jt(r,i),i.values),n):(`${e}${t}`,It(e,t))};function Xt(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?B(e,t,n):Gt(e)(e,t)}var Zt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>N.update(t,e),stop:()=>Ue(t),now:()=>P.isProcessing?P.timestamp:F.now()}},Qt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},$t=2e4;function en(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function tn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(en(r),$t);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:j(i)}}var V={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 nn(e,t){return e*Math.sqrt(1-t*t)}var rn=12;function an(e,t,n){let r=n;for(let n=1;n<rn;n++)r-=e(r)/t(r);return r}var on=.001;function sn({duration:e=V.duration,bounce:t=V.bounce,velocity:n=V.velocity,mass:r=V.mass}){let i,a;V.maxDuration;let o=1-t;o=D(V.minDamping,V.maxDamping,o),e=D(V.minDuration,V.maxDuration,j(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=nn(t,o),c=Math.exp(-i);return on-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=nn(t**2,o);return(-i(t)+on>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=an(i,a,s);if(e=A(e),isNaN(c))return{stiffness:V.stiffness,damping:V.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var cn=[`duration`,`bounce`],ln=[`stiffness`,`damping`,`mass`];function un(e,t){return t.some(t=>e[t]!==void 0)}function dn(e){let t={velocity:V.velocity,stiffness:V.stiffness,damping:V.damping,mass:V.mass,isResolvedFromDuration:!1,...e};if(!un(e,ln)&&un(e,cn)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*D(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:V.mass,stiffness:i,damping:a}}else{let n=sn({...e,velocity:0});t={...t,...n,mass:V.mass},t.isResolvedFromDuration=!0}}return t}function fn(e=V.visualDuration,t=V.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=dn({...n,velocity:-j(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=j(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?V.restSpeed.granular:V.restSpeed.default,i||=v?V.restDelta.granular:V.restDelta.default;let y,b,x,S,C,ee;if(h<1)x=nn(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,ee=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+ee*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let te={calculatedDuration:p&&d||null,velocity:e=>A(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=A(t*(C*n+ee*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=A(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(en(te),$t),t=Qt(t=>te.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return te}fn.applyToOptions=e=>{let t=tn(e,100,fn);return e.ease=t.ease,e.duration=A(t.duration),e.type=`keyframes`,e};var pn=5;function mn(e,t,n){let r=Math.max(t-pn,0);return _e(n-e(r),t-r)}function hn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=fn({keyframes:[f.value,m(f.value)],velocity:mn(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function gn(e,t,n){let r=[],i=n||O.mix||Xt,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=me(Array.isArray(t)?t[n]||k:t,a)),r.push(a)}return r}function _n(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=gn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=he(e[r],e[r+1],n);return s[r](i)};return n?t=>l(D(e[0],e[a-1],t)):l}function vn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=he(0,t,r);e.push(B(n,1,i))}}function yn(e){let t=[0];return vn(t,e.length-1),t}function bn(e,t){return e.map(e=>e*t)}function xn(e,t){return e.map(()=>t||Ne).splice(0,e.length-1)}function Sn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Pe(r)?r.map(Re):Re(r),a={done:!1,value:t[0]},o=_n(bn(n&&n.length===t.length?n:yn(t),e),t,{ease:Array.isArray(i)?i:xn(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Cn=e=>e!==null;function wn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Cn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Tn={decay:hn,inertia:hn,tween:Sn,keyframes:Sn,spring:fn};function En(e){typeof e.type==`string`&&(e.type=Tn[e.type])}var Dn=class{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)}},On=e=>e/100,kn=class extends Dn{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=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==F.now()&&this.tick(F.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(){let{options:e}=this;En(e);let{type:t=Sn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Sn;s!==Sn&&typeof o[0]!=`number`&&(this.mixKeyframes=me(On,Xt(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=en(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=D(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==hn&&(b.value=wn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return j(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+j(e)}get time(){return j(this.currentTime)}set time(e){e=A(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(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return mn(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(F.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Zt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(F.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(),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 An(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var jn=e=>e*180/Math.PI,Mn=e=>Pn(jn(Math.atan2(e[1],e[0]))),Nn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Mn,rotateZ:Mn,skewX:e=>jn(Math.atan(e[1])),skewY:e=>jn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Pn=e=>(e%=360,e<0&&(e+=360),e),Fn=Mn,In=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ln=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Rn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:In,scaleY:Ln,scale:e=>(In(e)+Ln(e))/2,rotateX:e=>Pn(jn(Math.atan2(e[6],e[5]))),rotateY:e=>Pn(jn(Math.atan2(-e[2],e[0]))),rotateZ:Fn,rotate:Fn,skewX:e=>jn(Math.atan(e[4])),skewY:e=>jn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function zn(e){return+!!e.includes(`scale`)}function Bn(e,t){if(!e||e===`none`)return zn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Rn,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Nn,i=t}if(!i)return zn(t);let a=r[t],o=i[1].split(`,`).map(Hn);return typeof a==`function`?a(o):o[a]}var Vn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Bn(n,t)};function Hn(e){return parseFloat(e.trim())}var Un=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Wn=new Set([...Un,`pathRotation`]),Gn=e=>e===$e||e===L,Kn=new Set([`x`,`y`,`z`]),qn=Un.filter(e=>!Kn.has(e));function Jn(e){let t=[];return qn.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Yn={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Bn(t,`x`),y:(e,{transform:t})=>Bn(t,`y`)};Yn.translateX=Yn.x,Yn.translateY=Yn.y;var Xn=new Set,Zn=!1,Qn=!1,$n=!1;function er(){if(Qn){let e=Array.from(Xn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Jn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Qn=!1,Zn=!1,Xn.forEach(e=>e.complete($n)),Xn.clear()}function tr(){Xn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Qn=!0)})}function nr(){$n=!0,tr(),er(),$n=!1}var rr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Xn.add(this),Zn||(Zn=!0,N.read(tr),N.resolveKeyframes(er))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}An(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Xn.delete(this)}cancel(){this.state===`scheduled`&&(Xn.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},ir=e=>e.startsWith(`--`);function ar(e,t,n){ir(t)?e.style.setProperty(t,n):e.style[t]=n}var or={};function sr(e,t){let n=pe(e);return()=>or[t]??n()}var cr=sr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),lr=sr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),ur=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,dr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ur([0,.65,.55,1]),circOut:ur([.55,0,1,.45]),backIn:ur([.31,.01,.66,-.59]),backOut:ur([.33,1.53,.69,.99])};function fr(e,t){if(e)return typeof e==`function`?lr()?Qt(e,t):`ease-out`:Fe(e)?ur(e):Array.isArray(e)?e.map(e=>fr(e,t)||dr.easeOut):dr[e]}function pr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=fr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function mr(e){return typeof e==`function`&&`applyToOptions`in e}function hr({type:e,...t}){return mr(e)&&lr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var gr=class extends Dn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=hr(e);this.animation=pr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=wn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ar(t,n,e),this.animation.cancel()}s?.(),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;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return j(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+j(e)}get time(){return j(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=A(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?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&cr()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),k):r(this)}},_r={anticipate:De,backInOut:Ee,circInOut:Ae};function vr(e){return e in _r}function yr(e){typeof e.ease==`string`&&vr(e.ease)&&(e.ease=_r[e.ease])}var br=10,xr=class extends gr{constructor(e){yr(e),En(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new kn({...a,autoplay:!1}),s=Math.max(br,F.now()-this.startTime),c=D(0,br,s-br),l=o.sample(s).value,{name:u}=this.options;i&&u&&ar(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Sr=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(z.test(e)||e===`0`)&&!e.startsWith(`url(`));function Cr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function wr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Sr(i,t),s=Sr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Cr(e)||(n===`spring`||mr(n))&&r}function Tr(e){e.duration=0,e.type=`keyframes`}var Er=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Dr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Or(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Dr.test(e[t]))return!0;return!1}var kr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ar=pe(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function jr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ar()&&n&&(Er.has(n)||kr.has(n)&&Or(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Mr=40,Nr=class extends Dn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||rr;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=F.now();let u=!0;wr(e,i,a,o)||(u=!1,(O.instantAnimations||!s)&&l?.(wn(e,n,t)),e[0]=e[e.length-1],Tr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Mr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&jr(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new xr({...d,element:p})}catch{m=new kn(d)}else m=new kn(d);m.finished.then(()=>{this.notifyFinished()}).catch(k),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}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(),nr()),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 Pr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Fr=30,Ir=e=>!isNaN(parseFloat(e)),Lr={current:void 0},Rr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=F.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ir(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 ge);let n=this.events[e].add(t);return e===`change`?()=>{n(),N.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let 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,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}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||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Lr.current&&Lr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Fr)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Fr);return _e(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 zr(e,t){return new Rr(e,t)}function Br(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Vr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Br(n,e)}var Hr={type:`spring`,stiffness:500,damping:25,restSpeed:10},Ur=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wr={type:`keyframes`,duration:.8},Gr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Kr=(e,{keyframes:t})=>t.length>2?Wr:Wn.has(e)?e.startsWith(`scale`)?Ur(t[1]):Hr:Gr,qr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Jr(e){for(let t in e)if(!qr.has(t))return!0;return!1}var Yr=(e,t,n,r={},i,a)=>o=>{let s=Vr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=A(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Jr(s)||Object.assign(u,Kr(e,u)),u.duration&&=A(u.duration),u.repeatDelay&&=A(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Tr(u),u.delay===0&&(d=!0)),(O.instantAnimations||O.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Tr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=wn(u.keyframes,s);if(e!==void 0){N.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new kn(u):new Nr(u)},Xr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zr(e){let t=Xr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Qr(e,t,n=1){`${e}`;let[r,i]=Zr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ue(e)?parseFloat(e):e}return Xe(i)?Qr(i,t,n+1):i}function $r(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ei(e,t,n,r){if(typeof t==`function`){let[i,a]=$r(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=$r(r);t=t(n===void 0?e.custom:n,i,a)}return t}function ti(e,t,n){let r=e.getProps();return ei(r,t,n===void 0?r.custom:n,e)}var ni=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Un]),ri=e=>Array.isArray(e);function ii(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zr(n))}function ai(e){return ri(e)?e[e.length-1]||0:e}function oi(e,t){let{transitionEnd:n={},transition:r={},...i}=ti(e,t)||{};i={...i,...n};for(let t in i)ii(e,t,ai(i[t]))}var H=e=>!!(e&&e.getVelocity);function si(e){return!!(H(e)&&e.add)}function ci(e,t){let n=e.getValue(`willChange`);if(si(n))return n.add(t);if(!n&&O.WillChange){let n=new O.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function li(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var ui=`data-`+li(`framerAppearId`);function di(e){return e.props[ui]}function fi({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function pi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Br(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&fi(f,t))continue;let o={delay:n,...Vr(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){N.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=di(e);if(n){let e=window.MotionHandoffAnimation(n,t,N);e!==null&&(o.startTime=e,p=!0)}}ci(e,t);let m=l??e.shouldReduceMotion;r.start(Yr(t,r,i,m&&ni.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>N.update(()=>{o&&oi(e,o)});d.length?Promise.all(d).then(t):t()}return d}function mi(e,t,n={}){let r=ti(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(pi(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return hi(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function hi(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(mi(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Pr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function gi(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>mi(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=mi(e,t,n);else{let i=typeof t==`function`?ti(e,t,n.custom):t;r=Promise.all(pi(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var _i={test:e=>e===`auto`,parse:e=>e},vi=e=>t=>t.test(e),yi=[$e,L,I,mt,gt,ht,_i],bi=e=>yi.find(vi(e));function xi(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||fe(e)}var Si=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Ci(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(rt)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Si.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var wi=/\b([a-z-]*)\(.*?\)/gu,Ti={...z,getAnimatableNone:e=>{let t=e.match(wi);return t?t.map(Ci).join(` `):e}},Ei={...z,getAnimatableNone:e=>{let t=z.parse(e);return z.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Di={...$e,transform:Math.round},Oi={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,rotate:mt,pathRotation:mt,rotateX:mt,rotateY:mt,rotateZ:mt,scale:tt,scaleX:tt,scaleY:tt,scaleZ:tt,skew:mt,skewX:mt,skewY:mt,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:et,originX:_t,originY:_t,originZ:L,zIndex:Di,fillOpacity:et,strokeOpacity:et,numOctaves:Di},ki={...Oi,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:Ti,WebkitFilter:Ti,mask:Ei,WebkitMask:Ei},Ai=e=>ki[e],ji=new Set([Ti,Ei]);function Mi(e,t){let n=Ai(e);return ji.has(n)||(n=z),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Ni=new Set([`auto`,`none`,`0`]);function Pi(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ni.has(t)&&Dt(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Mi(n,i)}var Fi=class extends rr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Xe(r))){let i=Qr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!ni.has(n)||e.length!==2)return;let[r,i]=e,a=bi(r),o=bi(i);if(Qe(r)!==Qe(i)&&Yn[n])this.needsMeasurement=!0;else if(a!==o){if(Gn(a)&&Gn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Yn[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||xi(e[t]))&&n.push(t);n.length&&Pi(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Yn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},Ii=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Li(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Ri=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function zi(e){return de(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Bi,cancel:Vi}=He(queueMicrotask,!1),U={x:!1,y:!1};function Hi(){return U.x||U.y}function Ui(e){return e===`x`||e===`y`?U[e]?null:(U[e]=!0,()=>{U[e]=!1}):U.x||U.y?null:(U.x=U.y=!0,()=>{U.x=U.y=!1})}function Wi(e,t){let n=Li(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Gi(e){return!(e.pointerType===`touch`||Hi())}function Ki(e,t,n={}){let[r,i,a]=Wi(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Gi(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var qi=(e,t)=>t?e===t||qi(e,t.parentElement):!1,Ji=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Yi=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Xi(e){return Yi.has(e.tagName)||e.isContentEditable===!0}var Zi=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Qi(e){return Zi.has(e.tagName)||e.isContentEditable===!0}var $i=new WeakSet;function ea(e){return t=>{t.key===`Enter`&&e(t)}}function ta(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var na=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ea(()=>{if($i.has(n))return;ta(n,`down`);let e=ea(()=>{ta(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ta(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ra(e){return Ji(e)&&!Hi()}var ia=new WeakSet;function aa(e,t,n={}){let[r,i,a]=Wi(e,n),o=e=>{let r=e.currentTarget;if(!ra(e)||ia.has(e))return;$i.add(r),n.stopPropagation&&ia.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),$i.has(r)&&$i.delete(r),ra(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||qi(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),zi(e)&&(e.addEventListener(`focus`,e=>na(e,i)),!Xi(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function oa(e){return de(e)&&`ownerSVGElement`in e}var sa=new WeakMap,ca,la=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:oa(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ua=la(`inline`,`width`,`offsetWidth`),da=la(`block`,`height`,`offsetHeight`);function fa({target:e,borderBoxSize:t}){sa.get(e)?.forEach(n=>{n(e,{get width(){return ua(e,t)},get height(){return da(e,t)}})})}function pa(e){e.forEach(fa)}function ma(){typeof ResizeObserver<`u`&&(ca=new ResizeObserver(pa))}function ha(e,t){ca||ma();let n=Li(e);return n.forEach(e=>{let n=sa.get(e);n||(n=new Set,sa.set(e,n)),n.add(t),ca?.observe(e)}),()=>{n.forEach(e=>{let n=sa.get(e);n?.delete(t),n?.size||ca?.unobserve(e)})}}var ga=new Set,_a;function va(){_a=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ga.forEach(t=>t(e))},window.addEventListener(`resize`,_a)}function ya(e){return ga.add(e),_a||va(),()=>{ga.delete(e),!ga.size&&typeof _a==`function`&&(window.removeEventListener(`resize`,_a),_a=void 0)}}function ba(e,t){return typeof e==`function`?ya(e):ha(e,t)}var xa={value:null,addProjectionMetrics:null};function Sa(e){return oa(e)&&e.tagName===`svg`}var Ca=[...yi,R,z],wa=e=>Ca.find(vi(e)),Ta=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ea=()=>({x:Ta(),y:Ta()}),Da=()=>({min:0,max:0}),W=()=>({x:Da(),y:Da()}),Oa=new WeakMap;function ka(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Aa(e){return typeof e==`string`||Array.isArray(e)}var ja=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ma=[`initial`,...ja];function Na(e){return ka(e.animate)||Ma.some(t=>Aa(e[t]))}function Pa(e){return!!(Na(e)||e.variants)}function Fa(e,t,n){for(let r in t){let i=t[r],a=n[r];if(H(i))e.addValue(r,i);else if(H(a))e.addValue(r,zr(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,zr(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ia={current:null},La={current:!1},Ra=typeof window<`u`;function za(){if(La.current=!0,Ra){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ia.current=e.matches;e.addEventListener(`change`,t),t()}else Ia.current=!1}}var Ba=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Va={};function Ha(e){Va=e}function Ua(){return Va}var Wa=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){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=rr,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=()=>{let e=F.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,N.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Na(t),this.isVariantNode=Pa(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&H(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Oa.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((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(La.current||za(),this.shouldReduceMotion=Ia.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(),Ue(this.notifyUpdate),Ue(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),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&&Er.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new gr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:A(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Wn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&N.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}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 Va){let t=Va[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):W()}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 t=0;t<Ba.length;t++){let n=Ba[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Fa(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){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let 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 n=this.values.get(e);return n===void 0&&t!==void 0&&(n=zr(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ue(n)||fe(n))?n=parseFloat(n):!wa(n)&&z.test(t)&&(n=Mi(e,t)),this.setBaseTarget(e,H(n)?n.get():n)),H(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=ei(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!H(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ge),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Bi.render(this.render)}},Ga=class extends Wa{constructor(){super(...arguments),this.KeyframeResolver=Fi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;H(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Ka=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function qa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ja({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ya(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Xa(e){return e===void 0||e===1}function Za({scale:e,scaleX:t,scaleY:n}){return!Xa(e)||!Xa(t)||!Xa(n)}function Qa(e){return Za(e)||$a(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $a(e){return eo(e.x)||eo(e.y)}function eo(e){return e&&e!==`0%`}function to(e,t,n){return n+t*(e-n)}function no(e,t,n,r,i){return i!==void 0&&(e=to(e,i,r)),to(e,n,r)+t}function ro(e,t=0,n=1,r,i){e.min=no(e.min,t,n,r,i),e.max=no(e.max,t,n,r,i)}function io(e,{x:t,y:n}){ro(e.x,t.translate,t.scale,t.originPoint),ro(e.y,n.translate,n.scale,n.originPoint)}var ao=.999999999999,oo=1.0000000000001;function so(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(G(e.x,-a.scroll.offset.x),G(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,io(e,o)),r&&Qa(a.latestValues)&&uo(e,a.latestValues,a.layout?.layoutBox))}t.x<oo&&t.x>ao&&(t.x=1),t.y<oo&&t.y>ao&&(t.y=1)}function G(e,t){e.min+=t,e.max+=t}function co(e,t,n,r,i=.5){ro(e,t,n,B(e.min,e.max,i),r)}function lo(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function uo(e,t,n){let r=n??e;co(e.x,lo(t.x,r.x),t.scaleX,t.scale,t.originX),co(e.y,lo(t.y,r.y),t.scaleY,t.scale,t.originY)}function fo(e,t){return qa(Ya(e.getBoundingClientRect(),t))}function po(e,t,n){let r=fo(e,n),{scroll:i}=t;return i&&(G(r.x,i.offset.x),G(r.y,i.offset.y)),r}var mo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ho=Un.length;function go(e,t,n){let r=``,i=!0;for(let a=0;a<ho;a++){let o=Un[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Ri(s,Oi[o]);if(!c){i=!1;let t=mo[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Ri(a,Oi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function _o(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Wn.has(e))o=!0;else if(Je(e))i[e]=n;else{let t=Ri(n,Oi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=go(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function vo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function yo(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var bo={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(L.test(e))e=parseFloat(e);else return e}return`${yo(e,t.target.x)}% ${yo(e,t.target.y)}%`}},xo={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=z.parse(e);if(i.length>5)return r;let a=z.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=B(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},So={borderRadius:{...bo,applyTo:[...Ii]},borderTopLeftRadius:bo,borderTopRightRadius:bo,borderBottomLeftRadius:bo,borderBottomRightRadius:bo,boxShadow:xo};function Co(e,{layout:t,layoutId:n}){return Wn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!So[e]||e===`opacity`)}function wo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(H(r[t])||i&&H(i[t])||Co(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function To(e){return window.getComputedStyle(e)}var Eo=class extends Ga{constructor(){super(...arguments),this.type=`html`,this.renderInstance=vo}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Wn.has(t))return this.projection?.isProjecting?zn(t):Vn(e,t);{let n=To(e),r=(Je(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return fo(e,t)}build(e,t,n){_o(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return wo(e,t,n)}},Do={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Oo={offset:`strokeDashoffset`,array:`strokeDasharray`};function ko(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Do:Oo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Ao=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function jo(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(_o(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ao)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ko(d,i,a,o,!1)}var Mo=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`]),No=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Po(e,t,n,r){vo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Mo.has(n)?n:li(n),t.attrs[n])}function Fo(e,t,n){let r=wo(e,t,n);for(let n in e)if(H(e[n])||H(t[n])){let t=Un.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Io=class extends Ga{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=W}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Wn.has(t)){let e=Ai(t);return e&&e.default||0}return t=Mo.has(t)?t:li(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Fo(e,t,n)}build(e,t,n){jo(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Po(e,t,n,r)}mount(e){this.isSVGTag=No(e.tagName),super.mount(e)}},Lo=Ma.length;function Ro(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Ro(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Lo;n++){let r=Ma[n],i=e.props[r];(Aa(i)||i===!1)&&(t[r]=i)}return t}function zo(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Bo=[...ja].reverse(),Vo=ja.length;function Ho(e){return t=>Promise.all(t.map(({animation:t,options:n})=>gi(e,t,n)))}function Uo(e){let t=Ho(e),n=Ko(),r=!0,i=!1,a=t=>(n,r)=>{let i=ti(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Ro(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Vo;t++){let p=Bo[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Aa(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ka(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Wo(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:ee={}}=m,te={...ee,...C},ne=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in te){let t=C[e],n=ee[e];if(d.hasOwnProperty(e))continue;let r=!1;r=ri(t)&&ri(n)?!zo(t,n)||y:t!==n,r?t==null?u.add(e):ne(e):t!==void 0&&u.has(e)?ne(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let w=v&&y;b&&(!w||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!w&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=ti(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Pr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=ti(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ko(),i=!0}}}function Wo(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!zo(t,e):!1}function Go(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ko(){return{animate:Go(!0),whileInView:Go(),whileHover:Go(),whileTap:Go(),whileDrag:Go(),whileFocus:Go(),exit:Go()}}function qo(e,t){e.min=t.min,e.max=t.max}function K(e,t){qo(e.x,t.x),qo(e.y,t.y)}function Jo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Yo=.9999,Xo=1.0001,Zo=-.01,Qo=.01;function q(e){return e.max-e.min}function $o(e,t,n){return Math.abs(e-t)<=n}function es(e,t,n,r=.5){e.origin=r,e.originPoint=B(t.min,t.max,e.origin),e.scale=q(n)/q(t),e.translate=B(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Yo&&e.scale<=Xo||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zo&&e.translate<=Qo||isNaN(e.translate))&&(e.translate=0)}function ts(e,t,n,r){es(e.x,t.x,n.x,r?r.originX:void 0),es(e.y,t.y,n.y,r?r.originY:void 0)}function ns(e,t,n,r=0){e.min=(r?B(n.min,n.max,r):n.min)+t.min,e.max=e.min+q(t)}function rs(e,t,n,r){ns(e.x,t.x,n.x,r?.x),ns(e.y,t.y,n.y,r?.y)}function is(e,t,n,r=0){let i=r?B(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+q(t)}function as(e,t,n,r){is(e.x,t.x,n.x,r?.x),is(e.y,t.y,n.y,r?.y)}function os(e,t,n,r,i){return e-=t,e=to(e,1/n,r),i!==void 0&&(e=to(e,1/i,r)),e}function ss(e,t=0,n=1,r=.5,i,a=e,o=e){if(I.test(t)&&(t=parseFloat(t),t=B(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=B(a.min,a.max,r);e===a&&(s-=t),e.min=os(e.min,t,n,s,i),e.max=os(e.max,t,n,s,i)}function cs(e,t,[n,r,i],a,o){ss(e,t[n],t[r],t[i],t.scale,a,o)}var ls=[`x`,`scaleX`,`originX`],us=[`y`,`scaleY`,`originY`];function ds(e,t,n,r){cs(e.x,t,ls,n?n.x:void 0,r?r.x:void 0),cs(e.y,t,us,n?n.y:void 0,r?r.y:void 0)}function fs(e){return e.translate===0&&e.scale===1}function ps(e){return fs(e.x)&&fs(e.y)}function ms(e,t){return e.min===t.min&&e.max===t.max}function hs(e,t){return ms(e.x,t.x)&&ms(e.y,t.y)}function gs(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function _s(e,t){return gs(e.x,t.x)&&gs(e.y,t.y)}function vs(e){return q(e.x)/q(e.y)}function ys(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function J(e){return[e(`x`),e(`y`)]}function bs(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var xs=Ii.length,Ss=e=>typeof e==`string`?parseFloat(e):e,Cs=e=>typeof e==`number`||L.test(e);function ws(e,t,n,r,i,a){i?(e.opacity=B(0,n.opacity??1,Es(r)),e.opacityExit=B(t.opacity??1,0,Ds(r))):a&&(e.opacity=B(t.opacity??1,n.opacity??1,r));for(let i=0;i<xs;i++){let a=Ii[i],o=Ts(t,a),s=Ts(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Cs(o)===Cs(s)?(e[a]=Math.max(B(Ss(o),Ss(s),r),0),(I.test(s)||I.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=B(t.rotate||0,n.rotate||0,r))}function Ts(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Es=Os(0,.5,ke),Ds=Os(.5,.95,k);function Os(e,t,n){return r=>r<e?0:r>t?1:n(he(e,t,r))}function ks(e,t,n){let r=H(e)?e:zr(e);return r.start(Yr(``,r,t,n)),r.animation}function As(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var js=(e,t)=>e.depth-t.depth,Ms=class{constructor(){this.children=[],this.isDirty=!1}add(e){le(this.children,e),this.isDirty=!0}remove(e){E(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(js),this.isDirty=!1,this.children.forEach(e)}};function Ns(e,t){let n=F.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Ue(r),e(a-t))};return N.setup(r,!0),()=>Ue(r)}function Ps(e){return H(e)?e.get():e}var Fs=class{constructor(){this.members=[]}add(e){le(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(E(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(E(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.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)}},Is={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ls={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Rs=[``,`X`,`Y`,`Z`],zs=1e3,Bs=0;function Vs(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Hs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=di(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,N,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Hs(r)}function Us({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Bs++,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,xa.value&&(Ls.nodes=Ls.calculatedTargetDeltas=Ls.calculatedProjections=0),this.nodes.forEach(Ks),this.nodes.forEach(tc),this.nodes.forEach(nc),this.nodes.forEach(qs),xa.addProjectionMetrics&&xa.addProjectionMetrics(Ls)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ms)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ge),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=oa(t)&&!Sa(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;N.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Ns(i,250),Is.hasAnimatedSinceResize&&(Is.hasAnimatedSinceResize=!1,this.nodes.forEach(ec)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||lc,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!_s(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Vr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||ec(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ue(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(rc),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Hs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Xs),this.nodes.forEach(Ys);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qs),this.nodes.forEach($s),this.nodes.forEach(Ws),this.nodes.forEach(Gs)):this.nodes.forEach(Zs),this.clearAllSnapshots();let e=F.now();P.delta=D(0,1e3/60,e-P.timestamp),P.timestamp=e,P.isProcessing=!0,We.update.process(P),We.preRender.process(P),We.render.process(P),P.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Js),this.sharedNodes.forEach(ic)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!q(this.snapshot.measuredBox.x)&&!q(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=W(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ps(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Qa(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),pc(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return W();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hc))){let{scroll:e}=this.root;e&&(G(t.x,e.offset.x),G(t.y,e.offset.y))}return t}removeElementScroll(e){let t=W();if(K(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&K(t,e),G(t.x,i.offset.x),G(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||W();K(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(G(r.x,-n.scroll.offset.x),G(r.y,-n.scroll.offset.y)),Qa(n.latestValues)&&uo(r,n.latestValues,n.layout?.layoutBox)}return Qa(this.latestValues)&&uo(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=W();K(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Qa(n.latestValues))continue;let r;n.instance&&(Za(n.latestValues)&&n.updateSnapshot(),r=W(),K(r,n.measurePageBox())),ds(t,n.latestValues,n.snapshot?.layoutBox,r)}return Qa(this.latestValues)&&ds(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}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!==P.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=P.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=W(),this.targetWithTransforms=W()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),rs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):K(this.target,this.layout.layoutBox),io(this.target,this.targetDelta)):K(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),xa.value&&Ls.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Za(this.parent.latestValues)||$a(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=W(),this.relativeTargetOrigin=W(),as(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),K(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===P.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;K(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;so(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=W());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Jo(this.prevProjectionDelta.x,this.projectionDelta.x),Jo(this.prevProjectionDelta.y,this.projectionDelta.y)),ts(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!ys(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),xa.value&&Ls.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ea(),this.projectionDelta=Ea(),this.projectionDeltaWithTransform=Ea()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ea();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=W(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(cc));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=B(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=B(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ac(o.x,e.x,n),ac(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(as(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),sc(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&hs(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=W(),K(f,this.relativeTarget)),c&&(this.animationValues=a,ws(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Ue(this.pendingAnimation),void 0),this.pendingAnimation=N.update(()=>{Is.hasAnimatedSinceResize=!0,this.motionValue||=zr(0),this.motionValue.jump(0,!1),this.currentAnimation=ks(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&mc(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||W();let t=q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}K(t,n),uo(t,i),ts(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Fs),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Vs(`z`,e,r,this.animationValues);for(let t=0;t<Rs.length;t++)Vs(`rotate${Rs[t]}`,e,r,this.animationValues),Vs(`skew${Rs[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Ps(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Ps(t?.pointerEvents)||``),this.hasProjected&&!Qa(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=bs(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in So){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=So[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Ps(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ys),this.root.sharedNodes.clear()}}}function Ws(e){e.updateLayout()}function Gs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)J(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;qo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else mc(i,t.layoutBox,n)&&J(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Ea();ts(o,n,t.layoutBox);let s=Ea();a?ts(s,e.applyTransform(r,!0),t.measuredBox):ts(s,n,t.layoutBox);let c=!ps(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=W();as(s,t.layoutBox,i.layoutBox,o);let c=W();as(c,n,a.layoutBox,o),_s(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ks(e){xa.value&&Ls.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function qs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Js(e){e.clearSnapshot()}function Ys(e){e.clearMeasurements()}function Xs(e){e.isLayoutDirty=!0,e.updateLayout()}function Zs(e){e.isLayoutDirty=!1}function Qs(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function $s(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ec(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tc(e){e.resolveTargetDelta()}function nc(e){e.calcProjection()}function rc(e){e.resetSkewAndRotation()}function ic(e){e.removeLeadSnapshot()}function ac(e,t,n){e.translate=B(t.translate,0,n),e.scale=B(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function oc(e,t,n,r){e.min=B(t.min,n.min,r),e.max=B(t.max,n.max,r)}function sc(e,t,n,r){oc(e.x,t.x,n.x,r),oc(e.y,t.y,n.y,r)}function cc(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var lc={duration:.45,ease:[.4,0,.1,1]},uc=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dc=uc(`applewebkit/`)&&!uc(`chrome/`)?Math.round:k;function fc(e){e.min=dc(e.min),e.max=dc(e.max)}function pc(e){fc(e.x),fc(e.y)}function mc(e,t,n){return e===`position`||e===`preserve-aspect`&&!$o(vs(t),vs(n),.2)}function hc(e){return e!==e.root&&e.scroll?.wasRoot}var gc=Us({attachResizeListener:(e,t)=>As(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),_c={current:void 0},vc=Us({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_c.current){let e=new gc({});e.mount(window),e.setOptions({layoutScroll:!0}),_c.current=e}return _c.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),yc=(0,w.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function bc(e=!0){let t=(0,w.useContext)(ce);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,w.useId)();(0,w.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,w.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var xc=(0,w.createContext)({strict:!1}),Sc={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Cc=!1;function wc(){if(Cc)return;let e={};for(let t in Sc)e[t]={isEnabled:e=>Sc[t].some(t=>!!e[t])};Ha(e),Cc=!0}function Tc(){return wc(),Ua()}function Ec(e){let t=Tc();for(let n in e)t[n]={...t[n],...e[n]};Ha(t)}var Dc=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Oc(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Dc.has(e)}var kc=r({default:()=>Ac}),Ac,jc=t((()=>{throw Ac={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),Mc=e=>!Oc(e);function Nc(e){typeof e==`function`&&(Mc=t=>t.startsWith(`on`)?!Oc(t):e(t))}try{Nc((jc(),e(kc)).default)}catch{}function Pc(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(H(e[i])||(Mc(i)||n===!0&&Oc(i)||!t&&!Oc(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var Fc=(0,w.createContext)({});function Ic(e,t){if(Na(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Aa(t)?t:void 0,animate:Aa(n)?n:void 0}}return e.inherit===!1?{}:t}function Lc(e){let{initial:t,animate:n}=Ic(e,(0,w.useContext)(Fc));return(0,w.useMemo)(()=>({initial:t,animate:n}),[Rc(t),Rc(n)])}function Rc(e){return Array.isArray(e)?e.join(` `):e}var zc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Bc(e,t,n){for(let r in t)!H(t[r])&&!Co(r,n)&&(e[r]=t[r])}function Vc({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=zc();return _o(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Hc(e,t){let n=e.style||{},r={};return Bc(r,n,e),Object.assign(r,Vc(e,t)),r}function Uc(e,t){let n={},r=Hc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Wc=()=>({...zc(),attrs:{}});function Gc(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=Wc();return jo(n,t,No(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Bc(t,e.style,e),i.style={...t,...i.style}}return i}var Kc=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function qc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Kc.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jc(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??qc(e)?Gc:Uc)(t,r,i,e),c=Pc(t,typeof e==`string`,a),l=e===w.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,w.useMemo)(()=>H(u)?u.get():u,[u]);return(0,w.createElement)(e,{...l,children:d})}function Yc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xc(n,r,i,e),renderState:t()}}function Xc(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Ps(a[e]);let{initial:o,animate:s}=e,c=Na(e),l=Pa(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ka(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=ei(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Zc=e=>(t,n)=>{let r=(0,w.useContext)(Fc),i=(0,w.useContext)(ce),a=()=>Yc(e,t,r,i);return n?a():oe(a)},Qc=Zc({scrapeMotionValuesFromProps:wo,createRenderState:zc}),$c=Zc({scrapeMotionValuesFromProps:Fo,createRenderState:Wc}),el=Symbol.for(`motionComponentSymbol`);function tl(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var nl=(0,w.createContext)({});function rl(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function il(e,t,n,r,i,a){let{visualElement:o}=(0,w.useContext)(Fc),s=(0,w.useContext)(xc),c=(0,w.useContext)(ce),l=(0,w.useContext)(yc),u=l.reducedMotion,d=l.skipAnimations,f=(0,w.useRef)(null),p=(0,w.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,w.useContext)(nl);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&al(f.current,n,i,h);let g=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[ui],v=(0,w.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return se(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,w.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function al(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ol(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&rl(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ol(e){if(e)return e.options.allowProjection===!1?ol(e.parent):e.projection}var Y=f();function sl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Ec(r);let a=n?n===`svg`:qc(e),o=a?$c:Qc;function s(n,s){let c,l={...(0,w.useContext)(yc),...n,layoutId:cl(n)},{isStatic:u}=l,d=Lc(n),f=o(n,u);if(!u&&typeof window<`u`){ll(l,r);let t=ul(l);c=t.MeasureLayout,d.visualElement=il(e,f,l,i,t.ProjectionNode,a)}return(0,Y.jsxs)(Fc.Provider,{value:d,children:[c&&d.visualElement?(0,Y.jsx)(c,{visualElement:d.visualElement,...l}):null,Jc(e,n,tl(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,w.forwardRef)(s);return c[el]=e,c}function cl({layoutId:e}){let t=(0,w.useContext)(ae).id;return t&&e!==void 0?t+`-`+e:e}function ll(e,t){(0,w.useContext)(xc).strict}function ul(e){let{drag:t,layout:n}=Tc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function dl(e,t){if(typeof Proxy>`u`)return sl;let n=new Map,r=(n,r)=>sl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,sl(a,void 0,e,t)),n.get(a))})}var fl=(e,t)=>t.isSVG??qc(e)?new Io(t):new Eo(t,{allowProjection:e!==w.Fragment}),pl=class extends Ka{constructor(e){super(e),e.animationState||=Uo(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ka(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},ml=0,hl={animation:{Feature:pl},exit:{Feature:class extends Ka{constructor(){super(...arguments),this.id=ml++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=ti(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function gl(e){return{point:{x:e.pageX,y:e.pageY}}}var _l=e=>t=>Ji(t)&&e(t,gl(t));function vl(e,t,n,r){return As(e,t,_l(n),r)}var yl=({current:e})=>e?e.ownerDocument.defaultView:null,bl=(e,t)=>Math.abs(e-t);function xl(e,t){let n=bl(e.x,t.x),r=bl(e.y,t.y);return Math.sqrt(n**2+r**2)}var Sl=new Set([`auto`,`scroll`]),Cl=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wl(this.lastRawMoveEventInfo,this.transformPagePoint));let e=El(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=xl(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=P;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=wl(t,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=El(e.type===`pointercancel`?this.lastMoveEventInfo:wl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ji(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=wl(gl(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=P;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,El(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=me(vl(this.contextWindow,`pointermove`,this.handlePointerMove,d),vl(this.contextWindow,`pointerup`,this.handlePointerUp,d),vl(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Sl.has(e.overflowX)||Sl.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),N.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ue(this.updatePoint)}};function wl(e,t){return t?{point:t(e.point)}:e}function Tl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function El({point:e},t){return{point:e,delta:Tl(e,Ol(t)),offset:Tl(e,Dl(t)),velocity:kl(t,.1)}}function Dl(e){return e[0]}function Ol(e){return e[e.length-1]}function kl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Ol(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>A(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>A(t)*2&&(r=e[1]);let a=j(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Al(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?B(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?B(n,e,r.max):Math.min(e,n)),e}function jl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Ml(e,{top:t,left:n,bottom:r,right:i}){return{x:jl(e.x,n,i),y:jl(e.y,t,r)}}function Nl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Pl(e,t){return{x:Nl(e.x,t.x),y:Nl(e.y,t.y)}}function Fl(e,t){let n=.5,r=q(e),i=q(t);return i>r?n=he(t.min,t.max-r,e.min):r>i&&(n=he(e.min,e.max-i,t.min)),D(0,1,n)}function Il(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Ll=.35;function Rl(e=Ll){return e===!1?e=0:e===!0&&(e=Ll),{x:zl(e,`left`,`right`),y:zl(e,`top`,`bottom`)}}function zl(e,t,n){return{min:Bl(e,t),max:Bl(e,n)}}function Bl(e,t){return typeof e==`number`?e:e[t]||0}var Vl=new WeakMap,Hl=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=W(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(gl(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ui(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),J(e=>{let t=this.getAxisMotionValue(e).get()||0;if(I.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&N.update(()=>i(e,t),!1,!0),ci(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Kl(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&N.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Cl(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:yl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&N.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Gl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Al(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&rl(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Ml(n.layoutBox,e):!1,this.elastic=Rl(t),r!==this.constraints&&!rl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&J(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Il(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!rl(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=po(n,r.root,this.visualElement.getTransformPagePoint()),a=Pl(r.layout.layoutBox,i);if(t){let e=t(Ja(a));this.hasMutatedConstraints=!!e,e&&(a=qa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=J(o=>{if(!Gl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ci(this.visualElement,e),n.start(Yr(e,n,0,t,this.visualElement,!1))}stopAnimation(){J(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){J(t=>{let{drag:n}=this.getProps();if(!Gl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-B(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!rl(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};J(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Fl({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),J(t=>{if(!Gl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(B(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Vl.set(this.visualElement,this);let e=this.visualElement.current,t=vl(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Qi(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();rl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Wl(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),N.read(r);let o=As(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(J(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Ll,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Ul(e){let t=!0;return()=>{t?t=!1:e()}}function Wl(e,t,n){let r=ba(e,Ul(n)),i=ba(t,Ul(n));return()=>{r(),i()}}function Gl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Kl(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var ql=class extends Ka{constructor(e){super(e),this.removeGroupControls=k,this.removeListeners=k,this.controls=new Hl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||k}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Jl=e=>(t,n)=>{e&&N.update(()=>e(t,n),!1,!0)},Yl=class extends Ka{constructor(){super(...arguments),this.removePointerDownListener=k}onPointerDown(e){this.session=new Cl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Jl(e),onStart:Jl(t),onMove:Jl(n),onEnd:(e,t)=>{delete this.session,r&&N.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=vl(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Xl=!1,Zl=class extends w.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Xl&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Is.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Xl=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||N.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Bi.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Xl=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ql(e){let[t,n]=bc(),r=(0,w.useContext)(ae);return(0,Y.jsx)(Zl,{...e,layoutGroup:r,switchLayoutGroup:(0,w.useContext)(nl),isPresent:t,safeToRemove:n})}var $l={pan:{Feature:Yl},drag:{Feature:ql,ProjectionNode:vc,MeasureLayout:Ql}};function eu(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&N.postRender(()=>i(t,gl(t)))}var tu=class extends Ka{mount(){let{current:e}=this.node;e&&(this.unmount=Ki(e,(e,t)=>(eu(this.node,t,`Start`),e=>eu(this.node,e,`End`))))}unmount(){}},nu=class extends Ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=me(As(this.node.current,`focus`,()=>this.onFocus()),As(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function ru(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&N.postRender(()=>i(t,gl(t)))}var iu=class extends Ka{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=aa(e,(e,t)=>(ru(this.node,t,`Start`),(e,{success:t})=>ru(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},au=new WeakMap,ou=new WeakMap,su=e=>{let t=au.get(e.target);t&&t(e)},cu=e=>{e.forEach(su)};function lu({root:e,...t}){let n=e||document;ou.has(n)||ou.set(n,{});let r=ou.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(cu,{root:e,...t})),r[i]}function uu(e,t,n){let r=lu(t);return au.set(e,n),r.observe(e),()=>{au.delete(e),r.unobserve(e)}}var du={some:0,all:1},fu=class extends Ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:du[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=uu(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(pu(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function pu({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var mu={inView:{Feature:fu},tap:{Feature:iu},focus:{Feature:nu},hover:{Feature:tu}},hu={layout:{ProjectionNode:vc,MeasureLayout:Ql}},gu=dl({...hl,...mu,...$l,...hu},fl);function _u(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}_u(`:root{--sileo-spring-easing:linear(
|
|
3
|
+
0,
|
|
4
|
+
0.002 0.6%,
|
|
5
|
+
0.007 1.2%,
|
|
6
|
+
0.015 1.8%,
|
|
7
|
+
0.026 2.4%,
|
|
8
|
+
0.041 3.1%,
|
|
9
|
+
0.06 3.8%,
|
|
10
|
+
0.108 5.3%,
|
|
11
|
+
0.157 6.6%,
|
|
12
|
+
0.214 8%,
|
|
13
|
+
0.467 13.7%,
|
|
14
|
+
0.577 16.3%,
|
|
15
|
+
0.631 17.7%,
|
|
16
|
+
0.682 19.1%,
|
|
17
|
+
0.73 20.5%,
|
|
18
|
+
0.771 21.8%,
|
|
19
|
+
0.808 23.1%,
|
|
20
|
+
0.844 24.5%,
|
|
21
|
+
0.874 25.8%,
|
|
22
|
+
0.903 27.2%,
|
|
23
|
+
0.928 28.6%,
|
|
24
|
+
0.952 30.1%,
|
|
25
|
+
0.972 31.6%,
|
|
26
|
+
0.988 33.1%,
|
|
27
|
+
1.01 35.7%,
|
|
28
|
+
1.025 38.5%,
|
|
29
|
+
1.034 41.6%,
|
|
30
|
+
1.038 45%,
|
|
31
|
+
1.035 50.1%,
|
|
32
|
+
1.012 64.2%,
|
|
33
|
+
1.003 73%,
|
|
34
|
+
0.999 83.7%,
|
|
35
|
+
1
|
|
36
|
+
);--sileo-duration:600ms;--sileo-height:40px;--sileo-width:350px;--sileo-state-success:oklch(0.723 0.219 142.136);--sileo-state-loading:oklch(0.556 0 0);--sileo-state-error:oklch(0.637 0.237 25.331);--sileo-state-warning:oklch(0.795 0.184 86.047);--sileo-state-info:oklch(0.685 0.169 237.323);--sileo-state-action:oklch(0.623 0.214 259.815)}[data-sileo-toast]{position:relative;cursor:pointer;pointer-events:auto;touch-action:none;border:0;background:0 0;padding:0;width:var(--sileo-width);height:var(--_h,var(--sileo-height));opacity:0;transform:translateZ(0) scale(.95);transform-origin:center;contain:layout style;overflow:visible}[data-sileo-toast][data-state=loading]{cursor:default}[data-sileo-toast][data-ready=true]{opacity:1;transform:translateZ(0) scale(1);transition:transform calc(var(--sileo-duration) * .66) var(--sileo-spring-easing),opacity calc(var(--sileo-duration) * .66) var(--sileo-spring-easing),margin-bottom calc(var(--sileo-duration) * .66) var(--sileo-spring-easing),margin-top calc(var(--sileo-duration) * .66) var(--sileo-spring-easing),height var(--sileo-duration) var(--sileo-spring-easing)}[data-sileo-viewport][data-position^=top] [data-sileo-toast]:not([data-ready=true]){transform:translateY(-6px) scale(.95)}[data-sileo-viewport][data-position^=bottom] [data-sileo-toast]:not([data-ready=true]){transform:translateY(6px) scale(.95)}[data-sileo-toast][data-ready=true][data-exiting=true]{opacity:0;pointer-events:none}[data-sileo-viewport][data-position^=top] [data-sileo-toast][data-ready=true][data-exiting=true]{transform:translateY(-6px) scale(.95)}[data-sileo-viewport][data-position^=bottom] [data-sileo-toast][data-ready=true][data-exiting=true]{transform:translateY(6px) scale(.95)}[data-sileo-canvas]{position:absolute;left:0;right:0;pointer-events:none;transform:translateZ(0);contain:layout style;overflow:visible}[data-sileo-canvas][data-edge=top]{bottom:0;transform:scaleY(-1) translateZ(0)}[data-sileo-canvas][data-edge=bottom]{top:0}[data-sileo-svg]{overflow:visible}[data-sileo-header]{position:absolute;z-index:20;display:flex;align-items:center;padding:.5rem;height:var(--sileo-height);overflow:hidden;left:var(--_px,0);transform:var(--_ht);max-width:var(--_pw)}[data-sileo-toast][data-ready=true] [data-sileo-header]{transition:transform var(--sileo-duration) var(--sileo-spring-easing),left var(--sileo-duration) var(--sileo-spring-easing),max-width var(--sileo-duration) var(--sileo-spring-easing)}[data-sileo-header][data-edge=top]{bottom:0}[data-sileo-header][data-edge=bottom]{top:0}[data-sileo-header-stack]{position:relative;display:inline-flex;align-items:center;height:100%}[data-sileo-header-inner]{display:flex;align-items:center;gap:.5rem;white-space:nowrap;opacity:1;filter:blur(0px);transform:translateZ(0)}[data-sileo-header-inner][data-layer=current]{position:relative;z-index:1;animation:sileo-header-enter var(--sileo-duration) var(--sileo-spring-easing) both}[data-sileo-header-inner][data-exiting=true],[data-sileo-header-inner][data-layer=current]:not(:only-child){will-change:opacity,filter}[data-sileo-header-inner][data-layer=prev]{position:absolute;left:0;top:0;z-index:0;pointer-events:none}[data-sileo-header-inner][data-exiting=true]{animation:sileo-header-exit calc(var(--sileo-duration) * .7) ease forwards}[data-sileo-badge]{display:flex;height:24px;width:24px;flex-shrink:0;align-items:center;justify-content:center;padding:2px;box-sizing:border-box;border-radius:9999px;color:var(--sileo-tone,currentColor);background-color:var(--sileo-tone-bg,transparent)}[data-sileo-title]{font-size:.825rem;line-height:1rem;font-weight:500;text-transform:capitalize;color:var(--sileo-tone,currentColor)}:is([data-sileo-badge],[data-sileo-title],[data-sileo-button])[data-state]{--_c:var(--sileo-state-success)}:is(
|
|
37
|
+
[data-sileo-badge],[data-sileo-title],[data-sileo-button]
|
|
38
|
+
)[data-state=loading]{--_c:var(--sileo-state-loading)}:is(
|
|
39
|
+
[data-sileo-badge],[data-sileo-title],[data-sileo-button]
|
|
40
|
+
)[data-state=error]{--_c:var(--sileo-state-error)}:is(
|
|
41
|
+
[data-sileo-badge],[data-sileo-title],[data-sileo-button]
|
|
42
|
+
)[data-state=warning]{--_c:var(--sileo-state-warning)}:is(
|
|
43
|
+
[data-sileo-badge],[data-sileo-title],[data-sileo-button]
|
|
44
|
+
)[data-state=info]{--_c:var(--sileo-state-info)}:is(
|
|
45
|
+
[data-sileo-badge],[data-sileo-title],[data-sileo-button]
|
|
46
|
+
)[data-state=action]{--_c:var(--sileo-state-action)}:is([data-sileo-badge],[data-sileo-title])[data-state]{--sileo-tone:var(--_c);--sileo-tone-bg:color-mix(in oklch, var(--_c) 20%, transparent)}[data-sileo-content]{position:absolute;left:0;z-index:10;width:100%;pointer-events:none;opacity:var(--_co, 0)}[data-sileo-content]:not([data-visible=true]){content-visibility:hidden}[data-sileo-toast][data-ready=true] [data-sileo-content]{transition:opacity calc(var(--sileo-duration) * .08) ease calc(var(--sileo-duration) * .04)}[data-sileo-content][data-edge=top]{top:0}[data-sileo-content][data-edge=bottom]{top:var(--sileo-height)}[data-sileo-content][data-visible=true]{pointer-events:auto}[data-sileo-toast][data-ready=true] [data-sileo-content][data-visible=true]{transition:opacity calc(var(--sileo-duration) * .6) ease calc(var(--sileo-duration) * .3)}[data-sileo-description]{width:100%;text-align:left;padding:1rem;font-size:.875rem;line-height:1.25rem;contain:layout style paint;content-visibility:auto}[data-sileo-button]{display:flex;align-items:center;justify-content:center;height:1.75rem;padding:0 .625rem;margin-top:.75rem;border-radius:9999px;border:0;font-size:.75rem;font-weight:500;cursor:pointer;color:var(--sileo-btn-color,currentColor);background-color:var(--sileo-btn-bg,transparent);transition:background-color 150ms ease}[data-sileo-button]:hover{background-color:var(--sileo-btn-bg-hover,transparent)}[data-sileo-button][data-state]{--sileo-btn-color:var(--_c);--sileo-btn-bg:color-mix(in oklch, var(--_c) 15%, transparent);--sileo-btn-bg-hover:color-mix(in oklch, var(--_c) 25%, transparent)}[data-sileo-icon=spin]{animation:sileo-spin 1s linear infinite}@keyframes sileo-spin{to{transform:rotate(360deg)}}@keyframes sileo-header-enter{from{opacity:0;filter:blur(6px)}to{opacity:1;filter:blur(0px)}}@keyframes sileo-header-exit{from{opacity:1;filter:blur(0px)}to{opacity:0;filter:blur(6px)}}[data-sileo-viewport]{position:fixed;z-index:50;display:flex;gap:.75rem;padding:.75rem;pointer-events:none;max-width:calc(100vw - 1.5rem);contain:layout style}[data-sileo-viewport][data-position^=top] [data-sileo-toast]:not([data-ready=true]){margin-bottom:calc(-1 * (var(--sileo-height) + .75rem))}[data-sileo-viewport][data-position^=bottom] [data-sileo-toast]:not([data-ready=true]){margin-top:calc(-1 * (var(--sileo-height) + .75rem))}[data-sileo-viewport][data-position^=top]{top:0;flex-direction:column-reverse}[data-sileo-viewport][data-position^=bottom]{bottom:0;flex-direction:column}[data-sileo-viewport][data-position$=left]{left:0;align-items:flex-start}[data-sileo-viewport][data-position$=right]{right:0;align-items:flex-end}[data-sileo-viewport][data-position$=center]{left:50%;transform:translateX(-50%);align-items:center}@media (prefers-reduced-motion:no-preference){[data-sileo-toast][data-ready=true]:hover,[data-sileo-toast][data-ready=true][data-exiting=true]{will-change:transform,opacity,height}}@media (prefers-reduced-motion:reduce){[data-sileo-viewport],[data-sileo-viewport] *,[data-sileo-viewport] ::after,[data-sileo-viewport] ::before{animation-duration:0s;animation-iteration-count:1;transition-duration:0s}}[data-sileo-viewport][data-theme=dark] [data-sileo-description]{color:rgba(0,0,0,.5)}[data-sileo-viewport][data-theme=light] [data-sileo-description]{color:rgba(255,255,255,.5)}`);var X=40,vu=350,yu=16,bu=600,xu=bu/1e3,Su=6e3,Cu=Su*.1,wu=Su*.025,Tu=4e3,Eu={type:`spring`,bounce:.25,duration:xu},Du=.5,Ou=10,ku=2.25,Au=200,ju=bu*.7,Mu=e=>{let{title:t,children:n}=e,r=ie(e,[`title`,`children`]);return(0,Y.jsxs)(`svg`,T({},r,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`title`,{children:t}),n]}))},Nu={success:(0,Y.jsx)(()=>(0,Y.jsx)(Mu,{title:`Check`,children:(0,Y.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),{}),loading:(0,Y.jsx)(e=>(0,Y.jsx)(Mu,T({title:`Loader Circle`},e,{children:(0,Y.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})})),{"data-sileo-icon":`spin`,"aria-hidden":`true`}),error:(0,Y.jsx)(()=>(0,Y.jsxs)(Mu,{title:`X`,children:[(0,Y.jsx)(`path`,{d:`M18 6 6 18`}),(0,Y.jsx)(`path`,{d:`m6 6 12 12`})]}),{}),warning:(0,Y.jsx)(()=>(0,Y.jsxs)(Mu,{title:`Circle Alert`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,Y.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,Y.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),{}),info:(0,Y.jsx)(()=>(0,Y.jsxs)(Mu,{title:`Life Buoy`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,Y.jsx)(`path`,{d:`m4.93 4.93 4.24 4.24`}),(0,Y.jsx)(`path`,{d:`m14.83 9.17 4.24-4.24`}),(0,Y.jsx)(`path`,{d:`m14.83 14.83 4.24 4.24`}),(0,Y.jsx)(`path`,{d:`m9.17 14.83-4.24 4.24`}),(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]}),{}),action:(0,Y.jsx)(()=>(0,Y.jsxs)(Mu,{title:`Arrow Right`,children:[(0,Y.jsx)(`path`,{d:`M5 12h14`}),(0,Y.jsx)(`path`,{d:`m12 5 7 7-7 7`})]}),{})},Pu=(0,w.memo)(function({filterId:e,blur:t}){return(0,Y.jsx)(`defs`,{children:(0,Y.jsxs)(`filter`,{id:e,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,colorInterpolationFilters:`sRGB`,children:[(0,Y.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t,result:`blur`}),(0,Y.jsx)(`feColorMatrix`,{in:`blur`,mode:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`,result:`goo`}),(0,Y.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`goo`,operator:`atop`})]})})}),Fu=(0,w.memo)(function({id:e,fill:t=`#FFFFFF`,state:n=`success`,title:r=n,description:i,position:a=`left`,expand:o=`bottom`,className:s,icon:c,styles:l,button:u,roundness:d,exiting:f=!1,autoExpandDelayMs:p,autoCollapseDelayMs:m,canExpand:h,interruptKey:g,refreshKey:_,onMouseEnter:v,onMouseLeave:y,onDismiss:b}){let x=(0,w.useMemo)(()=>({title:r,description:i,state:n,icon:c,styles:l,button:u,fill:t}),[r,i,n,c,l,u,t]),[S,C]=(0,w.useState)(x),[ee,te]=(0,w.useState)(_),[ne,re]=(0,w.useState)(!1),[ie,ae]=(0,w.useState)(!1),[oe,se]=(0,w.useState)(0),[ce,le]=(0,w.useState)(0),E=!!S.description||!!S.button,D=S.state===`loading`,O=E&&ne&&!D,ue=D?!1:h??(!g||g===e),de=`${S.state}-${S.title}`,fe=`sileo-gooey-${e}`,pe=Math.max(0,d??yu),k=pe*Du,me=(0,w.useRef)(null),he=(0,w.useRef)(null),ge=(0,w.useRef)(null),A=(0,w.useRef)(null),j=(0,w.useRef)(null),_e=(0,w.useRef)(null),ve=(0,w.useRef)(_),ye=(0,w.useRef)(null),[M,be]=(0,w.useState)({current:{key:de,view:S},prev:null}),xe=(0,w.useRef)(null),Se=(0,w.useRef)(null),Ce=(0,w.useRef)(null),we=(0,w.useRef)(0),Te=(0,w.useRef)(null);(0,w.useLayoutEffect)(()=>{let e=xe.current,t=me.current;if(!e||!t)return;if(Se.current===null){let e=getComputedStyle(t);Se.current=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)}let n=Se.current;(()=>{let t=e.scrollWidth+n+Ou;t>Ou&&se(e=>e===t?e:t)})(),Ce.current||=new ResizeObserver(()=>{cancelAnimationFrame(we.current),we.current=requestAnimationFrame(()=>{let e=xe.current,t=Se.current??0;if(!e)return;let n=e.scrollWidth+t+Ou;n>Ou&&se(e=>e===n?e:n)})}),Te.current!==e&&(Te.current&&Ce.current.unobserve(Te.current),Ce.current.observe(e),Te.current=e)},[M.current.key]),(0,w.useEffect)(()=>()=>{var e;cancelAnimationFrame(we.current),(e=Ce.current)==null||e.disconnect()},[]),(0,w.useLayoutEffect)(()=>{if(!E){le(0);return}let e=he.current;if(!e)return;let t=()=>{let t=e.scrollHeight;le(e=>e===t?e:t)};t();let n=0,r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(t)});return r.observe(e),()=>{cancelAnimationFrame(n),r.disconnect()}},[E]),(0,w.useEffect)(()=>{let e=requestAnimationFrame(()=>ae(!0));return()=>cancelAnimationFrame(e)},[]),(0,w.useLayoutEffect)(()=>{be(e=>e.current.key===de?e.current.view===S?e:T({},e,{current:{key:de,view:S}}):{prev:e.current,current:{key:de,view:S}})},[de,S]),(0,w.useEffect)(()=>{if(M.prev)return ge.current&&clearTimeout(ge.current),ge.current=window.setTimeout(()=>{ge.current=null,be(e=>T({},e,{prev:null}))},ju),()=>{ge.current&&=(clearTimeout(ge.current),null)}},[M.prev]),(0,w.useEffect)(()=>{C(e=>e.fill===t?e:T({},e,{fill:t}))},[t]),(0,w.useEffect)(()=>{_===void 0?(C(x),te(void 0),ye.current=null,ve.current=_):ve.current!==_&&(ve.current=_,_e.current&&=(clearTimeout(_e.current),null),O?(ye.current={key:_,payload:x},re(!1),_e.current=window.setTimeout(()=>{_e.current=null;let e=ye.current;e&&(C(e.payload),te(e.key),ye.current=null)},Au)):(ye.current=null,C(x),te(_)))},[O,_,x]),(0,w.useEffect)(()=>{if(!E)return;if(A.current&&clearTimeout(A.current),j.current&&clearTimeout(j.current),f||!ue){re(!1);return}if(p==null&&m==null)return;let e=p??0,t=m??0;return e>0?A.current=window.setTimeout(()=>re(!0),e):re(!0),t>0&&(j.current=window.setTimeout(()=>re(!1),t)),()=>{A.current&&clearTimeout(A.current),j.current&&clearTimeout(j.current)}},[m,p,E,ue,f,ee]);let Ee=X*ku,De=E?Math.max(Ee,X+ce):Ee,Oe=(0,w.useRef)(De);O&&(Oe.current=De);let ke=O?De:Oe.current,Ae=E?Math.max(ke,Ee):X,je=Math.max(0,ke-X),Me=Math.max(oe||X,X),Ne=X+k*3,Pe=a===`right`?vu-Me:a===`center`?(vu-Me)/2:0,Fe=(0,w.useMemo)(()=>({x:Pe,width:Me,height:O?Ne:X}),[Pe,Me,O,Ne]),Ie=(0,w.useMemo)(()=>({height:O?je:0,opacity:+!!O}),[O,je]),Le=(0,w.useMemo)(()=>O?Eu:T({},Eu,{bounce:0}),[O]),Re=(0,w.useMemo)(()=>ie?Eu:{duration:0},[ie]),ze=`0 0 ${vu} ${Ae}`,Be=(0,w.useMemo)(()=>({filter:`url(#${fe})`}),[fe]),Ve=(0,w.useMemo)(()=>({"--_h":`${O?ke:X}px`,"--_pw":`${Me}px`,"--_px":`${Pe}px`,"--_ht":`translateY(${O?o===`bottom`?3:-3:0}px) scale(${O?.9:1})`,"--_co":`${+!!O}`}),[O,ke,Me,Pe,o]),He=(0,w.useCallback)(e=>{v?.(e),E&&re(!0)},[E,v]),N=(0,w.useCallback)(e=>{y?.(e),re(!1)},[y]),Ue=(0,w.useCallback)(e=>{if(e.propertyName!==`height`&&e.propertyName!==`transform`||O)return;let t=ye.current;t&&(_e.current&&=(clearTimeout(_e.current),null),C(t.payload),te(t.key),ye.current=null)},[O]),P=(0,w.useRef)(null),We=(0,w.useRef)(null),Ge=(0,w.useRef)(b);Ge.current=b;let Ke=(0,w.useRef)(null);if(!Ke.current){let e={onMove:e=>{let t=P.current;if(We.current===null||!t)return;let n=e.clientY-We.current,r=Math.min(Math.abs(n),20)*(n>0?1:-1);t.style.transform=`translateY(${r}px)`},onUp:t=>{let n=P.current;if(We.current===null||!n)return;let r=t.clientY-We.current;We.current=null,n.style.transform=``,n.removeEventListener(`pointermove`,e.onMove),n.removeEventListener(`pointerup`,e.onUp),Math.abs(r)>30&&(Ge.current==null||Ge.current.call(Ge))}};Ke.current=e}let F=(0,w.useCallback)(e=>{var t;e.preventDefault(),e.stopPropagation(),(t=S.button)==null||t.onClick()},[S.button]),qe=(0,w.useCallback)(e=>{if(f||!b||e.target.closest(`[data-sileo-button]`))return;We.current=e.clientY,e.currentTarget.setPointerCapture(e.pointerId);let t=P.current,n=Ke.current;t&&n&&(t.addEventListener(`pointermove`,n.onMove,{passive:!0}),t.addEventListener(`pointerup`,n.onUp,{passive:!0}))},[f,b]);return(0,Y.jsxs)(`button`,{ref:P,type:`button`,"data-sileo-toast":!0,"data-ready":ie,"data-expanded":O,"data-exiting":f,"data-edge":o,"data-position":a,"data-state":S.state,className:s,style:Ve,onMouseEnter:He,onMouseLeave:N,onTransitionEnd:Ue,onPointerDown:qe,children:[(0,Y.jsx)(`div`,{"data-sileo-canvas":!0,"data-edge":o,style:Be,children:(0,Y.jsxs)(`svg`,{"data-sileo-svg":!0,width:vu,height:Ae,viewBox:ze,children:[(0,Y.jsx)(`title`,{children:`Sileo Notification`}),(0,Y.jsx)(Pu,{filterId:fe,blur:k}),(0,Y.jsx)(gu.rect,{"data-sileo-pill":!0,rx:pe,ry:pe,fill:S.fill,initial:!1,animate:Fe,transition:Re}),(0,Y.jsx)(gu.rect,{"data-sileo-body":!0,y:X,width:vu,rx:pe,ry:pe,fill:S.fill,initial:!1,animate:Ie,transition:Le})]})}),(0,Y.jsx)(`div`,{ref:me,"data-sileo-header":!0,"data-edge":o,children:(0,Y.jsxs)(`div`,{"data-sileo-header-stack":!0,children:[(0,Y.jsxs)(`div`,{ref:xe,"data-sileo-header-inner":!0,"data-layer":`current`,children:[(0,Y.jsx)(`div`,{"data-sileo-badge":!0,"data-state":M.current.view.state,className:M.current.view.styles?.badge,children:M.current.view.icon??Nu[M.current.view.state]}),(0,Y.jsx)(`span`,{"data-sileo-title":!0,"data-state":M.current.view.state,className:M.current.view.styles?.title,children:M.current.view.title})]},M.current.key),M.prev&&(0,Y.jsxs)(`div`,{"data-sileo-header-inner":!0,"data-layer":`prev`,"data-exiting":`true`,children:[(0,Y.jsx)(`div`,{"data-sileo-badge":!0,"data-state":M.prev.view.state,className:M.prev.view.styles?.badge,children:M.prev.view.icon??Nu[M.prev.view.state]}),(0,Y.jsx)(`span`,{"data-sileo-title":!0,"data-state":M.prev.view.state,className:M.prev.view.styles?.title,children:M.prev.view.title})]},M.prev.key)]})}),E&&(0,Y.jsx)(`div`,{"data-sileo-content":!0,"data-edge":o,"data-visible":O,children:(0,Y.jsxs)(`div`,{ref:he,"data-sileo-description":!0,className:S.styles?.description,children:[S.description,S.button&&(0,Y.jsx)(`a`,{href:`#`,type:`button`,"data-sileo-button":!0,"data-state":S.state,className:S.styles?.button,onClick:F,children:S.button.title})]})})]})}),Iu=e=>e.includes(`right`)?`right`:e.includes(`center`)?`center`:`left`,Lu=e=>e.startsWith(`top`)?`bottom`:`top`,Z={toasts:[],listeners:new Set,position:`top-right`,options:void 0,emit(){for(let e of this.listeners)e(this.toasts)},update(e){this.toasts=e(this.toasts),this.emit()}},Ru=0,zu=()=>`${++Ru}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Bu=e=>`${e.id}:${e.instanceId}`,Vu=e=>{let t=Z.toasts.find(t=>t.id===e);t&&!t.exiting&&(Z.update(t=>t.map(t=>t.id===e?T({},t,{exiting:!0}):t)),setTimeout(()=>Z.update(t=>t.filter(t=>t.id!==e)),Cu))},Hu=(e,t)=>{if(e.autopilot===!1||!t||t<=0)return{};let n=typeof e.autopilot==`object`?e.autopilot:void 0,r=e=>Math.min(t,Math.max(0,e));return{expandDelayMs:r(n?.expand??wu),collapseDelayMs:r(n?.collapse??Tu)}},Uu=e=>T({},Z.options,e,{styles:T({},Z.options?.styles,e.styles)}),Wu=(e,t,n)=>{let r=Hu(e,e.duration??Su);return T({},e,{id:t,instanceId:zu(),position:e.position??n??Z.position,autoExpandDelayMs:r.expandDelayMs,autoCollapseDelayMs:r.collapseDelayMs})},Gu=e=>{let t=Z.toasts.filter(e=>!e.exiting),n=Uu(e),r=n.id??`sileo-default`,i=t.find(e=>e.id===r),a=Wu(n,r,i?.position);return i?Z.update(e=>e.map(e=>e.id===r?a:e)):Z.update(e=>[...e.filter(e=>e.id!==r),a]),{id:r,duration:n.duration??Su}},Ku=(e,t)=>{let n=Z.toasts.find(t=>t.id===e);if(!n)return;let r=Wu(Uu(t),e,n.position);Z.update(t=>t.map(t=>t.id===e?r:t))},qu={show:e=>Gu(T({},e,{state:e.type})).id,success:e=>Gu(T({},e,{state:`success`})).id,error:e=>Gu(T({},e,{state:`error`})).id,warning:e=>Gu(T({},e,{state:`warning`})).id,info:e=>Gu(T({},e,{state:`info`})).id,action:e=>Gu(T({},e,{state:`action`})).id,promise:(e,t)=>{let{id:n}=Gu(T({},t.loading,{state:`loading`,duration:null,position:t.position})),r=typeof e==`function`?e():e;return r.then(e=>{if(t.action){let r=typeof t.action==`function`?t.action(e):t.action;Ku(n,T({},r,{state:`action`,id:n}))}else{let r=typeof t.success==`function`?t.success(e):t.success;Ku(n,T({},r,{state:`success`,id:n}))}}).catch(e=>{let r=typeof t.error==`function`?t.error(e):t.error;Ku(n,T({},r,{state:`error`,id:n}))}),r},dismiss:Vu,clear:e=>Z.update(t=>e?t.filter(t=>t.position!==e):[])},Ju={light:`#1a1a1a`,dark:`#f2f2f2`};function Yu(e){let[t,n]=(0,w.useState)(()=>e===`light`||e===`dark`?e:typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);return(0,w.useEffect)(()=>{if(e===`light`||e===`dark`){n(e);return}let t=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>n(e.matches?`dark`:`light`);return n(t.matches?`dark`:`light`),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Xu({children:e,position:t=`top-right`,offset:n,options:r,theme:i}){let a=Yu(i),[o,s]=(0,w.useState)(Z.toasts),[c,l]=(0,w.useState)(),u=(0,w.useRef)(!1),d=(0,w.useRef)(new Map),f=(0,w.useRef)(o),p=(0,w.useRef)(void 0),m=(0,w.useRef)(new Map);(0,w.useEffect)(()=>{Z.position=t,Z.options=r},[t,r]);let h=(0,w.useCallback)(()=>{for(let e of d.current.values())clearTimeout(e);d.current.clear()},[]),g=(0,w.useCallback)(e=>{if(!u.current)for(let t of e){if(t.exiting)continue;let e=Bu(t);if(d.current.has(e)||t.duration===null)continue;let n=t.duration??Su;n<=0||d.current.set(e,window.setTimeout(()=>Vu(t.id),n))}},[]);(0,w.useEffect)(()=>{let e=e=>s(e);return Z.listeners.add(e),()=>{Z.listeners.delete(e),h()}},[h]),(0,w.useEffect)(()=>{f.current=o;let e=new Set(o.map(Bu)),t=new Set(o.map(e=>e.id));for(let[t,n]of d.current)e.has(t)||(clearTimeout(n),d.current.delete(t));for(let e of m.current.keys())t.has(e)||m.current.delete(e);g(o)},[o,g]);let _=(0,w.useRef)(null),v=(0,w.useRef)(null);_.current=(0,w.useCallback)(()=>{u.current||(u.current=!0,h())},[h]),v.current=(0,w.useCallback)(()=>{u.current&&(u.current=!1,g(f.current))},[g]);let y=(0,w.useMemo)(()=>{for(let e=o.length-1;e>=0;e--)if(!o[e].exiting)return o[e].id},[o]);(0,w.useEffect)(()=>{p.current=y,l(y)},[y]);let b=(0,w.useCallback)(e=>{let t=m.current.get(e);return t||(t={enter:t=>{l(t=>t===e?t:e),_.current==null||_.current.call(_,t)},leave:e=>{l(e=>e===p.current?e:p.current),v.current==null||v.current.call(v,e)},dismiss:()=>Vu(e)},m.current.set(e,t),t)},[]),x=(0,w.useCallback)(e=>{if(n===void 0)return;let t=typeof n==`object`?n:{top:n,right:n,bottom:n,left:n},r={},i=e=>typeof e==`number`?`${e}px`:e;return e.startsWith(`top`)&&t.top&&(r.top=i(t.top)),e.startsWith(`bottom`)&&t.bottom&&(r.bottom=i(t.bottom)),e.endsWith(`left`)&&t.left&&(r.left=i(t.left)),e.endsWith(`right`)&&t.right&&(r.right=i(t.right)),r},[n]),S=(0,w.useMemo)(()=>{let e=new Map;for(let n of o){let r=n.position??t,i=e.get(r);i?i.push(n):e.set(r,[n])}return e},[o,t]);return(0,Y.jsxs)(Y.Fragment,{children:[e,Array.from(S,([e,t])=>{let n=Iu(e),r=Lu(e);return(0,Y.jsx)(`section`,{"data-sileo-viewport":!0,"data-position":e,"data-theme":i?a:void 0,"aria-live":`polite`,style:x(e),children:t.map(e=>{let t=b(e.id);return(0,Y.jsx)(Fu,{id:e.id,state:e.state,title:e.title,description:e.description,position:n,expand:r,icon:e.icon,fill:e.fill??(i?Ju[a]:void 0),styles:e.styles,button:e.button,roundness:e.roundness,exiting:e.exiting,autoExpandDelayMs:e.autoExpandDelayMs,autoCollapseDelayMs:e.autoCollapseDelayMs,refreshKey:e.instanceId,canExpand:c===void 0||c===e.id,onMouseEnter:t.enter,onMouseLeave:t.leave,onDismiss:t.dismiss},e.id)})},e)})]})}function Zu(){return(0,w.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{if(Math.abs(e.scale-1)>.01)return;document.documentElement.style.setProperty(`--mobile-viewport-height`,`${e.height}px`),document.documentElement.style.setProperty(`--mobile-viewport-top`,`${e.offsetTop}px`);let t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable;document.documentElement.dataset.mobileKeyboard=String(n&&e.height<document.documentElement.clientHeight-100)};return t(),e.addEventListener(`resize`,t),e.addEventListener(`scroll`,t),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,t),()=>{e.removeEventListener(`resize`,t),e.removeEventListener(`scroll`,t),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,t),delete document.documentElement.dataset.mobileKeyboard}},[]),null}function Qu(){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 117.9 128`,"aria-hidden":`true`,children:[(0,Y.jsx)(`path`,{fill:`currentColor`,d:`m113.9 42.6c-3.7-11.3-10.8-21.2-20.1-28.6-7.4-5.7-16.1-10-25.4-11.5-6.5-0.9-9.4-1.1-15.9-0.3-7.4 0.9-14.3 3.4-20.7 7-15.4 9.1-27.6 26.2-29.8 44.5-0.3 2.9-0.4 5.8-0.2 8.7 0.7 15.5 9.7 33.2 27.2 44.1l3.9 2.2c1.5 1.3 2.9 1.8 5.1 1.3 3.5-0.9 5.1-6.1 0.1-8.6-7.3-3.5-13.7-8.7-18.1-14.6-5-7-9-15.8-9.3-26.9-0.2-10 3.5-21.4 11.6-31.3 4.5-5.2 10.5-9.8 16.4-12.7 10.1-4.9 20.5-6.6 31.2-3.8 13.2 3.5 25.6 13.1 32.3 26.5 2.3 4.9 4.2 10.7 4.9 17.4 0.9 9.9-1.4 19.2-6.9 27.4-4.3 6.5-9.2 11-16.1 15.8l-4.1 2.1c-4.4 2.4-3.2 9.4 2.8 9 1.2 0 2.5-0.8 3.6-1.4 3.9-2 7.5-4.3 10.8-7 9.4-8 17.6-20.3 19.1-36.8 0.6-7.4-0.4-15.6-2.4-22.5z`}),(0,Y.jsx)(`path`,{fill:`#2266ea`,d:`m88.1 42.8c-3.6 0.3-7.4 2.9-9 7.3-5.5 0.8-14.1 3.6-20.3 12-4.3-6.3-11.6-10.7-19.7-12-1.1-3.8-5-7.5-10.2-7.2-4.1 0.4-8.7 3.8-8.7 9.7 0.2 6 5.7 10.3 11.1 9.3 2.8-0.3 5.2-2 6.6-4.3 6.7 1 14.9 4.7 17.3 14.1v36.7c-3.2 1.5-5.5 4.7-5.5 8.4 0 4.8 3.7 9.3 9.4 9.3s9.5-4.5 9.4-9.1c0.1-3.6-2.3-7.3-5.8-8.7v-36.4c1-5.6 5.9-10.9 13.3-13.3l3.9-1c1.8 2.9 4.9 4.6 8.6 4.5 4.6-0.2 9.3-3.6 9.3-9.5 0-5.6-4.9-10-9.7-9.8z`})]})}function $u({heading:e,detail:t,busy:n=!0}){return(0,Y.jsxs)(`div`,{className:`splash`,children:[(0,Y.jsx)(Qu,{}),(0,Y.jsxs)(`div`,{className:`splash-copy`,children:[(0,Y.jsx)(`strong`,{children:e}),(0,Y.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:t?n?(0,Y.jsx)(y,{text:t}):t:``})]}),n?(0,Y.jsx)(`div`,{className:`splash-mark`,"aria-hidden":`true`}):null]})}var ed=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,td=_,nd=(e,t)=>n=>{if(t?.variants==null)return td(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ed(t)||ed(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return td(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},rd=nd(`group/button inline-flex cursor-pointer shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-semibold whitespace-nowrap transition-[background-color,border-color,color,box-shadow,opacity,transform] duration-150 outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/25 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-45 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 hover:shadow-md hover:shadow-primary/20`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-9`,"icon-xs":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function id({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Y.jsx)(p,{"data-slot":`button`,"data-size":n,className:v(rd({variant:t,size:n,className:e})),...r})}var ad=b(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),od=null;async function sd(){if(!navigator.clipboard?.readText)throw Error(`Text clipboard access is unavailable.`);return navigator.clipboard.readText()}async function cd(e){if(!navigator.clipboard?.writeText)throw Error(`Text clipboard access is unavailable.`);await navigator.clipboard.writeText(e),od=null}async function ld(e,t){if(!navigator.clipboard?.writeText)throw Error(`Text clipboard access is unavailable.`);await navigator.clipboard.writeText(e.join(`\r
|
|
47
|
+
`)),od=t?{paths:[...e],transferId:t}:null}function ud(e){return!od||!fd(od.paths,e)?(od=null,null):od.transferId}function dd(e){let t=x(e);if(!t)throw Error(`Only web or mail links can be opened.`);window.open(t,`_blank`,`noopener,noreferrer`)}function fd(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}var pd=600;function md({delay:e=pd,...t}){return(0,Y.jsx)(o,{"data-slot":`tooltip-provider`,delay:e,...t})}function hd({...e}){return(0,Y.jsx)(a,{"data-slot":`tooltip`,...e})}function gd({...e}){return(0,Y.jsx)(c,{"data-slot":`tooltip-trigger`,...e})}function _d({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,anchor:a,children:o,...c}){return(0,Y.jsx)(l,{children:(0,Y.jsx)(u,{align:r,alignOffset:i,anchor:a,side:t,sideOffset:n,className:`isolate z-50 data-[anchor-hidden]:invisible`,children:(0,Y.jsxs)(d,{"data-slot":`tooltip-content`,className:v(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-xl border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[o,(0,Y.jsx)(s,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-popover fill-popover data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:translate-x-[1.5px] data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:translate-x-[-1.5px] data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:translate-x-[-1.5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:translate-x-[1.5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function vd({value:e,label:t=`Copy`,onCopied:n,onError:r}){let[i,a]=(0,w.useState)(!1);(0,w.useEffect)(()=>{if(!i)return;let e=window.setTimeout(()=>a(!1),2e3);return()=>window.clearTimeout(e)},[i]);let o=async()=>{try{await cd(e),a(!0),n?.()}catch{a(!1),r?.()}};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(hd,{children:[(0,Y.jsxs)(gd,{render:(0,Y.jsx)(`button`,{type:`button`,className:`copy-button`,"aria-label":i?`Copied`:t,"data-copy-state":i?`copied`:void 0,onClick:()=>void o()}),children:[(0,Y.jsx)(ad,{className:`copy-button-icon`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`copy-button-check`,"aria-hidden":`true`,children:`✓`})]}),(0,Y.jsx)(_d,{children:i?`Copied`:t})]}),(0,Y.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:i?`Copied`:``})]})}var yd=document.documentElement.dataset.opentigProfile===`dev`,bd=yd?`OpenTig Dev`:`OpenTig`;function xd({recovery:e=!1}){let t=e?yd?`node packages/server/dist/dev.mjs reset-access`:`opentig reset-access`:yd?`npm run pair:web:dev`:`opentig pair`,[n,r]=(0,w.useState)(!1);return(0,Y.jsxs)(`div`,{className:`mt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`code`,{className:`min-w-0 select-text break-words text-sm`,children:t}),(0,Y.jsx)(vd,{value:t,label:e?`Copy recovery command`:`Copy command`,onCopied:()=>r(!1),onError:()=>r(!0)})]}),n&&(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,role:`alert`,children:`Could not copy. Select and copy the command manually.`})]})}var Sd=36e5,Cd=6e4,wd=1e4;function Td({request:e=fetch,page:t=document,lifecycle:n=window}={}){let r=!1,i=null,a,o,s=()=>{r||(a=setTimeout(()=>{c()},Cd))},c=async()=>{if(r||i||t.visibilityState!==`visible`)return;clearTimeout(a);let n=new AbortController;i=n,o=setTimeout(()=>n.abort(),wd);try{let t=await e(`/api/auth/renew`,{method:`POST`,credentials:`include`,cache:`no-store`,signal:n.signal});!t.ok&&t.status!==401&&t.status!==403&&s()}catch{s()}finally{clearTimeout(o),i=null}},l=()=>{c()},u=setInterval(l,Sd);return t.addEventListener(`visibilitychange`,l),n.addEventListener(`focus`,l),n.addEventListener(`online`,l),l(),()=>{r=!0,clearInterval(u),clearTimeout(a),clearTimeout(o),i?.abort(),t.removeEventListener(`visibilitychange`,l),n.removeEventListener(`focus`,l),n.removeEventListener(`online`,l)}}var Q={bootstrap:`app:bootstrap`,capabilities:`app:capabilities`,preferences:`app:preferences`,filesTreeStateUpdate:`app:files-tree-state`,openFilesStateUpdate:`app:open-files-state`,projectCreate:`projects:create`,projectRename:`projects:rename`,projectRemove:`projects:remove`,projectAssign:`projects:assign`,projectMove:`projects:move`,projectMoveRepository:`projects:move-repository`,repositoryPreparePath:`repository:prepare-path`,repositoryCompleteSetup:`repository:complete-setup`,repositoryOpenPath:`repository:open-path`,repositoryBrowseDirectories:`repository:browse-directories`,repositoryOpenRecent:`repository:open-recent`,repositoryRelocateRecent:`repository:relocate-recent`,repositoryForget:`repository:forget`,repositoryStatus:`repository:status`,repositoryFiles:`repository:files`,repositoryDirectoryEntries:`repository:directory-entries`,repositoryReadFile:`repository:read-file`,repositoryReadImage:`repository:read-image`,repositoryGetFavicon:`repository:favicon`,repositoryWriteFile:`repository:write-file`,repositoryAbsolutePath:`repository:absolute-path`,repositoryCopyEntries:`repository:copy-entries`,repositoryCutEntries:`repository:cut-entries`,repositoryPasteEntries:`repository:paste-entries`,repositoryMoveEntry:`repository:move-entry`,repositoryDeleteEntry:`repository:delete-entry`,repositoryMoveEntries:`repository:move-entries`,repositoryDeleteEntries:`repository:delete-entries`,repositoryRenameEntry:`repository:rename-entry`,repositoryCreateEntry:`repository:create-entry`,repositoryFileHistoryState:`repository:file-history-state`,repositoryUndoFileOperation:`repository:undo-file-operation`,repositoryRedoFileOperation:`repository:redo-file-operation`,repositorySearch:`repository:search`,repositoryReplaceSearch:`repository:replace-search`,diffGet:`diff:get`,diffCommit:`diff:commit`,diffCommitFile:`diff:commit-file`,indexStage:`index:stage`,indexUnstage:`index:unstage`,indexDiscard:`index:discard`,indexStageAll:`index:stage-all`,indexUnstageAll:`index:unstage-all`,indexPrepareCommitGroup:`index:prepare-commit-group`,indexUpdateConflict:`index:update-conflict`,indexResolveConflict:`index:resolve-conflict`,commitCreate:`commit:create`,commitUndoLatest:`commit:undo-latest`,commitsList:`commits:list`,commitsFiles:`commits:files`,commitAuthorship:`commits:authorship`,commitSetAuthorship:`commits:set-authorship`,branchesList:`refs:branches`,branchSwitch:`refs:switch`,worktreesList:`refs:worktrees`,worktreeSelect:`refs:select-worktree`,refsPull:`refs:pull`,refsPush:`refs:push`,refsPushContext:`refs:push-context`,refsFetch:`refs:fetch`,localRefsSnapshot:`refs:local-snapshot`,branchDetails:`refs:branch-details`,worktreeDetails:`refs:worktree-details`,branchDelete:`refs:delete-branch`,worktreeRemove:`refs:remove-worktree`,remoteBranchDetails:`refs:remote-branch-details`,trackingBranchCreate:`refs:create-tracking-branch`,remoteBranchDelete:`refs:delete-remote-branch`,branchesFetch:`refs:fetch-branches`,aiRepositoryInstructions:`ai:repository-instructions`,aiSetRepositoryInstructions:`ai:set-repository-instructions`,aiStatuses:`ai:statuses`,aiGenerateCommitMessage:`ai:generate-commit-message`,aiCancelGeneration:`ai:cancel-generation`,aiLog:`ai:log`,aiClearLog:`ai:clear-log`,diagnosticsList:`diagnostics:list`,diagnosticsClear:`diagnostics:clear`,diagnosticsRecord:`diagnostics:record`,githubSetSuggestedAccount:`github:set-suggested-account`,githubAccountsStatus:`github:accounts-status`,githubSetDefaultAccount:`github:set-default-account`,githubRepositoryAccount:`github:repository-account`,githubSetRepositoryAccount:`github:set-repository-account`,githubStatus:`github:status`,githubRepositoryInfo:`github:repository-info`,githubPrForBranch:`github:pr-for-branch`,githubPrList:`github:pr-list`,githubPrView:`github:pr-view`,githubPrStack:`github:pr-stack`,githubPrDiff:`github:pr-diff`,githubPrCommitDiff:`github:pr-commit-diff`,githubPrCreate:`github:pr-create`,githubPrDraft:`github:pr-draft`,githubPrDraftCancel:`github:pr-draft-cancel`},Ed=6e5,Dd={protocolVersion:4}.protocolVersion,Od=1,kd=class extends Error{},Ad=class extends kd{},jd=class extends kd{},Md=class extends kd{},Nd=class extends kd{},Pd=class extends Ad{},Fd=class extends kd{detail;constructor(e){super(e.message),this.detail=e,this.name=`ServerResponseTooLargeError`}},Id=class{url;createSocket;requestTimeoutMs;heartbeatMs;reconnectBaseMs;reconnectMaxMs;offlineAfterAttempts;random;pending=new Map;connectionWaiters=new Set;stateListeners=new Set;eventListeners=new Set;reconnectListeners=new Set;socket=null;state=`connecting`;requestSequence=0;socketGeneration=0;reconnectAttempts=0;reconnectTimer=null;heartbeatTimer=null;awaitingPong=!1;started=!1;stopped=!1;connectedBefore=!1;constructor(e={}){this.url=e.url??Rd(),this.createSocket=e.createSocket??(e=>new WebSocket(e)),this.requestTimeoutMs=e.requestTimeoutMs??3e4,this.heartbeatMs=e.heartbeatMs??2e4,this.reconnectBaseMs=e.reconnectBaseMs??250,this.reconnectMaxMs=e.reconnectMaxMs??5e3,this.offlineAfterAttempts=e.offlineAfterAttempts??5,this.random=e.random??Math.random}getState=()=>this.state;subscribeState=e=>(this.stateListeners.add(e),this.start(),()=>this.stateListeners.delete(e));onEvent(e){return this.eventListeners.add(e),this.start(),()=>this.eventListeners.delete(e)}onReconnect(e){return this.reconnectListeners.add(e),()=>this.reconnectListeners.delete(e)}async request(e,t,n={}){let r=n.timeoutMs??this.requestTimeoutMs,i=Date.now();if(this.start(),await this.waitForConnection(r,n.signal),n.signal?.aborted)throw zd();let a=this.socket;if(!a||a.readyState!==Od)throw new Ad(`OpenTig server disconnected.`);let o=`${Date.now().toString(36)}-${(++this.requestSequence).toString(36)}`,s=Math.max(1,r-(Date.now()-i));return new Promise((r,i)=>{let c={resolve:r,reject:i,timer:setTimeout(()=>{this.finishPending(o),i(new Nd(`Server request timed out: ${String(e)}`))},s),...n.signal?{signal:n.signal}:{}};n.signal&&(c.abort=()=>{this.finishPending(o),i(zd())},n.signal.addEventListener(`abort`,c.abort,{once:!0})),this.pending.set(o,c);try{let n=[...t];for(;n.length>0&&n.at(-1)===void 0;)n.pop();a.send(JSON.stringify({type:`request`,id:o,command:e,args:n}))}catch{this.finishPending(o),i(new Ad(`Could not send request to the OpenTig server.`))}})}markIncompatible(){this.stopped=!0,this.clearReconnect(),this.setState(`incompatible-version`),this.rejectConnectionWaiters(new Md(`OpenTig server protocol is incompatible.`)),this.rejectPending(new Md(`OpenTig server protocol is incompatible.`)),this.socket?.close(1e3,`Incompatible protocol`)}close(){this.stopped=!0,this.clearReconnect(),this.clearHeartbeat(),this.rejectConnectionWaiters(new Ad(`OpenTig server connection closed.`)),this.rejectPending(new Ad(`OpenTig server connection closed.`)),this.socket?.close(1e3,`Client closing`),this.socket=null}start(){this.started||this.stopped||(this.started=!0,this.connect())}connect(){if(this.stopped)return;this.clearReconnect();let e=++this.socketGeneration,t;try{t=this.createSocket(this.url)}catch{this.disconnected(e,0);return}this.socket=t,t.onopen=()=>{if(e!==this.socketGeneration||this.stopped)return;let t=this.connectedBefore;if(this.connectedBefore=!0,this.reconnectAttempts=0,this.setState(`connected`),this.resolveConnectionWaiters(),this.startHeartbeat(),t)for(let e of this.reconnectListeners)Promise.resolve(e()).catch(()=>void 0)},t.onmessage=t=>this.message(e,t.data),t.onerror=()=>void 0,t.onclose=t=>this.disconnected(e,t.code)}message(e,t){if(e!==this.socketGeneration||typeof t!=`string`)return;let n;try{n=JSON.parse(t)}catch{return}if(n.type===`pong`){this.awaitingPong=!1;return}if(n.type===`event`){for(let e of this.eventListeners)e(n.event);return}if(n.type!==`result`)return;let r=this.pending.get(n.id);r&&(this.finishPending(n.id),Ld(r,n.result))}disconnected(e,t){if(e!==this.socketGeneration)return;this.socket=null,this.clearHeartbeat();let n=t===1008?new jd(`Authentication required.`):t===1013?new Pd(`OpenTig server disconnected because the client send queue was full.`):new Ad(`OpenTig server disconnected before the request completed.`);if(this.rejectPending(n),this.stopped)return;if(t===1008){this.stopped=!0,this.setState(`auth-required`),this.rejectConnectionWaiters(n);return}this.reconnectAttempts+=1,this.setState(this.reconnectAttempts>=this.offlineAfterAttempts?`offline`:`reconnecting`);let r=Math.min(this.reconnectMaxMs,this.reconnectBaseMs*2**(this.reconnectAttempts-1)),i=Math.max(0,Math.round(r*(.5+this.random())));this.reconnectTimer=setTimeout(()=>this.connect(),i)}waitForConnection(e,t){return this.state===`connected`&&this.socket?.readyState===Od?Promise.resolve():this.state===`auth-required`?Promise.reject(new jd(`Authentication required.`)):this.state===`incompatible-version`?Promise.reject(new Md(`OpenTig server protocol is incompatible.`)):this.stopped?Promise.reject(new Ad(`OpenTig server connection is closed.`)):t?.aborted?Promise.reject(zd()):new Promise((n,r)=>{let i={resolve:n,reject:r,timer:setTimeout(()=>{this.removeConnectionWaiter(i),r(new Nd(`Timed out waiting for the OpenTig server.`))},e),...t?{signal:t}:{}};t&&(i.abort=()=>{this.removeConnectionWaiter(i),r(zd())},t.addEventListener(`abort`,i.abort,{once:!0})),this.connectionWaiters.add(i)})}resolveConnectionWaiters(){for(let e of[...this.connectionWaiters])this.removeConnectionWaiter(e),e.resolve()}rejectConnectionWaiters(e){for(let t of[...this.connectionWaiters])this.removeConnectionWaiter(t),t.reject(e)}removeConnectionWaiter(e){clearTimeout(e.timer),e.signal&&e.abort&&e.signal.removeEventListener(`abort`,e.abort),this.connectionWaiters.delete(e)}finishPending(e){let t=this.pending.get(e);t&&(clearTimeout(t.timer),t.signal&&t.abort&&t.signal.removeEventListener(`abort`,t.abort),this.pending.delete(e))}rejectPending(e){for(let[t,n]of[...this.pending])this.finishPending(t),n.reject(e)}startHeartbeat(){this.clearHeartbeat(),this.heartbeatTimer=setInterval(()=>{let e=this.socket;e&&e.readyState===Od&&(this.awaitingPong?e.close(4e3,`Heartbeat timeout`):(this.awaitingPong=!0,e.send(JSON.stringify({type:`ping`}))))},this.heartbeatMs)}clearHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=null,this.awaitingPong=!1}clearReconnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null}setState(e){if(this.state!==e){this.state=e;for(let e of this.stateListeners)e()}}};function Ld(e,t){if(t.ok){e.resolve(t.value);return}if(t.error.code===`RESPONSE_TOO_LARGE`){e.reject(new Fd(t.error));return}let n=Error(t.error.message);n.detail=t.error,e.reject(n)}function Rd(){let e=new URL(`/ws`,window.location.href);return e.protocol=e.protocol===`https:`?`wss:`:`ws:`,e.href}function zd(){return new DOMException(`The request was cancelled.`,`AbortError`)}function Bd(e={}){let t=e.transport??new Id,n=e.httpOrigin??globalThis.location?.origin??`http://127.0.0.1`,r=e.fetch??fetch,i=new Set,a=new Set,o=new Set,s=new Set,c=(e,...n)=>t.request(e,n),l={app:{bootstrap:async()=>{let e=await t.request(Q.bootstrap,[]);if(!e.server||e.server.protocolVersion!==Dd)throw t.markIncompatible(),Error(`This OpenTig client is incompatible with the server.`);return e},capabilities:()=>c(Q.capabilities),setPreferences:e=>c(Q.preferences,e),setFilesTreeExpandedPaths:(e,t)=>c(Q.filesTreeStateUpdate,e,t),setOpenFilesState:(e,t,n,r)=>c(Q.openFilesStateUpdate,e,t,n,r)},projects:{create:e=>c(Q.projectCreate,e),rename:(e,t)=>c(Q.projectRename,e,t),remove:e=>c(Q.projectRemove,e),assign:(e,t)=>c(Q.projectAssign,e,t),moveProject:(e,t)=>c(Q.projectMove,e,t),moveRepository:(e,t)=>c(Q.projectMoveRepository,e,t)},repository:{preparePath:e=>c(Q.repositoryPreparePath,e),completeSetup:(e,t)=>c(Q.repositoryCompleteSetup,e,t),openPath:e=>c(Q.repositoryOpenPath,e),browseDirectories:e=>e===void 0?c(Q.repositoryBrowseDirectories):c(Q.repositoryBrowseDirectories,e),openRecent:e=>c(Q.repositoryOpenRecent,e),forget:e=>c(Q.repositoryForget,e),relocateRecent:(e,t)=>c(Q.repositoryRelocateRecent,e,t),getStatus:(e,t)=>c(Q.repositoryStatus,e,t),getFiles:e=>c(Q.repositoryFiles,e),getDirectoryEntries:(e,t)=>c(Q.repositoryDirectoryEntries,e,t),readFile:(e,t,n)=>c(Q.repositoryReadFile,e,t,n),readImage:(e,t)=>Ud(r,n,e,t),getFavicon:e=>c(Q.repositoryGetFavicon,e),writeFile:(e,t,n,r)=>c(Q.repositoryWriteFile,e,t,n,r),getAbsolutePath:(e,t)=>c(Q.repositoryAbsolutePath,e,t),copyEntries:(e,t)=>c(Q.repositoryCopyEntries,e,t),cutEntries:(e,t)=>c(Q.repositoryCutEntries,e,t),pasteEntries:(e,t,n,r,i)=>c(Q.repositoryPasteEntries,e,t,n,r,i),moveEntry:(e,t,n)=>c(Q.repositoryMoveEntry,e,t,n),moveEntries:(e,t,n)=>c(Q.repositoryMoveEntries,e,t,n),deleteEntry:(e,t)=>c(Q.repositoryDeleteEntry,e,t),deleteEntries:(e,t)=>c(Q.repositoryDeleteEntries,e,t),renameEntry:(e,t,n)=>c(Q.repositoryRenameEntry,e,t,n),createEntry:(e,t,n,r)=>c(Q.repositoryCreateEntry,e,t,n,r),search:(e,t)=>c(Q.repositorySearch,e,t),replaceSearch:(e,t)=>c(Q.repositoryReplaceSearch,e,t),fileHistoryState:e=>c(Q.repositoryFileHistoryState,e),undoFileOperation:e=>c(Q.repositoryUndoFileOperation,e),redoFileOperation:e=>c(Q.repositoryRedoFileOperation,e)},diff:{get:e=>c(Q.diffGet,e),getCommit:(e,t)=>c(Q.diffCommit,e,t),getCommitFile:(e,t,n,r)=>c(Q.diffCommitFile,e,t,n,r)},index:{stage:(e,t)=>c(Q.indexStage,e,t),unstage:(e,t)=>c(Q.indexUnstage,e,t),discard:(e,t)=>c(Q.indexDiscard,e,t),stageAll:e=>c(Q.indexStageAll,e),unstageAll:e=>c(Q.indexUnstageAll,e),prepareCommitGroup:e=>c(Q.indexPrepareCommitGroup,e),updateConflict:(e,t,n)=>c(Q.indexUpdateConflict,e,t,n),resolveConflict:(e,t,n)=>c(Q.indexResolveConflict,e,t,n)},commits:{authorship:e=>c(Q.commitAuthorship,e),setAuthorship:(e,t)=>c(Q.commitSetAuthorship,e,t),create:(e,t)=>c(Q.commitCreate,e,t),undoLatest:(e,t)=>c(Q.commitUndoLatest,e,t),list:(e,t)=>c(Q.commitsList,e,t),files:(e,t)=>c(Q.commitsFiles,e,t)},refs:{listBranches:e=>c(Q.branchesList,e),switchBranch:(e,t,n)=>c(Q.branchSwitch,e,t,n),listWorktrees:e=>c(Q.worktreesList,e),selectWorktree:(e,t)=>c(Q.worktreeSelect,e,t),pull:e=>c(Q.refsPull,e),pushContext:(e,t)=>c(Q.refsPushContext,e,t),push:(e,t,n)=>c(Q.refsPush,e,t,n),fetch:e=>c(Q.refsFetch,e),localRefsSnapshot:e=>c(Q.localRefsSnapshot,e),branchDetails:e=>c(Q.branchDetails,e),remoteBranchDetails:e=>c(Q.remoteBranchDetails,e),createTrackingBranch:e=>c(Q.trackingBranchCreate,e),deleteRemoteBranch:e=>c(Q.remoteBranchDelete,e),fetchBranches:e=>c(Q.branchesFetch,e),worktreeDetails:e=>c(Q.worktreeDetails,e),deleteBranch:e=>c(Q.branchDelete,e),removeWorktree:e=>c(Q.worktreeRemove,e)},ai:{repositoryInstructions:e=>c(Q.aiRepositoryInstructions,e),setRepositoryInstructions:(e,t)=>c(Q.aiSetRepositoryInstructions,e,t),statuses:e=>c(Q.aiStatuses,e),generateCommitMessage:e=>t.request(Q.aiGenerateCommitMessage,[e],{timeoutMs:Ed}),cancelGeneration:e=>c(Q.aiCancelGeneration,e),log:()=>c(Q.aiLog),clearLog:()=>c(Q.aiClearLog)},github:{setSuggestedAccount:e=>c(Q.githubSetSuggestedAccount,e),setDefaultAccount:e=>c(Q.githubSetDefaultAccount,e),accountsStatus:e=>t.request(Q.githubAccountsStatus,[e],{timeoutMs:9e4}),repositoryAccount:(e,n)=>t.request(Q.githubRepositoryAccount,[e,n],{timeoutMs:6e4}),setRepositoryAccount:(e,t,n)=>n===void 0?c(Q.githubSetRepositoryAccount,e,t):c(Q.githubSetRepositoryAccount,e,t,n),status:e=>c(Q.githubStatus,e),repositoryInfo:e=>c(Q.githubRepositoryInfo,e),findPullRequestForBranch:(e,t)=>c(Q.githubPrForBranch,e,t),listPullRequests:(e,t)=>c(Q.githubPrList,e,t),getPullRequest:(e,t)=>c(Q.githubPrView,e,t),getPullRequestStack:(e,t)=>c(Q.githubPrStack,e,t),getPullRequestDiff:(e,t)=>c(Q.githubPrDiff,e,t),getPullRequestCommitDiff:(e,t)=>c(Q.githubPrCommitDiff,e,t),createPullRequest:e=>c(Q.githubPrCreate,e),generateDraft:e=>t.request(Q.githubPrDraft,[e],{timeoutMs:Ed}),cancelDraft:e=>c(Q.githubPrDraftCancel,e)},diagnostics:{list:()=>c(Q.diagnosticsList),clear:()=>c(Q.diagnosticsClear),record:e=>c(Q.diagnosticsRecord,e)},events:{onAiInstructionsChanged:e=>Vd(a,e),onGitHubAccountsChanged:e=>Vd(o,e),onRepositoryChanged:e=>Vd(i,e),onActiveRepositoryChanged:e=>Vd(s,e)}};return t.onEvent(e=>Hd(e,i,s,o,a)),t.onReconnect(async()=>{let e=await l.app.bootstrap();for(let e of a)e([]);for(let e of o)e();if(e.activeRepository){for(let t of s)t(e.activeRepository);for(let t of i)t(e.activeRepository.id,`unknown`)}}),{api:l,transport:t}}function Vd(e,t){return e.add(t),()=>e.delete(t)}function Hd(e,t,n,r,i){if(e.type===`repository.changed`)for(let n of t)n(e.repositoryId,e.scope);else if(e.type===`repository.active-changed`)for(let t of n)t(e.repository);else if(e.type===`ai.instructions-changed`)for(let t of i)t(e.repositoryIds);else for(let t of r)t(e.repositoryIds,e.inventoryChanged)}async function Ud(e,t,n,r){let i=r.split(`/`).map(encodeURIComponent).join(`/`),a=await e(new URL(`/api/image/${encodeURIComponent(n)}/${i}`,t),{credentials:`include`});if(a.status===413||a.status===415)return a.json();if(!a.ok)throw Error(a.status===401?`Authentication required.`:`Could not load image preview.`);let o=a.headers.get(`content-type`);if(!o?.startsWith(`image/`))throw Error(`Server returned an invalid image preview.`);let s=new Uint8Array(await a.arrayBuffer());return{status:`ready`,path:r,mimeType:o,data:s,size:Number(a.headers.get(`content-length`)??s.byteLength),mtimeMs:Number(a.headers.get(`x-opentig-mtime-ms`)??0)}}var Wd=Bd(),$=window.opentigDesktop,Gd=Wd.api,Kd={...Gd,app:{...Gd.app,bootstrap:async()=>{let e=await Gd.app.bootstrap();return await $?.app.preferencesChanged(e.preferences),e},capabilities:async()=>{let e=await Gd.app.capabilities();return{...e,runtimeMode:$?`desktop`:e.runtimeMode,nativePicker:!!$,fileClipboard:!!$,revealInFileManager:!!$}},setPreferences:async e=>{let t=await Gd.app.setPreferences(e);return await $?.app.preferencesChanged(t),t},setZoomFactor:e=>{$?$.app.setZoomFactor(e):document.documentElement.style.zoom=String(Math.max(.8,Math.min(1.3,Number(e)||1)))},setTitleBarTheme:e=>$?.app.setTitleBarTheme(e)??Promise.resolve()},clipboard:{readFilePaths:()=>$?.clipboard.readFilePaths()??Promise.resolve([]),readImagePng:()=>$?.clipboard.readImagePng()??Promise.resolve(null)},repository:{...Gd.repository,select:async e=>$?$.repository.select(e):window.prompt(e??`Repository path on the OpenTig server`)?.trim()||null,selectRelocation:async(e,t)=>$?$.repository.selectRelocation(e,t):window.prompt(`New server path for ${e}`,t)?.trim()||null,revealEntry:async(e,t)=>{if(!$)throw Error(`Reveal in file manager is available only in the desktop app.`);let n=await Gd.repository.getAbsolutePath(e,t);await $.repository.revealEntry(n)}}},qd={connecting:`Connecting to OpenTig server…`,connected:`Server connected`,reconnecting:`Reconnecting to OpenTig server…`,"auth-required":`Authentication required`,"incompatible-version":`Client and server versions are incompatible`,offline:`OpenTig server is offline`},Jd=0;function Yd({children:e}){let t=(0,w.useSyncExternalStore)(Wd.transport.subscribeState,Wd.transport.getState,Wd.transport.getState),[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(null);if((0,w.useEffect)(()=>{if(t===`connected`&&!window.opentigDesktop)return Td()},[t]),(0,w.useEffect)(()=>{if(n&&t!==`connected`&&t!==`auth-required`){let e={id:i.current??`server-connection:${++Jd}`,title:qd[t],type:t===`connecting`||t===`reconnecting`?`warning`:`error`,position:`bottom-right`,duration:null,autopilot:!1,...t===`incompatible-version`?{button:{title:`Reload`,onClick:()=>window.location.reload()}}:{}};i.current=qu.show(e)}else i.current&&=(qu.dismiss(i.current),null)},[n,t]),(0,w.useEffect)(()=>()=>{i.current&&qu.dismiss(i.current),i.current=null},[]),(0,w.useEffect)(()=>(t===`connected`&&r(!0),document.documentElement.dataset.serverConnection=t,()=>{delete document.documentElement.dataset.serverConnection}),[t]),t===`auth-required`){let e=!!window.opentigDesktop;return(0,Y.jsx)(`main`,{className:`access-page flex min-h-dvh items-center justify-center bg-background px-4 py-6 text-foreground`,children:(0,Y.jsxs)(`section`,{className:`w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-sm`,role:`status`,children:[(0,Y.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Authentication required`}),(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e?`Restart OpenTig to restore its private desktop session.`:(0,Y.jsx)(Y.Fragment,{children:`If Web access is paused, restore it from the desktop app or with local recovery below, then reload to resume your saved session. New browsers and expired or revoked sessions need a pairing code from the desktop app or the command below.`})}),!e&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(xd,{}),(0,Y.jsxs)(`details`,{className:`mt-4 text-sm text-muted-foreground`,children:[(0,Y.jsx)(`summary`,{className:`cursor-pointer`,children:`Restore paused access`}),(0,Y.jsx)(`p`,{className:`mt-2`,children:`Run on the server, then restart this instance. For a custom CLI home, add --home. Paired devices stay saved.`}),(0,Y.jsx)(xd,{recovery:!0})]}),(0,Y.jsx)(id,{className:`mt-5`,nativeButton:!1,render:(0,Y.jsx)(`a`,{href:`/pair`}),children:`Check browser access`})]})]})})}return!n&&(t===`offline`||t===`incompatible-version`)?(0,Y.jsx)($u,{heading:t===`offline`?`OpenTig server is offline`:`OpenTig cannot continue`,detail:t===`offline`?`See the server log for details, then restart OpenTig.`:`Client and server versions are incompatible.`,busy:!1}):e}function Xd(e,t){return e===t?e:e===`unknown`||t===`unknown`?`unknown`:e===`worktree`&&t===`index`||e===`index`&&t===`worktree`?`index`:`unknown`}function Zd(e,t){return{...e.manual||t.manual?{manual:!0}:{},scope:Xd(e.scope,t.scope),background:e.background&&t.background,view:t.view}}function Qd(e,t){return t!==`diff`&&t!==`conflict`?!1:e===`worktree`||e===`index`||e===`unknown`}function $d(e){return e===`worktree`||e===`index`||e===`unknown`}function ef(e,t){let n=e===`unknown`;return{status:!0,branches:n||e===`refs`||e===`worktrees`,worktrees:n||e===`worktrees`,files:t===`files`&&(n||e===`worktree`||e===`index`),history:t===`history`&&(n||e===`refs`)}}var tf=new g({defaultOptions:{queries:{networkMode:`always`,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,staleTime:0},mutations:{networkMode:`always`,retry:!1}}}),nf={commitAuthorship:e=>[`repository`,e,`commit-authorship`],githubAccounts:[`github`,`accounts`],githubCliStatus:[`github`,`cli-status`],githubAccount:e=>[`repository`,e,`github-account`],aiRepositoryInstructions:e=>[`repository`,e,`ai-instructions`],aiStatuses:e=>[`ai`,`statuses`,e],repository:e=>[`repository`,e],status:e=>[`repository`,e,`status`],branches:e=>[`repository`,e,`branches`],worktrees:e=>[`repository`,e,`worktrees`],files:e=>[`repository`,e,`files`],fileHistory:e=>[`repository`,e,`file-history`],history:e=>[`repository`,e,`history`],githubInfo:e=>[`repository`,e,`github-info`],pulls:(e,t)=>[`repository`,e,`pulls`,...t],pullRequest:(e,t)=>[`repository`,e,`pull-request`,t],pullRequestStack:(e,t)=>[`repository`,e,`pull-request-stack`,t],pullRequestDiff:(e,t)=>[`repository`,e,`pull-request-diff`,t],pullRequestCommitDiff:(e,t)=>[`repository`,e,`pull-request-commit-diff`,t],search:(e,t)=>[`repository`,e,`search`,t],localRefs:e=>[`repository`,e,`local-refs`],branchDetails:(e,t)=>[`repository`,e,`branch-details`,t],remoteBranchDetails:(e,t)=>[`repository`,e,`remote-branch-details`,t],branchPullRequest:(e,t)=>[`repository`,e,`branch-pull-request`,t],worktreeDetails:(e,t)=>[`repository`,e,`worktree-details`,t]};function rf(e,t){let n=ef(e,t);return[`status`,`branches`,`worktrees`,`files`,`history`].filter(e=>n[e])}async function af(e,t,n=!1){let r=new Set([`push-context`,`github-account`,`pulls`,`pull-request`,`pull-request-stack`,`pull-request-diff`,`pull-request-commit-diff`,`branch-pull-request`]),i=e=>(!t||n&&e.queryKey[1]===`accounts`)&&e.queryKey[0]===`github`||e.queryKey[0]===`repository`&&(!t||t.includes(String(e.queryKey[1])))&&r.has(String(e.queryKey[2]));await e.cancelQueries({predicate:i}),await e.resetQueries({predicate:i})}var of=`modulepreload`,sf=function(e){return`/`+e},cf={},lf=function(e){return e.pathname.endsWith(`.css`)},uf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=sf(t,n);let r=s(t);if(r.href in cf)return;cf[r.href]=!0;let i=lf(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:of,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},df=(0,w.lazy)(()=>uf(()=>import(`./App-Bfw_TX8q.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),ff=(0,w.lazy)(()=>uf(()=>import(`./PairingPage-CqrxpC3_.js`),__vite__mapDeps([17,1,2,5,4,14])));function pf(){let e=window.location.pathname===`/pair`?(0,Y.jsx)(ff,{}):(0,Y.jsx)(Yd,{children:(0,Y.jsx)(df,{})});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Zu,{}),(0,Y.jsx)(Xu,{theme:`light`,position:`bottom-right`}),(0,Y.jsx)(h,{client:tf,children:(0,Y.jsx)(w.Suspense,{fallback:null,children:e})})]})}var mf=document.getElementById(`root`);if(!mf)throw Error(`Root container not found.`);(0,re.createRoot)(mf).render((0,Y.jsx)(w.StrictMode,{children:(0,Y.jsx)(pf,{})}));export{ee as A,ld as C,$u as D,nd as E,Qu as O,cd as S,id as T,md as _,Zd as a,dd as b,Qd as c,jd as d,xd as f,_d as g,hd as h,af as i,qu as k,Kd as l,yd as m,nf as n,ef as o,bd as p,rf as r,$d as s,uf as t,Wd as u,gd as v,ad as w,sd as x,ud as y};
|