@forsion/unit 2.13.2 → 2.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/main.mjs +3 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/{ArtificialView-Bs_6B211.js → ArtificialView-DS97zlMg.js} +1 -1
  5. package/web/assets/{AutomationBuilder-C-IFaaBp.js → AutomationBuilder-BsJc8wuC.js} +1 -1
  6. package/web/assets/{CalendarConfigView-DEsNvVkD.js → CalendarConfigView-BN8mraSo.js} +1 -1
  7. package/web/assets/{CalendarView-D7ZUE_dr.js → CalendarView-D55PA1vn.js} +1 -1
  8. package/web/assets/{CapabilityMenu-CrsaTtDe.js → CapabilityMenu-BVrokPpT.js} +1 -1
  9. package/web/assets/{CheckboxInput-DVO2-1J7.js → CheckboxInput-BuJ3HPm_.js} +1 -1
  10. package/web/assets/{Chrome-BvpbCvo1.js → Chrome-amTcZNE4.js} +1 -1
  11. package/web/assets/{CodeView-CB4kG7Y6.js → CodeView-DRVh13k9.js} +3 -3
  12. package/web/assets/DashboardGridView-D9s9pez_.css +1 -0
  13. package/web/assets/{DashboardGridView-tgaj9-SM.js → DashboardGridView-DlFyYfUh.js} +2 -2
  14. package/web/assets/{EventCard-c6s4uGBu.js → EventCard-DUrn2krw.js} +1 -1
  15. package/web/assets/{ExcalidrawCanvas-NdV86AR3.js → ExcalidrawCanvas-TpbzBF-J.js} +1 -1
  16. package/web/assets/{FloatingToc-ldOYWe2C.js → FloatingToc-B1d4-5EL.js} +1 -1
  17. package/web/assets/HomepageView-DnQ_5Obe.css +1 -0
  18. package/web/assets/{HomepageView-4joJWYlg.js → HomepageView-nzKfbHM-.js} +1 -1
  19. package/web/assets/{ImageStudioPanels-DgMYAsHj.js → ImageStudioPanels-B2PTq6Yb.js} +1 -1
  20. package/web/assets/{ImageStudioView-_CYHoOoG.js → ImageStudioView-Cawr6pGW.js} +1 -1
  21. package/web/assets/{InlineFiles-BIfsx3R-.js → InlineFiles-DKPH5JHz.js} +1 -1
  22. package/web/assets/{MarkdownBlock-wYEaBBOr.js → MarkdownBlock-BHpDy2qQ.js} +1 -1
  23. package/web/assets/{ModelPill-DveHcLqq.js → ModelPill-ChzAM3z1.js} +1 -1
  24. package/web/assets/{MuseLibraryView-Do9RnKiq.js → MuseLibraryView-DLuQ_jyV.js} +2 -2
  25. package/web/assets/{MuseView-3GL4Ltoj.js → MuseView-CDDwV6SR.js} +2 -2
  26. package/web/assets/{PageHistoryPanel-BMQC-V_l.js → PageHistoryPanel-BbdXpjJM.js} +2 -2
  27. package/web/assets/{PdfAnnotator-CyAw8sgq.js → PdfAnnotator-CW0wPWRB.js} +1 -1
  28. package/web/assets/{PenRow-BSB-h5Pb.js → PenRow-BY-MZLDQ.js} +1 -1
  29. package/web/assets/{ProductView-B96OeHOP.js → ProductView-0ieVL3rY.js} +1 -1
  30. package/web/assets/{RightPanel-BgSeCLnw.js → RightPanel-BRexwQ3W.js} +1 -1
  31. package/web/assets/RunLocationPicker-BrDfOu8-.css +1 -0
  32. package/web/assets/RunLocationPicker-CadYiE7C.js +43 -0
  33. package/web/assets/{SketchCard-DAD0jR0i.js → SketchCard-BcXCdBAs.js} +1 -1
  34. package/web/assets/{StudioGuestSurface-DlUKXBXv.js → StudioGuestSurface-ZJFKnNYF.js} +1 -1
  35. package/web/assets/{TodoListView-_yFkPUrw.js → TodoListView-DuRdVFgB.js} +1 -1
  36. package/web/assets/{Tooltip-DXuy9-1_.js → Tooltip-DtDUL18W.js} +1 -1
  37. package/web/assets/{UnifiedPage-EJNWKzxN.js → UnifiedPage-D7JTfABH.js} +3 -3
  38. package/web/assets/{amadeus-manual.en-DzRWr4BL.js → amadeus-manual.en-B8J-svqq.js} +1 -1
  39. package/web/assets/{amadeus-manual.zh-DW32DkL7.js → amadeus-manual.zh-CkCOFnrg.js} +1 -1
  40. package/web/assets/appStore-ClD7vq5L.css +1 -0
  41. package/web/assets/{appStore-CidPWYa0.js → appStore-affnJoin.js} +155 -117
  42. package/web/assets/{arrow-up-right-KPFbRA41.js → arrow-up-right-R4P9Mmxz.js} +1 -1
  43. package/web/assets/{astryxBridge-Bupzouso.js → astryxBridge-CT2wZJXs.js} +3 -3
  44. package/web/assets/{automationListSource-1aOVKBLw.js → automationListSource-JVBMsMbC.js} +1 -1
  45. package/web/assets/{boardSurface-BHuMoQN-.js → boardSurface-Ce0_vf9f.js} +1 -1
  46. package/web/assets/{book-open-CBeNsIpo.js → book-open-CcXCToyx.js} +1 -1
  47. package/web/assets/{calendarNavStore-Duyhbmm_.js → calendarNavStore-tQJRVpum.js} +1 -1
  48. package/web/assets/{canvasPrefs-CxfyDTMT.js → canvasPrefs-CSuX9aLF.js} +1 -1
  49. package/web/assets/{chatBoxSurface-OBzO1Z5E.js → chatBoxSurface-IG6Vu4Dz.js} +1 -1
  50. package/web/assets/{circle-question-mark-M8QUJJYk.js → circle-question-mark-O8AhUz35.js} +1 -1
  51. package/web/assets/{circle-x-Szwop5L_.js → circle-x-AV2ZWulM.js} +1 -1
  52. package/web/assets/{client-CPUljePZ.js → client-BqhpYbYL.js} +1 -1
  53. package/web/assets/{code-xml-n9mgGgkv.js → code-xml-DdR58F83.js} +1 -1
  54. package/web/assets/{codeStudioStore-DXMQwRzG.js → codeStudioStore-Dq5i8nbE.js} +1 -1
  55. package/web/assets/codingNavigation-CxdCK78-.js +53 -0
  56. package/web/assets/codingNavigation-_tOR0ell.css +1 -0
  57. package/web/assets/{create-C19zqt5N.js → create-BgJN5qsj.js} +2 -2
  58. package/web/assets/{dashboardSurface-BwcH16Qc.js → dashboardSurface-BY-AFB-r.js} +1 -1
  59. package/web/assets/{deskCapture-B_LKZSPt.js → deskCapture-BD2qD6NI.js} +1 -1
  60. package/web/assets/{diff2html-DrCCWvpR.js → diff2html-OoRdHZ_O.js} +1 -1
  61. package/web/assets/{docx-preview-Bi7wekSM.js → docx-preview-B43XC8Cn.js} +1 -1
  62. package/web/assets/{emoji-DczIG8SO.js → emoji-BPdA62d7.js} +1 -1
  63. package/web/assets/{floatingTocSurface-rc1ZC7-I.js → floatingTocSurface-BM2SYE_u.js} +1 -1
  64. package/web/assets/{foldActions-BGocXE-o.js → foldActions-BcyvNVBs.js} +1 -1
  65. package/web/assets/{folder-CoOsfQ64.js → folder-CCZqnwRc.js} +1 -1
  66. package/web/assets/{folder-plus-d5MwIMlf.js → folder-plus-BJKT1Pqg.js} +1 -1
  67. package/web/assets/{gestures-CXFaEydn.js → gestures-BwPbZDkU.js} +1 -1
  68. package/web/assets/{hand-fuehbnkI.js → hand-DRu7IJdU.js} +1 -1
  69. package/web/assets/{hard-drive-Bh1DmZg0.js → hard-drive-CXNJUCXw.js} +1 -1
  70. package/web/assets/i18n-BMo19xaR.css +1 -0
  71. package/web/assets/i18n.generated-DvY59Zq3.js +15 -0
  72. package/web/assets/{imageStudio-Dgl1wZNB.js → imageStudio-Axwmd4GW.js} +2 -2
  73. package/web/assets/imageStudio-DZ0qGU2s.css +1 -0
  74. package/web/assets/{index-e-MxdHFO.js → index-B1rE_NwA.js} +1 -1
  75. package/web/assets/{index-lfow5R3O.js → index-BFTY79aq.js} +1 -1
  76. package/web/assets/{index-38xsQSS9.js → index-BGEkZBs2.js} +1 -1
  77. package/web/assets/{index-YRWOePBS.js → index-BO2XJc36.js} +1 -1
  78. package/web/assets/{index-B5UW6SaE.js → index-BYUntVIZ.js} +2 -2
  79. package/web/assets/{index-2tD0kijW.js → index-C65u4fXd.js} +1 -1
  80. package/web/assets/{index-BCG8Wnc4.js → index-C_Ohi-I3.js} +1 -1
  81. package/web/assets/{index-Dff-DL1v.js → index-CkMhazev.js} +1 -1
  82. package/web/assets/{index-Dc8iMctf.js → index-CobUnTcv.js} +1 -1
  83. package/web/assets/{index-Dy07SBfH.js → index-D102FOuM.js} +1 -1
  84. package/web/assets/{index-B8Co6KG3.js → index-D3CYvMpl.js} +1 -1
  85. package/web/assets/{index-QjVOA7QM.js → index-D78izbLA.js} +1 -1
  86. package/web/assets/{index-BPqoEOV_.js → index-DDMXVG0h.js} +1 -1
  87. package/web/assets/{index-CPLtf9Vc.js → index-DY0M_dpd.js} +1 -1
  88. package/web/assets/{index-7kdR1oL8.js → index-DcbZwhpE.js} +1 -1
  89. package/web/assets/{index-D4CSH-v1.js → index-Dlkq7gkE.js} +1 -1
  90. package/web/assets/{index-Ch0FIsJX.js → index-HqmJW2np.js} +1 -1
  91. package/web/assets/{index-DcRyQ3eU.js → index-LxlyPm0_.js} +1 -1
  92. package/web/assets/{index-Ce1sNSS8.js → index-Uq4J2aoW.js} +1 -1
  93. package/web/assets/{index-DvOrTnw2.js → index-WbVt2P8R.js} +1 -1
  94. package/web/assets/{index-Df9jregv.js → index-XyjIhkPw.js} +1 -1
  95. package/web/assets/{index-BqGpbntz.js → index-Y2kzYlZq.js} +1 -1
  96. package/web/assets/{index-CnDAYLti.js → index-mB0EQkyZ.js} +1 -1
  97. package/web/assets/{index-fViJsYjM.js → index-pJh7JN7_.js} +1 -1
  98. package/web/assets/{index-Dx9aIoyo.js → index-taRxNsbp.js} +1 -1
  99. package/web/assets/{invitePage-Dgl3-c_m.js → invitePage-BW0BH8Ac.js} +1 -1
  100. package/web/assets/{ipc-CNlIRMtU.js → ipc-D7yENkjV.js} +1 -1
  101. package/web/assets/{jszip.min-tyV0GaJg.js → jszip.min-UE5d5vPJ.js} +1 -1
  102. package/web/assets/{layout-grid-DFmwM9NU.js → layout-grid-Hs3eDA07.js} +1 -1
  103. package/web/assets/{linkFollow-iP2zfbA3.js → linkFollow-Msu1XH9v.js} +4 -4
  104. package/web/assets/{list-tree-i07HsP3D.js → list-tree-DmuRb-p9.js} +1 -1
  105. package/web/assets/{listFold-Aea6I0Sa.js → listFold-CKxjyY5_.js} +1 -1
  106. package/web/assets/{lock-TSDKuCod.js → lock-kffGfeHt.js} +1 -1
  107. package/web/assets/{log-out-DK84lW5n.js → log-out-B5gEP0tF.js} +1 -1
  108. package/web/assets/main-DIyFlyfK.js +20 -0
  109. package/web/assets/markdownEditorSurface-Cx2rqFAY.js +3 -0
  110. package/web/assets/{message-square-plus-3wFslIMY.js → message-square-plus-DxBPIhPS.js} +1 -1
  111. package/web/assets/{messages-DEAGRsC3.js → messages-4w1Khzm1.js} +1 -1
  112. package/web/assets/minus-CfoZ4oxr.js +1 -0
  113. package/web/assets/{mobileEntry-5UaAITwY.js → mobileEntry-B8JwR53-.js} +1 -1
  114. package/web/assets/{nativeDownload-B3JGkABw.js → nativeDownload-Udrv_tmU.js} +1 -1
  115. package/web/assets/{pageChrome-DFi9zs6F.js → pageChrome-D-9npbUE.js} +1 -1
  116. package/web/assets/{pageChrome-BDHHmRnt.css → pageChrome-eO9pb2fH.css} +1 -1
  117. package/web/assets/{pageTree-DZ7Eiro-.js → pageTree-CIXFRCLk.js} +2 -2
  118. package/web/assets/{pen-tool-ChGmX6g_.js → pen-tool-D_Y9We9x.js} +1 -1
  119. package/web/assets/{pencil-CJsJD7M_.js → pencil-DGiTRzW1.js} +1 -1
  120. package/web/assets/phoneList-BQfCJwKF.css +1 -0
  121. package/web/assets/{phoneList-DrxIwJxQ.js → phoneList-DHUia6HT.js} +1 -1
  122. package/web/assets/{pluginChat-0QI9a8Q1.js → pluginChat-BXuJiMYi.js} +1 -1
  123. package/web/assets/{redo-2-CI57sDFr.js → redo-2-QgiKEg9T.js} +1 -1
  124. package/web/assets/{rotate-ccw-xgT_0UN9.js → rotate-ccw-BLoH5er1.js} +1 -1
  125. package/web/assets/{sharePage-C2Yqx0NQ.js → sharePage-DYYN5usb.js} +2 -2
  126. package/web/assets/{shareViewer-DKPWhTJv.js → shareViewer-BzuSyJv_.js} +1 -1
  127. package/web/assets/{star-C9KTji9N.js → star-BmywYD3u.js} +1 -1
  128. package/web/assets/{tableSurface-cYs6dX6B.js → tableSurface-21LDYY_G.js} +1 -1
  129. package/web/assets/{terminal-DPZazOQ2.js → terminal-BlmA_Z1C.js} +1 -1
  130. package/web/assets/{terminalView-CsJmxE_m.js → terminalView-SAxITnRW.js} +1 -1
  131. package/web/assets/{type-C5J875vb.js → type-DmIL6FB-.js} +1 -1
  132. package/web/assets/{undo-2-BOUt5qks.js → undo-2-yMeXc8Wi.js} +1 -1
  133. package/web/assets/{unitAccount-BIAIxKNp.js → unitAccount-BPYRAa3m.js} +1 -1
  134. package/web/assets/{unitBridge-b2C6zb3a.js → unitBridge-BNVzai6X.js} +1 -1
  135. package/web/assets/{unitCloudTransport-NGtDDKWo.js → unitCloudTransport-iFweA1xk.js} +1 -1
  136. package/web/assets/{unitOwnerAccess-CwH9ApZT.js → unitOwnerAccess-Bggl7bDP.js} +1 -1
  137. package/web/assets/{unitShim-CY8EVkKD.js → unitShim-BP2nBO_k.js} +3 -3
  138. package/web/assets/{upload-CrbEAW8C.js → upload-D20PZHXc.js} +1 -1
  139. package/web/assets/userSpaces-CrLrKklx.js +1 -0
  140. package/web/assets/{viewportLock-Bi3orrUs.css → viewportLock-DO1lzA2N.css} +1 -1
  141. package/web/assets/viewportLock-tlT6H_Hc.js +629 -0
  142. package/web/assets/{workflow-DY2Cnaei.js → workflow-Bd6xBHiT.js} +1 -1
  143. package/web/assets/{zoom-in-BcuPvIYd.js → zoom-in-_TgFOpyv.js} +1 -1
  144. package/web/index.html +2 -2
  145. package/web/assets/DashboardGridView-hpRmBr9B.css +0 -1
  146. package/web/assets/HomepageView-Cxf3AWBu.css +0 -1
  147. package/web/assets/RunLocationPicker-CEmFio4n.css +0 -1
  148. package/web/assets/RunLocationPicker-M1UoJyjf.js +0 -38
  149. package/web/assets/appStore-DeaC1U32.css +0 -1
  150. package/web/assets/codingNavigation-CCjs1kon.js +0 -53
  151. package/web/assets/codingNavigation-yp19w6uu.css +0 -1
  152. package/web/assets/i18n-DjziAw8r.css +0 -1
  153. package/web/assets/i18n.generated-BiQFRL2U.js +0 -15
  154. package/web/assets/imageStudio--KF9gwHA.css +0 -1
  155. package/web/assets/main-D7CEGndC.js +0 -20
  156. package/web/assets/markdownEditorSurface-DISu_twy.js +0 -3
  157. package/web/assets/minus-BBdfT_sc.js +0 -1
  158. package/web/assets/phoneList-DvpzD3zT.css +0 -1
  159. package/web/assets/userSpaces-B_Njvel_.js +0 -1
  160. package/web/assets/viewportLock-DZ927PNz.js +0 -629
@@ -1,4 +1,4 @@
1
- import{d as x,j as m,R as Rt,r as bt,u as Dr,f as jr,t as Lr,L as Or}from"./index-B5UW6SaE.js";import{c as Ir}from"./client-CPUljePZ.js";import{u as Fr,a as Nr,b as Br,A as zr,C as Ur,V as Wr,c as _r,M as $r,S as Kr,B as Hr,P as Gr,d as Yr,N as Xr,i as qr,e as Zr}from"./viewportLock-DZ927PNz.js";import{H as Fi,a as Jr,u as et,b as Qr,o as ta,f as ea,c as Ni,n as es,d as na,e as sa,g as ns,h as ia,i as Bi,j as oa,k as ra,l as aa,m as la,S as ca,Q as ua,O as ha,p as ss,q as is,r as os,s as da,t as fa,v as rs,w as ma,x as pa,y as ga,z as ya,A as va,B as xa,C as ba,D as wa,E as Sa,F as Ta}from"./appStore-CidPWYa0.js";import{d as Pa,i as Ca,s as Aa,a as ka,g as Ma,o as Va}from"./RunLocationPicker-M1UoJyjf.js";import{i as Ea,u as Ye,b as zi,E as Ra}from"./codingNavigation-CCjs1kon.js";import{F as Da}from"./UnifiedPage-EJNWKzxN.js";import{i as Sn,R as ja,a as La,b as Oa}from"./ipc-CNlIRMtU.js";import"./i18n.generated-BiQFRL2U.js";import"./ModelPill-DveHcLqq.js";import"./rotate-ccw-xgT_0UN9.js";import"./upload-CrbEAW8C.js";import"./hard-drive-Bh1DmZg0.js";import"./CapabilityMenu-CrsaTtDe.js";import"./book-open-CBeNsIpo.js";import"./folder-plus-d5MwIMlf.js";import"./circle-x-Szwop5L_.js";import"./userSpaces-B_Njvel_.js";import"./automationListSource-1aOVKBLw.js";import"./nativeDownload-B3JGkABw.js";import"./messages-DEAGRsC3.js";import"./code-xml-n9mgGgkv.js";import"./workflow-DY2Cnaei.js";import"./list-tree-i07HsP3D.js";import"./layout-grid-DFmwM9NU.js";import"./terminal-DPZazOQ2.js";import"./star-C9KTji9N.js";import"./folder-CoOsfQ64.js";import"./DashboardGridView-tgaj9-SM.js";import"./FloatingToc-ldOYWe2C.js";import"./MarkdownBlock-wYEaBBOr.js";import"./index-BqGpbntz.js";import"./linkFollow-iP2zfbA3.js";import"./emoji-DczIG8SO.js";import"./listFold-Aea6I0Sa.js";import"./pageChrome-DFi9zs6F.js";import"./pageTree-DZ7Eiro-.js";import"./pluginExt-Byb64tQO.js";import"./phoneList-DrxIwJxQ.js";import"./pen-tool-ChGmX6g_.js";import"./pencil-CJsJD7M_.js";import"./type-C5J875vb.js";import"./undo-2-BOUt5qks.js";import"./redo-2-CI57sDFr.js";import"./lock-TSDKuCod.js";import"./AutomationBuilder-C-IFaaBp.js";import"./gestures-CXFaEydn.js";import"./Chrome-BvpbCvo1.js";import"./minus-BBdfT_sc.js";import"./canvasPrefs-CxfyDTMT.js";import"./circle-question-mark-M8QUJJYk.js";import"./InlineFiles-BIfsx3R-.js";import"./RightPanel-BgSeCLnw.js";import"./MuseView-3GL4Ltoj.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-3wFslIMY.js";import"./codeStudioStore-DXMQwRzG.js";import"./log-out-DK84lW5n.js";import"./arrow-up-right-KPFbRA41.js";import"./index-CPLtf9Vc.js";/* empty css */import"./StudioGuestSurface-DlUKXBXv.js";import"./create-C19zqt5N.js";import"./hand-fuehbnkI.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-BcuPvIYd.js";import"./SketchCard-DAD0jR0i.js";import"./foldActions-BGocXE-o.js";const Me={addListener:async(t,e)=>({remove:()=>{}}),minimizeApp:async()=>{},getLaunchUrl:async()=>{}},Tn=x.createContext({});function Pn(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ia=typeof window<"u",Cn=Ia?x.useLayoutEffect:x.useEffect,Te=x.createContext(null);function An(t,e){t.indexOf(e)===-1&&t.push(e)}function fe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const rt=(t,e,n)=>n>e?e:n<t?t:n;let kn=()=>{};const ht={},Ui=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Wi=t=>typeof t=="object"&&t!==null,_i=t=>/^0[^.\s]+$/u.test(t);function $i(t){let e;return()=>(e===void 0&&(e=t()),e)}const Z=t=>t,_t=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Ft=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class Mn{constructor(){this.subscriptions=[]}add(e){return An(this.subscriptions,e),()=>fe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const H=t=>t*1e3,q=t=>t/1e3,Ki=(t,e)=>e?t*(1e3/e):0,Hi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fa=1e-7,Na=12;function Ba(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Hi(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Fa&&++a<Na);return o}function $t(t,e,n,s){if(t===e&&n===s)return Z;const i=r=>Ba(r,0,1,t,n);return r=>r===0||r===1?r:Hi(i(r),e,s)}const Gi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Yi=t=>e=>1-t(1-e),Xi=$t(.33,1.53,.69,.99),Vn=Yi(Xi),qi=Gi(Vn),Zi=t=>t>=1?1:(t*=2)<1?.5*Vn(t):.5*(2-Math.pow(2,-10*(t-1))),En=t=>1-Math.sin(Math.acos(t)),Ji=Yi(En),Qi=Gi(En),za=$t(.42,0,1,1),Ua=$t(0,0,.58,1),to=$t(.42,0,.58,1),Wa=t=>Array.isArray(t)&&typeof t[0]!="number",eo=t=>Array.isArray(t)&&typeof t[0]=="number",_a={linear:Z,easeIn:za,easeInOut:to,easeOut:Ua,circIn:En,circInOut:Qi,circOut:Ji,backIn:Vn,backInOut:qi,backOut:Xi,anticipate:Zi},$a=t=>typeof t=="string",as=t=>{if(eo(t)){kn(t.length===4);const[e,n,s,i]=t;return $t(e,n,s,i)}else if($a(t))return _a[t];return t},Xt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ka(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){r.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,u=!1,h=!1)=>{const p=h&&s?e:n;return u&&r.add(l),p.add(l),l},cancel:l=>{n.delete(l),r.delete(l)},process:l=>{if(o=l,s){i=!0;return}s=!0;const u=e;e=n,n=u,e.forEach(a),e.clear(),s=!1,i&&(i=!1,c.process(l))}};return c}const Ha=40;function no(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Xt.reduce((b,S)=>(b[S]=Ka(r),b),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:p,postRender:f}=o,y=()=>{const b=ht.useManualTiming,S=b?i.timestamp:performance.now();n=!1,b||(i.delta=s?1e3/60:Math.max(Math.min(S-i.timestamp,Ha),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),h.process(i),d.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},v=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Xt.reduce((b,S)=>{const k=o[S];return b[S]=(V,M=!1,C=!1)=>(n||v(),k.schedule(V,M,C)),b},{}),cancel:b=>{for(let S=0;S<Xt.length;S++)o[Xt[S]].cancel(b)},state:i,steps:o}}const{schedule:L,cancel:dt,state:U,steps:Ve}=no(typeof requestAnimationFrame<"u"?requestAnimationFrame:Z,!0);let ie;function Ga(){ie=void 0}const _={now:()=>(ie===void 0&&_.set(U.isProcessing||ht.useManualTiming?U.timestamp:performance.now()),ie),set:t=>{ie=t,queueMicrotask(Ga)}},so=t=>e=>typeof e=="string"&&e.startsWith(t),io=so("--"),Ya=so("var(--"),Rn=t=>Ya(t)?Xa.test(t.split("/*")[0].trim()):!1,Xa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ls(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const kt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Nt={...kt,transform:t=>rt(0,1,t)},qt={...kt,default:1},jt=t=>Math.round(t*1e5)/1e5,Dn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qa(t){return t==null}const Za=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jn=(t,e)=>n=>!!(typeof n=="string"&&Za.test(n)&&n.startsWith(t)||e&&!qa(n)&&Object.prototype.hasOwnProperty.call(n,e)),oo=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Dn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ja=t=>rt(0,255,t),Ee={...kt,transform:t=>Math.round(Ja(t))},gt={test:jn("rgb","red"),parse:oo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ee.transform(t)+", "+Ee.transform(e)+", "+Ee.transform(n)+", "+jt(Nt.transform(s))+")"};function Qa(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Xe={test:jn("#"),parse:Qa,transform:gt.transform},Kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),at=Kt("deg"),ot=Kt("%"),P=Kt("px"),tl=Kt("vh"),el=Kt("vw"),cs={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(t*100)},St={test:jn("hsl","hue"),parse:oo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(jt(e))+", "+ot.transform(jt(n))+", "+jt(Nt.transform(s))+")"},F={test:t=>gt.test(t)||Xe.test(t)||St.test(t),parse:t=>gt.test(t)?gt.parse(t):St.test(t)?St.parse(t):Xe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=F.parse(t);return e.alpha=0,F.transform(e)}},nl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sl(t){return isNaN(t)&&typeof t=="string"&&(t.match(Dn)?.length||0)+(t.match(nl)?.length||0)>0}const ro="number",ao="color",il="var",ol="var(",us="${}",rl=/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 Ct(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(rl,c=>(F.test(c)?(s.color.push(r),i.push(ao),n.push(F.parse(c))):c.startsWith(ol)?(s.var.push(r),i.push(il),n.push(c)):(s.number.push(r),i.push(ro),n.push(parseFloat(c))),++r,us)).split(us);return{values:n,split:a,indexes:s,types:i}}function al(t){return Ct(t).values}function lo({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===ro?i+=jt(s[r]):o===ao?i+=F.transform(s[r]):i+=s[r]}return i}}function ll(t){return lo(Ct(t))}const cl=t=>typeof t=="number"?0:F.test(t)?F.getAnimatableNone(t):t,ul=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:cl(t);function hl(t){const e=Ct(t);return lo(e)(e.values.map((s,i)=>ul(s,e.split[i])))}const nt={test:sl,parse:al,createTransformer:ll,getAnimatableNone:hl};function Re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function dl({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Re(c,a,t+1/3),r=Re(c,a,t),o=Re(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function me(t,e){return n=>n>0?e:t}const j=(t,e,n)=>t+(e-t)*n,De=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},fl=[Xe,gt,St],ml=t=>fl.find(e=>e.test(t));function hs(t){const e=ml(t);if(!e)return!1;let n=e.parse(t);return e===St&&(n=dl(n)),n}const ds=(t,e)=>{const n=hs(t),s=hs(e);if(!n||!s)return me(t,e);const i={...n};return r=>(i.red=De(n.red,s.red,r),i.green=De(n.green,s.green,r),i.blue=De(n.blue,s.blue,r),i.alpha=j(n.alpha,s.alpha,r),gt.transform(i))},qe=new Set(["none","hidden"]);function pl(t,e){return qe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gl(t,e){return n=>j(t,e,n)}function Ln(t){return typeof t=="number"?gl:typeof t=="string"?Rn(t)?me:F.test(t)?ds:xl:Array.isArray(t)?co:typeof t=="object"?F.test(t)?ds:yl:me}function co(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Ln(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function yl(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Ln(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function vl(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const xl=(t,e)=>{const n=nt.createTransformer(e),s=Ct(t),i=Ct(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?qe.has(t)&&!i.values.length||qe.has(e)&&!s.values.length?pl(t,e):_t(co(vl(s,i),i.values),n):me(t,e)};function uo(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?j(t,e,n):Ln(t)(t,e)}const bl=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>dt(e),now:()=>U.isProcessing?U.timestamp:_.now()}},ho=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},pe=2e4;function On(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<pe;)e+=n,s=t.next(e);return e>=pe?1/0:e}function wl(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(On(s),pe);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:q(i)}}const I={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 Ze(t,e){return t*Math.sqrt(1-e*e)}const Sl=12;function Tl(t,e,n){let s=n;for(let i=1;i<Sl;i++)s=s-t(s)/e(s);return s}const je=.001;function Pl({duration:t=I.duration,bounce:e=I.bounce,velocity:n=I.velocity,mass:s=I.mass}){let i,r,o=1-e;o=rt(I.minDamping,I.maxDamping,o),t=rt(I.minDuration,I.maxDuration,q(t)),o<1?(i=l=>{const u=l*o,h=u*t,d=u-n,p=Ze(l,o),f=Math.exp(-h);return je-d/p*f},r=l=>{const h=l*o*t,d=h*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,f=Math.exp(-h),y=Ze(Math.pow(l,2),o);return(-i(l)+je>0?-1:1)*((d-p)*f)/y}):(i=l=>{const u=Math.exp(-l*t),h=(l-n)*t+1;return-je+u*h},r=l=>{const u=Math.exp(-l*t),h=(n-l)*(t*t);return u*h});const a=5/t,c=Tl(i,r,a);if(t=H(t),isNaN(c))return{stiffness:I.stiffness,damping:I.damping,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Cl=["duration","bounce"],Al=["stiffness","damping","mass"];function fs(t,e){return e.some(n=>t[n]!==void 0)}function kl(t){let e={velocity:I.velocity,stiffness:I.stiffness,damping:I.damping,mass:I.mass,isResolvedFromDuration:!1,...t};if(!fs(t,Al)&&fs(t,Cl))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*rt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:I.mass,stiffness:i,damping:r}}else{const n=Pl({...t,velocity:0});e={...e,...n,mass:I.mass},e.isResolvedFromDuration=!0}return e}function ge(t=I.visualDuration,e=I.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:l,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=kl({...n,velocity:-q(n.velocity||0)}),f=d||0,y=l/(2*Math.sqrt(c*u)),v=o-r,g=q(Math.sqrt(c/u)),T=Math.abs(v)<5;s||(s=T?I.restSpeed.granular:I.restSpeed.default),i||(i=T?I.restDelta.granular:I.restDelta.default);let b,S,k,V,M,C;if(y<1)k=Ze(g,y),V=(f+y*g*v)/k,b=A=>{const O=Math.exp(-y*g*A);return o-O*(V*Math.sin(k*A)+v*Math.cos(k*A))},M=y*g*V+v*k,C=y*g*v-V*k,S=A=>Math.exp(-y*g*A)*(M*Math.sin(k*A)+C*Math.cos(k*A));else if(y===1){b=O=>o-Math.exp(-g*O)*(v+(f+g*v)*O);const A=f+g*v;S=O=>Math.exp(-g*O)*(g*A*O-f)}else{const A=g*Math.sqrt(y*y-1);b=G=>{const Y=Math.exp(-y*g*G),K=Math.min(A*G,300);return o-Y*((f+y*g*v)*Math.sinh(K)+A*v*Math.cosh(K))/A};const O=(f+y*g*v)/A,N=y*g*O-v*A,J=y*g*v-O*A;S=G=>{const Y=Math.exp(-y*g*G),K=Math.min(A*G,300);return Y*(N*Math.sinh(K)+J*Math.cosh(K))}}const E={calculatedDuration:p&&h||null,velocity:A=>H(S(A)),next:A=>{if(!p&&y<1){const N=Math.exp(-y*g*A),J=Math.sin(k*A),G=Math.cos(k*A),Y=o-N*(V*J+v*G),K=H(N*(M*J+C*G));return a.done=Math.abs(K)<=s&&Math.abs(o-Y)<=i,a.value=a.done?o:Y,a}const O=b(A);if(p)a.done=A>=h;else{const N=H(S(A));a.done=Math.abs(N)<=s&&Math.abs(o-O)<=i}return a.value=a.done?o:O,a},toString:()=>{const A=Math.min(On(E),pe),O=ho(N=>E.next(A*N).value,A,30);return A+"ms "+O},toTransition:()=>{}};return E}ge.applyToOptions=t=>{const e=wl(t,100,ge);return t.ease=e.ease,t.duration=H(e.duration),t.type="keyframes",t};const Ml=5;function fo(t,e,n){const s=Math.max(e-Ml,0);return Ki(n-t(s),e-s)}function Je({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=C=>a!==void 0&&C<a||c!==void 0&&C>c,f=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let y=n*e;const v=h+y,g=o===void 0?v:o(v);g!==v&&(y=g-h);const T=C=>-y*Math.exp(-C/s),b=C=>g+T(C),S=C=>{const E=T(C),A=b(C);d.done=Math.abs(E)<=l,d.value=d.done?g:A};let k,V;const M=C=>{p(d.value)&&(k=C,V=ge({keyframes:[d.value,f(d.value)],velocity:fo(b,C,d.value),damping:i,stiffness:r,restDelta:l,restSpeed:u}))};return M(0),{calculatedDuration:null,next:C=>{let E=!1;return!V&&k===void 0&&(E=!0,S(C),M(C)),k!==void 0&&C>=k?V.next(C-k):(!E&&S(C),d)}}}function Vl(t,e,n){const s=[],i=n||ht.mix||uo,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Z:e;a=_t(c,a)}s.push(a)}return s}function El(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(kn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Vl(e,s,i),c=a.length,l=u=>{if(o&&u<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=Ft(t[h],t[h+1],u);return a[h](d)};return n?u=>l(rt(t[0],t[r-1],u)):l}function Rl(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(j(n,1,i))}}function Dl(t){const e=[0];return Rl(e,t.length-1),e}function jl(t,e){return t.map(n=>n*e)}function Ll(t,e){return t.map(()=>e||to).splice(0,t.length-1)}function Lt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Wa(s)?s.map(as):as(s),r={done:!1,value:e[0]},o=jl(n&&n.length===e.length?n:Dl(e),t),a=El(o,e,{ease:Array.isArray(i)?i:Ll(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Ol=t=>t!==null;function Pe(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ol),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Il={decay:Je,inertia:Je,tween:Lt,keyframes:Lt,spring:ge};function mo(t){typeof t.type=="string"&&(t.type=Il[t.type])}class In{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Fl=t=>t/100;class ye extends In{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==_.now()&&this.tick(_.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;mo(e);const{type:n=Lt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Lt;c!==Lt&&typeof a[0]!="number"&&(this.mixKeyframes=_t(Fl,uo(a[0],a[1])),a=[0,100]);const l=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=On(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,S=s;if(h){const C=Math.min(this.currentTime,i)/a;let E=Math.floor(C),A=C%1;!A&&C>=1&&(A=1),A===1&&E--,E=Math.min(E,h+1),E%2&&(d==="reverse"?(A=1-A,p&&(A-=p/a)):d==="mirror"&&(S=o)),b=rt(0,1,A)*a}let k;T?(this.delayState.value=u[0],k=this.delayState):k=S.next(b),r&&!T&&(k.value=r(k.value));let{done:V}=k;!T&&c!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&f!==Je&&(k.value=Pe(u,this.options,v,this.speed)),y&&y(k.value),M&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return q(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+q(e)}get time(){return q(this.currentTime)}set time(e){e=H(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return fo(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(_.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=q(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bl,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Nl(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const yt=t=>t*180/Math.PI,Qe=t=>{const e=yt(Math.atan2(t[1],t[0]));return tn(e)},Bl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qe,rotateZ:Qe,skewX:t=>yt(Math.atan(t[1])),skewY:t=>yt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tn=t=>(t=t%360,t<0&&(t+=360),t),ms=Qe,ps=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),gs=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zl={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ps,scaleY:gs,scale:t=>(ps(t)+gs(t))/2,rotateX:t=>tn(yt(Math.atan2(t[6],t[5]))),rotateY:t=>tn(yt(Math.atan2(-t[2],t[0]))),rotateZ:ms,rotate:ms,skewX:t=>yt(Math.atan(t[4])),skewY:t=>yt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function en(t){return t.includes("scale")?1:0}function nn(t,e){if(!t||t==="none")return en(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=zl,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Bl,i=a}if(!i)return en(e);const r=s[e],o=i[1].split(",").map(Wl);return typeof r=="function"?r(o):o[r]}const Ul=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return nn(n,e)};function Wl(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set([...Mt,"pathRotation"]),ys=t=>t===kt||t===P,_l=new Set(["x","y","z"]),$l=Mt.filter(t=>!_l.has(t));function Kl(t){const e=[];return $l.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ut={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>nn(e,"x"),y:(t,{transform:e})=>nn(e,"y")};ut.translateX=ut.x;ut.translateY=ut.y;const vt=new Set;let sn=!1,on=!1,rn=!1;function po(){if(on){const t=Array.from(vt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Kl(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}on=!1,sn=!1,vt.forEach(t=>t.complete(rn)),vt.clear()}function go(){vt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(on=!0)})}function Hl(){rn=!0,go(),po(),rn=!1}class Fn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(vt.add(this),sn||(sn=!0,L.read(go),L.resolveKeyframes(po))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Nl(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vt.delete(this)}cancel(){this.state==="scheduled"&&(vt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gl=t=>t.startsWith("--");function yo(t,e,n){Gl(e)?t.style.setProperty(e,n):t.style[e]=n}const Yl={};function vo(t,e){const n=$i(t);return()=>Yl[e]??n()}const Xl=vo(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xo=vo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,vs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dt([0,.65,.55,1]),circOut:Dt([.55,0,1,.45]),backIn:Dt([.31,.01,.66,-.59]),backOut:Dt([.33,1.53,.69,.99])};function bo(t,e){if(t)return typeof t=="function"?xo()?ho(t,e):"ease-out":eo(t)?Dt(t):Array.isArray(t)?t.map(n=>bo(n,e)||vs.easeOut):vs[t]}function ql(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const h=bo(a,i);Array.isArray(h)&&(u.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function wo(t){return typeof t=="function"&&"applyToOptions"in t}function Zl({type:t,...e}){return wo(t)&&xo()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class So extends In{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,kn(typeof e.type!="string");const l=Zl(e);this.animation=ql(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Pe(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),yo(n,s,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return q(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+q(e)}get time(){return q(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Xl()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),Z):i(this)}}const To={anticipate:Zi,backInOut:qi,circInOut:Qi};function Jl(t){return t in To}function Ql(t){typeof t.ease=="string"&&Jl(t.ease)&&(t.ease=To[t.ease])}const Le=10;class tc extends So{constructor(e){Ql(e),mo(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new ye({...o,autoplay:!1}),c=Math.max(Le,_.now()-this.startTime),l=rt(0,Le,c-Le),u=a.sample(c).value,{name:h}=this.options;r&&h&&yo(r,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const xs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(nt.test(t)||t==="0")&&!t.startsWith("url("));function ec(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function nc(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=xs(i,e),a=xs(r,e);return!o||!a?!1:ec(t)||(n==="spring"||wo(n))&&s}function an(t){t.duration=0,t.type="keyframes"}const Po=new Set(["opacity","clipPath","filter","transform"]),sc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ic(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&sc.test(t[e]))return!0;return!1}const oc=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),rc=$i(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ac(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return rc()&&n&&(Po.has(n)||oc.has(n)&&ic(a))&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const lc=40;class cc extends In{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=_.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:l,element:u,...h},p=u?.KeyframeResolver||Fn;this.keyframeResolver=new p(a,(f,y,v)=>this.onKeyframesResolved(f,y,d,!v),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=_.now();let h=!0;nc(e,r,o,a)||(h=!1,(ht.instantAnimations||!c)&&u?.(Pe(e,s,n)),e[0]=e[e.length-1],an(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>lc?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},f=h&&!l&&ac(p),y=p.motionValue?.owner?.current;let v;if(f)try{v=new tc({...p,element:y})}catch{v=new ye(p)}else v=new ye(p);v.finished.then(()=>{this.notifyFinished()}).catch(Z),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hl()),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 Co(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const bs=30,uc=t=>!isNaN(parseFloat(t));class hc{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=_.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=_.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uc(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Mn);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=_.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,bs);return Ki(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 At(t,e){return new hc(t,e)}function Ao(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ao(n,t):n}const dc={type:"spring",stiffness:500,damping:25,restSpeed:10},fc=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mc={type:"keyframes",duration:.8},pc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gc=(t,{keyframes:e})=>e.length>2?mc:Vt.has(t)?t.startsWith("scale")?fc(e[1]):dc:pc,yc=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function vc(t){for(const e in t)if(!yc.has(e))return!0;return!1}const Bn=(t,e,n,s={},i,r)=>o=>{const a=Nn(s,t)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-H(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};vc(a)||Object.assign(u,gc(t,u)),u.duration&&(u.duration=H(u.duration)),u.repeatDelay&&(u.repeatDelay=H(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(an(u),u.delay===0&&(h=!0)),(ht.instantAnimations||ht.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,an(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Pe(u.keyframes,a);if(d!==void 0){L.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new ye(u):new cc(u)},xc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bc(t){const e=xc.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ko(t,e,n=1){const[s,i]=bc(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Ui(o)?parseFloat(o):o}return Rn(i)?ko(i,e,n+1):i}function ws(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function zn(t,e,n,s){if(typeof e=="function"){const[i,r]=ws(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=ws(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function xt(t,e,n){const s=t.getProps();return zn(s,e,n!==void 0?n:s.custom,t)}const Mo=new Set(["width","height","top","left","right","bottom",...Mt]),ln=t=>Array.isArray(t);function wc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,At(n))}function Sc(t){return ln(t)?t[t.length-1]||0:t}function Tc(t,e){const n=xt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Sc(r[o]);wc(t,o,a)}}const W=t=>!!(t&&t.getVelocity);function Pc(t){return!!(W(t)&&t.add)}function cn(t,e){const n=t.getValue("willChange");if(Pc(n))return n.add(e);if(!n&&ht.WillChange){const s=new ht.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Un(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Cc="framerAppearId",Vo="data-"+Un(Cc);function Eo(t){return t.props[Vo]}function Ac({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ro(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Ao(r,c):c;const l=r?.reduceMotion,u=r?.skipAnimations;s&&(r=s);const h=[],d=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const f in a){const y=t.getValue(f,t.latestValues[f]??null),v=a[f];if(v===void 0||d&&Ac(d,f))continue;const g={delay:n,...Nn(r||{},f)};u&&(g.skipAnimations=!0);const T=y.get();if(T!==void 0&&!y.isAnimating()&&!Array.isArray(v)&&v===T&&!g.velocity){L.update(()=>y.set(v));continue}let b=!1;if(window.MotionHandoffAnimation){const V=Eo(t);if(V){const M=window.MotionHandoffAnimation(V,f,L);M!==null&&(g.startTime=M,b=!0)}}cn(t,f);const S=l??t.shouldReduceMotion;y.start(Bn(f,y,v,S&&Mo.has(f)?{type:!1}:g,t,b));const k=y.animation;k&&h.push(k)}if(o){const f=()=>L.update(()=>{o&&Tc(t,o)});h.length?Promise.all(h).then(f):f()}return h}function un(t,e,n={}){const s=xt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Ro(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=i;return kc(t,e,c,l,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,l]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>l())}else return Promise.all([r(),o(n.delay)])}function kc(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(un(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Co(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Mc(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>un(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=un(t,e,n);else{const i=typeof e=="function"?xt(t,e,n.custom):e;s=Promise.all(Ro(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Vc={test:t=>t==="auto",parse:t=>t},Do=t=>e=>e.test(t),jo=[kt,P,ot,at,el,tl,Vc],Ss=t=>jo.find(Do(t));function Ec(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_i(t):!0}const Rc=new Set(["brightness","contrast","saturate","opacity"]);function Dc(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Dn)||[];if(!s)return t;const i=n.replace(s,"");let r=Rc.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const jc=/\b([a-z-]*)\(.*?\)/gu,hn={...nt,getAnimatableNone:t=>{const e=t.match(jc);return e?e.map(Dc).join(" "):t}},dn={...nt,getAnimatableNone:t=>{const e=nt.parse(t);return nt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Ts={...kt,transform:Math.round},Lc={rotate:at,pathRotation:at,rotateX:at,rotateY:at,rotateZ:at,scale:qt,scaleX:qt,scaleY:qt,scaleZ:qt,skew:at,skewX:at,skewY:at,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Nt,originX:cs,originY:cs,originZ:P},ve={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...Lc,zIndex:Ts,fillOpacity:Nt,strokeOpacity:Nt,numOctaves:Ts},Oc={...ve,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:hn,WebkitFilter:hn,mask:dn,WebkitMask:dn},Lo=t=>Oc[t],Ic=new Set([hn,dn]);function Oo(t,e){let n=Lo(t);return Ic.has(n)||(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Fc=new Set(["auto","none","0"]);function Nc(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Fc.has(r)&&Ct(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Oo(n,i)}class Bc extends Fn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Rn(h))){const d=ko(h,n.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Mo.has(s)||e.length!==2)return;const[i,r]=e,o=Ss(i),a=Ss(r),c=ls(i),l=ls(r);if(c!==l&&ut[s]){this.needsMeasurement=!0;return}if(o!==a)if(ys(o)&&ys(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else ut[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ec(e[i]))&&s.push(i);s.length&&Nc(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ut[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=ut[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const Wn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Io(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const fn=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function oe(t){return Wi(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:_n}=no(queueMicrotask,!1),tt={x:!1,y:!1};function Fo(){return tt.x||tt.y}function zc(t){return t==="x"||t==="y"?tt[t]?null:(tt[t]=!0,()=>{tt[t]=!1}):tt.x||tt.y?null:(tt.x=tt.y=!0,()=>{tt.x=tt.y=!1})}function No(t,e){const n=Io(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Uc(t){return!(t.pointerType==="touch"||Fo())}function Wc(t,e,n={}){const[s,i,r]=No(t,n);return s.forEach(o=>{let a=!1,c=!1,l;const u=()=>{o.removeEventListener("pointerleave",f)},h=v=>{l&&(l(v),l=void 0),u()},d=v=>{a=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),c&&(c=!1,h(v))},p=()=>{a=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},f=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}h(v)}},y=v=>{if(!Uc(v))return;c=!1;const g=e(o,v);typeof g=="function"&&(l=g,o.addEventListener("pointerleave",f,i))};o.addEventListener("pointerenter",y,i),o.addEventListener("pointerdown",p,i)}),r}const Bo=(t,e)=>e?t===e?!0:Bo(t,e.parentElement):!1,$n=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_c=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $c(t){return _c.has(t.tagName)||t.isContentEditable===!0}const Kc=new Set(["INPUT","SELECT","TEXTAREA"]);function Hc(t){return Kc.has(t.tagName)||t.isContentEditable===!0}const re=new WeakSet;function Ps(t){return e=>{e.key==="Enter"&&t(e)}}function Oe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Gc=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ps(()=>{if(re.has(n))return;Oe(n,"down");const i=Ps(()=>{Oe(n,"up")}),r=()=>Oe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Cs(t){return $n(t)&&!Fo()}const As=new WeakSet;function Yc(t,e,n={}){const[s,i,r]=No(t,n),o=a=>{const c=a.currentTarget;if(!Cs(a)||As.has(a))return;re.add(c),n.stopPropagation&&As.add(a);const l=e(c,a),u={...i,capture:!0},h=(f,y)=>{window.removeEventListener("pointerup",d,u),window.removeEventListener("pointercancel",p,u),re.has(c)&&re.delete(c),Cs(f)&&typeof l=="function"&&l(f,{success:y})},d=f=>{h(f,c===window||c===document||n.useGlobalTarget||Bo(c,f.target))},p=f=>{h(f,!1)};window.addEventListener("pointerup",d,u),window.addEventListener("pointercancel",p,u)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),oe(a)&&(a.addEventListener("focus",l=>Gc(l,i)),!$c(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Kn(t){return Wi(t)&&"ownerSVGElement"in t}const ae=new WeakMap;let le;const zo=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Kn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Xc=zo("inline","width","offsetWidth"),qc=zo("block","height","offsetHeight");function Zc({target:t,borderBoxSize:e}){ae.get(t)?.forEach(n=>{n(t,{get width(){return Xc(t,e)},get height(){return qc(t,e)}})})}function Jc(t){t.forEach(Zc)}function Qc(){typeof ResizeObserver>"u"||(le=new ResizeObserver(Jc))}function tu(t,e){le||Qc();const n=Io(t);return n.forEach(s=>{let i=ae.get(s);i||(i=new Set,ae.set(s,i)),i.add(e),le?.observe(s)}),()=>{n.forEach(s=>{const i=ae.get(s);i?.delete(e),i?.size||le?.unobserve(s)})}}const ce=new Set;let Tt;function eu(){Tt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};ce.forEach(e=>e(t))},window.addEventListener("resize",Tt)}function nu(t){return ce.add(t),Tt||eu(),()=>{ce.delete(t),!ce.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function ks(t,e){return typeof t=="function"?nu(t):tu(t,e)}function su(t){return Kn(t)&&t.tagName==="svg"}const iu=[...jo,F,nt],ou=t=>iu.find(Do(t)),Ms=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pt=()=>({x:Ms(),y:Ms()}),Vs=()=>({min:0,max:0}),z=()=>({x:Vs(),y:Vs()}),ru=new WeakMap;function Ce(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Bt(t){return typeof t=="string"||Array.isArray(t)}const Hn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gn=["initial",...Hn];function Ae(t){return Ce(t.animate)||Gn.some(e=>Bt(t[e]))}function Uo(t){return!!(Ae(t)||t.variants)}function au(t,e,n){for(const s in e){const i=e[s],r=n[s];if(W(i))t.addValue(s,i);else if(W(r))t.addValue(s,At(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,At(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const mn={current:null},Wo={current:!1},lu=typeof window<"u";function cu(){if(Wo.current=!0,!!lu)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mn.current=t.matches;t.addEventListener("change",e),e()}else mn.current=!1}const Es=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xe={};function _o(t){xe=t}function uu(){return xe}class hu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=_.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,L.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Ae(n),this.isVariantNode=Uo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in d){const f=d[p];l[p]!==void 0&&W(f)&&f.set(l[p])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,ru.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((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Wo.current||cu(),this.shouldReduceMotion=mn.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(),dt(this.notifyUpdate),dt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Po.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new So({element:this.current,name:e,keyframes:a,times:c,ease:l,duration:H(u)}),d=o(h);this.valueSubscriptions.set(e,()=>{d(),h.cancel()});return}const s=Vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}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 xe){const n=xe[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Es.length;s++){const i=Es[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=au(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=At(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Ui(s)||_i(s))?s=parseFloat(s):!ou(s)&&nt.test(n)&&(s=Oo(e,n)),this.setBaseTarget(e,W(s)?s.get():s)),W(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=zn(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!W(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Mn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){_n.render(this.render)}}class $o extends hu{constructor(){super(...arguments),this.KeyframeResolver=Bc}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;W(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ft{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Ko({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function du({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function fu(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Ie(t){return t===void 0||t===1}function pn({scale:t,scaleX:e,scaleY:n}){return!Ie(t)||!Ie(e)||!Ie(n)}function pt(t){return pn(t)||Ho(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ho(t){return Rs(t.x)||Rs(t.y)}function Rs(t){return t&&t!=="0%"}function be(t,e,n){const s=t-n,i=e*s;return n+i}function Ds(t,e,n,s,i){return i!==void 0&&(t=be(t,i,s)),be(t,n,s)+e}function gn(t,e=0,n=1,s,i){t.min=Ds(t.min,e,n,s,i),t.max=Ds(t.max,e,n,s,i)}function Go(t,{x:e,y:n}){gn(t.x,e.translate,e.scale,e.originPoint),gn(t.y,n.translate,n.scale,n.originPoint)}const js=.999999999999,Ls=1.0000000000001;function mu(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(it(t.x,-r.scroll.offset.x),it(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Go(t,o)),s&&pt(r.latestValues)&&ue(t,r.latestValues,r.layout?.layoutBox))}e.x<Ls&&e.x>js&&(e.x=1),e.y<Ls&&e.y>js&&(e.y=1)}function it(t,e){t.min+=e,t.max+=e}function Os(t,e,n,s,i=.5){const r=j(t.min,t.max,i);gn(t,e,n,r,s)}function Is(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function ue(t,e,n){const s=n??t;Os(t.x,Is(e.x,s.x),e.scaleX,e.scale,e.originX),Os(t.y,Is(e.y,s.y),e.scaleY,e.scale,e.originY)}function Yo(t,e){return Ko(fu(t.getBoundingClientRect(),e))}function pu(t,e,n){const s=Yo(t,n),{scroll:i}=e;return i&&(it(s.x,i.offset.x),it(s.y,i.offset.y)),s}const gu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yu=Mt.length;function vu(t,e,n){let s="",i=!0;for(let o=0;o<yu;o++){const a=Mt[o],c=t[a];if(c===void 0)continue;let l=!0;if(typeof c=="number")l=c===(a.startsWith("scale")?1:0);else{const u=parseFloat(c);l=a.startsWith("scale")?u===1:u===0}if(!l||n){const u=fn(c,ve[a]);if(!l){i=!1;const h=gu[a]||a;s+=`${h}(${u}) `}n&&(e[a]=u)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${fn(r,ve.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Yn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(Vt.has(c)){o=!0;continue}else if(io(c)){i[c]=l;continue}else{const u=fn(l,ve[c]);c.startsWith("origin")?(a=!0,r[c]=u):s[c]=u}}if(e.transform||(o||n?s.transform=vu(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=r;s.transformOrigin=`${c} ${l} ${u}`}}function Xo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function Fs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Et={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=Fs(t,e.target.x),s=Fs(t,e.target.y);return`${n}% ${s}%`}},xu={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=nt.parse(t);if(i.length>5)return s;const r=nt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=j(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),r(i)}},yn={borderRadius:{...Et,applyTo:[...Wn]},borderTopLeftRadius:Et,borderTopRightRadius:Et,borderBottomLeftRadius:Et,borderBottomRightRadius:Et,boxShadow:xu};function qo(t,{layout:e,layoutId:n}){return Vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!yn[t]||t==="opacity")}function Xn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(W(s[o])||i&&W(i[o])||qo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function bu(t){return window.getComputedStyle(t)}class wu extends $o{constructor(){super(...arguments),this.type="html",this.renderInstance=Xo}readValueFromInstance(e,n){if(Vt.has(n))return this.projection?.isProjecting?en(n):Ul(e,n);{const s=bu(e),i=(io(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Yo(e,n)}build(e,n,s){Yn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Xn(e,n,s)}}const Su={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tu={offset:"strokeDashoffset",array:"strokeDasharray"};function Pu(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Su:Tu;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Cu=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zo(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,l,u){if(Yn(t,a,l),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const p of Cu)h[p]!==void 0&&(d[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Pu(h,i,r,o,!1)}const Jo=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"]),Qo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Au(t,e,n,s){Xo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Jo.has(i)?i:Un(i),e.attrs[i])}function tr(t,e,n){const s=Xn(t,e,n);for(const i in t)if(W(t[i])||W(e[i])){const r=Mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class ku extends $o{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Vt.has(n)){const s=Lo(n);return s&&s.default||0}return n=Jo.has(n)?n:Un(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return tr(e,n,s)}build(e,n,s){Zo(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Au(e,n,s,i)}mount(e){this.isSVGTag=Qo(e.tagName),super.mount(e)}}const Mu=Gn.length;function er(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?er(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Mu;n++){const s=Gn[n],i=t.props[s];(Bt(i)||i===!1)&&(e[s]=i)}return e}function nr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Vu=[...Hn].reverse(),Eu=Hn.length;function Ru(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Mc(t,n,s)))}function Du(t){let e=Ru(t),n=Ns(),s=!0,i=!1;const r=l=>(u,h)=>{const d=xt(t,h,l==="exit"?t.presenceContext?.custom:void 0);if(d){const{transition:p,transitionEnd:f,...y}=d;u={...u,...y,...f}}return u};function o(l){e=l(t)}function a(l){const{props:u}=t,h=er(t.parent)||{},d=[],p=new Set;let f={},y=1/0;for(let g=0;g<Eu;g++){const T=Vu[g],b=n[T],S=u[T]!==void 0?u[T]:h[T],k=Bt(S),V=T===l?b.isActive:null;V===!1&&(y=g);let M=S===h[T]&&S!==u[T]&&k;if(M&&(s||i)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...f},!b.isActive&&V===null||!S&&!b.prevProp||Ce(S)||typeof S=="boolean")continue;if(T==="exit"&&b.isActive&&V!==!0){b.prevResolvedValues&&(f={...f,...b.prevResolvedValues});continue}const C=ju(b.prevProp,S);let E=C||T===l&&b.isActive&&!M&&k||g>y&&k,A=!1;const O=Array.isArray(S)?S:[S];let N=O.reduce(r(T),{});V===!1&&(N={});const{prevResolvedValues:J={}}=b,G={...J,...N},Y=B=>{E=!0,p.has(B)&&(A=!0,p.delete(B)),b.needsAnimating[B]=!0;const w=t.getValue(B);w&&(w.liveStyle=!1)};for(const B in G){const w=N[B],R=J[B];if(f.hasOwnProperty(B))continue;let X=!1;ln(w)&&ln(R)?X=!nr(w,R)||C:X=w!==R,X?w!=null?Y(B):p.add(B):w!==void 0&&p.has(B)?Y(B):b.protectedKeys[B]=!0}b.prevProp=S,b.prevResolvedValues=N,b.isActive&&(f={...f,...N}),(s||i)&&t.blockInitialAnimation&&(E=!1);const K=M&&C;E&&(!K||A)&&d.push(...O.map(B=>{const w={type:T};if(typeof B=="string"&&(s||i)&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:R}=t,X=xt(R,B);if(R.enteringChildren&&X){const{delayChildren:D}=X.transition||{};w.delay=Co(R.enteringChildren,t,D)}}return{animation:B,options:w}}))}if(p.size){const g={};if(typeof u.initial!="boolean"){const T=xt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);T&&T.transition&&(g.transition=T.transition)}p.forEach(T=>{const b=t.getBaseTarget(T),S=t.getValue(T);S&&(S.liveStyle=!0),g[T]=b??null}),d.push({animation:g})}let v=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(v=!1),s=!1,i=!1,v?e(d):Promise.resolve()}function c(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),n[l].isActive=u;const h=a(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ns(),i=!0}}}function ju(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!nr(e,t):!1}function mt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ns(){return{animate:mt(!0),whileInView:mt(),whileHover:mt(),whileTap:mt(),whileDrag:mt(),whileFocus:mt(),exit:mt()}}function vn(t,e){t.min=e.min,t.max=e.max}function Q(t,e){vn(t.x,e.x),vn(t.y,e.y)}function Bs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const sr=1e-4,Lu=1-sr,Ou=1+sr,ir=.01,Iu=0-ir,Fu=0+ir;function $(t){return t.max-t.min}function Nu(t,e,n){return Math.abs(t-e)<=n}function zs(t,e,n,s=.5){t.origin=s,t.originPoint=j(e.min,e.max,t.origin),t.scale=$(n)/$(e),t.translate=j(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Lu&&t.scale<=Ou||isNaN(t.scale))&&(t.scale=1),(t.translate>=Iu&&t.translate<=Fu||isNaN(t.translate))&&(t.translate=0)}function Ot(t,e,n,s){zs(t.x,e.x,n.x,s?s.originX:void 0),zs(t.y,e.y,n.y,s?s.originY:void 0)}function Us(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+$(e)}function Bu(t,e,n,s){Us(t.x,e.x,n.x,s?.x),Us(t.y,e.y,n.y,s?.y)}function Ws(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+$(e)}function we(t,e,n,s){Ws(t.x,e.x,n.x,s?.x),Ws(t.y,e.y,n.y,s?.y)}function _s(t,e,n,s,i){return t-=e,t=be(t,1/n,s),i!==void 0&&(t=be(t,1/i,s)),t}function zu(t,e=0,n=1,s=.5,i,r=t,o=t){if(ot.test(e)&&(e=parseFloat(e),e=j(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=j(r.min,r.max,s);t===r&&(a-=e),t.min=_s(t.min,e,n,a,i),t.max=_s(t.max,e,n,a,i)}function $s(t,e,[n,s,i],r,o){zu(t,e[n],e[s],e[i],e.scale,r,o)}const Uu=["x","scaleX","originX"],Wu=["y","scaleY","originY"];function Ks(t,e,n,s){$s(t.x,e,Uu,n?n.x:void 0,s?s.x:void 0),$s(t.y,e,Wu,n?n.y:void 0,s?s.y:void 0)}function Hs(t){return t.translate===0&&t.scale===1}function or(t){return Hs(t.x)&&Hs(t.y)}function Gs(t,e){return t.min===e.min&&t.max===e.max}function _u(t,e){return Gs(t.x,e.x)&&Gs(t.y,e.y)}function Ys(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function rr(t,e){return Ys(t.x,e.x)&&Ys(t.y,e.y)}function Xs(t){return $(t.x)/$(t.y)}function qs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function st(t){return[t("x"),t("y")]}function $u(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,pathRotation:h,rotateX:d,rotateY:p,skewX:f,skewY:y}=n;l&&(s=`perspective(${l}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotate(${h}deg) `),d&&(s+=`rotateX(${d}deg) `),p&&(s+=`rotateY(${p}deg) `),f&&(s+=`skewX(${f}deg) `),y&&(s+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Ku=Wn.length,Zs=t=>typeof t=="string"?parseFloat(t):t,Js=t=>typeof t=="number"||P.test(t);function Hu(t,e,n,s,i,r){i?(t.opacity=j(0,n.opacity??1,Gu(s)),t.opacityExit=j(e.opacity??1,0,Yu(s))):r&&(t.opacity=j(e.opacity??1,n.opacity??1,s));for(let o=0;o<Ku;o++){const a=Wn[o];let c=Qs(e,a),l=Qs(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Js(c)===Js(l)?(t[a]=Math.max(j(Zs(c),Zs(l),s),0),(ot.test(l)||ot.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=j(e.rotate||0,n.rotate||0,s))}function Qs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Gu=ar(0,.5,Ji),Yu=ar(.5,.95,Z);function ar(t,e,n){return s=>s<t?0:s>e?1:n(Ft(t,e,s))}function Xu(t,e,n){const s=W(t)?t:At(t);return s.start(Bn("",s,e,n)),s.animation}function zt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const qu=(t,e)=>t.depth-e.depth;class Zu{constructor(){this.children=[],this.isDirty=!1}add(e){An(this.children,e),this.isDirty=!0}remove(e){fe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qu),this.isDirty=!1,this.children.forEach(e)}}function Ju(t,e){const n=_.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(dt(s),t(r-e))};return L.setup(s,!0),()=>dt(s)}function he(t){return W(t)?t.get():t}class Qu{constructor(){this.members=[]}add(e){An(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(fe(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(fe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const de={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Fe=["","X","Y","Z"],th=1e3;let eh=0;function Ne(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function lr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Eo(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&lr(s)}function cr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=eh++,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,this.nodes.forEach(ih),this.nodes.forEach(uh),this.nodes.forEach(hh),this.nodes.forEach(oh)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Mn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Kn(o)&&!su(o),this.instance=o;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;L.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,u&&u(),u=Ju(d,250),de.hasAnimatedSinceResize&&(de.hasAnimatedSinceResize=!1,this.nodes.forEach(ni)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const f=this.options.transition||l.getDefaultTransition()||gh,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=l.getProps(),g=!this.targetLayout||!rr(this.targetLayout,p),T=!h&&d;if(this.options.layoutRoot||this.resumeFrom||T||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...Nn(f,"layout"),onPlay:y,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(u,T,b.path)}else h||ni(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dt(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(dh),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(ah),this.nodes.forEach(ti);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ei);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lh),this.nodes.forEach(ch),this.nodes.forEach(nh),this.nodes.forEach(sh)):this.nodes.forEach(ei),this.clearAllSnapshots();const a=_.now();U.delta=rt(0,1e3/60,a-U.timestamp),U.timestamp=a,U.isProcessing=!0,Ve.update.process(U),Ve.preRender.process(U),Ve.render.process(U),U.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_n.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rh),this.sharedNodes.forEach(fh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=z()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!or(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||pt(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),yh(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return z();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vh))){const{scroll:l}=this.root;l&&(it(a.x,l.offset.x),it(a.y,l.offset.y))}return a}removeElementScroll(o){const a=z();if(Q(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;l!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&Q(a,o),it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}applyTransform(o,a=!1,c){const l=c||z();Q(l,o);for(let u=0;u<this.path.length;u++){const h=this.path[u];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(it(l.x,-h.scroll.offset.x),it(l.y,-h.scroll.offset.y)),pt(h.latestValues)&&ue(l,h.latestValues,h.layout?.layoutBox)}return pt(this.latestValues)&&ue(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=z();Q(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!pt(l.latestValues))continue;let u;l.instance&&(pn(l.latestValues)&&l.updateSnapshot(),u=z(),Q(u,l.measurePageBox())),Ks(a,l.latestValues,l.snapshot?.layoutBox,u)}return pt(this.latestValues)&&Ks(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==U.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=U.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Q(this.target,this.layout.layoutBox),Go(this.target,this.targetDelta)):Q(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||pn(this.parent.latestValues)||Ho(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),we(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Q(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===U.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Q(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;mu(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=z());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bs(this.prevProjectionDelta.x,this.projectionDelta.x),Bs(this.prevProjectionDelta.y,this.projectionDelta.y)),Ot(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!qs(this.projectionDelta.x,this.prevProjectionDelta.x)||!qs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Pt(),this.projectionDelta=Pt(),this.projectionDeltaWithTransform=Pt()}setAnimationOrigin(o,a=!1,c){const l=this.snapshot,u=l?l.latestValues:{},h={...this.latestValues},d=Pt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=z(),f=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=f!==y,g=this.getStack(),T=!g||g.members.length<=1,b=!!(v&&!T&&this.options.crossfade===!0&&!this.path.some(ph));this.animationProgress=0;let S;const k=c?.interpolateProjection(o);this.mixTargetDelta=V=>{const M=V/1e3,C=k?.(M);C?(d.x.translate=C.x,d.x.scale=j(o.x.scale,1,M),d.x.origin=o.x.origin,d.x.originPoint=o.x.originPoint,d.y.translate=C.y,d.y.scale=j(o.y.scale,1,M),d.y.origin=o.y.origin,d.y.originPoint=o.y.originPoint):(si(d.x,o.x,M),si(d.y,o.y,M)),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(we(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mh(this.relativeTarget,this.relativeTargetOrigin,p,M),S&&_u(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=z()),Q(S,this.relativeTarget)),v&&(this.animationValues=h,Hu(h,u,this.latestValues,M,b,T)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{de.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=At(0)),this.motionValue.jump(0,!1),this.currentAnimation=Xu(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(th),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&ur(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||z();const h=$(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const d=$(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}Q(a,c),ue(a,u),Ot(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qu),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Ne("z",o,l,this.animationValues);for(let u=0;u<Fe.length;u++)Ne(`rotate${Fe[u]}`,o,l,this.animationValues),Ne(`skew${Fe[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=he(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=he(a?.pointerEvents)||""),this.hasProjected&&!pt(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=$u(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),o.transform=h;const{x:d,y:p}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in yn){if(u[f]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:g}=yn[f],T=h==="none"?u[f]:y(u[f],l);if(v){const b=v.length;for(let S=0;S<b;S++)o[v[S]]=T}else g?this.options.visualElement.renderState.vars[f]=T:o[f]=T}this.options.layoutId&&(o.pointerEvents=l===this?he(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ti),this.root.sharedNodes.clear()}}}function nh(t){t.updateLayout()}function sh(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")st(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],d=$(h);h.min=n[u].min,h.max=h.min+d});else if(i==="x"||i==="y"){const u=i==="x"?"y":"x";vn(r?e.measuredBox[u]:e.layoutBox[u],n[u])}else ur(i,e.layoutBox,n)&&st(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],d=$(n[u]);h.max=h.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+d)});const o=Pt();Ot(o,n,e.layoutBox);const a=Pt();r?Ot(a,t.applyTransform(s,!0),e.measuredBox):Ot(a,n,e.layoutBox);const c=!or(o);let l=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:d}=u;if(h&&d){const p=t.options.layoutAnchor||void 0,f=z();we(f,e.layoutBox,h.layoutBox,p);const y=z();we(y,n,d.layoutBox,p),rr(f,y)||(l=!0),u.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=f,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ih(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oh(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rh(t){t.clearSnapshot()}function ti(t){t.clearMeasurements()}function ah(t){t.isLayoutDirty=!0,t.updateLayout()}function ei(t){t.isLayoutDirty=!1}function lh(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ch(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ni(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function uh(t){t.resolveTargetDelta()}function hh(t){t.calcProjection()}function dh(t){t.resetSkewAndRotation()}function fh(t){t.removeLeadSnapshot()}function si(t,e,n){t.translate=j(e.translate,0,n),t.scale=j(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ii(t,e,n,s){t.min=j(e.min,n.min,s),t.max=j(e.max,n.max,s)}function mh(t,e,n,s){ii(t.x,e.x,n.x,s),ii(t.y,e.y,n.y,s)}function ph(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gh={duration:.45,ease:[.4,0,.1,1]},oi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ri=oi("applewebkit/")&&!oi("chrome/")?Math.round:Z;function ai(t){t.min=ri(t.min),t.max=ri(t.max)}function yh(t){ai(t.x),ai(t.y)}function ur(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nu(Xs(e),Xs(n),.2)}function vh(t){return t!==t.root&&t.scroll?.wasRoot}const xh=cr({attachResizeListener:(t,e)=>zt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Be={current:void 0},hr=cr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Be.current){const t=new xh({});t.mount(window),t.setOptions({layoutScroll:!0}),Be.current=t}return Be.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),qn=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function li(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function bh(...t){return e=>{let n=!1;const s=t.map(i=>{const r=li(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():li(t[i],null)}}}}function wh(...t){return x.useCallback(bh(...t),t)}class Sh extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(oe(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=oe(s)&&s.offsetWidth||0,r=oe(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Th({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=x.useContext(qn),u=t.props?.ref??t?.ref,h=wh(a,u);return x.useInsertionEffect(()=>{const{width:d,height:p,top:f,left:y,right:v,bottom:g,direction:T}=c.current;if(e||r===!1||!a.current||!d||!p)return;const b=T==="rtl",S=n==="left"?b?`right: ${v}`:`left: ${y}`:b?`left: ${y}`:`right: ${v}`,k=s==="bottom"?`bottom: ${g}`:`top: ${f}`;a.current.dataset.motionPopId=o;const V=document.createElement("style");l&&(V.nonce=l);const M=i??document.head;return M.appendChild(V),V.sheet&&V.sheet.insertRule(`
1
+ import{d as x,j as m,R as Rt,r as bt,u as Dr,f as jr,t as Lr,L as Or}from"./index-BYUntVIZ.js";import{c as Ir}from"./client-BqhpYbYL.js";import{u as Fr,a as Nr,b as Br,A as zr,C as Ur,V as Wr,c as _r,M as $r,S as Kr,B as Hr,P as Gr,d as Yr,N as Xr,i as qr,e as Zr}from"./viewportLock-tlT6H_Hc.js";import{H as Fi,a as Jr,u as et,b as Qr,o as ta,f as ea,c as Ni,n as es,d as na,e as sa,g as ns,h as ia,i as Bi,j as oa,k as ra,l as aa,m as la,S as ca,Q as ua,O as ha,p as ss,q as is,r as os,s as da,t as fa,v as rs,w as ma,x as pa,y as ga,z as ya,A as va,B as xa,C as ba,D as wa,E as Sa,F as Ta}from"./appStore-affnJoin.js";import{d as Pa,i as Ca,s as Aa,a as ka,g as Ma,o as Va}from"./RunLocationPicker-CadYiE7C.js";import{i as Ea,u as Ye,b as zi,E as Ra}from"./codingNavigation-CxdCK78-.js";import{F as Da}from"./UnifiedPage-D7JTfABH.js";import{i as Sn,R as ja,a as La,b as Oa}from"./ipc-D7yENkjV.js";import"./i18n.generated-DvY59Zq3.js";import"./ModelPill-ChzAM3z1.js";import"./rotate-ccw-BLoH5er1.js";import"./upload-D20PZHXc.js";import"./hard-drive-CXNJUCXw.js";import"./CapabilityMenu-BVrokPpT.js";import"./book-open-CcXCToyx.js";import"./folder-plus-BJKT1Pqg.js";import"./circle-x-AV2ZWulM.js";import"./userSpaces-CrLrKklx.js";import"./automationListSource-JVBMsMbC.js";import"./nativeDownload-Udrv_tmU.js";import"./messages-4w1Khzm1.js";import"./code-xml-DdR58F83.js";import"./workflow-Bd6xBHiT.js";import"./list-tree-DmuRb-p9.js";import"./layout-grid-Hs3eDA07.js";import"./terminal-BlmA_Z1C.js";import"./star-BmywYD3u.js";import"./folder-CCZqnwRc.js";import"./DashboardGridView-DlFyYfUh.js";import"./FloatingToc-B1d4-5EL.js";import"./MarkdownBlock-BHpDy2qQ.js";import"./index-Y2kzYlZq.js";import"./linkFollow-Msu1XH9v.js";import"./emoji-BPdA62d7.js";import"./listFold-CKxjyY5_.js";import"./pageChrome-D-9npbUE.js";import"./pageTree-CIXFRCLk.js";import"./pluginExt-Byb64tQO.js";import"./phoneList-DHUia6HT.js";import"./pen-tool-D_Y9We9x.js";import"./pencil-DGiTRzW1.js";import"./type-DmIL6FB-.js";import"./undo-2-yMeXc8Wi.js";import"./redo-2-QgiKEg9T.js";import"./lock-kffGfeHt.js";import"./AutomationBuilder-BsJc8wuC.js";import"./gestures-BwPbZDkU.js";import"./Chrome-amTcZNE4.js";import"./minus-CfoZ4oxr.js";import"./canvasPrefs-CSuX9aLF.js";import"./circle-question-mark-O8AhUz35.js";import"./InlineFiles-DKPH5JHz.js";import"./RightPanel-BRexwQ3W.js";import"./MuseView-CDDwV6SR.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-DxBPIhPS.js";import"./codeStudioStore-Dq5i8nbE.js";import"./log-out-B5gEP0tF.js";import"./arrow-up-right-R4P9Mmxz.js";import"./index-DY0M_dpd.js";/* empty css */import"./StudioGuestSurface-ZJFKnNYF.js";import"./create-BgJN5qsj.js";import"./hand-DRu7IJdU.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-_TgFOpyv.js";import"./SketchCard-BcXCdBAs.js";import"./foldActions-BcyvNVBs.js";const Me={addListener:async(t,e)=>({remove:()=>{}}),minimizeApp:async()=>{},getLaunchUrl:async()=>{}},Tn=x.createContext({});function Pn(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ia=typeof window<"u",Cn=Ia?x.useLayoutEffect:x.useEffect,Te=x.createContext(null);function An(t,e){t.indexOf(e)===-1&&t.push(e)}function fe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const rt=(t,e,n)=>n>e?e:n<t?t:n;let kn=()=>{};const ht={},Ui=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Wi=t=>typeof t=="object"&&t!==null,_i=t=>/^0[^.\s]+$/u.test(t);function $i(t){let e;return()=>(e===void 0&&(e=t()),e)}const Z=t=>t,_t=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Ft=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class Mn{constructor(){this.subscriptions=[]}add(e){return An(this.subscriptions,e),()=>fe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const H=t=>t*1e3,q=t=>t/1e3,Ki=(t,e)=>e?t*(1e3/e):0,Hi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fa=1e-7,Na=12;function Ba(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Hi(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Fa&&++a<Na);return o}function $t(t,e,n,s){if(t===e&&n===s)return Z;const i=r=>Ba(r,0,1,t,n);return r=>r===0||r===1?r:Hi(i(r),e,s)}const Gi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Yi=t=>e=>1-t(1-e),Xi=$t(.33,1.53,.69,.99),Vn=Yi(Xi),qi=Gi(Vn),Zi=t=>t>=1?1:(t*=2)<1?.5*Vn(t):.5*(2-Math.pow(2,-10*(t-1))),En=t=>1-Math.sin(Math.acos(t)),Ji=Yi(En),Qi=Gi(En),za=$t(.42,0,1,1),Ua=$t(0,0,.58,1),to=$t(.42,0,.58,1),Wa=t=>Array.isArray(t)&&typeof t[0]!="number",eo=t=>Array.isArray(t)&&typeof t[0]=="number",_a={linear:Z,easeIn:za,easeInOut:to,easeOut:Ua,circIn:En,circInOut:Qi,circOut:Ji,backIn:Vn,backInOut:qi,backOut:Xi,anticipate:Zi},$a=t=>typeof t=="string",as=t=>{if(eo(t)){kn(t.length===4);const[e,n,s,i]=t;return $t(e,n,s,i)}else if($a(t))return _a[t];return t},Xt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ka(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){r.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,u=!1,h=!1)=>{const p=h&&s?e:n;return u&&r.add(l),p.add(l),l},cancel:l=>{n.delete(l),r.delete(l)},process:l=>{if(o=l,s){i=!0;return}s=!0;const u=e;e=n,n=u,e.forEach(a),e.clear(),s=!1,i&&(i=!1,c.process(l))}};return c}const Ha=40;function no(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Xt.reduce((b,S)=>(b[S]=Ka(r),b),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:p,postRender:f}=o,y=()=>{const b=ht.useManualTiming,S=b?i.timestamp:performance.now();n=!1,b||(i.delta=s?1e3/60:Math.max(Math.min(S-i.timestamp,Ha),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),h.process(i),d.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},v=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Xt.reduce((b,S)=>{const k=o[S];return b[S]=(V,M=!1,C=!1)=>(n||v(),k.schedule(V,M,C)),b},{}),cancel:b=>{for(let S=0;S<Xt.length;S++)o[Xt[S]].cancel(b)},state:i,steps:o}}const{schedule:L,cancel:dt,state:U,steps:Ve}=no(typeof requestAnimationFrame<"u"?requestAnimationFrame:Z,!0);let ie;function Ga(){ie=void 0}const _={now:()=>(ie===void 0&&_.set(U.isProcessing||ht.useManualTiming?U.timestamp:performance.now()),ie),set:t=>{ie=t,queueMicrotask(Ga)}},so=t=>e=>typeof e=="string"&&e.startsWith(t),io=so("--"),Ya=so("var(--"),Rn=t=>Ya(t)?Xa.test(t.split("/*")[0].trim()):!1,Xa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ls(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const kt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Nt={...kt,transform:t=>rt(0,1,t)},qt={...kt,default:1},jt=t=>Math.round(t*1e5)/1e5,Dn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qa(t){return t==null}const Za=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jn=(t,e)=>n=>!!(typeof n=="string"&&Za.test(n)&&n.startsWith(t)||e&&!qa(n)&&Object.prototype.hasOwnProperty.call(n,e)),oo=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Dn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ja=t=>rt(0,255,t),Ee={...kt,transform:t=>Math.round(Ja(t))},gt={test:jn("rgb","red"),parse:oo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ee.transform(t)+", "+Ee.transform(e)+", "+Ee.transform(n)+", "+jt(Nt.transform(s))+")"};function Qa(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Xe={test:jn("#"),parse:Qa,transform:gt.transform},Kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),at=Kt("deg"),ot=Kt("%"),P=Kt("px"),tl=Kt("vh"),el=Kt("vw"),cs={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(t*100)},St={test:jn("hsl","hue"),parse:oo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(jt(e))+", "+ot.transform(jt(n))+", "+jt(Nt.transform(s))+")"},F={test:t=>gt.test(t)||Xe.test(t)||St.test(t),parse:t=>gt.test(t)?gt.parse(t):St.test(t)?St.parse(t):Xe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=F.parse(t);return e.alpha=0,F.transform(e)}},nl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sl(t){return isNaN(t)&&typeof t=="string"&&(t.match(Dn)?.length||0)+(t.match(nl)?.length||0)>0}const ro="number",ao="color",il="var",ol="var(",us="${}",rl=/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 Ct(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(rl,c=>(F.test(c)?(s.color.push(r),i.push(ao),n.push(F.parse(c))):c.startsWith(ol)?(s.var.push(r),i.push(il),n.push(c)):(s.number.push(r),i.push(ro),n.push(parseFloat(c))),++r,us)).split(us);return{values:n,split:a,indexes:s,types:i}}function al(t){return Ct(t).values}function lo({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===ro?i+=jt(s[r]):o===ao?i+=F.transform(s[r]):i+=s[r]}return i}}function ll(t){return lo(Ct(t))}const cl=t=>typeof t=="number"?0:F.test(t)?F.getAnimatableNone(t):t,ul=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:cl(t);function hl(t){const e=Ct(t);return lo(e)(e.values.map((s,i)=>ul(s,e.split[i])))}const nt={test:sl,parse:al,createTransformer:ll,getAnimatableNone:hl};function Re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function dl({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Re(c,a,t+1/3),r=Re(c,a,t),o=Re(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function me(t,e){return n=>n>0?e:t}const j=(t,e,n)=>t+(e-t)*n,De=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},fl=[Xe,gt,St],ml=t=>fl.find(e=>e.test(t));function hs(t){const e=ml(t);if(!e)return!1;let n=e.parse(t);return e===St&&(n=dl(n)),n}const ds=(t,e)=>{const n=hs(t),s=hs(e);if(!n||!s)return me(t,e);const i={...n};return r=>(i.red=De(n.red,s.red,r),i.green=De(n.green,s.green,r),i.blue=De(n.blue,s.blue,r),i.alpha=j(n.alpha,s.alpha,r),gt.transform(i))},qe=new Set(["none","hidden"]);function pl(t,e){return qe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gl(t,e){return n=>j(t,e,n)}function Ln(t){return typeof t=="number"?gl:typeof t=="string"?Rn(t)?me:F.test(t)?ds:xl:Array.isArray(t)?co:typeof t=="object"?F.test(t)?ds:yl:me}function co(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Ln(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function yl(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Ln(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function vl(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const xl=(t,e)=>{const n=nt.createTransformer(e),s=Ct(t),i=Ct(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?qe.has(t)&&!i.values.length||qe.has(e)&&!s.values.length?pl(t,e):_t(co(vl(s,i),i.values),n):me(t,e)};function uo(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?j(t,e,n):Ln(t)(t,e)}const bl=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>dt(e),now:()=>U.isProcessing?U.timestamp:_.now()}},ho=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},pe=2e4;function On(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<pe;)e+=n,s=t.next(e);return e>=pe?1/0:e}function wl(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(On(s),pe);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:q(i)}}const I={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 Ze(t,e){return t*Math.sqrt(1-e*e)}const Sl=12;function Tl(t,e,n){let s=n;for(let i=1;i<Sl;i++)s=s-t(s)/e(s);return s}const je=.001;function Pl({duration:t=I.duration,bounce:e=I.bounce,velocity:n=I.velocity,mass:s=I.mass}){let i,r,o=1-e;o=rt(I.minDamping,I.maxDamping,o),t=rt(I.minDuration,I.maxDuration,q(t)),o<1?(i=l=>{const u=l*o,h=u*t,d=u-n,p=Ze(l,o),f=Math.exp(-h);return je-d/p*f},r=l=>{const h=l*o*t,d=h*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,f=Math.exp(-h),y=Ze(Math.pow(l,2),o);return(-i(l)+je>0?-1:1)*((d-p)*f)/y}):(i=l=>{const u=Math.exp(-l*t),h=(l-n)*t+1;return-je+u*h},r=l=>{const u=Math.exp(-l*t),h=(n-l)*(t*t);return u*h});const a=5/t,c=Tl(i,r,a);if(t=H(t),isNaN(c))return{stiffness:I.stiffness,damping:I.damping,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Cl=["duration","bounce"],Al=["stiffness","damping","mass"];function fs(t,e){return e.some(n=>t[n]!==void 0)}function kl(t){let e={velocity:I.velocity,stiffness:I.stiffness,damping:I.damping,mass:I.mass,isResolvedFromDuration:!1,...t};if(!fs(t,Al)&&fs(t,Cl))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*rt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:I.mass,stiffness:i,damping:r}}else{const n=Pl({...t,velocity:0});e={...e,...n,mass:I.mass},e.isResolvedFromDuration=!0}return e}function ge(t=I.visualDuration,e=I.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:l,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=kl({...n,velocity:-q(n.velocity||0)}),f=d||0,y=l/(2*Math.sqrt(c*u)),v=o-r,g=q(Math.sqrt(c/u)),T=Math.abs(v)<5;s||(s=T?I.restSpeed.granular:I.restSpeed.default),i||(i=T?I.restDelta.granular:I.restDelta.default);let b,S,k,V,M,C;if(y<1)k=Ze(g,y),V=(f+y*g*v)/k,b=A=>{const O=Math.exp(-y*g*A);return o-O*(V*Math.sin(k*A)+v*Math.cos(k*A))},M=y*g*V+v*k,C=y*g*v-V*k,S=A=>Math.exp(-y*g*A)*(M*Math.sin(k*A)+C*Math.cos(k*A));else if(y===1){b=O=>o-Math.exp(-g*O)*(v+(f+g*v)*O);const A=f+g*v;S=O=>Math.exp(-g*O)*(g*A*O-f)}else{const A=g*Math.sqrt(y*y-1);b=G=>{const Y=Math.exp(-y*g*G),K=Math.min(A*G,300);return o-Y*((f+y*g*v)*Math.sinh(K)+A*v*Math.cosh(K))/A};const O=(f+y*g*v)/A,N=y*g*O-v*A,J=y*g*v-O*A;S=G=>{const Y=Math.exp(-y*g*G),K=Math.min(A*G,300);return Y*(N*Math.sinh(K)+J*Math.cosh(K))}}const E={calculatedDuration:p&&h||null,velocity:A=>H(S(A)),next:A=>{if(!p&&y<1){const N=Math.exp(-y*g*A),J=Math.sin(k*A),G=Math.cos(k*A),Y=o-N*(V*J+v*G),K=H(N*(M*J+C*G));return a.done=Math.abs(K)<=s&&Math.abs(o-Y)<=i,a.value=a.done?o:Y,a}const O=b(A);if(p)a.done=A>=h;else{const N=H(S(A));a.done=Math.abs(N)<=s&&Math.abs(o-O)<=i}return a.value=a.done?o:O,a},toString:()=>{const A=Math.min(On(E),pe),O=ho(N=>E.next(A*N).value,A,30);return A+"ms "+O},toTransition:()=>{}};return E}ge.applyToOptions=t=>{const e=wl(t,100,ge);return t.ease=e.ease,t.duration=H(e.duration),t.type="keyframes",t};const Ml=5;function fo(t,e,n){const s=Math.max(e-Ml,0);return Ki(n-t(s),e-s)}function Je({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=C=>a!==void 0&&C<a||c!==void 0&&C>c,f=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let y=n*e;const v=h+y,g=o===void 0?v:o(v);g!==v&&(y=g-h);const T=C=>-y*Math.exp(-C/s),b=C=>g+T(C),S=C=>{const E=T(C),A=b(C);d.done=Math.abs(E)<=l,d.value=d.done?g:A};let k,V;const M=C=>{p(d.value)&&(k=C,V=ge({keyframes:[d.value,f(d.value)],velocity:fo(b,C,d.value),damping:i,stiffness:r,restDelta:l,restSpeed:u}))};return M(0),{calculatedDuration:null,next:C=>{let E=!1;return!V&&k===void 0&&(E=!0,S(C),M(C)),k!==void 0&&C>=k?V.next(C-k):(!E&&S(C),d)}}}function Vl(t,e,n){const s=[],i=n||ht.mix||uo,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Z:e;a=_t(c,a)}s.push(a)}return s}function El(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(kn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Vl(e,s,i),c=a.length,l=u=>{if(o&&u<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=Ft(t[h],t[h+1],u);return a[h](d)};return n?u=>l(rt(t[0],t[r-1],u)):l}function Rl(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(j(n,1,i))}}function Dl(t){const e=[0];return Rl(e,t.length-1),e}function jl(t,e){return t.map(n=>n*e)}function Ll(t,e){return t.map(()=>e||to).splice(0,t.length-1)}function Lt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Wa(s)?s.map(as):as(s),r={done:!1,value:e[0]},o=jl(n&&n.length===e.length?n:Dl(e),t),a=El(o,e,{ease:Array.isArray(i)?i:Ll(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Ol=t=>t!==null;function Pe(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ol),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Il={decay:Je,inertia:Je,tween:Lt,keyframes:Lt,spring:ge};function mo(t){typeof t.type=="string"&&(t.type=Il[t.type])}class In{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Fl=t=>t/100;class ye extends In{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==_.now()&&this.tick(_.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;mo(e);const{type:n=Lt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Lt;c!==Lt&&typeof a[0]!="number"&&(this.mixKeyframes=_t(Fl,uo(a[0],a[1])),a=[0,100]);const l=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=On(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,S=s;if(h){const C=Math.min(this.currentTime,i)/a;let E=Math.floor(C),A=C%1;!A&&C>=1&&(A=1),A===1&&E--,E=Math.min(E,h+1),E%2&&(d==="reverse"?(A=1-A,p&&(A-=p/a)):d==="mirror"&&(S=o)),b=rt(0,1,A)*a}let k;T?(this.delayState.value=u[0],k=this.delayState):k=S.next(b),r&&!T&&(k.value=r(k.value));let{done:V}=k;!T&&c!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&f!==Je&&(k.value=Pe(u,this.options,v,this.speed)),y&&y(k.value),M&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return q(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+q(e)}get time(){return q(this.currentTime)}set time(e){e=H(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return fo(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(_.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=q(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bl,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Nl(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const yt=t=>t*180/Math.PI,Qe=t=>{const e=yt(Math.atan2(t[1],t[0]));return tn(e)},Bl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qe,rotateZ:Qe,skewX:t=>yt(Math.atan(t[1])),skewY:t=>yt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tn=t=>(t=t%360,t<0&&(t+=360),t),ms=Qe,ps=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),gs=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zl={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ps,scaleY:gs,scale:t=>(ps(t)+gs(t))/2,rotateX:t=>tn(yt(Math.atan2(t[6],t[5]))),rotateY:t=>tn(yt(Math.atan2(-t[2],t[0]))),rotateZ:ms,rotate:ms,skewX:t=>yt(Math.atan(t[4])),skewY:t=>yt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function en(t){return t.includes("scale")?1:0}function nn(t,e){if(!t||t==="none")return en(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=zl,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Bl,i=a}if(!i)return en(e);const r=s[e],o=i[1].split(",").map(Wl);return typeof r=="function"?r(o):o[r]}const Ul=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return nn(n,e)};function Wl(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set([...Mt,"pathRotation"]),ys=t=>t===kt||t===P,_l=new Set(["x","y","z"]),$l=Mt.filter(t=>!_l.has(t));function Kl(t){const e=[];return $l.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ut={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>nn(e,"x"),y:(t,{transform:e})=>nn(e,"y")};ut.translateX=ut.x;ut.translateY=ut.y;const vt=new Set;let sn=!1,on=!1,rn=!1;function po(){if(on){const t=Array.from(vt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Kl(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}on=!1,sn=!1,vt.forEach(t=>t.complete(rn)),vt.clear()}function go(){vt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(on=!0)})}function Hl(){rn=!0,go(),po(),rn=!1}class Fn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(vt.add(this),sn||(sn=!0,L.read(go),L.resolveKeyframes(po))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Nl(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vt.delete(this)}cancel(){this.state==="scheduled"&&(vt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gl=t=>t.startsWith("--");function yo(t,e,n){Gl(e)?t.style.setProperty(e,n):t.style[e]=n}const Yl={};function vo(t,e){const n=$i(t);return()=>Yl[e]??n()}const Xl=vo(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xo=vo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,vs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dt([0,.65,.55,1]),circOut:Dt([.55,0,1,.45]),backIn:Dt([.31,.01,.66,-.59]),backOut:Dt([.33,1.53,.69,.99])};function bo(t,e){if(t)return typeof t=="function"?xo()?ho(t,e):"ease-out":eo(t)?Dt(t):Array.isArray(t)?t.map(n=>bo(n,e)||vs.easeOut):vs[t]}function ql(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const h=bo(a,i);Array.isArray(h)&&(u.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function wo(t){return typeof t=="function"&&"applyToOptions"in t}function Zl({type:t,...e}){return wo(t)&&xo()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class So extends In{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,kn(typeof e.type!="string");const l=Zl(e);this.animation=ql(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Pe(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),yo(n,s,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return q(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+q(e)}get time(){return q(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Xl()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),Z):i(this)}}const To={anticipate:Zi,backInOut:qi,circInOut:Qi};function Jl(t){return t in To}function Ql(t){typeof t.ease=="string"&&Jl(t.ease)&&(t.ease=To[t.ease])}const Le=10;class tc extends So{constructor(e){Ql(e),mo(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new ye({...o,autoplay:!1}),c=Math.max(Le,_.now()-this.startTime),l=rt(0,Le,c-Le),u=a.sample(c).value,{name:h}=this.options;r&&h&&yo(r,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const xs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(nt.test(t)||t==="0")&&!t.startsWith("url("));function ec(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function nc(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=xs(i,e),a=xs(r,e);return!o||!a?!1:ec(t)||(n==="spring"||wo(n))&&s}function an(t){t.duration=0,t.type="keyframes"}const Po=new Set(["opacity","clipPath","filter","transform"]),sc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ic(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&sc.test(t[e]))return!0;return!1}const oc=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),rc=$i(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ac(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return rc()&&n&&(Po.has(n)||oc.has(n)&&ic(a))&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const lc=40;class cc extends In{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=_.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:l,element:u,...h},p=u?.KeyframeResolver||Fn;this.keyframeResolver=new p(a,(f,y,v)=>this.onKeyframesResolved(f,y,d,!v),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=_.now();let h=!0;nc(e,r,o,a)||(h=!1,(ht.instantAnimations||!c)&&u?.(Pe(e,s,n)),e[0]=e[e.length-1],an(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>lc?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},f=h&&!l&&ac(p),y=p.motionValue?.owner?.current;let v;if(f)try{v=new tc({...p,element:y})}catch{v=new ye(p)}else v=new ye(p);v.finished.then(()=>{this.notifyFinished()}).catch(Z),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hl()),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 Co(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const bs=30,uc=t=>!isNaN(parseFloat(t));class hc{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=_.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=_.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uc(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Mn);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=_.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,bs);return Ki(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 At(t,e){return new hc(t,e)}function Ao(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ao(n,t):n}const dc={type:"spring",stiffness:500,damping:25,restSpeed:10},fc=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mc={type:"keyframes",duration:.8},pc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gc=(t,{keyframes:e})=>e.length>2?mc:Vt.has(t)?t.startsWith("scale")?fc(e[1]):dc:pc,yc=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function vc(t){for(const e in t)if(!yc.has(e))return!0;return!1}const Bn=(t,e,n,s={},i,r)=>o=>{const a=Nn(s,t)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-H(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};vc(a)||Object.assign(u,gc(t,u)),u.duration&&(u.duration=H(u.duration)),u.repeatDelay&&(u.repeatDelay=H(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(an(u),u.delay===0&&(h=!0)),(ht.instantAnimations||ht.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,an(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Pe(u.keyframes,a);if(d!==void 0){L.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new ye(u):new cc(u)},xc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bc(t){const e=xc.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ko(t,e,n=1){const[s,i]=bc(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Ui(o)?parseFloat(o):o}return Rn(i)?ko(i,e,n+1):i}function ws(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function zn(t,e,n,s){if(typeof e=="function"){const[i,r]=ws(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=ws(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function xt(t,e,n){const s=t.getProps();return zn(s,e,n!==void 0?n:s.custom,t)}const Mo=new Set(["width","height","top","left","right","bottom",...Mt]),ln=t=>Array.isArray(t);function wc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,At(n))}function Sc(t){return ln(t)?t[t.length-1]||0:t}function Tc(t,e){const n=xt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Sc(r[o]);wc(t,o,a)}}const W=t=>!!(t&&t.getVelocity);function Pc(t){return!!(W(t)&&t.add)}function cn(t,e){const n=t.getValue("willChange");if(Pc(n))return n.add(e);if(!n&&ht.WillChange){const s=new ht.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Un(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Cc="framerAppearId",Vo="data-"+Un(Cc);function Eo(t){return t.props[Vo]}function Ac({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ro(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Ao(r,c):c;const l=r?.reduceMotion,u=r?.skipAnimations;s&&(r=s);const h=[],d=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const f in a){const y=t.getValue(f,t.latestValues[f]??null),v=a[f];if(v===void 0||d&&Ac(d,f))continue;const g={delay:n,...Nn(r||{},f)};u&&(g.skipAnimations=!0);const T=y.get();if(T!==void 0&&!y.isAnimating()&&!Array.isArray(v)&&v===T&&!g.velocity){L.update(()=>y.set(v));continue}let b=!1;if(window.MotionHandoffAnimation){const V=Eo(t);if(V){const M=window.MotionHandoffAnimation(V,f,L);M!==null&&(g.startTime=M,b=!0)}}cn(t,f);const S=l??t.shouldReduceMotion;y.start(Bn(f,y,v,S&&Mo.has(f)?{type:!1}:g,t,b));const k=y.animation;k&&h.push(k)}if(o){const f=()=>L.update(()=>{o&&Tc(t,o)});h.length?Promise.all(h).then(f):f()}return h}function un(t,e,n={}){const s=xt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Ro(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=i;return kc(t,e,c,l,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,l]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>l())}else return Promise.all([r(),o(n.delay)])}function kc(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(un(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Co(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Mc(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>un(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=un(t,e,n);else{const i=typeof e=="function"?xt(t,e,n.custom):e;s=Promise.all(Ro(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Vc={test:t=>t==="auto",parse:t=>t},Do=t=>e=>e.test(t),jo=[kt,P,ot,at,el,tl,Vc],Ss=t=>jo.find(Do(t));function Ec(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_i(t):!0}const Rc=new Set(["brightness","contrast","saturate","opacity"]);function Dc(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Dn)||[];if(!s)return t;const i=n.replace(s,"");let r=Rc.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const jc=/\b([a-z-]*)\(.*?\)/gu,hn={...nt,getAnimatableNone:t=>{const e=t.match(jc);return e?e.map(Dc).join(" "):t}},dn={...nt,getAnimatableNone:t=>{const e=nt.parse(t);return nt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Ts={...kt,transform:Math.round},Lc={rotate:at,pathRotation:at,rotateX:at,rotateY:at,rotateZ:at,scale:qt,scaleX:qt,scaleY:qt,scaleZ:qt,skew:at,skewX:at,skewY:at,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Nt,originX:cs,originY:cs,originZ:P},ve={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...Lc,zIndex:Ts,fillOpacity:Nt,strokeOpacity:Nt,numOctaves:Ts},Oc={...ve,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:hn,WebkitFilter:hn,mask:dn,WebkitMask:dn},Lo=t=>Oc[t],Ic=new Set([hn,dn]);function Oo(t,e){let n=Lo(t);return Ic.has(n)||(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Fc=new Set(["auto","none","0"]);function Nc(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Fc.has(r)&&Ct(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Oo(n,i)}class Bc extends Fn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Rn(h))){const d=ko(h,n.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Mo.has(s)||e.length!==2)return;const[i,r]=e,o=Ss(i),a=Ss(r),c=ls(i),l=ls(r);if(c!==l&&ut[s]){this.needsMeasurement=!0;return}if(o!==a)if(ys(o)&&ys(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else ut[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ec(e[i]))&&s.push(i);s.length&&Nc(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ut[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=ut[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const Wn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Io(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const fn=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function oe(t){return Wi(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:_n}=no(queueMicrotask,!1),tt={x:!1,y:!1};function Fo(){return tt.x||tt.y}function zc(t){return t==="x"||t==="y"?tt[t]?null:(tt[t]=!0,()=>{tt[t]=!1}):tt.x||tt.y?null:(tt.x=tt.y=!0,()=>{tt.x=tt.y=!1})}function No(t,e){const n=Io(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Uc(t){return!(t.pointerType==="touch"||Fo())}function Wc(t,e,n={}){const[s,i,r]=No(t,n);return s.forEach(o=>{let a=!1,c=!1,l;const u=()=>{o.removeEventListener("pointerleave",f)},h=v=>{l&&(l(v),l=void 0),u()},d=v=>{a=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),c&&(c=!1,h(v))},p=()=>{a=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},f=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}h(v)}},y=v=>{if(!Uc(v))return;c=!1;const g=e(o,v);typeof g=="function"&&(l=g,o.addEventListener("pointerleave",f,i))};o.addEventListener("pointerenter",y,i),o.addEventListener("pointerdown",p,i)}),r}const Bo=(t,e)=>e?t===e?!0:Bo(t,e.parentElement):!1,$n=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_c=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $c(t){return _c.has(t.tagName)||t.isContentEditable===!0}const Kc=new Set(["INPUT","SELECT","TEXTAREA"]);function Hc(t){return Kc.has(t.tagName)||t.isContentEditable===!0}const re=new WeakSet;function Ps(t){return e=>{e.key==="Enter"&&t(e)}}function Oe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Gc=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ps(()=>{if(re.has(n))return;Oe(n,"down");const i=Ps(()=>{Oe(n,"up")}),r=()=>Oe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Cs(t){return $n(t)&&!Fo()}const As=new WeakSet;function Yc(t,e,n={}){const[s,i,r]=No(t,n),o=a=>{const c=a.currentTarget;if(!Cs(a)||As.has(a))return;re.add(c),n.stopPropagation&&As.add(a);const l=e(c,a),u={...i,capture:!0},h=(f,y)=>{window.removeEventListener("pointerup",d,u),window.removeEventListener("pointercancel",p,u),re.has(c)&&re.delete(c),Cs(f)&&typeof l=="function"&&l(f,{success:y})},d=f=>{h(f,c===window||c===document||n.useGlobalTarget||Bo(c,f.target))},p=f=>{h(f,!1)};window.addEventListener("pointerup",d,u),window.addEventListener("pointercancel",p,u)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),oe(a)&&(a.addEventListener("focus",l=>Gc(l,i)),!$c(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Kn(t){return Wi(t)&&"ownerSVGElement"in t}const ae=new WeakMap;let le;const zo=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Kn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Xc=zo("inline","width","offsetWidth"),qc=zo("block","height","offsetHeight");function Zc({target:t,borderBoxSize:e}){ae.get(t)?.forEach(n=>{n(t,{get width(){return Xc(t,e)},get height(){return qc(t,e)}})})}function Jc(t){t.forEach(Zc)}function Qc(){typeof ResizeObserver>"u"||(le=new ResizeObserver(Jc))}function tu(t,e){le||Qc();const n=Io(t);return n.forEach(s=>{let i=ae.get(s);i||(i=new Set,ae.set(s,i)),i.add(e),le?.observe(s)}),()=>{n.forEach(s=>{const i=ae.get(s);i?.delete(e),i?.size||le?.unobserve(s)})}}const ce=new Set;let Tt;function eu(){Tt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};ce.forEach(e=>e(t))},window.addEventListener("resize",Tt)}function nu(t){return ce.add(t),Tt||eu(),()=>{ce.delete(t),!ce.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function ks(t,e){return typeof t=="function"?nu(t):tu(t,e)}function su(t){return Kn(t)&&t.tagName==="svg"}const iu=[...jo,F,nt],ou=t=>iu.find(Do(t)),Ms=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pt=()=>({x:Ms(),y:Ms()}),Vs=()=>({min:0,max:0}),z=()=>({x:Vs(),y:Vs()}),ru=new WeakMap;function Ce(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Bt(t){return typeof t=="string"||Array.isArray(t)}const Hn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gn=["initial",...Hn];function Ae(t){return Ce(t.animate)||Gn.some(e=>Bt(t[e]))}function Uo(t){return!!(Ae(t)||t.variants)}function au(t,e,n){for(const s in e){const i=e[s],r=n[s];if(W(i))t.addValue(s,i);else if(W(r))t.addValue(s,At(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,At(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const mn={current:null},Wo={current:!1},lu=typeof window<"u";function cu(){if(Wo.current=!0,!!lu)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mn.current=t.matches;t.addEventListener("change",e),e()}else mn.current=!1}const Es=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xe={};function _o(t){xe=t}function uu(){return xe}class hu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=_.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,L.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Ae(n),this.isVariantNode=Uo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in d){const f=d[p];l[p]!==void 0&&W(f)&&f.set(l[p])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,ru.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((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Wo.current||cu(),this.shouldReduceMotion=mn.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(),dt(this.notifyUpdate),dt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Po.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new So({element:this.current,name:e,keyframes:a,times:c,ease:l,duration:H(u)}),d=o(h);this.valueSubscriptions.set(e,()=>{d(),h.cancel()});return}const s=Vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}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 xe){const n=xe[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Es.length;s++){const i=Es[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=au(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=At(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Ui(s)||_i(s))?s=parseFloat(s):!ou(s)&&nt.test(n)&&(s=Oo(e,n)),this.setBaseTarget(e,W(s)?s.get():s)),W(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=zn(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!W(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Mn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){_n.render(this.render)}}class $o extends hu{constructor(){super(...arguments),this.KeyframeResolver=Bc}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;W(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ft{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Ko({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function du({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function fu(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Ie(t){return t===void 0||t===1}function pn({scale:t,scaleX:e,scaleY:n}){return!Ie(t)||!Ie(e)||!Ie(n)}function pt(t){return pn(t)||Ho(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ho(t){return Rs(t.x)||Rs(t.y)}function Rs(t){return t&&t!=="0%"}function be(t,e,n){const s=t-n,i=e*s;return n+i}function Ds(t,e,n,s,i){return i!==void 0&&(t=be(t,i,s)),be(t,n,s)+e}function gn(t,e=0,n=1,s,i){t.min=Ds(t.min,e,n,s,i),t.max=Ds(t.max,e,n,s,i)}function Go(t,{x:e,y:n}){gn(t.x,e.translate,e.scale,e.originPoint),gn(t.y,n.translate,n.scale,n.originPoint)}const js=.999999999999,Ls=1.0000000000001;function mu(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(it(t.x,-r.scroll.offset.x),it(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Go(t,o)),s&&pt(r.latestValues)&&ue(t,r.latestValues,r.layout?.layoutBox))}e.x<Ls&&e.x>js&&(e.x=1),e.y<Ls&&e.y>js&&(e.y=1)}function it(t,e){t.min+=e,t.max+=e}function Os(t,e,n,s,i=.5){const r=j(t.min,t.max,i);gn(t,e,n,r,s)}function Is(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function ue(t,e,n){const s=n??t;Os(t.x,Is(e.x,s.x),e.scaleX,e.scale,e.originX),Os(t.y,Is(e.y,s.y),e.scaleY,e.scale,e.originY)}function Yo(t,e){return Ko(fu(t.getBoundingClientRect(),e))}function pu(t,e,n){const s=Yo(t,n),{scroll:i}=e;return i&&(it(s.x,i.offset.x),it(s.y,i.offset.y)),s}const gu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yu=Mt.length;function vu(t,e,n){let s="",i=!0;for(let o=0;o<yu;o++){const a=Mt[o],c=t[a];if(c===void 0)continue;let l=!0;if(typeof c=="number")l=c===(a.startsWith("scale")?1:0);else{const u=parseFloat(c);l=a.startsWith("scale")?u===1:u===0}if(!l||n){const u=fn(c,ve[a]);if(!l){i=!1;const h=gu[a]||a;s+=`${h}(${u}) `}n&&(e[a]=u)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${fn(r,ve.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Yn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(Vt.has(c)){o=!0;continue}else if(io(c)){i[c]=l;continue}else{const u=fn(l,ve[c]);c.startsWith("origin")?(a=!0,r[c]=u):s[c]=u}}if(e.transform||(o||n?s.transform=vu(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=r;s.transformOrigin=`${c} ${l} ${u}`}}function Xo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function Fs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Et={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=Fs(t,e.target.x),s=Fs(t,e.target.y);return`${n}% ${s}%`}},xu={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=nt.parse(t);if(i.length>5)return s;const r=nt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=j(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),r(i)}},yn={borderRadius:{...Et,applyTo:[...Wn]},borderTopLeftRadius:Et,borderTopRightRadius:Et,borderBottomLeftRadius:Et,borderBottomRightRadius:Et,boxShadow:xu};function qo(t,{layout:e,layoutId:n}){return Vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!yn[t]||t==="opacity")}function Xn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(W(s[o])||i&&W(i[o])||qo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function bu(t){return window.getComputedStyle(t)}class wu extends $o{constructor(){super(...arguments),this.type="html",this.renderInstance=Xo}readValueFromInstance(e,n){if(Vt.has(n))return this.projection?.isProjecting?en(n):Ul(e,n);{const s=bu(e),i=(io(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Yo(e,n)}build(e,n,s){Yn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Xn(e,n,s)}}const Su={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tu={offset:"strokeDashoffset",array:"strokeDasharray"};function Pu(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Su:Tu;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Cu=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zo(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,l,u){if(Yn(t,a,l),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const p of Cu)h[p]!==void 0&&(d[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Pu(h,i,r,o,!1)}const Jo=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"]),Qo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Au(t,e,n,s){Xo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Jo.has(i)?i:Un(i),e.attrs[i])}function tr(t,e,n){const s=Xn(t,e,n);for(const i in t)if(W(t[i])||W(e[i])){const r=Mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class ku extends $o{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Vt.has(n)){const s=Lo(n);return s&&s.default||0}return n=Jo.has(n)?n:Un(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return tr(e,n,s)}build(e,n,s){Zo(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Au(e,n,s,i)}mount(e){this.isSVGTag=Qo(e.tagName),super.mount(e)}}const Mu=Gn.length;function er(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?er(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Mu;n++){const s=Gn[n],i=t.props[s];(Bt(i)||i===!1)&&(e[s]=i)}return e}function nr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Vu=[...Hn].reverse(),Eu=Hn.length;function Ru(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Mc(t,n,s)))}function Du(t){let e=Ru(t),n=Ns(),s=!0,i=!1;const r=l=>(u,h)=>{const d=xt(t,h,l==="exit"?t.presenceContext?.custom:void 0);if(d){const{transition:p,transitionEnd:f,...y}=d;u={...u,...y,...f}}return u};function o(l){e=l(t)}function a(l){const{props:u}=t,h=er(t.parent)||{},d=[],p=new Set;let f={},y=1/0;for(let g=0;g<Eu;g++){const T=Vu[g],b=n[T],S=u[T]!==void 0?u[T]:h[T],k=Bt(S),V=T===l?b.isActive:null;V===!1&&(y=g);let M=S===h[T]&&S!==u[T]&&k;if(M&&(s||i)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...f},!b.isActive&&V===null||!S&&!b.prevProp||Ce(S)||typeof S=="boolean")continue;if(T==="exit"&&b.isActive&&V!==!0){b.prevResolvedValues&&(f={...f,...b.prevResolvedValues});continue}const C=ju(b.prevProp,S);let E=C||T===l&&b.isActive&&!M&&k||g>y&&k,A=!1;const O=Array.isArray(S)?S:[S];let N=O.reduce(r(T),{});V===!1&&(N={});const{prevResolvedValues:J={}}=b,G={...J,...N},Y=B=>{E=!0,p.has(B)&&(A=!0,p.delete(B)),b.needsAnimating[B]=!0;const w=t.getValue(B);w&&(w.liveStyle=!1)};for(const B in G){const w=N[B],R=J[B];if(f.hasOwnProperty(B))continue;let X=!1;ln(w)&&ln(R)?X=!nr(w,R)||C:X=w!==R,X?w!=null?Y(B):p.add(B):w!==void 0&&p.has(B)?Y(B):b.protectedKeys[B]=!0}b.prevProp=S,b.prevResolvedValues=N,b.isActive&&(f={...f,...N}),(s||i)&&t.blockInitialAnimation&&(E=!1);const K=M&&C;E&&(!K||A)&&d.push(...O.map(B=>{const w={type:T};if(typeof B=="string"&&(s||i)&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:R}=t,X=xt(R,B);if(R.enteringChildren&&X){const{delayChildren:D}=X.transition||{};w.delay=Co(R.enteringChildren,t,D)}}return{animation:B,options:w}}))}if(p.size){const g={};if(typeof u.initial!="boolean"){const T=xt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);T&&T.transition&&(g.transition=T.transition)}p.forEach(T=>{const b=t.getBaseTarget(T),S=t.getValue(T);S&&(S.liveStyle=!0),g[T]=b??null}),d.push({animation:g})}let v=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(v=!1),s=!1,i=!1,v?e(d):Promise.resolve()}function c(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),n[l].isActive=u;const h=a(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ns(),i=!0}}}function ju(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!nr(e,t):!1}function mt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ns(){return{animate:mt(!0),whileInView:mt(),whileHover:mt(),whileTap:mt(),whileDrag:mt(),whileFocus:mt(),exit:mt()}}function vn(t,e){t.min=e.min,t.max=e.max}function Q(t,e){vn(t.x,e.x),vn(t.y,e.y)}function Bs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const sr=1e-4,Lu=1-sr,Ou=1+sr,ir=.01,Iu=0-ir,Fu=0+ir;function $(t){return t.max-t.min}function Nu(t,e,n){return Math.abs(t-e)<=n}function zs(t,e,n,s=.5){t.origin=s,t.originPoint=j(e.min,e.max,t.origin),t.scale=$(n)/$(e),t.translate=j(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Lu&&t.scale<=Ou||isNaN(t.scale))&&(t.scale=1),(t.translate>=Iu&&t.translate<=Fu||isNaN(t.translate))&&(t.translate=0)}function Ot(t,e,n,s){zs(t.x,e.x,n.x,s?s.originX:void 0),zs(t.y,e.y,n.y,s?s.originY:void 0)}function Us(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+$(e)}function Bu(t,e,n,s){Us(t.x,e.x,n.x,s?.x),Us(t.y,e.y,n.y,s?.y)}function Ws(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+$(e)}function we(t,e,n,s){Ws(t.x,e.x,n.x,s?.x),Ws(t.y,e.y,n.y,s?.y)}function _s(t,e,n,s,i){return t-=e,t=be(t,1/n,s),i!==void 0&&(t=be(t,1/i,s)),t}function zu(t,e=0,n=1,s=.5,i,r=t,o=t){if(ot.test(e)&&(e=parseFloat(e),e=j(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=j(r.min,r.max,s);t===r&&(a-=e),t.min=_s(t.min,e,n,a,i),t.max=_s(t.max,e,n,a,i)}function $s(t,e,[n,s,i],r,o){zu(t,e[n],e[s],e[i],e.scale,r,o)}const Uu=["x","scaleX","originX"],Wu=["y","scaleY","originY"];function Ks(t,e,n,s){$s(t.x,e,Uu,n?n.x:void 0,s?s.x:void 0),$s(t.y,e,Wu,n?n.y:void 0,s?s.y:void 0)}function Hs(t){return t.translate===0&&t.scale===1}function or(t){return Hs(t.x)&&Hs(t.y)}function Gs(t,e){return t.min===e.min&&t.max===e.max}function _u(t,e){return Gs(t.x,e.x)&&Gs(t.y,e.y)}function Ys(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function rr(t,e){return Ys(t.x,e.x)&&Ys(t.y,e.y)}function Xs(t){return $(t.x)/$(t.y)}function qs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function st(t){return[t("x"),t("y")]}function $u(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,pathRotation:h,rotateX:d,rotateY:p,skewX:f,skewY:y}=n;l&&(s=`perspective(${l}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotate(${h}deg) `),d&&(s+=`rotateX(${d}deg) `),p&&(s+=`rotateY(${p}deg) `),f&&(s+=`skewX(${f}deg) `),y&&(s+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Ku=Wn.length,Zs=t=>typeof t=="string"?parseFloat(t):t,Js=t=>typeof t=="number"||P.test(t);function Hu(t,e,n,s,i,r){i?(t.opacity=j(0,n.opacity??1,Gu(s)),t.opacityExit=j(e.opacity??1,0,Yu(s))):r&&(t.opacity=j(e.opacity??1,n.opacity??1,s));for(let o=0;o<Ku;o++){const a=Wn[o];let c=Qs(e,a),l=Qs(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Js(c)===Js(l)?(t[a]=Math.max(j(Zs(c),Zs(l),s),0),(ot.test(l)||ot.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=j(e.rotate||0,n.rotate||0,s))}function Qs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Gu=ar(0,.5,Ji),Yu=ar(.5,.95,Z);function ar(t,e,n){return s=>s<t?0:s>e?1:n(Ft(t,e,s))}function Xu(t,e,n){const s=W(t)?t:At(t);return s.start(Bn("",s,e,n)),s.animation}function zt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const qu=(t,e)=>t.depth-e.depth;class Zu{constructor(){this.children=[],this.isDirty=!1}add(e){An(this.children,e),this.isDirty=!0}remove(e){fe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qu),this.isDirty=!1,this.children.forEach(e)}}function Ju(t,e){const n=_.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(dt(s),t(r-e))};return L.setup(s,!0),()=>dt(s)}function he(t){return W(t)?t.get():t}class Qu{constructor(){this.members=[]}add(e){An(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(fe(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(fe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const de={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Fe=["","X","Y","Z"],th=1e3;let eh=0;function Ne(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function lr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Eo(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&lr(s)}function cr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=eh++,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,this.nodes.forEach(ih),this.nodes.forEach(uh),this.nodes.forEach(hh),this.nodes.forEach(oh)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Mn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Kn(o)&&!su(o),this.instance=o;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;L.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,u&&u(),u=Ju(d,250),de.hasAnimatedSinceResize&&(de.hasAnimatedSinceResize=!1,this.nodes.forEach(ni)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const f=this.options.transition||l.getDefaultTransition()||gh,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=l.getProps(),g=!this.targetLayout||!rr(this.targetLayout,p),T=!h&&d;if(this.options.layoutRoot||this.resumeFrom||T||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...Nn(f,"layout"),onPlay:y,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(u,T,b.path)}else h||ni(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dt(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(dh),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(ah),this.nodes.forEach(ti);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ei);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lh),this.nodes.forEach(ch),this.nodes.forEach(nh),this.nodes.forEach(sh)):this.nodes.forEach(ei),this.clearAllSnapshots();const a=_.now();U.delta=rt(0,1e3/60,a-U.timestamp),U.timestamp=a,U.isProcessing=!0,Ve.update.process(U),Ve.preRender.process(U),Ve.render.process(U),U.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_n.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rh),this.sharedNodes.forEach(fh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=z()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!or(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||pt(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),yh(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return z();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vh))){const{scroll:l}=this.root;l&&(it(a.x,l.offset.x),it(a.y,l.offset.y))}return a}removeElementScroll(o){const a=z();if(Q(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;l!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&Q(a,o),it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}applyTransform(o,a=!1,c){const l=c||z();Q(l,o);for(let u=0;u<this.path.length;u++){const h=this.path[u];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(it(l.x,-h.scroll.offset.x),it(l.y,-h.scroll.offset.y)),pt(h.latestValues)&&ue(l,h.latestValues,h.layout?.layoutBox)}return pt(this.latestValues)&&ue(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=z();Q(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!pt(l.latestValues))continue;let u;l.instance&&(pn(l.latestValues)&&l.updateSnapshot(),u=z(),Q(u,l.measurePageBox())),Ks(a,l.latestValues,l.snapshot?.layoutBox,u)}return pt(this.latestValues)&&Ks(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==U.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=U.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Q(this.target,this.layout.layoutBox),Go(this.target,this.targetDelta)):Q(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||pn(this.parent.latestValues)||Ho(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),we(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Q(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===U.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Q(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;mu(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=z());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bs(this.prevProjectionDelta.x,this.projectionDelta.x),Bs(this.prevProjectionDelta.y,this.projectionDelta.y)),Ot(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!qs(this.projectionDelta.x,this.prevProjectionDelta.x)||!qs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Pt(),this.projectionDelta=Pt(),this.projectionDeltaWithTransform=Pt()}setAnimationOrigin(o,a=!1,c){const l=this.snapshot,u=l?l.latestValues:{},h={...this.latestValues},d=Pt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=z(),f=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=f!==y,g=this.getStack(),T=!g||g.members.length<=1,b=!!(v&&!T&&this.options.crossfade===!0&&!this.path.some(ph));this.animationProgress=0;let S;const k=c?.interpolateProjection(o);this.mixTargetDelta=V=>{const M=V/1e3,C=k?.(M);C?(d.x.translate=C.x,d.x.scale=j(o.x.scale,1,M),d.x.origin=o.x.origin,d.x.originPoint=o.x.originPoint,d.y.translate=C.y,d.y.scale=j(o.y.scale,1,M),d.y.origin=o.y.origin,d.y.originPoint=o.y.originPoint):(si(d.x,o.x,M),si(d.y,o.y,M)),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(we(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mh(this.relativeTarget,this.relativeTargetOrigin,p,M),S&&_u(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=z()),Q(S,this.relativeTarget)),v&&(this.animationValues=h,Hu(h,u,this.latestValues,M,b,T)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{de.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=At(0)),this.motionValue.jump(0,!1),this.currentAnimation=Xu(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(th),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&ur(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||z();const h=$(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const d=$(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}Q(a,c),ue(a,u),Ot(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qu),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Ne("z",o,l,this.animationValues);for(let u=0;u<Fe.length;u++)Ne(`rotate${Fe[u]}`,o,l,this.animationValues),Ne(`skew${Fe[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=he(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=he(a?.pointerEvents)||""),this.hasProjected&&!pt(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=$u(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),o.transform=h;const{x:d,y:p}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in yn){if(u[f]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:g}=yn[f],T=h==="none"?u[f]:y(u[f],l);if(v){const b=v.length;for(let S=0;S<b;S++)o[v[S]]=T}else g?this.options.visualElement.renderState.vars[f]=T:o[f]=T}this.options.layoutId&&(o.pointerEvents=l===this?he(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ti),this.root.sharedNodes.clear()}}}function nh(t){t.updateLayout()}function sh(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")st(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],d=$(h);h.min=n[u].min,h.max=h.min+d});else if(i==="x"||i==="y"){const u=i==="x"?"y":"x";vn(r?e.measuredBox[u]:e.layoutBox[u],n[u])}else ur(i,e.layoutBox,n)&&st(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],d=$(n[u]);h.max=h.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+d)});const o=Pt();Ot(o,n,e.layoutBox);const a=Pt();r?Ot(a,t.applyTransform(s,!0),e.measuredBox):Ot(a,n,e.layoutBox);const c=!or(o);let l=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:d}=u;if(h&&d){const p=t.options.layoutAnchor||void 0,f=z();we(f,e.layoutBox,h.layoutBox,p);const y=z();we(y,n,d.layoutBox,p),rr(f,y)||(l=!0),u.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=f,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ih(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oh(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rh(t){t.clearSnapshot()}function ti(t){t.clearMeasurements()}function ah(t){t.isLayoutDirty=!0,t.updateLayout()}function ei(t){t.isLayoutDirty=!1}function lh(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ch(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ni(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function uh(t){t.resolveTargetDelta()}function hh(t){t.calcProjection()}function dh(t){t.resetSkewAndRotation()}function fh(t){t.removeLeadSnapshot()}function si(t,e,n){t.translate=j(e.translate,0,n),t.scale=j(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ii(t,e,n,s){t.min=j(e.min,n.min,s),t.max=j(e.max,n.max,s)}function mh(t,e,n,s){ii(t.x,e.x,n.x,s),ii(t.y,e.y,n.y,s)}function ph(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gh={duration:.45,ease:[.4,0,.1,1]},oi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ri=oi("applewebkit/")&&!oi("chrome/")?Math.round:Z;function ai(t){t.min=ri(t.min),t.max=ri(t.max)}function yh(t){ai(t.x),ai(t.y)}function ur(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nu(Xs(e),Xs(n),.2)}function vh(t){return t!==t.root&&t.scroll?.wasRoot}const xh=cr({attachResizeListener:(t,e)=>zt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Be={current:void 0},hr=cr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Be.current){const t=new xh({});t.mount(window),t.setOptions({layoutScroll:!0}),Be.current=t}return Be.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),qn=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function li(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function bh(...t){return e=>{let n=!1;const s=t.map(i=>{const r=li(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():li(t[i],null)}}}}function wh(...t){return x.useCallback(bh(...t),t)}class Sh extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(oe(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=oe(s)&&s.offsetWidth||0,r=oe(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Th({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=x.useContext(qn),u=t.props?.ref??t?.ref,h=wh(a,u);return x.useInsertionEffect(()=>{const{width:d,height:p,top:f,left:y,right:v,bottom:g,direction:T}=c.current;if(e||r===!1||!a.current||!d||!p)return;const b=T==="rtl",S=n==="left"?b?`right: ${v}`:`left: ${y}`:b?`left: ${y}`:`right: ${v}`,k=s==="bottom"?`bottom: ${g}`:`top: ${f}`;a.current.dataset.motionPopId=o;const V=document.createElement("style");l&&(V.nonce=l);const M=i??document.head;return M.appendChild(V),V.sheet&&V.sheet.insertRule(`
2
2
  [data-motion-pop-id="${o}"] {
3
3
  position: absolute !important;
4
4
  width: ${d}px !important;
@@ -1 +1 @@
1
- import{R as w,t as b,r as L}from"./index-B5UW6SaE.js";const z=e=>{let n;const s=new Set,l=(u,a)=>{const f=typeof u=="function"?u(n):u;if(!Object.is(f,n)){const y=n;n=a??(typeof f!="object"||f===null)?f:Object.assign({},n,f),s.forEach(E=>E(n,y))}},t=()=>n,d={setState:l,getState:t,getInitialState:()=>c,subscribe:u=>(s.add(u),()=>s.delete(u))},c=n=e(l,t,d);return d},q=(e=>e?z(e):z),C=e=>e;function F(e,n=C){const s=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>n(e.getState()),[e,n]),w.useCallback(()=>n(e.getInitialState()),[e,n]));return w.useDebugValue(s),s}const K=e=>{const n=q(e),s=l=>F(n,l);return Object.assign(s,n),s},k=(e=>e?K(e):K),I=[{id:"system.generic",labelKey:"ntf.event.system",defaultOn:!0},{id:"sync.error",labelKey:"ntf.event.syncError",defaultOn:!0},{id:"sync.done",labelKey:"ntf.event.syncDone",defaultOn:!0},{id:"sync.doneOnline",labelKey:"ntf.event.syncDoneOnline",defaultOn:!1},{id:"agent.done",labelKey:"ntf.event.agentDone",defaultOn:!0},{id:"inbox.message",labelKey:"ntf.event.inbox",defaultOn:!0},{id:"note.reminder",labelKey:"ntf.event.noteReminder",defaultOn:!0},{id:"harness.candidates",labelKey:"ntf.event.harnessCandidates",defaultOn:!0},{id:"memory.projectCandidates",labelKey:"ntf.event.projectCandidates",defaultOn:!0},{id:"memory.projectCompacted",labelKey:"ntf.event.projectCompacted",defaultOn:!0}];function R(e){const n=I.find(s=>s.id===e);return n?n.defaultOn:!0}const N=4,B={success:3200,info:5e3,warning:8e3,error:0},U=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?Math.min(e,12e4):void 0,D=e=>e.durationMs??B[e.level],T="forsion.ntf.prefs";function P(){try{const e=localStorage.getItem(T);if(e)return{enabled:!0,osEnabled:!0,events:{},...JSON.parse(e)}}catch{}return{enabled:!0,osEnabled:!0,events:{}}}function M(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}function V(e){return typeof window>"u"||!window.tangu?.mobile||!/Failed to fetch/i.test(e)?e:e.replace(/(?:TypeError:\s*)?Failed to fetch/gi,b("net.unavailable"))}const m=new Map;function O(e){const n=m.get(e);n?.handle&&clearTimeout(n.handle),m.delete(e)}let Y=0;const J=k((e,n)=>{const s=(t,o)=>{if(O(t),!(o<=0)){if(n().paused){m.set(t,{handle:null,deadline:0,remaining:o});return}m.set(t,{handle:setTimeout(()=>n().dismiss(t),o),deadline:Date.now()+o,remaining:0})}},l=t=>{try{t?.onClose?.()}catch{}};return{items:[],queue:[],prefs:P(),paused:!1,notify:t=>{const o=t.level&&["info","success","warning","error"].includes(t.level)?t.level:"info",i=t.event??"system.generic",d=n();if(!t.force&&!t.receipt&&(!d.prefs.enabled||!(d.prefs.events[i]??R(i))))return null;const c=t.sticky??o==="error",u=U(t.durationMs),a=V(String(t.text??"")).slice(0,500),f=t.title?String(t.title).slice(0,120):void 0;if(t.dedupeKey){const r=d.items.find(h=>h.dedupeKey===t.dedupeKey)||d.queue.find(h=>h.dedupeKey===t.dedupeKey);if(r){const h=d.items.some(p=>p.id===r.id),g={...r,text:a,title:f??r.title,level:o,count:r.count+1,createdAt:Date.now(),sticky:c||r.sticky,action:t.action??r.action,durationMs:u??r.durationMs,onClose:t.onClose??r.onClose};return e(p=>({items:p.items.map(v=>v.id===r.id?g:v),queue:p.queue.map(v=>v.id===r.id?g:v)})),h&&(g.sticky?O(r.id):s(r.id,D(g))),r.id}}const y={id:`ntf-${++Y}-${Date.now()}`,text:a,title:f,level:o,event:i,sourceLabel:t.sourceLabel,createdAt:Date.now(),sticky:c,count:1,dedupeKey:t.dedupeKey,action:t.action,durationMs:u,onClose:t.onClose},E=typeof document<"u"&&(!document.hasFocus()||document.visibilityState==="hidden");if(!t.inAppOnly&&!t.receipt&&d.prefs.osEnabled&&E){const r=f||t.sourceLabel||"Forsion";try{window.tangu?.notify?.(r,a,{event:i})}catch{}}return d.items.length<N?(e(r=>({items:[...r.items,y]})),c||s(y.id,D(y))):e(r=>({queue:[...r.queue,y]})),y.id},dismiss:t=>{O(t);const o=n(),i=o.items.find(a=>a.id===t)||o.queue.find(a=>a.id===t);let d=o.items.filter(a=>a.id!==t),c=o.queue.filter(a=>a.id!==t);if(d.length===o.items.length&&c.length===o.queue.length)return;const u=[];for(;d.length<N&&c.length;){const a=c[0];c=c.slice(1),d=[...d,a],u.push(a)}e({items:d,queue:c});for(const a of u)a.sticky||s(a.id,D(a));l(i)},dismissAll:()=>{for(const i of[...m.keys()])O(i);const{items:t,queue:o}=n();e({items:[],queue:[]});for(const i of[...t,...o])l(i)},setEnabled:t=>{const o={...n().prefs,enabled:t};e({prefs:o}),M(o)},setOsEnabled:t=>{const o={...n().prefs,osEnabled:t};e({prefs:o}),M(o)},setEventOn:(t,o)=>{const i={...n().prefs,events:{...n().prefs.events,[t]:o}};e({prefs:i}),M(i)},pause:()=>{if(!n().paused){e({paused:!0});for(const[t,o]of m)o.handle&&(clearTimeout(o.handle),m.set(t,{handle:null,deadline:0,remaining:Math.max(800,o.deadline-Date.now())}))}},resume:()=>{if(n().paused){e({paused:!1});for(const[t,o]of m)if(!o.handle){const i=o.remaining||1500;m.set(t,{handle:setTimeout(()=>n().dismiss(t),i),deadline:Date.now()+i,remaining:0})}}}}}),W=e=>J.getState().notify(e),S=50*1024*1024;L({"nativedl.saved":{zh:"已保存到「下载」:{name}",en:"Saved to Downloads: {name}"},"nativedl.tooLarge":{zh:"文件太大({size} MB),手机上一次最多保存 {max} MB",en:"File is too large ({size} MB); the phone can save up to {max} MB at a time"},"nativedl.unsupportedOs":{zh:"保存到「下载」需要 Android 10 及以上",en:"Saving to Downloads requires Android 10 or later"},"nativedl.failed":{zh:"保存到「下载」失败:{err}",en:"Could not save to Downloads: {err}"},"hostdl.failed":{zh:"下载失败({status})",en:"Download failed ({status})"},"hostdl.tooLarge":{zh:"文件太大({size} MB),远程下载一次最多 {max} MB",en:"File is too large ({size} MB); remote downloads are limited to {max} MB"},"hostdl.unsupported":{zh:"那台电脑上的 Forsion 版本还不支持远程下载文件",en:"Forsion on that computer does not support remote file downloads yet"}});function _(){return(typeof window<"u"?window.tangu?.saveDownload:void 0)??null}const x=e=>(e/1024/1024).toFixed(1);function j(e){return Object.assign(new Error(b("nativedl.tooLarge",{size:x(e),max:String(S/1024/1024)})),{code:"too_large"})}function X(e){const n=e?.code;if(n==="unsupported_os")return Object.assign(new Error(b("nativedl.unsupportedOs")),{code:n});const s=String(e?.message||e||"");return Object.assign(new Error(b("nativedl.failed",{err:s})),{code:typeof n=="string"?n:void 0})}async function A(e,n,s){const l=Number(s.headers.get("content-length"));if(Number.isFinite(l)&&l>S){try{await s.body?.cancel()}catch{}throw j(l)}const t=await s.blob();if(t.size>S)throw j(t.size);let o;try{o=(await e(n,t.type||"",t)).name||n}catch(i){throw i?.code==="too_large"?j(t.size):X(i)}return W({text:b("nativedl.saved",{name:o}),level:"info",inAppOnly:!0}),o}async function $(e,n){const s=_();if(s){await A(s,e,n);return}const l=await n.blob(),t=document.createElement("a");t.href=URL.createObjectURL(l),t.download=e,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),5e3)}async function G(e){let n={};try{n=await e.json()}catch{}return e.status===413&&n.code==="HOST_DOWNLOAD_TOO_LARGE"?Object.assign(new Error(b("hostdl.tooLarge",{size:x(Number(n.size)||0),max:String(Math.round((Number(n.limit)||0)/1024/1024))})),{status:413,code:"too_large"}):e.status===501?Object.assign(new Error(b("hostdl.unsupported")),{status:501}):Object.assign(new Error(b("hostdl.failed",{status:e.status})),{status:e.status})}const Q=Object.freeze(Object.defineProperty({__proto__:null,NATIVE_DOWNLOAD_MAX_BYTES:S,hostDownloadError:G,nativeSaveDownload:_,saveResponseAs:$,saveResponseNative:A},Symbol.toStringTag,{value:"Module"}));export{I as N,F as a,Q as b,k as c,R as e,G as h,W as n,$ as s,J as u};
1
+ import{R as w,t as b,r as L}from"./index-BYUntVIZ.js";const z=e=>{let n;const s=new Set,l=(u,a)=>{const f=typeof u=="function"?u(n):u;if(!Object.is(f,n)){const y=n;n=a??(typeof f!="object"||f===null)?f:Object.assign({},n,f),s.forEach(E=>E(n,y))}},t=()=>n,d={setState:l,getState:t,getInitialState:()=>c,subscribe:u=>(s.add(u),()=>s.delete(u))},c=n=e(l,t,d);return d},q=(e=>e?z(e):z),C=e=>e;function F(e,n=C){const s=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>n(e.getState()),[e,n]),w.useCallback(()=>n(e.getInitialState()),[e,n]));return w.useDebugValue(s),s}const K=e=>{const n=q(e),s=l=>F(n,l);return Object.assign(s,n),s},k=(e=>e?K(e):K),I=[{id:"system.generic",labelKey:"ntf.event.system",defaultOn:!0},{id:"sync.error",labelKey:"ntf.event.syncError",defaultOn:!0},{id:"sync.done",labelKey:"ntf.event.syncDone",defaultOn:!0},{id:"sync.doneOnline",labelKey:"ntf.event.syncDoneOnline",defaultOn:!1},{id:"agent.done",labelKey:"ntf.event.agentDone",defaultOn:!0},{id:"inbox.message",labelKey:"ntf.event.inbox",defaultOn:!0},{id:"note.reminder",labelKey:"ntf.event.noteReminder",defaultOn:!0},{id:"harness.candidates",labelKey:"ntf.event.harnessCandidates",defaultOn:!0},{id:"memory.projectCandidates",labelKey:"ntf.event.projectCandidates",defaultOn:!0},{id:"memory.projectCompacted",labelKey:"ntf.event.projectCompacted",defaultOn:!0}];function R(e){const n=I.find(s=>s.id===e);return n?n.defaultOn:!0}const N=4,B={success:3200,info:5e3,warning:8e3,error:0},U=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?Math.min(e,12e4):void 0,D=e=>e.durationMs??B[e.level],T="forsion.ntf.prefs";function P(){try{const e=localStorage.getItem(T);if(e)return{enabled:!0,osEnabled:!0,events:{},...JSON.parse(e)}}catch{}return{enabled:!0,osEnabled:!0,events:{}}}function M(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}function V(e){return typeof window>"u"||!window.tangu?.mobile||!/Failed to fetch/i.test(e)?e:e.replace(/(?:TypeError:\s*)?Failed to fetch/gi,b("net.unavailable"))}const m=new Map;function O(e){const n=m.get(e);n?.handle&&clearTimeout(n.handle),m.delete(e)}let Y=0;const J=k((e,n)=>{const s=(t,o)=>{if(O(t),!(o<=0)){if(n().paused){m.set(t,{handle:null,deadline:0,remaining:o});return}m.set(t,{handle:setTimeout(()=>n().dismiss(t),o),deadline:Date.now()+o,remaining:0})}},l=t=>{try{t?.onClose?.()}catch{}};return{items:[],queue:[],prefs:P(),paused:!1,notify:t=>{const o=t.level&&["info","success","warning","error"].includes(t.level)?t.level:"info",i=t.event??"system.generic",d=n();if(!t.force&&!t.receipt&&(!d.prefs.enabled||!(d.prefs.events[i]??R(i))))return null;const c=t.sticky??o==="error",u=U(t.durationMs),a=V(String(t.text??"")).slice(0,500),f=t.title?String(t.title).slice(0,120):void 0;if(t.dedupeKey){const r=d.items.find(h=>h.dedupeKey===t.dedupeKey)||d.queue.find(h=>h.dedupeKey===t.dedupeKey);if(r){const h=d.items.some(p=>p.id===r.id),g={...r,text:a,title:f??r.title,level:o,count:r.count+1,createdAt:Date.now(),sticky:c||r.sticky,action:t.action??r.action,durationMs:u??r.durationMs,onClose:t.onClose??r.onClose};return e(p=>({items:p.items.map(v=>v.id===r.id?g:v),queue:p.queue.map(v=>v.id===r.id?g:v)})),h&&(g.sticky?O(r.id):s(r.id,D(g))),r.id}}const y={id:`ntf-${++Y}-${Date.now()}`,text:a,title:f,level:o,event:i,sourceLabel:t.sourceLabel,createdAt:Date.now(),sticky:c,count:1,dedupeKey:t.dedupeKey,action:t.action,durationMs:u,onClose:t.onClose},E=typeof document<"u"&&(!document.hasFocus()||document.visibilityState==="hidden");if(!t.inAppOnly&&!t.receipt&&d.prefs.osEnabled&&E){const r=f||t.sourceLabel||"Forsion";try{window.tangu?.notify?.(r,a,{event:i})}catch{}}return d.items.length<N?(e(r=>({items:[...r.items,y]})),c||s(y.id,D(y))):e(r=>({queue:[...r.queue,y]})),y.id},dismiss:t=>{O(t);const o=n(),i=o.items.find(a=>a.id===t)||o.queue.find(a=>a.id===t);let d=o.items.filter(a=>a.id!==t),c=o.queue.filter(a=>a.id!==t);if(d.length===o.items.length&&c.length===o.queue.length)return;const u=[];for(;d.length<N&&c.length;){const a=c[0];c=c.slice(1),d=[...d,a],u.push(a)}e({items:d,queue:c});for(const a of u)a.sticky||s(a.id,D(a));l(i)},dismissAll:()=>{for(const i of[...m.keys()])O(i);const{items:t,queue:o}=n();e({items:[],queue:[]});for(const i of[...t,...o])l(i)},setEnabled:t=>{const o={...n().prefs,enabled:t};e({prefs:o}),M(o)},setOsEnabled:t=>{const o={...n().prefs,osEnabled:t};e({prefs:o}),M(o)},setEventOn:(t,o)=>{const i={...n().prefs,events:{...n().prefs.events,[t]:o}};e({prefs:i}),M(i)},pause:()=>{if(!n().paused){e({paused:!0});for(const[t,o]of m)o.handle&&(clearTimeout(o.handle),m.set(t,{handle:null,deadline:0,remaining:Math.max(800,o.deadline-Date.now())}))}},resume:()=>{if(n().paused){e({paused:!1});for(const[t,o]of m)if(!o.handle){const i=o.remaining||1500;m.set(t,{handle:setTimeout(()=>n().dismiss(t),i),deadline:Date.now()+i,remaining:0})}}}}}),W=e=>J.getState().notify(e),S=50*1024*1024;L({"nativedl.saved":{zh:"已保存到「下载」:{name}",en:"Saved to Downloads: {name}"},"nativedl.tooLarge":{zh:"文件太大({size} MB),手机上一次最多保存 {max} MB",en:"File is too large ({size} MB); the phone can save up to {max} MB at a time"},"nativedl.unsupportedOs":{zh:"保存到「下载」需要 Android 10 及以上",en:"Saving to Downloads requires Android 10 or later"},"nativedl.failed":{zh:"保存到「下载」失败:{err}",en:"Could not save to Downloads: {err}"},"hostdl.failed":{zh:"下载失败({status})",en:"Download failed ({status})"},"hostdl.tooLarge":{zh:"文件太大({size} MB),远程下载一次最多 {max} MB",en:"File is too large ({size} MB); remote downloads are limited to {max} MB"},"hostdl.unsupported":{zh:"那台电脑上的 Forsion 版本还不支持远程下载文件",en:"Forsion on that computer does not support remote file downloads yet"}});function _(){return(typeof window<"u"?window.tangu?.saveDownload:void 0)??null}const x=e=>(e/1024/1024).toFixed(1);function j(e){return Object.assign(new Error(b("nativedl.tooLarge",{size:x(e),max:String(S/1024/1024)})),{code:"too_large"})}function X(e){const n=e?.code;if(n==="unsupported_os")return Object.assign(new Error(b("nativedl.unsupportedOs")),{code:n});const s=String(e?.message||e||"");return Object.assign(new Error(b("nativedl.failed",{err:s})),{code:typeof n=="string"?n:void 0})}async function A(e,n,s){const l=Number(s.headers.get("content-length"));if(Number.isFinite(l)&&l>S){try{await s.body?.cancel()}catch{}throw j(l)}const t=await s.blob();if(t.size>S)throw j(t.size);let o;try{o=(await e(n,t.type||"",t)).name||n}catch(i){throw i?.code==="too_large"?j(t.size):X(i)}return W({text:b("nativedl.saved",{name:o}),level:"info",inAppOnly:!0}),o}async function $(e,n){const s=_();if(s){await A(s,e,n);return}const l=await n.blob(),t=document.createElement("a");t.href=URL.createObjectURL(l),t.download=e,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),5e3)}async function G(e){let n={};try{n=await e.json()}catch{}return e.status===413&&n.code==="HOST_DOWNLOAD_TOO_LARGE"?Object.assign(new Error(b("hostdl.tooLarge",{size:x(Number(n.size)||0),max:String(Math.round((Number(n.limit)||0)/1024/1024))})),{status:413,code:"too_large"}):e.status===501?Object.assign(new Error(b("hostdl.unsupported")),{status:501}):Object.assign(new Error(b("hostdl.failed",{status:e.status})),{status:e.status})}const Q=Object.freeze(Object.defineProperty({__proto__:null,NATIVE_DOWNLOAD_MAX_BYTES:S,hostDownloadError:G,nativeSaveDownload:_,saveResponseAs:$,saveResponseNative:A},Symbol.toStringTag,{value:"Module"}));export{I as N,F as a,Q as b,k as c,R as e,G as h,W as n,$ as s,J as u};