@forsion/unit 2.13.3 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/main.mjs +25 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/ArtificialView-DLh75dAI.js +1 -0
  5. package/web/assets/AutomationBuilder-DNWWGnFr.js +1 -0
  6. package/web/assets/CalendarConfigView-G7je7k9-.js +1 -0
  7. package/web/assets/{CalendarView-D55PA1vn.js → CalendarView-B2MtaOJk.js} +1 -1
  8. package/web/assets/{CapabilityMenu-BVrokPpT.js → CapabilityMenu-DJaZ_Cyt.js} +1 -1
  9. package/web/assets/{CheckboxInput-BuJ3HPm_.js → CheckboxInput-FYXLaZke.js} +1 -1
  10. package/web/assets/{Chrome-amTcZNE4.js → Chrome-CFonajM4.js} +1 -1
  11. package/web/assets/{CodeView-DRVh13k9.js → CodeView-GZ0BAgoW.js} +3 -3
  12. package/web/assets/DashboardGridView-Xgw4wa0_.js +17 -0
  13. package/web/assets/{EventCard-DUrn2krw.js → EventCard-_39F_I5M.js} +1 -1
  14. package/web/assets/ExcalidrawCanvas-rXujil36.js +1 -0
  15. package/web/assets/{FloatingToc-B1d4-5EL.js → FloatingToc-DNqAkkI0.js} +1 -1
  16. package/web/assets/GitCloneDialog-Bj9G3o-n.css +1 -0
  17. package/web/assets/GitCloneDialog-CQx-O4j1.js +1 -0
  18. package/web/assets/HomepageView-DcWmTPQO.css +1 -0
  19. package/web/assets/HomepageView-MYEk3RCs.js +3 -0
  20. package/web/assets/{ImageStudioPanels-B2PTq6Yb.js → ImageStudioPanels-4wnb2XF4.js} +2 -2
  21. package/web/assets/ImageStudioView-qrmW8pfx.js +1 -0
  22. package/web/assets/InlineAiPanel-B3kd1ob2.js +1 -0
  23. package/web/assets/InlineAiPanel-DZZijfif.css +1 -0
  24. package/web/assets/InlineFiles-Clnqh9jD.js +1 -0
  25. package/web/assets/MarkdownBlock-DQTuoen3.css +1 -0
  26. package/web/assets/MarkdownBlock-DT_wsaja.js +58 -0
  27. package/web/assets/ModelPill-JaIH3ffZ.js +2 -0
  28. package/web/assets/MuseLibraryView-16p1zsxz.css +1 -0
  29. package/web/assets/MuseLibraryView-DOJVVeU6.js +2 -0
  30. package/web/assets/{MuseView-CDDwV6SR.js → MuseView-uxTmjVQa.js} +2 -2
  31. package/web/assets/{PageHistoryPanel-BbdXpjJM.js → PageHistoryPanel-Bn4-XmdK.js} +2 -2
  32. package/web/assets/{PdfAnnotator-CW0wPWRB.js → PdfAnnotator-Cq8cklTz.js} +1 -1
  33. package/web/assets/PenRow-COOYAaxx.js +1 -0
  34. package/web/assets/ProductView-DPTveulg.js +1 -0
  35. package/web/assets/RightPanel-BJUacrsf.js +4 -0
  36. package/web/assets/RightPanel-D0zk1g3I.css +1 -0
  37. package/web/assets/{SketchCard-BcXCdBAs.js → SketchCard-B_UU5sxV.js} +3 -3
  38. package/web/assets/{StudioGuestSurface-ZJFKnNYF.js → StudioGuestSurface-yBa4QKfX.js} +1 -1
  39. package/web/assets/TargetHealthNotice-BLzDB-Xl.css +1 -0
  40. package/web/assets/TargetHealthNotice-CgkdTdhB.js +47 -0
  41. package/web/assets/{TodoListView-DuRdVFgB.js → TodoListView-CricdCfW.js} +1 -1
  42. package/web/assets/{Tooltip-DtDUL18W.js → Tooltip-o8ZqIb3L.js} +1 -1
  43. package/web/assets/UnifiedPage-BWAyqj65.js +69 -0
  44. package/web/assets/ViewSelectionBar-35x8TiLA.js +2 -0
  45. package/web/assets/appStore-CI1_L5OS.js +3357 -0
  46. package/web/assets/appStore-DQc2marq.css +1 -0
  47. package/web/assets/{arrow-up-right-R4P9Mmxz.js → arrow-up-right-BDsMFoNQ.js} +1 -1
  48. package/web/assets/{astryxBridge-CT2wZJXs.js → astryxBridge-CH_c5xjo.js} +3 -3
  49. package/web/assets/automationListSource-CB6AWkL_.js +1 -0
  50. package/web/assets/{boardSurface-Ce0_vf9f.js → boardSurface-CLvEUjbF.js} +1 -1
  51. package/web/assets/{book-open-CcXCToyx.js → book-open-BLzEdGfu.js} +1 -1
  52. package/web/assets/{calendarNavStore-tQJRVpum.js → calendarNavStore-BHUNxDx8.js} +1 -1
  53. package/web/assets/{canvasPrefs-CSuX9aLF.js → canvasPrefs-CvE7mgyq.js} +1 -1
  54. package/web/assets/{chatBoxSurface-IG6Vu4Dz.js → chatBoxSurface-CuuHLzs5.js} +1 -1
  55. package/web/assets/{circle-question-mark-O8AhUz35.js → circle-question-mark-BM4ZRxQS.js} +1 -1
  56. package/web/assets/{circle-x-AV2ZWulM.js → circle-x-DTcNGZDT.js} +1 -1
  57. package/web/assets/{client-BqhpYbYL.js → client-CaivGZFR.js} +5 -5
  58. package/web/assets/{code-xml-DdR58F83.js → code-xml-AE3mT4T5.js} +1 -1
  59. package/web/assets/{codeStudioStore-Dq5i8nbE.js → codeStudioStore-DhyMazGT.js} +1 -1
  60. package/web/assets/codingNavigation-B0kVsy4x.js +53 -0
  61. package/web/assets/codingNavigation-DHCidM4N.css +1 -0
  62. package/web/assets/{create-BgJN5qsj.js → create-1JI2I47p.js} +2 -2
  63. package/web/assets/dashboardSurface-CIE5HybN.js +1 -0
  64. package/web/assets/{deskCapture-BD2qD6NI.js → deskCapture-COW7aG5Y.js} +1 -1
  65. package/web/assets/{diff2html-OoRdHZ_O.js → diff2html-Daje9Kkm.js} +1 -1
  66. package/web/assets/{docx-preview-B43XC8Cn.js → docx-preview-CABR7n30.js} +1 -1
  67. package/web/assets/emoji-DZ9CA_3l.css +1 -0
  68. package/web/assets/emoji-DphwSxPx.js +1 -0
  69. package/web/assets/{floatingTocSurface-BM2SYE_u.js → floatingTocSurface-BOm2QYBK.js} +1 -1
  70. package/web/assets/{foldActions-BcyvNVBs.js → foldActions-DNbJPlPl.js} +1 -1
  71. package/web/assets/{folder-CCZqnwRc.js → folder-DotgUhYD.js} +1 -1
  72. package/web/assets/{folder-plus-BJKT1Pqg.js → folder-plus-aJgL9NeP.js} +1 -1
  73. package/web/assets/gestures-dqncPOwo.js +1 -0
  74. package/web/assets/git-branch-CwR2qic6.js +1 -0
  75. package/web/assets/{hand-DRu7IJdU.js → hand-XNkzNiW2.js} +1 -1
  76. package/web/assets/{hard-drive-CXNJUCXw.js → hard-drive-CfWKRoAE.js} +1 -1
  77. package/web/assets/i18n-CykmULlm.css +1 -0
  78. package/web/assets/{i18n.generated-DvY59Zq3.js → i18n.generated-BwynSSMk.js} +3 -3
  79. package/web/assets/{imageStudio-Axwmd4GW.js → imageStudio-CWgLpC_d.js} +2 -2
  80. package/web/assets/{index-C65u4fXd.js → index-B65ULikK.js} +1 -1
  81. package/web/assets/{index-DDMXVG0h.js → index-BGfvNj7R.js} +1 -1
  82. package/web/assets/{index-BGEkZBs2.js → index-BIIeiIap.js} +1 -1
  83. package/web/assets/{index-BYUntVIZ.js → index-BOzsniE1.js} +89 -89
  84. package/web/assets/{index-BO2XJc36.js → index-BfrjVzia.js} +1 -1
  85. package/web/assets/{index-mB0EQkyZ.js → index-Bi9UtjVz.js} +1 -1
  86. package/web/assets/{index-pJh7JN7_.js → index-C1uilc9i.js} +1 -1
  87. package/web/assets/{index-DY0M_dpd.js → index-C3Dc3Ivz.js} +1 -1
  88. package/web/assets/{index-D3CYvMpl.js → index-CJF_Ld1Y.js} +1 -1
  89. package/web/assets/{index-BFTY79aq.js → index-CMARP4oV.js} +1 -1
  90. package/web/assets/{index-taRxNsbp.js → index-C_RsQVNm.js} +1 -1
  91. package/web/assets/{index-Dlkq7gkE.js → index-ChyxZMm8.js} +1 -1
  92. package/web/assets/{index-DcbZwhpE.js → index-CoKcOaZg.js} +1 -1
  93. package/web/assets/{index-Uq4J2aoW.js → index-CuviSCbk.js} +1 -1
  94. package/web/assets/{index-HqmJW2np.js → index-Cw43kua8.js} +1 -1
  95. package/web/assets/{index-WbVt2P8R.js → index-D1fu6XQN.js} +1 -1
  96. package/web/assets/{index-D78izbLA.js → index-DG-hXb63.js} +1 -1
  97. package/web/assets/index-DjnTfJpN.js +1 -0
  98. package/web/assets/{index-LxlyPm0_.js → index-Dtw0abst.js} +1 -1
  99. package/web/assets/{index-D102FOuM.js → index-O05r2Ty6.js} +1 -1
  100. package/web/assets/{index-C_Ohi-I3.js → index-W3ErfZiX.js} +1 -1
  101. package/web/assets/{index-B1rE_NwA.js → index-Yc56b3XX.js} +1 -1
  102. package/web/assets/{index-CkMhazev.js → index-d4jCdYJH.js} +1 -1
  103. package/web/assets/{index-CobUnTcv.js → index-gt5JBIFf.js} +1 -1
  104. package/web/assets/{index-XyjIhkPw.js → index-siHtlYTM.js} +1 -1
  105. package/web/assets/{invitePage-BW0BH8Ac.js → invitePage-Bgveo6Hj.js} +1 -1
  106. package/web/assets/{ipc-D7yENkjV.js → ipc-B6hkgxQL.js} +1 -1
  107. package/web/assets/{jszip.min-UE5d5vPJ.js → jszip.min-eU-k-vEy.js} +1 -1
  108. package/web/assets/{layout-grid-Hs3eDA07.js → layout-grid-CraV7nhh.js} +1 -1
  109. package/web/assets/linkFollow-BpvDWzUx.js +8 -0
  110. package/web/assets/{list-tree-DmuRb-p9.js → list-tree-cLJw-jYQ.js} +1 -1
  111. package/web/assets/{listFold-CKxjyY5_.js → listFold-M8s5JYEC.js} +1 -1
  112. package/web/assets/{lock-kffGfeHt.js → lock-DBkXXwaI.js} +1 -1
  113. package/web/assets/lock-open-C-9-AWct.js +1 -0
  114. package/web/assets/{log-out-B5gEP0tF.js → log-out-C8bDXj9P.js} +1 -1
  115. package/web/assets/main-CMk6twzA.js +20 -0
  116. package/web/assets/markdownEditorSurface-DgQ0TUWH.js +3 -0
  117. package/web/assets/{message-square-plus-DxBPIhPS.js → message-square-plus-8pfimvem.js} +1 -1
  118. package/web/assets/{messages-4w1Khzm1.js → messages-CKtabOqy.js} +1 -1
  119. package/web/assets/minus-CfA9fAN3.js +1 -0
  120. package/web/assets/mobileEntry-NcMcK0LV.js +13 -0
  121. package/web/assets/{nativeDownload-Udrv_tmU.js → nativeDownload-CNtwSCy0.js} +1 -1
  122. package/web/assets/pageChrome-BR4cfIaA.js +1 -0
  123. package/web/assets/{pageChrome-eO9pb2fH.css → pageChrome-BbUhILy0.css} +1 -1
  124. package/web/assets/{pageTree-CIXFRCLk.js → pageTree-BYYPgZm_.js} +4 -4
  125. package/web/assets/{pen-tool-D_Y9We9x.js → pen-tool-C5ftHCnm.js} +1 -1
  126. package/web/assets/{pencil-DGiTRzW1.js → pencil-ehhM9_9k.js} +1 -1
  127. package/web/assets/phoneList-B6gwUJZF.js +9 -0
  128. package/web/assets/phoneList-iRdfiKA8.css +1 -0
  129. package/web/assets/pluginChat-DTTWWiUS.js +2 -0
  130. package/web/assets/{redo-2-QgiKEg9T.js → redo-2-DCEAgQlN.js} +1 -1
  131. package/web/assets/{rotate-ccw-BLoH5er1.js → rotate-ccw-DdkrbRAB.js} +1 -1
  132. package/web/assets/selectionActions-BQD2kox1.js +2 -0
  133. package/web/assets/selectionBarSurface-CzUZmJDJ.js +1 -0
  134. package/web/assets/server-Ddu9f1k3.js +1 -0
  135. package/web/assets/sharePage-CNrm2xTC.js +2 -0
  136. package/web/assets/{shareViewer-BzuSyJv_.js → shareViewer-BiMqIBxP.js} +2 -2
  137. package/web/assets/{star-BmywYD3u.js → star-Dxv7XANS.js} +1 -1
  138. package/web/assets/tableSurface-Bly1iCXc.js +1 -0
  139. package/web/assets/{terminal-BlmA_Z1C.js → terminal-CAmmC9cV.js} +1 -1
  140. package/web/assets/{terminalView-SAxITnRW.js → terminalView-lbcBgG0c.js} +1 -1
  141. package/web/assets/theme-CUWFlazV.css +1 -0
  142. package/web/assets/{type-DmIL6FB-.js → type-Dz6rnTvG.js} +1 -1
  143. package/web/assets/{undo-2-yMeXc8Wi.js → undo-2-B7izWNb_.js} +1 -1
  144. package/web/assets/{unitAccount-BPYRAa3m.js → unitAccount-DGwGsmC3.js} +1 -1
  145. package/web/assets/{unitBridge-BNVzai6X.js → unitBridge-CE2yAvm0.js} +1 -1
  146. package/web/assets/{unitCloudTransport-iFweA1xk.js → unitCloudTransport-BGFwkaDM.js} +1 -1
  147. package/web/assets/{unitOwnerAccess-Bggl7bDP.js → unitOwnerAccess-D4nKS6Gg.js} +1 -1
  148. package/web/assets/{unitShim-BP2nBO_k.js → unitShim-2_2hhGxS.js} +3 -3
  149. package/web/assets/{upload-D20PZHXc.js → upload-DqpRRAhG.js} +1 -1
  150. package/web/assets/userSpaces-VFu4s05v.js +1 -0
  151. package/web/assets/viewportLock-3AOdDmwi.js +631 -0
  152. package/web/assets/viewportLock-djvL8fUQ.css +1 -0
  153. package/web/assets/{zoom-in-_TgFOpyv.js → zoom-in-Bf-eKTnH.js} +1 -1
  154. package/web/index.html +2 -2
  155. package/web/assets/ArtificialView-DS97zlMg.js +0 -1
  156. package/web/assets/AutomationBuilder-BsJc8wuC.js +0 -1
  157. package/web/assets/CalendarConfigView-BN8mraSo.js +0 -1
  158. package/web/assets/DashboardGridView-DlFyYfUh.js +0 -17
  159. package/web/assets/ExcalidrawCanvas-TpbzBF-J.js +0 -1
  160. package/web/assets/HomepageView-DnQ_5Obe.css +0 -1
  161. package/web/assets/HomepageView-nzKfbHM-.js +0 -1
  162. package/web/assets/ImageStudioView-Cawr6pGW.js +0 -1
  163. package/web/assets/InlineFiles-DKPH5JHz.js +0 -1
  164. package/web/assets/MarkdownBlock--__nPQGh.css +0 -1
  165. package/web/assets/MarkdownBlock-BHpDy2qQ.js +0 -58
  166. package/web/assets/ModelPill-ChzAM3z1.js +0 -2
  167. package/web/assets/MuseLibraryView-DLuQ_jyV.js +0 -2
  168. package/web/assets/PenRow-BY-MZLDQ.js +0 -1
  169. package/web/assets/ProductView-0ieVL3rY.js +0 -1
  170. package/web/assets/RightPanel-BRexwQ3W.js +0 -4
  171. package/web/assets/RunLocationPicker-BrDfOu8-.css +0 -1
  172. package/web/assets/RunLocationPicker-CadYiE7C.js +0 -43
  173. package/web/assets/UnifiedPage-D7JTfABH.js +0 -68
  174. package/web/assets/appStore-ClD7vq5L.css +0 -1
  175. package/web/assets/appStore-affnJoin.js +0 -3292
  176. package/web/assets/automationListSource-JVBMsMbC.js +0 -1
  177. package/web/assets/codingNavigation-CxdCK78-.js +0 -53
  178. package/web/assets/codingNavigation-_tOR0ell.css +0 -1
  179. package/web/assets/dashboardSurface-BY-AFB-r.js +0 -1
  180. package/web/assets/emoji-BPdA62d7.js +0 -1
  181. package/web/assets/gestures-BwPbZDkU.js +0 -1
  182. package/web/assets/i18n-BMo19xaR.css +0 -1
  183. package/web/assets/index-Y2kzYlZq.js +0 -1
  184. package/web/assets/linkFollow-Msu1XH9v.js +0 -8
  185. package/web/assets/main-DIyFlyfK.js +0 -20
  186. package/web/assets/markdownEditorSurface-Cx2rqFAY.js +0 -3
  187. package/web/assets/minus-CfoZ4oxr.js +0 -1
  188. package/web/assets/mobileEntry-B8JwR53-.js +0 -13
  189. package/web/assets/pageChrome-D-9npbUE.js +0 -1
  190. package/web/assets/phoneList-BQfCJwKF.css +0 -1
  191. package/web/assets/phoneList-DHUia6HT.js +0 -9
  192. package/web/assets/pluginChat-BXuJiMYi.js +0 -2
  193. package/web/assets/sharePage-DYYN5usb.js +0 -2
  194. package/web/assets/tableSurface-21LDYY_G.js +0 -1
  195. package/web/assets/theme-Dgqst5S9.css +0 -1
  196. package/web/assets/userSpaces-CrLrKklx.js +0 -1
  197. package/web/assets/viewportLock-DO1lzA2N.css +0 -1
  198. package/web/assets/viewportLock-tlT6H_Hc.js +0 -629
  199. package/web/assets/workflow-Bd6xBHiT.js +0 -1
@@ -1,9 +0,0 @@
1
- import{G as ln,u as Yo,cq as Xo,T as qo}from"./appStore-affnJoin.js";import{d as v,j as E,r as Zo,u as ri,t as Jo}from"./index-BYUntVIZ.js";import"./client-BqhpYbYL.js";import{c as ai}from"./nativeDownload-Udrv_tmU.js";const Qo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],mh=ln("clock",Qo);const tr=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],gh=ln("pin",tr);const er=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],yh=ln("square-pen",er);function vh(t,e={}){return!1}function xh(t,e,n){const[s,i]=v.useState(null),r=v.useRef({build:e,onClose:n});r.current={build:e,onClose:n};const o=t!=null&&t!==!1,a=o&&s!==t&&!1;return v.useEffect(()=>{if(!o){s!==null&&i(null);return}},[t,s,o]),!a}const cn=v.createContext({});function un(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const nr=typeof window<"u",hn=nr?v.useLayoutEffect:v.useEffect,fe=v.createContext(null);function fn(t,e){t.indexOf(e)===-1&&t.push(e)}function ee(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tt=(t,e,n)=>n>e?e:n<t?t:n;let dn=()=>{};const ot={},li=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ci=t=>typeof t=="object"&&t!==null,ui=t=>/^0[^.\s]+$/u.test(t);function hi(t){let e;return()=>(e===void 0&&(e=t()),e)}const H=t=>t,jt=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Lt=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class pn{constructor(){this.subscriptions=[]}add(e){return fn(this.subscriptions,e),()=>ee(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 K=t=>t*1e3,z=t=>t/1e3,fi=(t,e)=>e?t*(1e3/e):0,di=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,sr=1e-7,ir=12;function or(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=di(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>sr&&++a<ir);return o}function Ot(t,e,n,s){if(t===e&&n===s)return H;const i=r=>or(r,0,1,t,n);return r=>r===0||r===1?r:di(i(r),e,s)}const pi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mi=t=>e=>1-t(1-e),gi=Ot(.33,1.53,.69,.99),mn=mi(gi),yi=pi(mn),vi=t=>t>=1?1:(t*=2)<1?.5*mn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),xi=mi(gn),Ti=pi(gn),rr=Ot(.42,0,1,1),ar=Ot(0,0,.58,1),wi=Ot(.42,0,.58,1),lr=t=>Array.isArray(t)&&typeof t[0]!="number",Pi=t=>Array.isArray(t)&&typeof t[0]=="number",cr={linear:H,easeIn:rr,easeInOut:wi,easeOut:ar,circIn:gn,circInOut:Ti,circOut:xi,backIn:mn,backInOut:yi,backOut:gi,anticipate:vi},ur=t=>typeof t=="string",Un=t=>{if(Pi(t)){dn(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(ur(t))return cr[t];return t},Ut=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hr(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)&&(u.schedule(l),t()),l(o)}const u={schedule:(l,c=!1,h=!1)=>{const p=h&&s?e:n;return c&&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 c=e;e=n,n=c,e.forEach(a),e.clear(),s=!1,i&&(i=!1,u.process(l))}};return u}const fr=40;function Si(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ut.reduce((x,w)=>(x[w]=hr(r),x),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:f,render:p,postRender:d}=o,m=()=>{const x=ot.useManualTiming,w=x?i.timestamp:performance.now();n=!1,x||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,fr),1)),i.timestamp=w,i.isProcessing=!0,a.process(i),u.process(i),l.process(i),c.process(i),h.process(i),f.process(i),p.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Ut.reduce((x,w)=>{const A=o[w];return x[w]=(C,M=!1,S=!1)=>(n||g(),A.schedule(C,M,S)),x},{}),cancel:x=>{for(let w=0;w<Ut.length;w++)o[Ut[w]].cancel(x)},state:i,steps:o}}const{schedule:R,cancel:rt,state:O,steps:ye}=Si(typeof requestAnimationFrame<"u"?requestAnimationFrame:H,!0);let _t;function dr(){_t=void 0}const W={now:()=>(_t===void 0&&W.set(O.isProcessing||ot.useManualTiming?O.timestamp:performance.now()),_t),set:t=>{_t=t,queueMicrotask(dr)}},bi=t=>e=>typeof e=="string"&&e.startsWith(t),Ai=bi("--"),pr=bi("var(--"),yn=t=>pr(t)?mr.test(t.split("/*")[0].trim()):!1,mr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Kn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kt={...St,transform:t=>tt(0,1,t)},Kt={...St,default:1},Mt=t=>Math.round(t*1e5)/1e5,vn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gr(t){return t==null}const yr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xn=(t,e)=>n=>!!(typeof n=="string"&&yr.test(n)&&n.startsWith(t)||e&&!gr(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ci=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(vn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},vr=t=>tt(0,255,t),ve={...St,transform:t=>Math.round(vr(t))},ht={test:xn("rgb","red"),parse:Ci("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ve.transform(t)+", "+ve.transform(e)+", "+ve.transform(n)+", "+Mt(kt.transform(s))+")"};function xr(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 Ie={test:xn("#"),parse:xr,transform:ht.transform},Nt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Nt("deg"),Q=Nt("%"),P=Nt("px"),Tr=Nt("vh"),wr=Nt("vw"),$n={...Q,parse:t=>Q.parse(t)/100,transform:t=>Q.transform(t*100)},yt={test:xn("hsl","hue"),parse:Ci("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Q.transform(Mt(e))+", "+Q.transform(Mt(n))+", "+Mt(kt.transform(s))+")"},I={test:t=>ht.test(t)||Ie.test(t)||yt.test(t),parse:t=>ht.test(t)?ht.parse(t):yt.test(t)?yt.parse(t):Ie.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):yt.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},Pr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sr(t){return isNaN(t)&&typeof t=="string"&&(t.match(vn)?.length||0)+(t.match(Pr)?.length||0)>0}const Vi="number",Mi="color",br="var",Ar="var(",zn="${}",Cr=/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 wt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Cr,u=>(I.test(u)?(s.color.push(r),i.push(Mi),n.push(I.parse(u))):u.startsWith(Ar)?(s.var.push(r),i.push(br),n.push(u)):(s.number.push(r),i.push(Vi),n.push(parseFloat(u))),++r,zn)).split(zn);return{values:n,split:a,indexes:s,types:i}}function Vr(t){return wt(t).values}function Ei({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===Vi?i+=Mt(s[r]):o===Mi?i+=I.transform(s[r]):i+=s[r]}return i}}function Mr(t){return Ei(wt(t))}const Er=t=>typeof t=="number"?0:I.test(t)?I.getAnimatableNone(t):t,Dr=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:Er(t);function Rr(t){const e=wt(t);return Ei(e)(e.values.map((s,i)=>Dr(s,e.split[i])))}const Y={test:Sr,parse:Vr,createTransformer:Mr,getAnimatableNone:Rr};function xe(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 Lr({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,u=2*n-a;i=xe(u,a,t+1/3),r=xe(u,a,t),o=xe(u,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function ne(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,Te=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},kr=[Ie,ht,yt],Ir=t=>kr.find(e=>e.test(t));function Hn(t){const e=Ir(t);if(!e)return!1;let n=e.parse(t);return e===yt&&(n=Lr(n)),n}const _n=(t,e)=>{const n=Hn(t),s=Hn(e);if(!n||!s)return ne(t,e);const i={...n};return r=>(i.red=Te(n.red,s.red,r),i.green=Te(n.green,s.green,r),i.blue=Te(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),ht.transform(i))},Be=new Set(["none","hidden"]);function Br(t,e){return Be.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Fr(t,e){return n=>D(t,e,n)}function Tn(t){return typeof t=="number"?Fr:typeof t=="string"?yn(t)?ne:I.test(t)?_n:Nr:Array.isArray(t)?Di:typeof t=="object"?I.test(t)?_n:jr:ne}function Di(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Tn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function jr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Tn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Or(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 Nr=(t,e)=>{const n=Y.createTransformer(e),s=wt(t),i=wt(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?Be.has(t)&&!i.values.length||Be.has(e)&&!s.values.length?Br(t,e):jt(Di(Or(s,i),i.values),n):ne(t,e)};function Ri(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):Tn(t)(t,e)}const Wr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>R.update(e,n),stop:()=>rt(e),now:()=>O.isProcessing?O.timestamp:W.now()}},Li=(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)})`},se=2e4;function wn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<se;)e+=n,s=t.next(e);return e>=se?1/0:e}function Ur(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(wn(s),se);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:z(i)}}const k={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 Fe(t,e){return t*Math.sqrt(1-e*e)}const Kr=12;function $r(t,e,n){let s=n;for(let i=1;i<Kr;i++)s=s-t(s)/e(s);return s}const we=.001;function zr({duration:t=k.duration,bounce:e=k.bounce,velocity:n=k.velocity,mass:s=k.mass}){let i,r,o=1-e;o=tt(k.minDamping,k.maxDamping,o),t=tt(k.minDuration,k.maxDuration,z(t)),o<1?(i=l=>{const c=l*o,h=c*t,f=c-n,p=Fe(l,o),d=Math.exp(-h);return we-f/p*d},r=l=>{const h=l*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,d=Math.exp(-h),m=Fe(Math.pow(l,2),o);return(-i(l)+we>0?-1:1)*((f-p)*d)/m}):(i=l=>{const c=Math.exp(-l*t),h=(l-n)*t+1;return-we+c*h},r=l=>{const c=Math.exp(-l*t),h=(n-l)*(t*t);return c*h});const a=5/t,u=$r(i,r,a);if(t=K(t),isNaN(u))return{stiffness:k.stiffness,damping:k.damping,duration:t};{const l=Math.pow(u,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Hr=["duration","bounce"],_r=["stiffness","damping","mass"];function Gn(t,e){return e.some(n=>t[n]!==void 0)}function Gr(t){let e={velocity:k.velocity,stiffness:k.stiffness,damping:k.damping,mass:k.mass,isResolvedFromDuration:!1,...t};if(!Gn(t,_r)&&Gn(t,Hr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*tt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:k.mass,stiffness:i,damping:r}}else{const n=zr({...t,velocity:0});e={...e,...n,mass:k.mass},e.isResolvedFromDuration=!0}return e}function ie(t=k.visualDuration,e=k.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:u,damping:l,mass:c,duration:h,velocity:f,isResolvedFromDuration:p}=Gr({...n,velocity:-z(n.velocity||0)}),d=f||0,m=l/(2*Math.sqrt(u*c)),g=o-r,y=z(Math.sqrt(u/c)),T=Math.abs(g)<5;s||(s=T?k.restSpeed.granular:k.restSpeed.default),i||(i=T?k.restDelta.granular:k.restDelta.default);let x,w,A,C,M,S;if(m<1)A=Fe(y,m),C=(d+m*y*g)/A,x=b=>{const L=Math.exp(-m*y*b);return o-L*(C*Math.sin(A*b)+g*Math.cos(A*b))},M=m*y*C+g*A,S=m*y*g-C*A,w=b=>Math.exp(-m*y*b)*(M*Math.sin(A*b)+S*Math.cos(A*b));else if(m===1){x=L=>o-Math.exp(-y*L)*(g+(d+y*g)*L);const b=d+y*g;w=L=>Math.exp(-y*L)*(y*b*L-d)}else{const b=y*Math.sqrt(m*m-1);x=X=>{const nt=Math.exp(-m*y*X),q=Math.min(b*X,300);return o-nt*((d+m*y*g)*Math.sinh(q)+b*g*Math.cosh(q))/b};const L=(d+m*y*g)/b,F=m*y*L-g*b,et=m*y*g-L*b;w=X=>{const nt=Math.exp(-m*y*X),q=Math.min(b*X,300);return nt*(F*Math.sinh(q)+et*Math.cosh(q))}}const V={calculatedDuration:p&&h||null,velocity:b=>K(w(b)),next:b=>{if(!p&&m<1){const F=Math.exp(-m*y*b),et=Math.sin(A*b),X=Math.cos(A*b),nt=o-F*(C*et+g*X),q=K(F*(M*et+S*X));return a.done=Math.abs(q)<=s&&Math.abs(o-nt)<=i,a.value=a.done?o:nt,a}const L=x(b);if(p)a.done=b>=h;else{const F=K(w(b));a.done=Math.abs(F)<=s&&Math.abs(o-L)<=i}return a.value=a.done?o:L,a},toString:()=>{const b=Math.min(wn(V),se),L=Li(F=>V.next(b*F).value,b,30);return b+"ms "+L},toTransition:()=>{}};return V}ie.applyToOptions=t=>{const e=Ur(t,100,ie);return t.ease=e.ease,t.duration=K(e.duration),t.type="keyframes",t};const Yr=5;function ki(t,e,n){const s=Math.max(e-Yr,0);return fi(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:u,restDelta:l=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},p=S=>a!==void 0&&S<a||u!==void 0&&S>u,d=S=>a===void 0?u:u===void 0||Math.abs(a-S)<Math.abs(u-S)?a:u;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const T=S=>-m*Math.exp(-S/s),x=S=>y+T(S),w=S=>{const V=T(S),b=x(S);f.done=Math.abs(V)<=l,f.value=f.done?y:b};let A,C;const M=S=>{p(f.value)&&(A=S,C=ie({keyframes:[f.value,d(f.value)],velocity:ki(x,S,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:c}))};return M(0),{calculatedDuration:null,next:S=>{let V=!1;return!C&&A===void 0&&(V=!0,w(S),M(S)),A!==void 0&&S>=A?C.next(S-A):(!V&&w(S),f)}}}function Xr(t,e,n){const s=[],i=n||ot.mix||Ri,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||H:e;a=jt(u,a)}s.push(a)}return s}function qr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(dn(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=Xr(e,s,i),u=a.length,l=c=>{if(o&&c<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Lt(t[h],t[h+1],c);return a[h](f)};return n?c=>l(tt(t[0],t[r-1],c)):l}function Zr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Lt(0,e,s);t.push(D(n,1,i))}}function Jr(t){const e=[0];return Zr(e,t.length-1),e}function Qr(t,e){return t.map(n=>n*e)}function ta(t,e){return t.map(()=>e||wi).splice(0,t.length-1)}function Et({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=lr(s)?s.map(Un):Un(s),r={done:!1,value:e[0]},o=Qr(n&&n.length===e.length?n:Jr(e),t),a=qr(o,e,{ease:Array.isArray(i)?i:ta(e,i)});return{calculatedDuration:t,next:u=>(r.value=a(u),r.done=u>=t,r)}}const ea=t=>t!==null;function de(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ea),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const na={decay:je,inertia:je,tween:Et,keyframes:Et,spring:ie};function Ii(t){typeof t.type=="string"&&(t.type=na[t.type])}class Pn{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 sa=t=>t/100;class oe extends Pn{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!==W.now()&&this.tick(W.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;Ii(e);const{type:n=Et,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const u=n||Et;u!==Et&&typeof a[0]!="number"&&(this.mixKeyframes=jt(sa,Ri(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wn(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+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:u}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:p,type:d,onUpdate:m,finalKeyframe:g}=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 y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,w=s;if(h){const S=Math.min(this.currentTime,i)/a;let V=Math.floor(S),b=S%1;!b&&S>=1&&(b=1),b===1&&V--,V=Math.min(V,h+1),V%2&&(f==="reverse"?(b=1-b,p&&(b-=p/a)):f==="mirror"&&(w=o)),x=tt(0,1,b)*a}let A;T?(this.delayState.value=c[0],A=this.delayState):A=w.next(x),r&&!T&&(A.value=r(A.value));let{done:C}=A;!T&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return M&&d!==je&&(A.value=de(c,this.options,g,this.speed)),m&&m(A.value),M&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return z(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(this.currentTime)}set time(e){e=K(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 ki(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(W.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=z(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Wr,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(W.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 ia(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,Oe=t=>{const e=ft(Math.atan2(t[1],t[0]));return Ne(e)},oa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Oe,rotateZ:Oe,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ne=t=>(t=t%360,t<0&&(t+=360),t),Yn=Oe,Xn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),qn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ra={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xn,scaleY:qn,scale:t=>(Xn(t)+qn(t))/2,rotateX:t=>Ne(ft(Math.atan2(t[6],t[5]))),rotateY:t=>Ne(ft(Math.atan2(-t[2],t[0]))),rotateZ:Yn,rotate:Yn,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function We(t){return t.includes("scale")?1:0}function Ue(t,e){if(!t||t==="none")return We(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=ra,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=oa,i=a}if(!i)return We(e);const r=s[e],o=i[1].split(",").map(la);return typeof r=="function"?r(o):o[r]}const aa=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ue(n,e)};function la(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=new Set([...bt,"pathRotation"]),Zn=t=>t===St||t===P,ca=new Set(["x","y","z"]),ua=bt.filter(t=>!ca.has(t));function ha(t){const e=[];return ua.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={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})=>Ue(e,"x"),y:(t,{transform:e})=>Ue(e,"y")};it.translateX=it.x;it.translateY=it.y;const dt=new Set;let Ke=!1,$e=!1,ze=!1;function Bi(){if($e){const t=Array.from(dt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ha(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)})}$e=!1,Ke=!1,dt.forEach(t=>t.complete(ze)),dt.clear()}function Fi(){dt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&($e=!0)})}function fa(){ze=!0,Fi(),Bi(),ze=!1}class Sn{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?(dt.add(this),Ke||(Ke=!0,R.read(Fi),R.resolveKeyframes(Bi))):(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])}ia(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),dt.delete(this)}cancel(){this.state==="scheduled"&&(dt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const da=t=>t.startsWith("--");function ji(t,e,n){da(e)?t.style.setProperty(e,n):t.style[e]=n}const pa={};function Oi(t,e){const n=hi(t);return()=>pa[e]??n()}const ma=Oi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ni=Oi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vt([0,.65,.55,1]),circOut:Vt([.55,0,1,.45]),backIn:Vt([.31,.01,.66,-.59]),backOut:Vt([.33,1.53,.69,.99])};function Wi(t,e){if(t)return typeof t=="function"?Ni()?Li(t,e):"ease-out":Pi(t)?Vt(t):Array.isArray(t)?t.map(n=>Wi(n,e)||Jn.easeOut):Jn[t]}function ga(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=Wi(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(c,f)}function Ui(t){return typeof t=="function"&&"applyToOptions"in t}function ya({type:t,...e}){return Ui(t)&&Ni()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ki extends Pn{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:u}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,dn(typeof e.type!="string");const l=ya(e);this.animation=ga(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=de(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),ji(n,s,c),this.animation.cancel()}u?.(),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 z(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(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&&ma()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),H):i(this)}}const $i={anticipate:vi,backInOut:yi,circInOut:Ti};function va(t){return t in $i}function xa(t){typeof t.ease=="string"&&va(t.ease)&&(t.ease=$i[t.ease])}const Pe=10;class Ta extends Ki{constructor(e){xa(e),Ii(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 oe({...o,autoplay:!1}),u=Math.max(Pe,W.now()-this.startTime),l=tt(0,Pe,u-Pe),c=a.sample(u).value,{name:h}=this.options;r&&h&&ji(r,h,c),n.setWithVelocity(a.sample(Math.max(0,u-l)).value,c,l),a.stop()}}const Qn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Y.test(t)||t==="0")&&!t.startsWith("url("));function wa(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 Pa(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=Qn(i,e),a=Qn(r,e);return!o||!a?!1:wa(t)||(n==="spring"||Ui(n))&&s}function He(t){t.duration=0,t.type="keyframes"}const zi=new Set(["opacity","clipPath","filter","transform"]),Sa=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ba(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Sa.test(t[e]))return!0;return!1}const Aa=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ca=hi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Va(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:c}=e.owner.getProps();return Ca()&&n&&(zi.has(n)||Aa.has(n)&&ba(a))&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const Ma=40;class Ea extends Pn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=W.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:u,motionValue:l,element:c,...h},p=c?.KeyframeResolver||Sn;this.keyframeResolver=new p(a,(d,m,g)=>this.onKeyframesResolved(d,m,f,!g),u,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=s;this.resolvedAt=W.now();let h=!0;Pa(e,r,o,a)||(h=!1,(ot.instantAnimations||!u)&&c?.(de(e,s,n)),e[0]=e[e.length-1],He(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ma?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=h&&!l&&Va(p),m=p.motionValue?.owner?.current;let g;if(d)try{g=new Ta({...p,element:m})}catch{g=new oe(p)}else g=new oe(p);g.finished.then(()=>{this.notifyFinished()}).catch(H),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),fa()),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 Hi(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,c)=>l.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const ts=30,Da=t=>!isNaN(parseFloat(t));class Ra{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=W.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=W.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Da(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 pn);const s=this.events[e].add(n);return e==="change"?()=>{s(),R.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=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ts)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ts);return fi(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 Pt(t,e){return new Ra(t,e)}function _i(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function bn(t,e){const n=t?.[e]??t?.default??t;return n!==t?_i(n,t):n}const La={type:"spring",stiffness:500,damping:25,restSpeed:10},ka=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ia={type:"keyframes",duration:.8},Ba={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fa=(t,{keyframes:e})=>e.length>2?Ia:At.has(t)?t.startsWith("scale")?ka(e[1]):La:Ba,ja=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Oa(t){for(const e in t)if(!ja.has(e))return!0;return!1}const An=(t,e,n,s={},i,r)=>o=>{const a=bn(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-K(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Oa(a)||Object.assign(c,Fa(t,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(He(c),c.delay===0&&(h=!0)),(ot.instantAnimations||ot.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,He(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=de(c.keyframes,a);if(f!==void 0){R.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new oe(c):new Ea(c)},Na=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wa(t){const e=Na.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Gi(t,e,n=1){const[s,i]=Wa(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return li(o)?parseFloat(o):o}return yn(i)?Gi(i,e,n+1):i}function es(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Cn(t,e,n,s){if(typeof e=="function"){const[i,r]=es(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]=es(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function pt(t,e,n){const s=t.getProps();return Cn(s,e,n!==void 0?n:s.custom,t)}const Yi=new Set(["width","height","top","left","right","bottom",...bt]),_e=t=>Array.isArray(t);function Ua(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pt(n))}function Ka(t){return _e(t)?t[t.length-1]||0:t}function $a(t,e){const n=pt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ka(r[o]);Ua(t,o,a)}}const N=t=>!!(t&&t.getVelocity);function za(t){return!!(N(t)&&t.add)}function Ge(t,e){const n=t.getValue("willChange");if(za(n))return n.add(e);if(!n&&ot.WillChange){const s=new ot.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Vn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ha="framerAppearId",Xi="data-"+Vn(Ha);function qi(t){return t.props[Xi]}function _a({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Zi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?_i(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;s&&(r=s);const h=[],f=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const d in a){const m=t.getValue(d,t.latestValues[d]??null),g=a[d];if(g===void 0||f&&_a(f,d))continue;const y={delay:n,...bn(r||{},d)};c&&(y.skipAnimations=!0);const T=m.get();if(T!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===T&&!y.velocity){R.update(()=>m.set(g));continue}let x=!1;if(window.MotionHandoffAnimation){const C=qi(t);if(C){const M=window.MotionHandoffAnimation(C,d,R);M!==null&&(y.startTime=M,x=!0)}}Ge(t,d);const w=l??t.shouldReduceMotion;m.start(An(d,m,g,w&&Yi.has(d)?{type:!1}:y,t,x));const A=m.animation;A&&h.push(A)}if(o){const d=()=>R.update(()=>{o&&$a(t,o)});h.length?Promise.all(h).then(d):d()}return h}function Ye(t,e,n={}){const s=pt(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(Zi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:l=0,staggerChildren:c,staggerDirection:h}=i;return Ga(t,e,u,l,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,l]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>l())}else return Promise.all([r(),o(n.delay)])}function Ga(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Ye(u,e,{...o,delay:n+(typeof s=="function"?0:s)+Hi(t.variantChildren,u,s,i,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Ya(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ye(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ye(t,e,n);else{const i=typeof e=="function"?pt(t,e,n.custom):e;s=Promise.all(Zi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Xa={test:t=>t==="auto",parse:t=>t},Ji=t=>e=>e.test(t),Qi=[St,P,Q,st,wr,Tr,Xa],ns=t=>Qi.find(Ji(t));function qa(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ui(t):!0}const Za=new Set(["brightness","contrast","saturate","opacity"]);function Ja(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(vn)||[];if(!s)return t;const i=n.replace(s,"");let r=Za.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Qa=/\b([a-z-]*)\(.*?\)/gu,Xe={...Y,getAnimatableNone:t=>{const e=t.match(Qa);return e?e.map(Ja).join(" "):t}},qe={...Y,getAnimatableNone:t=>{const e=Y.parse(t);return Y.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},ss={...St,transform:Math.round},tl={rotate:st,pathRotation:st,rotateX:st,rotateY:st,rotateZ:st,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:st,skewX:st,skewY:st,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:kt,originX:$n,originY:$n,originZ:P},re={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,...tl,zIndex:ss,fillOpacity:kt,strokeOpacity:kt,numOctaves:ss},el={...re,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Xe,WebkitFilter:Xe,mask:qe,WebkitMask:qe},to=t=>el[t],nl=new Set([Xe,qe]);function eo(t,e){let n=to(t);return nl.has(n)||(n=Y),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const sl=new Set(["auto","none","0"]);function il(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!sl.has(r)&&wt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=eo(n,i)}class ol extends Sn{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 c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),yn(h))){const f=Gi(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Yi.has(s)||e.length!==2)return;const[i,r]=e,o=ns(i),a=ns(r),u=Kn(i),l=Kn(r);if(u!==l&&it[s]){this.needsMeasurement=!0;return}if(o!==a)if(Zn(o)&&Zn(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else it[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||qa(e[i]))&&s.push(i);s.length&&il(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=it[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]=it[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function no(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 Ze=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Gt(t){return ci(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Mn}=Si(queueMicrotask,!1),G={x:!1,y:!1};function so(){return G.x||G.y}function rl(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function io(t,e){const n=no(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function al(t){return!(t.pointerType==="touch"||so())}function ll(t,e,n={}){const[s,i,r]=io(t,n);return s.forEach(o=>{let a=!1,u=!1,l;const c=()=>{o.removeEventListener("pointerleave",d)},h=g=>{l&&(l(g),l=void 0),c()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(g))},p=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},d=g=>{if(g.pointerType!=="touch"){if(a){u=!0;return}h(g)}},m=g=>{if(!al(g))return;u=!1;const y=e(o,g);typeof y=="function"&&(l=y,o.addEventListener("pointerleave",d,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",p,i)}),r}const oo=(t,e)=>e?t===e?!0:oo(t,e.parentElement):!1,En=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,cl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(t){return cl.has(t.tagName)||t.isContentEditable===!0}const hl=new Set(["INPUT","SELECT","TEXTAREA"]);function fl(t){return hl.has(t.tagName)||t.isContentEditable===!0}const Yt=new WeakSet;function is(t){return e=>{e.key==="Enter"&&t(e)}}function Se(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const dl=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=is(()=>{if(Yt.has(n))return;Se(n,"down");const i=is(()=>{Se(n,"up")}),r=()=>Se(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 os(t){return En(t)&&!so()}const rs=new WeakSet;function pl(t,e,n={}){const[s,i,r]=io(t,n),o=a=>{const u=a.currentTarget;if(!os(a)||rs.has(a))return;Yt.add(u),n.stopPropagation&&rs.add(a);const l=e(u,a),c={...i,capture:!0},h=(d,m)=>{window.removeEventListener("pointerup",f,c),window.removeEventListener("pointercancel",p,c),Yt.has(u)&&Yt.delete(u),os(d)&&typeof l=="function"&&l(d,{success:m})},f=d=>{h(d,u===window||u===document||n.useGlobalTarget||oo(u,d.target))},p=d=>{h(d,!1)};window.addEventListener("pointerup",f,c),window.addEventListener("pointercancel",p,c)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Gt(a)&&(a.addEventListener("focus",l=>dl(l,i)),!ul(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Dn(t){return ci(t)&&"ownerSVGElement"in t}const Xt=new WeakMap;let qt;const ro=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Dn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],ml=ro("inline","width","offsetWidth"),gl=ro("block","height","offsetHeight");function yl({target:t,borderBoxSize:e}){Xt.get(t)?.forEach(n=>{n(t,{get width(){return ml(t,e)},get height(){return gl(t,e)}})})}function vl(t){t.forEach(yl)}function xl(){typeof ResizeObserver>"u"||(qt=new ResizeObserver(vl))}function Tl(t,e){qt||xl();const n=no(t);return n.forEach(s=>{let i=Xt.get(s);i||(i=new Set,Xt.set(s,i)),i.add(e),qt?.observe(s)}),()=>{n.forEach(s=>{const i=Xt.get(s);i?.delete(e),i?.size||qt?.unobserve(s)})}}const Zt=new Set;let vt;function wl(){vt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zt.forEach(e=>e(t))},window.addEventListener("resize",vt)}function Pl(t){return Zt.add(t),vt||wl(),()=>{Zt.delete(t),!Zt.size&&typeof vt=="function"&&(window.removeEventListener("resize",vt),vt=void 0)}}function as(t,e){return typeof t=="function"?Pl(t):Tl(t,e)}function Sl(t){return Dn(t)&&t.tagName==="svg"}const bl=[...Qi,I,Y],Al=t=>bl.find(Ji(t)),ls=()=>({translate:0,scale:1,origin:0,originPoint:0}),xt=()=>({x:ls(),y:ls()}),cs=()=>({min:0,max:0}),B=()=>({x:cs(),y:cs()}),Cl=new WeakMap;function pe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function It(t){return typeof t=="string"||Array.isArray(t)}const Rn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ln=["initial",...Rn];function me(t){return pe(t.animate)||Ln.some(e=>It(t[e]))}function ao(t){return!!(me(t)||t.variants)}function Vl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(N(i))t.addValue(s,i);else if(N(r))t.addValue(s,Pt(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,Pt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ae={current:null},kn={current:!1},Ml=typeof window<"u";function lo(){if(kn.current=!0,!!Ml)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ae.current=t.matches;t.addEventListener("change",e),e()}else ae.current=!1}const us=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let le={};function co(t){le=t}function El(){return le}class Dl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},u={}){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=Sn,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=W.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,R.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=me(n),this.isVariantNode=ao(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const d=f[p];l[p]!==void 0&&N(d)&&d.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,Cl.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:(kn.current||lo(),this.shouldReduceMotion=ae.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(),rt(this.notifyUpdate),rt(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&&zi.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:u,ease:l,duration:c}=n.accelerate,h=new Ki({element:this.current,name:e,keyframes:a,times:u,ease:l,duration:K(c)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=At.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&R.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 le){const n=le[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):B()}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<us.length;s++){const i=us[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=Vl(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=Pt(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"&&(li(s)||ui(s))?s=parseFloat(s):!Al(s)&&Y.test(n)&&(s=eo(e,n)),this.setBaseTarget(e,N(s)?s.get():s)),N(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=Cn(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&&!N(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 pn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Mn.render(this.render)}}class uo extends Dl{constructor(){super(...arguments),this.KeyframeResolver=ol}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;N(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ho({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Rl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ll(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 be(t){return t===void 0||t===1}function Je({scale:t,scaleX:e,scaleY:n}){return!be(t)||!be(e)||!be(n)}function ut(t){return Je(t)||fo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function fo(t){return hs(t.x)||hs(t.y)}function hs(t){return t&&t!=="0%"}function ce(t,e,n){const s=t-n,i=e*s;return n+i}function fs(t,e,n,s,i){return i!==void 0&&(t=ce(t,i,s)),ce(t,n,s)+e}function Qe(t,e=0,n=1,s,i){t.min=fs(t.min,e,n,s,i),t.max=fs(t.max,e,n,s,i)}function po(t,{x:e,y:n}){Qe(t.x,e.translate,e.scale,e.originPoint),Qe(t.y,n.translate,n.scale,n.originPoint)}const ds=.999999999999,ps=1.0000000000001;function kl(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:u}=r.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(J(t.x,-r.scroll.offset.x),J(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,po(t,o)),s&&ut(r.latestValues)&&Jt(t,r.latestValues,r.layout?.layoutBox))}e.x<ps&&e.x>ds&&(e.x=1),e.y<ps&&e.y>ds&&(e.y=1)}function J(t,e){t.min+=e,t.max+=e}function ms(t,e,n,s,i=.5){const r=D(t.min,t.max,i);Qe(t,e,n,r,s)}function gs(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Jt(t,e,n){const s=n??t;ms(t.x,gs(e.x,s.x),e.scaleX,e.scale,e.originX),ms(t.y,gs(e.y,s.y),e.scaleY,e.scale,e.originY)}function mo(t,e){return ho(Ll(t.getBoundingClientRect(),e))}function Il(t,e,n){const s=mo(t,n),{scroll:i}=e;return i&&(J(s.x,i.offset.x),J(s.y,i.offset.y)),s}const Bl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fl=bt.length;function jl(t,e,n){let s="",i=!0;for(let o=0;o<Fl;o++){const a=bt[o],u=t[a];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(a.startsWith("scale")?1:0);else{const c=parseFloat(u);l=a.startsWith("scale")?c===1:c===0}if(!l||n){const c=Ze(u,re[a]);if(!l){i=!1;const h=Bl[a]||a;s+=`${h}(${c}) `}n&&(e[a]=c)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${Ze(r,re.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function In(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const u in e){const l=e[u];if(At.has(u)){o=!0;continue}else if(Ai(u)){i[u]=l;continue}else{const c=Ze(l,re[u]);u.startsWith("origin")?(a=!0,r[u]=c):s[u]=c}}if(e.transform||(o||n?s.transform=jl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:u="50%",originY:l="50%",originZ:c=0}=r;s.transformOrigin=`${u} ${l} ${c}`}}function go(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 ys(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ct={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=ys(t,e.target.x),s=ys(t,e.target.y);return`${n}% ${s}%`}},Ol={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Y.parse(t);if(i.length>5)return s;const r=Y.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=u;const l=D(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),r(i)}},tn={borderRadius:{...Ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomLeftRadius:Ct,borderBottomRightRadius:Ct,boxShadow:Ol};function yo(t,{layout:e,layoutId:n}){return At.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!tn[t]||t==="opacity")}function Bn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(N(s[o])||i&&N(i[o])||yo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Nl(t){return window.getComputedStyle(t)}class Wl extends uo{constructor(){super(...arguments),this.type="html",this.renderInstance=go}readValueFromInstance(e,n){if(At.has(n))return this.projection?.isProjecting?We(n):aa(e,n);{const s=Nl(e),i=(Ai(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return mo(e,n)}build(e,n,s){In(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Bn(e,n,s)}}const Ul={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kl={offset:"strokeDashoffset",array:"strokeDasharray"};function $l(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ul:Kl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const zl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function vo(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},u,l,c){if(In(t,a,l),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const p of zl)h[p]!==void 0&&(f[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&&$l(h,i,r,o,!1)}const xo=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"]),To=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Hl(t,e,n,s){go(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(xo.has(i)?i:Vn(i),e.attrs[i])}function wo(t,e,n){const s=Bn(t,e,n);for(const i in t)if(N(t[i])||N(e[i])){const r=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class _l extends uo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(At.has(n)){const s=to(n);return s&&s.default||0}return n=xo.has(n)?n:Vn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return wo(e,n,s)}build(e,n,s){vo(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Hl(e,n,s,i)}mount(e){this.isSVGTag=To(e.tagName),super.mount(e)}}const Gl=Ln.length;function Po(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Po(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Gl;n++){const s=Ln[n],i=t.props[s];(It(i)||i===!1)&&(e[s]=i)}return e}function So(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 Yl=[...Rn].reverse(),Xl=Rn.length;function ql(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ya(t,n,s)))}function Zl(t){let e=ql(t),n=vs(),s=!0,i=!1;const r=l=>(c,h)=>{const f=pt(t,h,l==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:p,transitionEnd:d,...m}=f;c={...c,...m,...d}}return c};function o(l){e=l(t)}function a(l){const{props:c}=t,h=Po(t.parent)||{},f=[],p=new Set;let d={},m=1/0;for(let y=0;y<Xl;y++){const T=Yl[y],x=n[T],w=c[T]!==void 0?c[T]:h[T],A=It(w),C=T===l?x.isActive:null;C===!1&&(m=y);let M=w===h[T]&&w!==c[T]&&A;if(M&&(s||i)&&t.manuallyAnimateOnMount&&(M=!1),x.protectedKeys={...d},!x.isActive&&C===null||!w&&!x.prevProp||pe(w)||typeof w=="boolean")continue;if(T==="exit"&&x.isActive&&C!==!0){x.prevResolvedValues&&(d={...d,...x.prevResolvedValues});continue}const S=Jl(x.prevProp,w);let V=S||T===l&&x.isActive&&!M&&A||y>m&&A,b=!1;const L=Array.isArray(w)?w:[w];let F=L.reduce(r(T),{});C===!1&&(F={});const{prevResolvedValues:et={}}=x,X={...et,...F},nt=j=>{V=!0,p.has(j)&&(b=!0,p.delete(j)),x.needsAnimating[j]=!0;const $=t.getValue(j);$&&($.liveStyle=!1)};for(const j in X){const $=F[j],lt=et[j];if(d.hasOwnProperty(j))continue;let mt=!1;_e($)&&_e(lt)?mt=!So($,lt)||S:mt=$!==lt,mt?$!=null?nt(j):p.add(j):$!==void 0&&p.has(j)?nt(j):x.protectedKeys[j]=!0}x.prevProp=w,x.prevResolvedValues=F,x.isActive&&(d={...d,...F}),(s||i)&&t.blockInitialAnimation&&(V=!1);const q=M&&S;V&&(!q||b)&&f.push(...L.map(j=>{const $={type:T};if(typeof j=="string"&&(s||i)&&!q&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,mt=pt(lt,j);if(lt.enteringChildren&&mt){const{delayChildren:Go}=mt.transition||{};$.delay=Hi(lt.enteringChildren,t,Go)}}return{animation:j,options:$}}))}if(p.size){const y={};if(typeof c.initial!="boolean"){const T=pt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);T&&T.transition&&(y.transition=T.transition)}p.forEach(T=>{const x=t.getBaseTarget(T),w=t.getValue(T);w&&(w.liveStyle=!0),y[T]=x??null}),f.push({animation:y})}let g=!!f.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function u(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const h=a(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=vs(),i=!0}}}function Jl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!So(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vs(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function en(t,e){t.min=e.min,t.max=e.max}function _(t,e){en(t.x,e.x),en(t.y,e.y)}function xs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const bo=1e-4,Ql=1-bo,tc=1+bo,Ao=.01,ec=0-Ao,nc=0+Ao;function U(t){return t.max-t.min}function sc(t,e,n){return Math.abs(t-e)<=n}function Ts(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ql&&t.scale<=tc||isNaN(t.scale))&&(t.scale=1),(t.translate>=ec&&t.translate<=nc||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){Ts(t.x,e.x,n.x,s?s.originX:void 0),Ts(t.y,e.y,n.y,s?s.originY:void 0)}function ws(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+U(e)}function ic(t,e,n,s){ws(t.x,e.x,n.x,s?.x),ws(t.y,e.y,n.y,s?.y)}function Ps(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+U(e)}function ue(t,e,n,s){Ps(t.x,e.x,n.x,s?.x),Ps(t.y,e.y,n.y,s?.y)}function Ss(t,e,n,s,i){return t-=e,t=ce(t,1/n,s),i!==void 0&&(t=ce(t,1/i,s)),t}function oc(t,e=0,n=1,s=.5,i,r=t,o=t){if(Q.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=Ss(t.min,e,n,a,i),t.max=Ss(t.max,e,n,a,i)}function bs(t,e,[n,s,i],r,o){oc(t,e[n],e[s],e[i],e.scale,r,o)}const rc=["x","scaleX","originX"],ac=["y","scaleY","originY"];function As(t,e,n,s){bs(t.x,e,rc,n?n.x:void 0,s?s.x:void 0),bs(t.y,e,ac,n?n.y:void 0,s?s.y:void 0)}function Cs(t){return t.translate===0&&t.scale===1}function Co(t){return Cs(t.x)&&Cs(t.y)}function Vs(t,e){return t.min===e.min&&t.max===e.max}function lc(t,e){return Vs(t.x,e.x)&&Vs(t.y,e.y)}function Ms(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Vo(t,e){return Ms(t.x,e.x)&&Ms(t.y,e.y)}function Es(t){return U(t.x)/U(t.y)}function Ds(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Z(t){return[t("x"),t("y")]}function cc(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:c,pathRotation:h,rotateX:f,rotateY:p,skewX:d,skewY:m}=n;l&&(s=`perspective(${l}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotate(${h}deg) `),f&&(s+=`rotateX(${f}deg) `),p&&(s+=`rotateY(${p}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(s+=`scale(${a}, ${u})`),s||"none"}const Mo=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],uc=Mo.length,Rs=t=>typeof t=="string"?parseFloat(t):t,Ls=t=>typeof t=="number"||P.test(t);function hc(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,fc(s)),t.opacityExit=D(e.opacity??1,0,dc(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<uc;o++){const a=Mo[o];let u=ks(e,a),l=ks(n,a);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||Ls(u)===Ls(l)?(t[a]=Math.max(D(Rs(u),Rs(l),s),0),(Q.test(l)||Q.test(u))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function ks(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const fc=Eo(0,.5,xi),dc=Eo(.5,.95,H);function Eo(t,e,n){return s=>s<t?0:s>e?1:n(Lt(t,e,s))}function pc(t,e,n){const s=N(t)?t:Pt(t);return s.start(An("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const mc=(t,e)=>t.depth-e.depth;class gc{constructor(){this.children=[],this.isDirty=!1}add(e){fn(this.children,e),this.isDirty=!0}remove(e){ee(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mc),this.isDirty=!1,this.children.forEach(e)}}function yc(t,e){const n=W.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(rt(s),t(r-e))};return R.setup(s,!0),()=>rt(s)}function Qt(t){return N(t)?t.get():t}class vc{constructor(){this.members=[]}add(e){fn(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&&(ee(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(ee(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 te={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ae=["","X","Y","Z"],xc=1e3;let Tc=0;function Ce(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Do(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=qi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",R,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Do(s)}function Ro({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Tc++,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(Sc),this.nodes.forEach(Ec),this.nodes.forEach(Dc),this.nodes.forEach(bc)},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 u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new gc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new pn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const u=this.eventHandlers.get(o);u&&u.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Dn(o)&&!Sl(o),this.instance=o;const{layoutId:a,layout:u,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&&(u||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;R.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,c&&c(),c=yc(f,250),te.hasAnimatedSinceResize&&(te.hasAnimatedSinceResize=!1,this.nodes.forEach(Fs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const d=this.options.transition||l.getDefaultTransition()||Bc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=l.getProps(),y=!this.targetLayout||!Vo(this.targetLayout,p),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...bn(d,"layout"),onPlay:m,onComplete:g};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(c,T,x.path)}else h||Fs(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(),rt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Rc),this.animationId++)}getTransformTemplate(){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&&Do(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];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:u}=this.options;if(a===void 0&&!u)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 u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(Cc),this.nodes.forEach(Is);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vc),this.nodes.forEach(Mc),this.nodes.forEach(wc),this.nodes.forEach(Pc)):this.nodes.forEach(Bs),this.clearAllSnapshots();const a=W.now();O.delta=tt(0,1e3/60,a-O.timestamp),O.timestamp=a,O.isProcessing=!0,ye.update.process(O),ye.preRender.process(O),ye.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ac),this.sharedNodes.forEach(Lc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,R.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){R.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=B()),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 u=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Co(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||ut(this.latestValues)||c)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return o&&(u=this.removeTransform(u)),Fc(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return B();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(jc))){const{scroll:l}=this.root;l&&(J(a.x,l.offset.x),J(a.y,l.offset.y))}return a}removeElementScroll(o){const a=B();if(_(a,o),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const l=this.path[u],{scroll:c,options:h}=l;l!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&_(a,o),J(a.x,c.offset.x),J(a.y,c.offset.y))}return a}applyTransform(o,a=!1,u){const l=u||B();_(l,o);for(let c=0;c<this.path.length;c++){const h=this.path[c];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(J(l.x,-h.scroll.offset.x),J(l.y,-h.scroll.offset.y)),ut(h.latestValues)&&Jt(l,h.latestValues,h.layout?.layoutBox)}return ut(this.latestValues)&&Jt(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=B();_(a,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!ut(l.latestValues))continue;let c;l.instance&&(Je(l.latestValues)&&l.updateSnapshot(),c=B(),_(c,l.measurePageBox())),As(a,l.latestValues,l.snapshot?.layoutBox,c)}return ut(this.latestValues)&&As(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!==O.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 u=!!this.resumingFrom||this!==a;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=O.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ic(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):_(this.target,this.layout.layoutBox),po(this.target,this.targetDelta)):_(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Je(this.parent.latestValues)||fo(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,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),ue(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),_(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===O.timestamp&&(u=!1),u)return;const{layout:l,layoutId:c}=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||c))return;_(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;kl(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=B());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xs(this.prevProjectionDelta.x,this.projectionDelta.x),xs(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ds(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ds(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=xt(),this.projectionDelta=xt(),this.projectionDeltaWithTransform=xt()}setAnimationOrigin(o,a=!1,u){const l=this.snapshot,c=l?l.latestValues:{},h={...this.latestValues},f=xt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=B(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=d!==m,y=this.getStack(),T=!y||y.members.length<=1,x=!!(g&&!T&&this.options.crossfade===!0&&!this.path.some(Ic));this.animationProgress=0;let w;const A=u?.interpolateProjection(o);this.mixTargetDelta=C=>{const M=C/1e3,S=A?.(M);S?(f.x.translate=S.x,f.x.scale=D(o.x.scale,1,M),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=S.y,f.y.scale=D(o.y.scale,1,M),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(js(f.x,o.x,M),js(f.y,o.y,M)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ue(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),kc(this.relativeTarget,this.relativeTargetOrigin,p,M),w&&lc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=B()),_(w,this.relativeTarget)),g&&(this.animationValues=h,hc(h,c,this.latestValues,M,x,T)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=S.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&&(rt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=R.update(()=>{te.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pt(0)),this.motionValue.jump(0,!1),this.currentAnimation=pc(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(xc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:c}=o;if(!(!a||!u||!l)){if(this!==o&&this.layout&&l&&Lo(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||B();const h=U(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const f=U(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}_(a,u),Jt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vc),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:u}={}){const l=this.getStack();l&&l.promote(this,u),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:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const l={};u.z&&Ce("z",o,l,this.animationValues);for(let c=0;c<Ae.length;c++)Ce(`rotate${Ae[c]}`,o,l,this.animationValues),Ce(`skew${Ae[c]}`,o,l,this.animationValues);o.render();for(const c in l)o.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Qt(a?.pointerEvents)||"",o.transform=u?u(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=Qt(a?.pointerEvents)||""),this.hasProjected&&!ut(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=cc(this.projectionDeltaWithTransform,this.treeScale,c);u&&(h=u(c,h)),o.transform=h;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=l===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const d in tn){if(c[d]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=tn[d],T=h==="none"?c[d]:m(c[d],l);if(g){const x=g.length;for(let w=0;w<x;w++)o[g[w]]=T}else y?this.options.visualElement.renderState.vars[d]=T:o[d]=T}this.options.layoutId&&(o.pointerEvents=l===this?Qt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Is),this.root.sharedNodes.clear()}}}function wc(t){t.updateLayout()}function Pc(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")Z(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=U(h);h.min=n[c].min,h.max=h.min+f});else if(i==="x"||i==="y"){const c=i==="x"?"y":"x";en(r?e.measuredBox[c]:e.layoutBox[c],n[c])}else Lo(i,e.layoutBox,n)&&Z(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=U(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const o=xt();Dt(o,n,e.layoutBox);const a=xt();r?Dt(a,t.applyTransform(s,!0),e.measuredBox):Dt(a,n,e.layoutBox);const u=!Co(o);let l=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const p=t.options.layoutAnchor||void 0,d=B();ue(d,e.layoutBox,h.layoutBox,p);const m=B();ue(m,n,f.layoutBox,p),Vo(d,m)||(l=!0),c.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Sc(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 bc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ac(t){t.clearSnapshot()}function Is(t){t.clearMeasurements()}function Cc(t){t.isLayoutDirty=!0,t.updateLayout()}function Bs(t){t.isLayoutDirty=!1}function Vc(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Mc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Fs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ec(t){t.resolveTargetDelta()}function Dc(t){t.calcProjection()}function Rc(t){t.resetSkewAndRotation()}function Lc(t){t.removeLeadSnapshot()}function js(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Os(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function kc(t,e,n,s){Os(t.x,e.x,n.x,s),Os(t.y,e.y,n.y,s)}function Ic(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Bc={duration:.45,ease:[.4,0,.1,1]},Ns=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ws=Ns("applewebkit/")&&!Ns("chrome/")?Math.round:H;function Us(t){t.min=Ws(t.min),t.max=Ws(t.max)}function Fc(t){Us(t.x),Us(t.y)}function Lo(t,e,n){return t==="position"||t==="preserve-aspect"&&!sc(Es(e),Es(n),.2)}function jc(t){return t!==t.root&&t.scroll?.wasRoot}const Oc=Ro({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ve={current:void 0},ko=Ro({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ve.current){const t=new Oc({});t.mount(window),t.setOptions({layoutScroll:!0}),Ve.current=t}return Ve.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Fn=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ks(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Nc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ks(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():Ks(t[i],null)}}}}function Wc(...t){return v.useCallback(Nc(...t),t)}class Uc extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Gt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Gt(s)&&s.offsetWidth||0,r=Gt(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 Kc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=v.useId(),a=v.useRef(null),u=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=v.useContext(Fn),c=t.props?.ref??t?.ref,h=Wc(a,c);return v.useInsertionEffect(()=>{const{width:f,height:p,top:d,left:m,right:g,bottom:y,direction:T}=u.current;if(e||r===!1||!a.current||!f||!p)return;const x=T==="rtl",w=n==="left"?x?`right: ${g}`:`left: ${m}`:x?`left: ${m}`:`right: ${g}`,A=s==="bottom"?`bottom: ${y}`:`top: ${d}`;a.current.dataset.motionPopId=o;const C=document.createElement("style");l&&(C.nonce=l);const M=i??document.head;return M.appendChild(C),C.sheet&&C.sheet.insertRule(`
2
- [data-motion-pop-id="${o}"] {
3
- position: absolute !important;
4
- width: ${f}px !important;
5
- height: ${p}px !important;
6
- ${w}px !important;
7
- ${A}px !important;
8
- }
9
- `),()=>{a.current?.removeAttribute("data-motion-pop-id"),M.contains(C)&&M.removeChild(C)}},[e]),E.jsx(Uc,{isPresent:e,childRef:a,sizeRef:u,pop:r,children:r===!1?t:v.cloneElement(t,{ref:h})})}const $c=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:u,root:l})=>{const c=un(zc),h=v.useId(),f=v.useRef(n),p=v.useRef(s);hn(()=>{f.current=n,p.current=s});let d=!0,m=v.useMemo(()=>(d=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:g=>{c.set(g,!0);for(const y of c.values())if(!y)return;s&&s()},register:g=>(c.set(g,!1),()=>{c.delete(g),!f.current&&!c.size&&p.current?.()})}),[n,c,s]);return r&&d&&(m={...m}),v.useMemo(()=>{c.forEach((g,y)=>c.set(y,!1))},[n]),v.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),t=E.jsx(Kc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:u,root:l,children:t}),E.jsx(fe.Provider,{value:m,children:t})};function zc(){return new Map}function Io(t=!0){const e=v.useContext(fe);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=v.useId();v.useEffect(()=>{if(t)return i(r)},[t]);const o=v.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const $t=t=>t.key||"";function $s(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const wh=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[c,h]=Io(o),f=v.useMemo(()=>$s(t),[t]),p=o&&!c?[]:f.map($t),d=v.useRef(!0),m=v.useRef(f),g=un(()=>new Map),y=v.useRef(new Set),[T,x]=v.useState(f),[w,A]=v.useState(f);hn(()=>{d.current=!1,m.current=f;for(let S=0;S<w.length;S++){const V=$t(w[S]);p.includes(V)?(g.delete(V),y.current.delete(V)):g.get(V)!==!0&&g.set(V,!1)}},[w,p.length,p.join("-")]);const C=[];if(f!==T){let S=[...f];for(let V=0;V<w.length;V++){const b=w[V],L=$t(b);p.includes(L)||(S.splice(V,0,b),C.push(b))}return r==="wait"&&C.length&&(S=C),A($s(S)),x(f),null}const{forceRender:M}=v.useContext(cn);return E.jsx(E.Fragment,{children:w.map(S=>{const V=$t(S),b=o&&!c?!1:f===w||p.includes(V),L=()=>{if(y.current.has(V))return;if(g.has(V))y.current.add(V),g.set(V,!0);else return;let F=!0;g.forEach(et=>{et||(F=!1)}),F&&(M?.(),A(m.current),o&&h?.(),s&&s())};return E.jsx($c,{isPresent:b,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:b?void 0:L,anchorX:a,anchorY:u,children:S},V)})})},Bo=v.createContext({strict:!1}),zs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Hs=!1;function Hc(){if(Hs)return;const t={};for(const e in zs)t[e]={isEnabled:n=>zs[e].some(s=>!!n[s])};co(t),Hs=!0}function Fo(){return Hc(),El()}function _c(t){const e=Fo();for(const n in t)e[n]={...e[n],...t[n]};co(e)}const Gc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function he(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Gc.has(t)}let jo=t=>!he(t);function Yc(t){typeof t=="function"&&(jo=e=>e.startsWith("on")?!he(e):t(e))}try{Yc(require("@emotion/is-prop-valid").default)}catch{}function Xc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||N(t[i])||(jo(i)||n===!0&&he(i)||!e&&!he(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const ge=v.createContext({});function qc(t,e){if(me(t)){const{initial:n,animate:s}=t;return{initial:n===!1||It(n)?n:void 0,animate:It(s)?s:void 0}}return t.inherit!==!1?e:{}}function Zc(t){const{initial:e,animate:n}=qc(t,v.useContext(ge));return v.useMemo(()=>({initial:e,animate:n}),[_s(e),_s(n)])}function _s(t){return Array.isArray(t)?t.join(" "):t}const jn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Oo(t,e,n){for(const s in e)!N(e[s])&&!yo(s,n)&&(t[s]=e[s])}function Jc({transformTemplate:t},e){return v.useMemo(()=>{const n=jn();return In(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Qc(t,e){const n=t.style||{},s={};return Oo(s,n,t),Object.assign(s,Jc(t,e)),s}function tu(t,e){const n={},s=Qc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const No=()=>({...jn(),attrs:{}});function eu(t,e,n,s){const i=v.useMemo(()=>{const r=No();return vo(r,e,To(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Oo(r,t.style,t),i.style={...r,...i.style}}return i}const nu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function On(t){return typeof t!="string"||t.includes("-")?!1:!!(nu.indexOf(t)>-1||/[A-Z]/u.test(t))}function su(t,e,n,{latestValues:s},i,r=!1,o){const u=(o??On(t)?eu:tu)(e,s,i,t),l=Xc(e,typeof t=="string",r),c=t!==v.Fragment?{...l,...u,ref:n}:{},{children:h}=e,f=v.useMemo(()=>N(h)?h.get():h,[h]);return v.createElement(t,{...c,children:f})}function iu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:ou(n,s,i,t),renderState:e()}}function ou(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Qt(r[f]);let{initial:o,animate:a}=t;const u=me(t),l=ao(t);e&&l&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!pe(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const d=Cn(t,f[p]);if(d){const{transitionEnd:m,transition:g,...y}=d;for(const T in y){let x=y[T];if(Array.isArray(x)){const w=c?x.length-1:0;x=x[w]}x!==null&&(i[T]=x)}for(const T in m)i[T]=m[T]}}}return i}const Wo=t=>(e,n)=>{const s=v.useContext(ge),i=v.useContext(fe),r=()=>iu(t,e,s,i);return n?r():un(r)},ru=Wo({scrapeMotionValuesFromProps:Bn,createRenderState:jn}),au=Wo({scrapeMotionValuesFromProps:wo,createRenderState:No}),lu=Symbol.for("motionComponentSymbol");function cu(t,e,n){const s=v.useRef(n);v.useInsertionEffect(()=>{s.current=n});const i=v.useRef(null);return v.useCallback(r=>{r&&t.onMount?.(r),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const Uo=v.createContext({});function gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function uu(t,e,n,s,i,r){const{visualElement:o}=v.useContext(ge),a=v.useContext(Bo),u=v.useContext(fe),l=v.useContext(Fn),c=l.reducedMotion,h=l.skipAnimations,f=v.useRef(null),p=v.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:r}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const d=f.current,m=v.useContext(Uo);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&hu(f.current,n,i,m);const g=v.useRef(!1);v.useInsertionEffect(()=>{d&&g.current&&d.update(n,u)});const y=n[Xi],T=v.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return hn(()=>{p.current=!0,d&&(g.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),T.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!T.current&&d.animationState&&d.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),T.current=!1),d.enteringChildren=void 0)}),d}function hu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutAnchor:c,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ko(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&gt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:u,layoutRoot:l,layoutAnchor:c})}function Ko(t){if(t)return t.options.allowProjection!==!1?t.projection:Ko(t.parent)}function Me(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&_c(s);const r=n?n==="svg":On(t),o=r?au:ru;function a(l,c){let h;const f={...v.useContext(Fn),...l,layoutId:fu(l)},{isStatic:p}=f,d=Zc(l),m=o(l,p);if(!p&&typeof window<"u"){du();const g=pu(f);h=g.MeasureLayout,d.visualElement=uu(t,m,f,i,g.ProjectionNode,r)}return E.jsxs(ge.Provider,{value:d,children:[h&&d.visualElement?E.jsx(h,{visualElement:d.visualElement,...f}):null,su(t,l,cu(m,d.visualElement,c),m,p,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=v.forwardRef(a);return u[lu]=t,u}function fu({layoutId:t}){const e=v.useContext(cn).id;return e&&t!==void 0?e+"-"+t:t}function du(t,e){v.useContext(Bo).strict}function pu(t){const e=Fo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function mu(t,e){if(typeof Proxy>"u")return Me;const n=new Map,s=(r,o)=>Me(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Me(o,void 0,t,e)),n.get(o))})}const gu=(t,e)=>e.isSVG??On(t)?new _l(e):new Wl(e,{allowProjection:t!==v.Fragment});class yu extends at{constructor(e){super(e),e.animationState||(e.animationState=Zl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();pe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let vu=0;class xu extends at{constructor(){super(...arguments),this.id=vu++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"||typeof r=="object"&&r!==null&&!Array.isArray(r)){const a=pt(this.node,r,o);if(a){const{transition:u,transitionEnd:l,...c}=a;for(const h in c)this.node.getValue(h)?.jump(c[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Tu={animation:{Feature:yu},exit:{Feature:xu}};function Wt(t){return{point:{x:t.pageX,y:t.pageY}}}const wu=t=>e=>En(e)&&t(e,Wt(e));function Rt(t,e,n,s){return Bt(t,e,wu(n),s)}const $o=({current:t})=>t?t.ownerDocument.defaultView:null,Gs=(t,e)=>Math.abs(t-e);function Pu(t,e){const n=Gs(t.x,e.x),s=Gs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ys=new Set(["auto","scroll"]);class zo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ee(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Pu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=d,{timestamp:T}=O;this.history.push({...y,timestamp:T});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=zt(m,this.transformPagePoint),R.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ee(d.type==="pointercancel"?this.lastMoveEventInfo:zt(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),y&&y(d,x)},!En(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const u=Wt(e),l=zt(u,this.transformPagePoint),{point:c}=l,{timestamp:h}=O;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ee(l,this.history));const p={passive:!0,capture:!0};this.removeListeners=jt(Rt(this.contextWindow,"pointermove",this.handlePointerMove,p),Rt(this.contextWindow,"pointerup",this.handlePointerUp,p),Rt(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ys.has(s.overflowX)||Ys.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),R.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rt(this.updatePoint)}}function zt(t,e){return e?{point:e(t.point)}:t}function Xs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ee({point:t},e){return{point:t,delta:Xs(t,Ho(e)),offset:Xs(t,Su(e)),velocity:bu(e,.1)}}function Su(t){return t[0]}function Ho(t){return t[t.length-1]}function bu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ho(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>K(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>K(e)*2&&(s=t[1]);const r=z(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Au(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function qs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Cu(t,{top:e,left:n,bottom:s,right:i}){return{x:qs(t.x,n,i),y:qs(t.y,e,s)}}function Zs(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Vu(t,e){return{x:Zs(t.x,e.x),y:Zs(t.y,e.y)}}function Mu(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=Lt(e.min,e.max-s,t.min):s>i&&(n=Lt(t.min,t.max-i,e.min)),tt(0,1,n)}function Eu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const nn=.35;function Du(t=nn){return t===!1?t=0:t===!0&&(t=nn),{x:Js(t,"left","right"),y:Js(t,"top","bottom")}}function Js(t,e,n){return{min:Qs(t,e),max:Qs(t,n)}}function Qs(t,e){return typeof t=="number"?t:t[e]||0}const Ru=new WeakMap;class Lu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Wt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:d,onDragStart:m}=this.getProps();if(p&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rl(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(y=>{let T=this.getAxisMotionValue(y).get()||0;if(Q.test(T)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[y];w&&(T=U(w)*(parseFloat(T)/100))}}this.originPoint[y]=T}),m&&R.update(()=>m(h,f),!1,!0),Ge(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:d,onDirectionLock:m,onDrag:g}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(d&&this.currentDirection===null){this.currentDirection=Iu(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&R.update(()=>g(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new zo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:$o(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&R.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ht(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Au(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&gt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Cu(s.layoutBox,e):this.constraints=!1,this.elastic=Du(n),i!==this.constraints&&!gt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&Z(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Eu(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=Il(s,i.root,this.visualElement.getTransformPagePoint());let o=Vu(i.layout.layoutBox,r);if(n){const a=n(Rl(o));this.hasMutatedConstraints=!!a,a&&(o=ho(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=Z(c=>{if(!Ht(c,n,this.currentDirection))return;let h=u&&u[c]||{};(o===!0||o===c)&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,d={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,d)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ge(this.visualElement,e),s.start(An(e,s,0,n,this.visualElement,!1))}stopAnimation(){Z(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Z(n=>{const{drag:s}=this.getProps();if(!Ht(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],u=r.get()||0;r.set(e[n]-D(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!gt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const u=a.get();i[o]=Mu({min:u,max:u},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Z(o=>{if(!Ht(o,e,null))return;const a=this.getAxisMotionValue(o),{min:u,max:l}=this.constraints[o];a.set(D(u,l,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ru.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",l=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=l.target,p=f!==e&&fl(f);c&&h&&!p&&this.start(l)});let s;const i=()=>{const{dragConstraints:l}=this.getProps();gt(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),s||(s=ku(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),R.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Z(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=l[h].translate,f.set(f.get()+l[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),u&&u(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=nn,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function ti(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function ku(t,e,n){const s=as(t,ti(n)),i=as(e,ti(n));return()=>{s(),i()}}function Ht(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Iu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Bu extends at{constructor(e){super(e),this.removeGroupControls=H,this.removeListeners=H,this.controls=new Lu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const De=t=>(e,n)=>{t&&R.update(()=>t(e,n),!1,!0)};class Fu extends at{constructor(){super(...arguments),this.removePointerDownListener=H}onPointerDown(e){this.session=new zo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$o(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:De(e),onStart:De(n),onMove:De(s),onEnd:(r,o)=>{delete this.session,i&&R.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Re=!1;class ju extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Re&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),te.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Re=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||R.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Mn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Re=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function _o(t){const[e,n]=Io(),s=v.useContext(cn);return E.jsx(ju,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(Uo),isPresent:e,safeToRemove:n})}const Ou={pan:{Feature:Fu},drag:{Feature:Bu,ProjectionNode:ko,MeasureLayout:_o}};function ei(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&R.postRender(()=>r(e,Wt(e)))}class Nu extends at{mount(){const{current:e}=this.node;e&&(this.unmount=ll(e,(n,s)=>(ei(this.node,s,"Start"),i=>ei(this.node,i,"End"))))}unmount(){}}class Wu extends at{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=jt(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ni(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&R.postRender(()=>r(e,Wt(e)))}class Uu extends at{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=pl(e,(i,r)=>(ni(this.node,r,"Start"),(o,{success:a})=>ni(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const sn=new WeakMap,Le=new WeakMap,Ku=t=>{const e=sn.get(t.target);e&&e(t)},$u=t=>{t.forEach(Ku)};function zu({root:t,...e}){const n=t||document;Le.has(n)||Le.set(n,{});const s=Le.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver($u,{root:t,...e})),s[i]}function Hu(t,e,n){const s=zu(e);return sn.set(t,n),s.observe(t),()=>{sn.delete(t),s.unobserve(t)}}const _u={some:0,all:1};class Gu extends at{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:_u[i]},a=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=l?c:h;f&&f(u)};this.stopObserver=Hu(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Yu(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Yu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Xu={inView:{Feature:Gu},tap:{Feature:Uu},focus:{Feature:Wu},hover:{Feature:Nu}},qu={layout:{ProjectionNode:ko,MeasureLayout:_o}},Zu={...Tu,...Xu,...Ou,...qu},Ph=mu(Zu,gu);function Sh(){!kn.current&&lo();const[t]=v.useState(ae.current);return t}function Ju(t){return t.shiftKey?{open:"none",select:"range"}:t.altKey?{open:"none",select:"toggle"}:t.metaKey||t.ctrlKey?{open:"new",select:"replace"}:{open:"same",select:"replace"}}function Qu(t,e,n,s,i){if(s==="toggle"){const r=t.includes(n);return{sel:r?t.filter(o=>o!==n):[...t,n],anchor:r?e:n}}if(s==="range"){const r=e&&i.includes(e)?e:n,o=i.indexOf(r),a=i.indexOf(n);return o<0||a<0?{sel:[n],anchor:n}:{sel:i.slice(Math.min(o,a),Math.max(o,a)+1),anchor:r}}return{sel:[n],anchor:n}}function bh(t){const[e,n]=v.useState([]),s=v.useRef(null),i=v.useRef(e);i.current=e;const r=()=>Array.from(t.current?.querySelectorAll("[data-sel-id]")??[]).map(a=>a.dataset.selId??"").filter(Boolean),o=(a,u)=>{i.current=a,s.current=u,n(a)};return{ids:e,has:a=>e.includes(a),click:(a,u)=>{const l=Ju(u),c=Qu(i.current,s.current,a,l.select,l.select==="range"?r():[]);return o(c.sel,c.anchor),l},batch:a=>i.current.length>1&&i.current.includes(a)?[...i.current]:[a],only:a=>o([a],a),clear:()=>o([],null)}}const on="forsion_tangu_recent_views",th=24;function eh(){try{const t=JSON.parse(localStorage.getItem(on)||"[]");return Array.isArray(t)?t.filter(e=>e&&e.key&&e.id):[]}catch{return[]}}const Ah=ai(t=>({items:eh(),record:e=>t(n=>{const s=[{...e,ts:Date.now()},...n.items.filter(i=>i.key!==e.key)].slice(0,th);try{localStorage.setItem(on,JSON.stringify(s))}catch{}return{items:s}}),remove:e=>t(n=>{const s=n.items.filter(i=>i.key!==e);try{localStorage.setItem(on,JSON.stringify(s))}catch{}return{items:s}})})),nh=14,sh=10.5,ih=4.5;function Nn(t){return nh+t*sh}function Ch(t){return Nn(t)-ih}const oh=18.4,rh=5.5;function Vh(t){return Nn(t)+oh+rh}const ah=1e3,lh=100,Ft=ai(t=>({anchor:null,lines:[],open:(e,n)=>t({anchor:e,lines:n}),close:()=>t({anchor:null,lines:[]})}));let rn,an=0,Wn=0;function si(t,e,n){const s=t.getBoundingClientRect();(async()=>{let i;try{i=await e()}catch{i=null}Wn!==n||!i?.length||Ft.getState().open(s,i)})()}function ii(t,e){window.clearTimeout(rn);const n=++Wn;an>0&&Date.now()-an<=lh?si(t,e,n):rn=window.setTimeout(()=>si(t,e,n),ah)}function Tt(){window.clearTimeout(rn),Wn++,Ft.getState().anchor&&(an=Date.now()),Ft.getState().close()}function Mh(t,e){const n={onMouseEnter:s=>ii(s.currentTarget,t),onMouseLeave:Tt};return e?.focus&&(n.onFocus=s=>{let i=!0;try{i=s.currentTarget.matches(":focus-visible")}catch{}i&&ii(s.currentTarget,t)},n.onBlur=Tt),n}function oi(t){return Xo(t,{year:"always"})}const ke=(t,e)=>Yo.getState().tr(t,e);async function Eh(t,e){const n=await window.tangu?.statPath?.(t).catch(()=>null);if(!n)return null;if(n.isDir)return[ke("tip.folder",{files:n.files??0,folders:n.folders??0})];const s=[e,ke("tip.modified",{t:oi(n.mtimeMs)})];return n.birthtimeMs&&s.push(ke("tip.created",{t:oi(n.birthtimeMs)})),s}function Dh(){const t=Ft(o=>o.anchor),e=Ft(o=>o.lines),n=v.useRef(null),[s,i]=v.useState(!1);if(v.useLayoutEffect(()=>{if(!t||!n.current)return;const o=n.current.offsetWidth;i(t.right+10+o>window.innerWidth-8)},[t,e]),v.useEffect(()=>{if(t)return window.addEventListener("scroll",Tt,!0),window.addEventListener("resize",Tt),()=>{window.removeEventListener("scroll",Tt,!0),window.removeEventListener("resize",Tt)}},[t]),!t)return null;const r=s?{right:window.innerWidth-t.left+10,top:t.top+t.height/2}:{left:t.right+10,top:t.top+t.height/2};return E.jsx("div",{ref:n,className:"amx-tip","data-flip":s||void 0,style:r,role:"tooltip",children:e.map((o,a)=>E.jsx("div",{className:a===0?"amx-tip-head":void 0,children:o},a))},`${t.top}:${e[0]}`)}function Rh({items:t}){return E.jsx(E.Fragment,{children:t.map(e=>E.jsxs("button",{type:"button",className:e.danger?"danger":void 0,"data-act":e.act,disabled:e.disabled,onClick:e.run,children:[e.icon," ",e.label]},e.id))})}function Lh({className:t,depth:e=1,style:n,title:s,lead:i,children:r,trailing:o,selId:a,as:u="div",elRef:l,...c}){const h=u;return E.jsxs(h,{ref:l,className:`t2s-srow${t?` ${t}`:""}`,"data-sel-id":a,title:s,style:{paddingLeft:Nn(e),...n},...c,children:[i!==void 0&&E.jsx("span",{className:"t2s-lead",children:i}),r,o]})}Zo({"phonelist.sec.pinned":{zh:"置顶",en:"Pinned"},"phonelist.sec.today":{zh:"今天",en:"Today"},"phonelist.sec.yesterday":{zh:"昨天",en:"Yesterday"},"phonelist.sec.week":{zh:"这一周",en:"This week"},"phonelist.sec.earlier":{zh:"更早",en:"Earlier"},"phonelist.hint.ok":{zh:"知道了",en:"Got it"},"phonelist.pull.idle":{zh:"下拉搜索",en:"Pull down to search"},"phonelist.pull.armed":{zh:"松开搜索",en:"Release to search"}});function kh(t,e=Date.now()){if(!t)return"earlier";const n=new Date(e);return n.setHours(0,0,0,0),t>=n.getTime()?"today":(n.setDate(n.getDate()-1),t>=n.getTime()?"yesterday":(n.setDate(n.getDate()-5),t>=n.getTime()?"week":"earlier"))}function Ih(t,e){const n=[];let s=null;for(const i of t){const r=e(i);r!==s&&(n.push({section:r}),s=r),n.push({item:i})}return n}function Bh({bucket:t}){return E.jsx("div",{className:"pl-sec",role:"heading","aria-level":3,"data-section":t,children:Jo(`phonelist.sec.${t}`)})}function Fh({label:t,items:e,value:n,onChange:s}){return E.jsx("div",{className:"pl-chips",role:"tablist","aria-label":t,children:e.map(i=>E.jsx("button",{type:"button",role:"tab","data-filter":i.id,"aria-selected":n===i.id,className:n===i.id?"on":void 0,onClick:()=>s(i.id),children:i.label},i.id))})}function jh({label:t,icon:e,onClick:n,onMenu:s}){return E.jsx("button",{type:"button",className:"pl-fab","data-act":"list-fab","aria-label":t,onClick:n,onContextMenu:s&&(i=>{i.preventDefault(),i.stopPropagation();const r=i.currentTarget.getBoundingClientRect();s({x:r.left,y:r.top})}),children:e})}function Oh(t){const e=t.target?.closest?.(".pl-swipe");for(const n of document.querySelectorAll(".pl-swipe"))n!==e&&n.scrollLeft>0&&n.scrollTo({left:0,behavior:"smooth"})}function Nh({actions:t,children:e}){const n=v.useRef(null);if(!t.length)return E.jsx(E.Fragment,{children:e});const s=()=>n.current?.scrollTo({left:0,behavior:"smooth"});return E.jsxs("div",{className:"pl-swipe",ref:n,onClickCapture:i=>{(n.current?.scrollLeft??0)<4||i.target.closest(".pl-swipe-acts")||(i.preventDefault(),i.stopPropagation(),s())},children:[e,E.jsx("div",{className:"pl-swipe-acts",children:t.map(i=>E.jsx("button",{type:"button",className:`pl-swipe-act${i.tone?` ${i.tone}`:""}`,"data-act":i.id,"aria-label":i.label,title:i.label,onClick:r=>{r.stopPropagation(),s(),i.run()},children:i.icon},i.id))})]})}const ch=84;function Wh(t,e){const n=v.useRef(e);n.current=e;const s=!!e;v.useEffect(()=>{const i=t.current;if(!i||!s)return;let r=-1,o=0;const a=f=>{o=f,f?i.style.setProperty("--pl-pull",f.toFixed(3)):i.style.removeProperty("--pl-pull"),i.toggleAttribute("data-pull-armed",f>=1)},u=f=>{r=i.scrollTop<=0&&f.touches.length===1?f.touches[0].clientY:-1},l=f=>{if(!(r<0)){if(i.scrollTop>0){r=-1,a(0);return}a(Math.max(0,Math.min(1.25,(f.touches[0].clientY-r)/ch)))}},c=()=>{r=-1,a(0)},h=()=>{const f=o>=1;c(),f&&n.current?.()};return i.addEventListener("touchstart",u,{passive:!0}),i.addEventListener("touchmove",l,{passive:!0}),i.addEventListener("touchend",h),i.addEventListener("touchcancel",c),()=>{i.removeEventListener("touchstart",u),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",h),i.removeEventListener("touchcancel",c),a(0)}},[t,s])}function Uh(){const{t}=ri();return E.jsx("div",{className:"pl-pull","aria-hidden":"true",children:E.jsxs("span",{className:"pl-pull-pill",children:[E.jsx(qo,{}),E.jsx("span",{className:"pl-pull-idle",children:t("phonelist.pull.idle")}),E.jsx("span",{className:"pl-pull-armed",children:t("phonelist.pull.armed")})]})})}function Kh({id:t,children:e}){const{t:n}=ri(),s=`forsion_phone_list_hint_${t}`,[i,r]=v.useState(()=>{try{return!localStorage.getItem(s)}catch{return!1}});return i?E.jsxs("div",{className:"pl-hint",role:"note","data-hint":t,children:[E.jsx("span",{children:e}),E.jsx("button",{type:"button",onClick:()=>{try{localStorage.setItem(s,"1")}catch{}r(!1)},children:n("phonelist.hint.ok")})]}):null}export{wh as A,mh as C,Dh as H,jh as L,gh as P,yh as S,xh as a,Fh as b,Kh as c,Rh as d,Lh as e,ke as f,Ch as g,Ah as h,bh as i,Eh as j,Tt as k,Wh as l,Ph as m,Vh as n,vh as o,Oh as p,Uh as q,Nn as r,kh as s,Mh as t,Sh as u,Bh as v,Ih as w,Nh as x};
@@ -1,2 +0,0 @@
1
- import{j as n,M as w,u as j,r as A}from"./index-BYUntVIZ.js";import{ig as I,t as f,u as g,i9 as N,ia as _,b as E,sj as T,ib as C,ic as b,ii as L,gd as O}from"./appStore-affnJoin.js";import{w as $,n as D}from"./viewportLock-tlT6H_Hc.js";import{C as M}from"./codingNavigation-CxdCK78-.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";import"./client-BqhpYbYL.js";import"./UnifiedPage-D7JTfABH.js";import"./MarkdownBlock-BHpDy2qQ.js";import"./index-Y2kzYlZq.js";import"./linkFollow-Msu1XH9v.js";import"./emoji-BPdA62d7.js";import"./listFold-CKxjyY5_.js";import"./book-open-CcXCToyx.js";import"./pageChrome-D-9npbUE.js";import"./upload-D20PZHXc.js";import"./SketchCard-BcXCdBAs.js";import"./arrow-up-right-R4P9Mmxz.js";import"./Chrome-amTcZNE4.js";import"./minus-CfoZ4oxr.js";import"./canvasPrefs-CSuX9aLF.js";import"./hand-DRu7IJdU.js";import"./type-DmIL6FB-.js";import"./foldActions-BcyvNVBs.js";import"./lock-kffGfeHt.js";import"./undo-2-yMeXc8Wi.js";import"./code-xml-DdR58F83.js";import"./message-square-plus-DxBPIhPS.js";import"./RunLocationPicker-CadYiE7C.js";import"./codeStudioStore-Dq5i8nbE.js";import"./RightPanel-BRexwQ3W.js";import"./folder-plus-BJKT1Pqg.js";import"./folder-CCZqnwRc.js";import"./pencil-DGiTRzW1.js";import"./phoneList-DHUia6HT.js";import"./ModelPill-ChzAM3z1.js";import"./create-BgJN5qsj.js";import"./approvalText-Cy2UAUAQ.js";import"./rotate-ccw-BLoH5er1.js";import"./hard-drive-CXNJUCXw.js";import"./CapabilityMenu-BVrokPpT.js";import"./circle-x-AV2ZWulM.js";import"./userSpaces-CrLrKklx.js";import"./automationListSource-JVBMsMbC.js";import"./messages-4w1Khzm1.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"./DashboardGridView-DlFyYfUh.js";import"./FloatingToc-B1d4-5EL.js";import"./pageTree-CIXFRCLk.js";import"./pluginExt-Byb64tQO.js";import"./pen-tool-D_Y9We9x.js";import"./redo-2-QgiKEg9T.js";import"./AutomationBuilder-BsJc8wuC.js";import"./gestures-BwPbZDkU.js";import"./circle-question-mark-O8AhUz35.js";import"./InlineFiles-DKPH5JHz.js";import"./MuseView-CDDwV6SR.js";import"./i18n.generated-DvY59Zq3.js";import"./log-out-B5gEP0tF.js";import"./index-DY0M_dpd.js";/* empty css */import"./StudioGuestSurface-ZJFKnNYF.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-_TgFOpyv.js";A({"pluginChat.failed":{zh:"对话没接上:{error}",en:"Could not open the chat: {error}"},"pluginChat.noEngine":{zh:"引擎还没连上",en:"the engine is not connected"},"pluginChat.noFolder":{zh:"这台设备上打不开这个文件夹",en:"this folder is not available on this device"},"pluginChat.noAgent":{zh:"没有这个 Agent:{agent}",en:"no such agent: {agent}"}});const x="engine is not connected",y="folder is not available on this host: ",u="unknown agent: ",v="tangu.pluginChats",P=15e3,S=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")||{}}catch{return{}}},k=e=>String(e?.message??e),d=new Map;async function z(e){if(!await $(P))return{ok:!1,error:x};const t=e.resolveCwd?.()||void 0;if(e.folder&&!t)return{ok:!1,error:`${y}${e.folder}`};const r=`${e.owner}
2
- ${t??""}`,i=d.get(r);if(i)return i;const m=(async()=>{const s=e.agent?.trim()||void 0;if(s&&!await D(s))return{ok:!1,error:`${u}${s}`};const c=S()[r];if(c)try{const o=await I(f(),c);if(!o.archived)return g.getState().adoptSession(o),{ok:!0,sessionId:o.id}}catch(o){if(o?.status!==404)return{ok:!1,error:k(o)}}const a=g.getState(),p=s?a.agentDefs.find(o=>o.slug===s):void 0,l=s??a.defaultAgentSlug,h=N(_({...t?{...T(C(a.desktopConfig,!0),{}),execMode:"host",cwd:t}:{...C(a.desktopConfig,!1),execMode:"sandbox"},...p?.thinkingLevel?{thinkingLevel:p.thinkingLevel,...p.thinkingLevel!=="max"?{ultra:!1}:{}}:{},...l?{agentSlug:l}:{}},E.getState().vaultRoot||null));try{const o=await b(f(),{...e.title?{title:e.title}:{},...t?{project_path:t,project_name:t.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||t}:{projectless:!0},...p?.model?{model_id:p.model}:{},agent_config:h});g.getState().adoptSession({...o,agent_config:o.agent_config||h},{fresh:!0});try{localStorage.setItem(v,JSON.stringify({...S(),[r]:o.id}))}catch{}return{ok:!0,sessionId:o.id}}catch(o){return{ok:!1,error:k(o)}}})();return d.set(r,m),m.finally(()=>{d.delete(r)}),m}const F=(e,t)=>e===x?t("pluginChat.noEngine"):e.startsWith(y)?t("pluginChat.noFolder"):e.startsWith(u)?t("pluginChat.noAgent",{agent:e.slice(u.length)}):e;function R({leaf:e,state:t,retry:r}){const{t:i}=j();return t?.ok&&t.sessionId?n.jsx("div",{"data-plugin-chat":e.type,style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:n.jsx(M,{leaf:e,params:{followActive:!1,sessionId:t.sessionId,childSurface:!0}},t.sessionId)}):n.jsx("div",{className:"empty-state","data-plugin-chat":e.type,role:t?"alert":"status",style:{height:"100%",padding:16,textAlign:"center"},children:t?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i("pluginChat.failed",{error:F(t.error||"",i)})}),n.jsx("button",{className:"btn ghost sm",onClick:r,children:i("common.retry")})]}):n.jsx("span",{children:i("common.loading")})})}function ee(e,t,r){const i=L(t),m={id:i,type:i,loc:"right",params:{},setTitle(){},setParams(){},close(){}},s=O(e,null,r),c=l=>s.render(n.jsx(w,{children:n.jsx(R,{leaf:m,state:l,retry:()=>{p()}})}));let a;const p=()=>(c(null),a=z(t).then(l=>(c(l),l)),a);return{ready:p(),latest:()=>a,dispose:s.dispose}}export{z as ensurePluginChat,ee as mountPluginChat};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./shareViewer-BzuSyJv_.js","./index-BYUntVIZ.js","./client-BqhpYbYL.js","./i18n.generated-DvY59Zq3.js","./appStore-affnJoin.js","./nativeDownload-Udrv_tmU.js","./ipc-D7yENkjV.js","./appStore-ClD7vq5L.css","./MarkdownBlock-BHpDy2qQ.js","./index-Y2kzYlZq.js","./linkFollow-Msu1XH9v.js","./emoji-BPdA62d7.js","./listFold-CKxjyY5_.js","./book-open-CcXCToyx.js","./MarkdownBlock--__nPQGh.css","./i18n-BMo19xaR.css","./UnifiedPage-D7JTfABH.js","./pageChrome-D-9npbUE.js","./upload-D20PZHXc.js","./pageChrome-eO9pb2fH.css","./SketchCard-BcXCdBAs.js","./arrow-up-right-R4P9Mmxz.js","./Chrome-amTcZNE4.js","./minus-CfoZ4oxr.js","./canvasPrefs-CSuX9aLF.js","./hand-DRu7IJdU.js","./type-DmIL6FB-.js","./foldActions-BcyvNVBs.js","./lock-kffGfeHt.js","./undo-2-yMeXc8Wi.js","./code-xml-DdR58F83.js","./message-square-plus-DxBPIhPS.js","./UnifiedPage-CWXc_mo1.css","./pageTree-CIXFRCLk.js","./shareViewer-DLVrwanO.css"])))=>i.map(i=>d[i]);
2
- import{t as n,i as g,_ as m,g as u,r as f}from"./index-BYUntVIZ.js";f({"sharepage.rateLimited":{zh:"访问过于频繁,稍后再试",en:"Too many requests — please try again later"},"sharepage.gone":{zh:"分享不存在或已撤销",en:"This share does not exist or has been revoked"},"sharepage.loadFailed":{zh:"加载失败",en:"Failed to load"}});function c(r){const s=document.getElementById("root")??document.body.appendChild(document.createElement("div"));s.innerHTML="";const e=document.createElement("div");e.style.cssText='padding:48px;text-align:center;font:15px/1.6 -apple-system,"PingFang SC","Segoe UI",Roboto,sans-serif;opacity:.75',e.textContent=r,s.appendChild(e)}async function y(r,s=u()){const e=`${s}/amadeus/public/shares/${encodeURIComponent(r)}`;let t;try{const a=await fetch(e);if(!a.ok){c(a.status===429?n("sharepage.rateLimited"):n("sharepage.gone"));return}t=await a.json()}catch{c(n("sharepage.loadFailed"));return}let o={root:t.path,pages:[t.path],folders:[]};try{const a=await fetch(`${e}/tree`);if(a.ok){const d=await a.json(),p=l=>!l.split("/").some(h=>h.startsWith("."));o={root:d.root,pages:d.pages.filter(p),folders:d.folders.filter(p)}}}catch{}t.mode==="page"&&!o.pages.includes(t.path)&&o.pages.unshift(t.path);const i={tree:o,current:t.path};g({apiBase:s,token:r,tree:()=>i.tree,currentPage:()=>i.current}),(await m(()=>import("./shareViewer-BzuSyJv_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url)).mountShareViewer({token:r,base:e,meta:t,tree:o,onCurrentChange:a=>{i.current=a}})}function b(r,s){y(r,s?.apiBase).catch(e=>{console.error("[share] boot failed:",e),c(n("sharepage.loadFailed"))})}export{b as mountSharePage};
@@ -1 +0,0 @@
1
- import{j as n,d as a}from"./index-BYUntVIZ.js";import"./MarkdownBlock-BHpDy2qQ.js";import{s2 as b,gd as y,j as R,s3 as h,s4 as j,s5 as v,fy as M,s6 as g}from"./appStore-affnJoin.js";import"./index-Y2kzYlZq.js";import"./linkFollow-Msu1XH9v.js";import"./client-BqhpYbYL.js";import"./emoji-BPdA62d7.js";import"./listFold-CKxjyY5_.js";import"./book-open-CcXCToyx.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";function p({pluginId:d,spec:t,popHost:s}){const o=R(e=>e.mode),l=a.useRef(null),u=a.useMemo(()=>h(t.error?{...t,rows:[]}:t),[t]),i=a.useMemo(()=>j(t.error?{...t,rows:[]}:t),[t]),f=a.useMemo(()=>new Map(t.rows.map(e=>[e.id,e])),[t]),x=a.useRef(t.sort?{colId:t.sort.key,dir:t.sort.dir}:null),m=a.useRef(t);m.current=t,a.useLayoutEffect(()=>{s.dataset.mode=o},[o,s]),a.useLayoutEffect(()=>{l.current&&m.current.onRender?.(l.current)});const c=e=>f.get(e.id),w=a.useMemo(()=>t.fold?.summary?e=>v(t,e.flatMap(r=>f.get(r.id)??[])):void 0,[t,f]);return n.jsx("div",{className:"amadeus-root am-app tangu-lovable amx-plugtable","data-mode":o,ref:l,children:n.jsxs(n.Fragment,{children:[n.jsx(M,{target:`plugin:${d}/${t.id}`,pagePath:`plugin:${d}`,db:u,readOnly:!0,cellMeta:i,hideHead:!0,hideTools:!!t.partial,popHost:s,selectedRowId:t.selectedId??null,initialSort:x.current,onSort:e=>m.current.onSort?.(e?{key:e.colId,dir:e.dir}:null),foldMeta:w,onRowOpen:t.onRowOpen?e=>{const r=c(e);r&&m.current.onRowOpen?.(r)}:void 0,rowAttrs:e=>{const r=c(e);return r?{...r.className?{class:r.className}:{},...g(r.attrs)??{},...g(m.current.rowAttrs?.(r))??{}}:{}}}),t.error?n.jsx("div",{className:"amx-plugtable-error",children:t.error}):t.rows.length===0&&t.empty?n.jsx("div",{className:"amx-plugtable-empty",children:t.empty}):null]})})}function D(d,t,s){b(s);const o=document.createElement("div");o.className="am-app tangu-lovable amx-plugtable-pops",document.body.appendChild(o);let l=!1;const u=y(t,n.jsx(p,{pluginId:d,spec:s,popHost:o}),()=>{l=!0,o.remove()});return{update:i=>{l||(b(i),u.render(n.jsx(p,{pluginId:d,spec:i,popHost:o})))},dispose:u.dispose}}export{D as mountPluginTable};
@@ -1 +0,0 @@
1
- [data-theme=genesis-glass]{--border-width: 1px;--radius-sm: 6px;--radius-md: 12px;--radius-lg: 16px;--radius-chat-surface: var(--radius-lg);--radius-chat-card: var(--radius-md);--font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Hanken Grotesk", ui-sans-serif, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;--gl-stage: transparent;--gl-chrome: color-mix(in srgb, var(--sidebar-bg) var(--gl-chrome-pct, 46%), transparent);--gl-pane: color-mix(in srgb, var(--sidebar-bg) var(--gl-pane-pct, 58%), transparent);--gl-paper: var(--bg);--gl-menu: color-mix(in srgb, var(--bg-card) clamp(50%, calc(var(--gl-float-pct, 72%) - 14%), 76%), transparent);--gl-float: color-mix(in srgb, var(--bg-card) var(--gl-float-pct, 72%), transparent);--gl-side: color-mix(in srgb, var(--bg-card) clamp(80%, calc(var(--gl-float-pct, 72%) + 12%), 92%), transparent);--gl-thin: color-mix(in srgb, var(--bg-card) 50%, transparent);--gl-sheen: linear-gradient(145deg, color-mix(in srgb, var(--bg-card) 20%, transparent), transparent 48%, color-mix(in srgb, var(--accent-ink) 4%, transparent));--gl-hairline: color-mix(in srgb, var(--text) 12%, transparent);--gl-blur-float: blur(var(--gl-blur-radius, 40px)) saturate(var(--gl-saturate, 160%));--card-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .06), 0 16px 40px -12px rgba(0, 0, 0, .2);--btn-shadow: var(--inset);--icon-shadow: var(--inset);--panel-blur: var(--gl-blur-float)}:root[data-theme=genesis-glass][data-skin]{--bg-glass: var(--gl-float)}.dark[data-theme=genesis-glass]{--gl-chrome: color-mix(in srgb, var(--sidebar-bg) calc(var(--gl-chrome-pct, 46%) + 10%), transparent);--gl-pane: color-mix(in srgb, var(--sidebar-bg) calc(var(--gl-pane-pct, 58%) + 8%), transparent);--gl-menu: color-mix(in srgb, var(--bg-card) clamp(52%, calc(var(--gl-float-pct, 72%) - 12%), 78%), transparent);--gl-float: color-mix(in srgb, var(--bg-card) calc(var(--gl-float-pct, 72%) + 2%), transparent);--gl-side: color-mix(in srgb, var(--bg-card) clamp(82%, calc(var(--gl-float-pct, 72%) + 14%), 94%), transparent);--gl-thin: color-mix(in srgb, var(--bg-card) 50%, transparent);--gl-hairline: color-mix(in srgb, var(--text) 14%, transparent);--card-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .4), 0 20px 48px -12px rgba(0, 0, 0, .6);--btn-shadow: 0 1px 2px rgba(0, 0, 0, .4);--icon-shadow: 0 1px 2px rgba(0, 0, 0, .3)}:root[data-theme=genesis-glass]{background:var(--gl-stage)!important}[data-theme=genesis-glass] body,[data-theme=genesis-glass] .shell,[data-theme=genesis-glass] .shell-top,[data-theme=genesis-glass] .shell-work,[data-theme=genesis-glass] .wb-dockview{background:var(--gl-stage)}[data-theme=genesis-glass] .dockview-theme-lcl{--dv-background-color: transparent;--dv-group-view-background-color: transparent;--dv-tabs-and-actions-container-background-color: transparent}[data-theme=genesis-glass] .rb,[data-theme=genesis-glass] .dockview-theme-lcl .dv-groupview:not(:has(.wb-tab--icon)){background:var(--gl-chrome)}[data-theme=genesis-glass] .rb-badge{border-color:color-mix(in srgb,var(--sidebar-bg) 60%,transparent)}[data-theme=genesis-glass] .dockview-theme-lcl .dv-groupview:has(.wb-tab--icon){background:var(--gl-pane)}[data-theme=genesis-glass] .t2s-side{background:transparent}[data-theme=genesis-glass] .dockview-theme-lcl .dv-tab.dv-active-tab:not(:has(.wb-tab--icon)) .wb-tab{background:color-mix(in srgb,var(--bg-card) 62%,transparent)}[data-theme=genesis-glass] .dockview-theme-lcl .dv-groupview:not(:has(.wb-tab--icon)) .dv-content-container{background:transparent}[data-theme=genesis-glass] .dockview-theme-lcl .dv-groupview:not(:has(.wb-tab--icon)) .dv-content-container>.dv-react-part{background:var(--gl-paper);border-radius:var(--radius-lg);box-shadow:var(--card-shadow)}[data-theme=genesis-glass] .amx-toolbar{background:var(--gl-paper)}[data-theme=genesis-glass] .t2c-card{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;border-color:transparent;isolation:isolate}[data-theme=genesis-glass] .t2c-card:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--gl-sheen),var(--gl-thin);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float)}[data-theme=genesis-glass] .t2c-apv{background:transparent;isolation:isolate}[data-theme=genesis-glass] .t2c-apv:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--gl-sheen),var(--gl-thin);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float)}[data-theme=genesis-glass] .composer-menu,[data-theme=genesis-glass] .cm-sub,[data-theme=genesis-glass] .approval-hover-desc,[data-theme=genesis-glass] .ctx-menu,[data-theme=genesis-glass] .project-menu,[data-theme=genesis-glass] .t2c-menu,[data-theme=genesis-glass] .t2c-ctxring-pop,[data-theme=genesis-glass] .account-pop,[data-theme=genesis-glass] .rb-menu,[data-theme=genesis-glass] .rb-fly,[data-theme=genesis-glass] .rb-iconpick,[data-theme=genesis-glass] .unitsw-menu,[data-theme=genesis-glass] .t2sw-plug-menu,[data-theme=genesis-glass] .t2-quote-menu,[data-theme=genesis-glass] .amx-tip,[data-theme=genesis-glass] .amx-db-pop,[data-theme=genesis-glass] .ui-popover,[data-theme=genesis-glass] .amx-bpick,[data-theme=genesis-glass] .amx-mbar,[data-theme=genesis-glass] .amx-cal-agenda,[data-theme=genesis-glass] .amx-cal-cardwrap,[data-theme=genesis-glass] .dash-add-menu{background:var(--gl-sheen),var(--gl-menu);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float);border-color:transparent;isolation:isolate}[data-theme=genesis-glass] .am-app :is(.slash-menu,.wiki-suggest,.paste-as-menu,.inline-toolbar,.ctx-menu){background:var(--gl-sheen),var(--gl-menu);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float);border-color:transparent;isolation:isolate}[data-theme=genesis-glass] .amx-db-pop:not(.amx-coverpick){border-color:transparent}[data-theme=genesis-glass] .am-app :is(.amx-db-card:not(.amx-db-card-add),.embed-file,.amx-bm,.embed-media),[data-theme=genesis-glass] :is(.dash-card:not([data-bad]),.csl-gallery-card:not(:hover,:focus-visible),.iui-app-card){border-color:transparent}[data-theme=genesis-glass] .rb-menu,[data-theme=genesis-glass] .rb-fly,[data-theme=genesis-glass] .rb-iconpick,[data-theme=genesis-glass] .unitsw-menu,[data-theme=genesis-glass] .t2sw-plug-menu,[data-theme=genesis-glass] .amx-tip{background:var(--gl-sheen),var(--gl-side)}[data-theme=genesis-glass] .ntf,[data-theme=genesis-glass] .wsfile-panel,[data-theme=genesis-glass] .amx-qf,[data-theme=genesis-glass] .amx-trash-pop,[data-theme=genesis-glass] .amx-hoverprev,[data-theme=genesis-glass] .amx-toast{background:var(--gl-sheen),var(--gl-float);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float);border-color:transparent;isolation:isolate}[data-theme=genesis-glass] .jump-bottom,[data-theme=genesis-glass] .voting-indicator{background:var(--gl-sheen),var(--gl-menu)}[data-theme=genesis-glass] .composer-menu:is(.composer-menu--model,.composer-menu--mode,.composer-menu--add){background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}[data-theme=genesis-glass] .composer-menu:is(.composer-menu--model,.composer-menu--mode,.composer-menu--add):before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--gl-sheen),var(--gl-menu);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float)}[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .t2c-card{background:transparent}[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .t2c-card:before{background:var(--gl-sheen),var(--gl-side)}[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .composer-menu:not(.composer-menu--model):not(.composer-menu--mode):not(.composer-menu--add),[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .cm-sub,[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .approval-hover-desc,[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .t2c-menu,[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .t2c-ctxring-pop,[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .t2-quote-menu,[data-theme=genesis-glass] .dv-groupview:has(.wb-tab--icon) .composer-menu:is(.composer-menu--model,.composer-menu--mode,.composer-menu--add):before{background:var(--gl-sheen),var(--gl-side)}[data-theme=genesis-glass] .cmd-panel,[data-theme=genesis-glass] .modal,[data-theme=genesis-glass] .memv-modal-box,[data-theme=genesis-glass] .amx-qf-card,[data-theme=genesis-glass] .amxc-panel,[data-theme=genesis-glass] .amxc-card,[data-theme=genesis-glass] .csx-pub-card,[data-theme=genesis-glass] .dv-edge-right{background:var(--gl-sheen),var(--gl-float);backdrop-filter:var(--gl-blur-float);-webkit-backdrop-filter:var(--gl-blur-float);border:var(--gl-hairline-width, 1px) solid var(--gl-hairline);box-shadow:var(--card-shadow);isolation:isolate}[data-theme=genesis-glass] .cmd-overlay{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate}[data-theme=genesis-glass] .cmd-overlay:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:color-mix(in srgb,var(--overlay-scrim) 45%,transparent);backdrop-filter:blur(6px) saturate(120%);-webkit-backdrop-filter:blur(6px) saturate(120%)}[data-theme=genesis-glass] .dv-edge-right{border-radius:var(--radius-sm)}[data-theme=genesis-glass] .fs-overlay{background:var(--gl-stage)}[data-theme=genesis-glass] .fs-overlay .settings-page{background:transparent}[data-theme=genesis-glass] .fs-overlay .settings-nav{background:var(--gl-pane)}[data-theme=genesis-glass] .fs-overlay .settings-main,[data-theme=genesis-glass] .fs-overlay .settings-main-head{background:var(--gl-paper)}[data-theme=genesis-glass] .ob-shell{background:transparent}[data-theme=genesis-glass] .ob-rail{background:var(--gl-pane)}[data-theme=genesis-glass] .ob-stage,[data-theme=genesis-glass] .ob-step-actions{background:var(--gl-paper)}:root[data-theme=genesis-glass][data-glass=off][data-mode]{--gl-stage: var(--bg);--gl-chrome: var(--sidebar-bg);--gl-pane: var(--sidebar-bg);--gl-menu: var(--bg-card);--gl-float: var(--bg-card);--gl-side: var(--bg-card);--gl-sheen: none;--gl-thin: var(--bg-card);--gl-hairline: var(--border)}:root[data-theme=genesis-glass][data-glass=off] .t2c-card:before,:root[data-theme=genesis-glass][data-glass=off] .t2c-apv:before,:root[data-theme=genesis-glass][data-glass=off] .composer-menu:is(.composer-menu--model,.composer-menu--mode,.composer-menu--add):before,:root[data-theme=genesis-glass][data-glass=off] .cmd-overlay:before{backdrop-filter:none;-webkit-backdrop-filter:none}:root[data-theme=genesis-glass]:not([data-platform=mac]){--gl-stage: var(--bg)}
@@ -1 +0,0 @@
1
- import{b as re,r as Q,j as y,d as le,u as nt,K as it}from"./index-BYUntVIZ.js";import{G as k,oB as ot,oC as st,oD as rt,oE as lt,a6 as m,d4 as v,m as ct,a as q,oF as V,bq as dt,ai as ft,af as ce,ap as Ae,aK as ut,de as b,go as gt,oG as pt,I as _e,oH as ht,J as Ie,U as mt,oI as yt,oJ as St,oK as vt,oL as kt,oM as M,g as xe,oN as Pt,j0 as bt,oO as wt,oP as zt,is as At,q as ee,u as Me,oQ as te,a$ as De,b2 as H,oR as de,oS as I,oT as E,oU as _t,cO as Ce,f8 as Ee,ab as L,cZ as It,d0 as xt,oV as Oe,oW as Te,ay as Mt,oX as Dt,aD as fe,b9 as Ct,oY as Et,oZ as Ot,cW as Tt,o_ as Vt,aI as Ve,j2 as Lt,ba as ae,N as Nt,Z as jt,X as $t,a3 as Ut,a4 as Rt,_ as Ft,a5 as Ht,V as Wt,gQ as Bt,o$ as Gt,aC as qt,p0 as Kt}from"./appStore-affnJoin.js";import"./client-BqhpYbYL.js";import{A as Le}from"./automationListSource-JVBMsMbC.js";import{C as Jt}from"./code-xml-DdR58F83.js";import{W as Xt}from"./workflow-Bd6xBHiT.js";import{L as Yt}from"./list-tree-DmuRb-p9.js";import{L as Zt}from"./layout-grid-Hs3eDA07.js";import{T as Qt}from"./terminal-BlmA_Z1C.js";import{S as ea}from"./star-BmywYD3u.js";import{F as ta}from"./folder-CCZqnwRc.js";import{B as aa}from"./book-open-CcXCToyx.js";const na=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Ne=k("boxes",na);const ia=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],oa=k("briefcase",ia);const sa=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ra=k("code",sa);const la=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ca=k("heart",la);const da=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],fa=k("mail",da);const ua=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],ga=k("music",ua);const pa=[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M9.5 8h5",key:"11mslq"}],["path",{d:"M9.5 12H16",key:"ktog6x"}],["path",{d:"M9.5 16H14",key:"p1seyn"}]],je=k("notebook-text",pa);const ha=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],ma=k("rocket",ha);const ya=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],Sa=k("server-cog",ya);const va=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ka=k("server",va);const Pa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ba=k("target",Pa);const wa=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],za=k("video",wa),ue=["right","left","full","main"],$e=/^[a-z0-9][a-z0-9-]{0,63}$/;function Aa(e,t){const n=e.replace(/^v/i,"").split("."),a=t.replace(/^v/i,"").split(".");for(let o=0;o<Math.max(n.length,a.length);o++){const s=parseInt(n[o]??"0",10)||0,i=parseInt(a[o]??"0",10)||0;if(s!==i)return s<i?-1:1}return 0}function _(e,t){if(e===void 0)return[];if(!Array.isArray(e))return`layout.${t} 必须是数组`;const n=[];for(const a of e){if(!a||typeof a!="object"||typeof a.type!="string"||!a.type)return`layout.${t} 的条目必须是 { type: string }`;const o=a.params;if(o!==void 0&&(typeof o!="object"||o===null||Array.isArray(o)))return`layout.${t} 的 params 必须是对象`;const s=a.split,i=a.splitFrom;if(s!==void 0&&s!=="right"&&s!=="down")return`layout.${t} 的 split 必须是 right 或 down`;if(i!==void 0&&(t!=="main"||!s||!Number.isInteger(i)||i<0||i>=n.length))return`layout.${t} 的 splitFrom 必须指向此前的 main 条目(从 0 开始),且同时声明 split`;const d=a.pinned;if(d!==void 0&&(typeof d!="boolean"||d&&t==="bottom"))return`layout.${t} 的 pinned 必须是布尔值,且底部面板不支持固定`;n.push({type:a.type,...o?{params:o}:{},...s?{split:s}:{},...i!==void 0?{splitFrom:i}:{},...d?{pinned:!0}:{}})}return n}function _a(e){return e.map((t,n)=>n===0?{panel:t,mode:"first"}:t.split?{panel:t,mode:"split",direction:t.split,from:t.splitFrom??n-1}:{panel:t,mode:"tab"})}function Ia(e,t){let n;try{n=JSON.parse(e)}catch{return{ok:!1,error:"space.json 不是合法 JSON"}}if(!n||typeof n!="object")return{ok:!1,error:"space.json 必须是对象"};const a=n,o=a.id;if(typeof o!="string"||!$e.test(o))return{ok:!1,error:"id 必须是 kebab-case(a-z0-9-)"};if(t.reservedIds.includes(o))return{ok:!1,error:`id "${o}" 是内置 Space 保留名`};const s=a.name;if(!(typeof s=="string"&&s.trim()||!!s&&typeof s=="object"&&!Array.isArray(s)&&(typeof s.zh=="string"||typeof s.en=="string")))return{ok:!1,error:"name 必须是非空字符串或 {zh?,en?}"};if(a.icon!==void 0&&typeof a.icon!="string")return{ok:!1,error:"icon 必须是字符串"};if(a.minAppVersion!==void 0&&typeof a.minAppVersion!="string")return{ok:!1,error:"minAppVersion 必须是字符串"};if(typeof a.minAppVersion=="string"&&t.appVersion&&Aa(t.appVersion,a.minAppVersion)<0)return{ok:!1,error:`需要应用版本 ≥ ${a.minAppVersion}(当前 ${t.appVersion})`,code:"min-app-version",id:o,name:s,need:a.minAppVersion};if(!a.layout||typeof a.layout!="object")return{ok:!1,error:"缺少 layout"};const d=a.layout,l=_(d.main,"main"),c=_(d.left,"left"),u=_(d.right,"right"),h=_(d.bottom,"bottom");for(const p of[l,c,u,h])if(typeof p=="string")return{ok:!1,error:p};if(!l.length)return{ok:!1,error:"layout.main 至少要有一个视图"};if(l[0].split)return{ok:!1,error:"layout.main 第一项不能声明 split"};if([c,u,h].some(p=>p.some(A=>A.split)))return{ok:!1,error:"split 只适用于 layout.main"};if(d.bottomSpan!==void 0&&!ue.includes(d.bottomSpan))return{ok:!1,error:`layout.bottomSpan 必须是 ${ue.join(" / ")} 之一`};let P;if(a.mini!==void 0){if(!a.mini||typeof a.mini!="object"||Array.isArray(a.mini))return{ok:!1,error:"mini 必须是 {view, mainView} 对象"};const p=a.mini,A=_([p.view],"mini.view"),N=_([p.mainView],"mini.mainView");if(typeof A=="string")return{ok:!1,error:A};if(typeof N=="string")return{ok:!1,error:N};if(A[0].type===N[0].type)return{ok:!1,error:"mini.view 必须单独适配,不能复用 mainView 的视图类型"};if(p.name!==void 0&&!(typeof p.name=="string"&&p.name.trim())&&!(p.name&&typeof p.name=="object"&&!Array.isArray(p.name)&&Object.values(p.name).some(se=>typeof se=="string"&&se.trim())))return{ok:!1,error:"mini.name 必须是名称或双语对象"};P={view:A[0],mainView:N[0],name:p.name}}const r=a.requires,S=Array.isArray(r?.views)?r.views.filter(p=>typeof p=="string"):[],at=[l,c,u,h].flatMap(p=>p).map(p=>p.type).concat(S),K=[...new Set(at.filter(p=>!t.isViewRegistered(p)))];return K.length?{ok:!1,error:`引用了未注册的视图: ${K.join(", ")}(可能需要升级应用或安装对应 Space App)`,code:"missing-views",id:o,name:s,views:K}:{ok:!0,spec:{id:o,name:s,icon:typeof a.icon=="string"?a.icon:void 0,iconFile:typeof a.iconFile=="string"?a.iconFile:void 0,version:typeof a.version=="string"?a.version:void 0,mini:P,minAppVersion:typeof a.minAppVersion=="string"?a.minAppVersion:void 0,layout:{main:l,left:c,right:u,...h.length?{bottom:h}:{},...d.bottomSpan?{bottomSpan:d.bottomSpan}:{}},requires:S.length?{views:S}:void 0}}}function Ue(e){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48);return $e.test(t)?t:"space"}function Re(e,t){if(!t.has(e))return e;for(let n=2;;n++)if(!t.has(`${e}-${n}`))return`${e}-${n}`}function xa(e){return e==="bottom"?null:e==="left"||e==="right"?e:"main"}const Fe="plugin:inbox:messages",Ma=new Set(["amadeus-editor","amadeus-drawing","dashboard","amadeus-dashboard","amadeus-db","amadeus-pdf"]);function yn(e,t,n="sessions",a){return e!=="right"&&a?a:t==="chat"?e==="right"?"files":"sessions":t&&Ma.has(t)?e==="right"?"files":"notes":t==="code-studio"||e==="right"?"files":n}function Sn(e,t,n){const a=t==="notes"&&!n?"files":t;return{automatic:a,active:e==="auto"?a:e}}function vn(e,t){if(!t)return null;const n=s=>s.replace(/\\/g,"/").replace(/\/+$/,""),a=n(t);let o=null;for(const s of e){const i=s.path?n(s.path):"";!i||a!==i&&!a.startsWith(`${i}/`)||(!o||i.length>o.len)&&(o={key:s.key,len:i.length})}return o?.key??null}function ge(e){const t=structuredClone(e),n=new Set(["chat-panel","memory","subchats"]),a=t.sidebars.right.stash.filter(r=>!n.has(r.type)&&r.type!=="tangu-details");t.sidebars.right.stash=[{type:"tangu-details",params:{}},...a];const o=t.dockview;if(!o?.panels)return t;const s=Object.entries(o.panels).filter(([,r])=>r.params?.__loc==="right"&&n.has(r.params?.__type)),d=Object.entries(o.panels).find(([,r])=>r.params?.__loc==="right"&&r.params?.__type==="tangu-details")?.[0]||s[0]?.[0];if(!d)return t;const l=o.panels[d];l.params={__type:"tangu-details",__loc:"right"},l.contentComponent="tangu-details";const c=new Set(s.map(([r])=>r).filter(r=>r!==d));for(const r of c)delete o.panels[r];const u=r=>{if(!(!r||typeof r!="object")){Array.isArray(r.views)&&(r.views=r.views.filter(S=>!c.has(S)),c.has(r.activeView)&&(r.activeView=r.views[0]));for(const S of Object.values(r))Array.isArray(S)?S.forEach(u):S&&typeof S=="object"&&u(S)}};u(o.grid);const h=new Set,P=r=>{if(Array.isArray(r?.data?.views)){if(!r.data.views.length)return!1;r.data.id&&h.add(r.data.id)}return Array.isArray(r?.data)?(r.data=r.data.filter(P),r.data.length>0):!0};return P(o.grid?.root),o.activeGroup&&h.size&&!h.has(o.activeGroup)&&(o.activeGroup=[...h][0]),t}function Da(){try{if(localStorage.getItem(re("tangu_details_layout_v1"))==="1")return;const e=ot("space:tangu");if(e&&st("space:tangu",ge(e)),(localStorage.getItem("forsion_tangu_active_space")||"tangu")==="tangu"){const t=rt();t&&lt(ge(t))}localStorage.setItem(re("tangu_details_layout_v1"),"1")}catch{}}Q({"agentProfile.title":{zh:"Tangu 详情",en:"Tangu details"},"agentProfile.space":{zh:"Agents",en:"Agents"},"agentProfile.roster":{zh:"Agent 名册",en:"Agent roster"},"agentProfile.search":{zh:"搜索 Agent",en:"Search agents"},"agentProfile.skills":{zh:"技能",en:"Skills"},"agentProfile.mcp":{zh:"MCP",en:"MCP"},"agentProfile.memory":{zh:"记忆",en:"Memory"},"agentProfile.evolution":{zh:"进化",en:"Evolution"},"agentProfile.config":{zh:"配置",en:"Settings"},"agentProfile.full":{zh:"在 Agents 中打开",en:"Open in Agents"},"agentProfile.session":{zh:"当前会话",en:"Current conversation"},"agentProfile.project":{zh:"项目",en:"Project"},"agentProfile.model":{zh:"模型",en:"Model"},"agentProfile.default":{zh:"跟随默认设置",en:"Use default settings"},"agentProfile.standby":{zh:"待命",en:"Standby"},"agentProfile.working":{zh:"工作中",en:"Working"},"agentProfile.waiting":{zh:"等待你的回应",en:"Waiting for your response"},"agentProfile.offline":{zh:"离线",en:"Offline"},"agentProfile.all":{zh:"全部可用",en:"All available"},"agentProfile.selected":{zh:"仅选中的装备",en:"Selected only"},"agentProfile.none":{zh:"尚无可用项目",en:"Nothing available yet"},"agentProfile.manageSkills":{zh:"管理技能库",en:"Manage skill library"},"agentProfile.manageMcp":{zh:"管理 MCP 连接",en:"Manage MCP connections"},"agentProfile.saved":{zh:"已保存,将在下一次运行生效",en:"Saved. Changes apply to the next run."},"agentProfile.save":{zh:"保存配置",en:"Save configuration"},"agentProfile.cancel":{zh:"放弃修改",en:"Discard changes"},"agentProfile.edit":{zh:"编辑",en:"Edit"},"agentProfile.name":{zh:"名称",en:"Name"},"agentProfile.description":{zh:"简介",en:"Description"},"agentProfile.descriptionPlaceholder":{zh:"添加简介…",en:"Add a description…"},"agentProfile.avatarChange":{zh:"更换头像",en:"Change avatar"},"agentProfile.avatarRemove":{zh:"移除头像",en:"Remove avatar"},"agentProfile.avatarHint":{zh:"PNG、JPEG、GIF 或 WebP,不超过 1 MB;头像修改会立即保存。",en:"PNG, JPEG, GIF or WebP, up to 1 MB. Avatar changes are saved immediately."},"agentProfile.avatarTooLarge":{zh:"头像不能超过 1 MB。",en:"The avatar must be no larger than 1 MB."},"agentProfile.avatarReadFailed":{zh:"读取头像失败。",en:"Could not read the avatar."},"agentProfile.avatarSaved":{zh:"头像已保存",en:"Avatar saved"},"agentProfile.avatarRemoved":{zh:"头像已移除",en:"Avatar removed"},"agentProfile.prompt":{zh:"工作指令",en:"Instructions"},"agentProfile.soul":{zh:"人格",en:"Persona"},"agentProfile.thinking":{zh:"思考档位",en:"Thinking effort"},"agentProfile.approval":{zh:"审批模式",en:"Approval mode"},"agentProfile.readonly":{zh:"只读",en:"Read only"},"agentProfile.autoEdit":{zh:"自动编辑",en:"Auto edit"},"agentProfile.fullAuto":{zh:"完全自动",en:"Full auto"},"agentProfile.custom":{zh:"自定义",en:"Custom"},"agentProfile.sharedMemory":{zh:"共用默认 Agent 的记忆",en:"Share the default agent’s memory"},"agentProfile.privateMemory":{zh:"独立记忆",en:"Private memory"},"agentProfile.scopeHint":{zh:"修改此 Agent 的默认配置,适用于独立会话与项目会话;会话自身的设置优先。",en:"Edit defaults for this agent across independent and project sessions. Session overrides take precedence."},"agentProfile.noAgent":{zh:"选择或创建一个 Agent,查看它的状态与装备。",en:"Select or create an agent to inspect its status and capabilities."},"agentProfile.create":{zh:"创建 Agent",en:"Create agent"},"agentProfile.createHint":{zh:"先写下它的用途和工作指令,创建后可以在档案里继续完善能力。",en:"Give this agent a purpose and instructions. You can refine its capabilities in the profile."},"agentProfile.createInstructionsPlaceholder":{zh:"描述它如何协助你、做事时应遵守什么原则…",en:"Describe how it should help and the principles it should follow…"},"agentProfile.isDefault":{zh:"默认 Agent",en:"Default agent"},"agentProfile.actionsFor":{zh:"{name} 的操作",en:"Actions for {name}"},"agentProfile.reorder":{zh:"调整顺序",en:"Reorder"},"agentProfile.moveUp":{zh:"上移",en:"Move up"},"agentProfile.moveDown":{zh:"下移",en:"Move down"},"agentProfile.makeDefault":{zh:"设为默认",en:"Set as default"},"agentProfile.delete":{zh:"删除 Agent",en:"Delete agent"},"agentProfile.backToCurrent":{zh:"回到当前会话",en:"Back to current session"},"agentProfile.deleteFailed":{zh:"无法删除此 Agent。请检查它是否仍在运行或被设为默认。",en:"Could not delete this agent. Check whether it is running or set as default."},"agentProfile.team":{zh:"团队",en:"Team"},"agentProfile.context":{zh:"上下文",en:"Context"},"agentProfile.maxIterations":{zh:"最大运行轮数",en:"Maximum iterations"},"agentProfile.tools":{zh:"内置工具",en:"Built-in tools"},"agentProfile.denyTools":{zh:"禁用选中的工具",en:"Disable selected tools"},"agentProfile.allowTools":{zh:"仅允许选中的工具",en:"Allow selected tools only"},"agentProfile.activityAccess":{zh:"允许读取活动日志",en:"Allow activity log access"},"agentProfile.cloudSync":{zh:"跨设备同步此 Agent",en:"Sync this agent across devices"},"agentProfile.teamContext":{zh:"成员各自保留独立上下文,可在 Pin Summary 中打开子会话继续交流。",en:"Members retain their own context. Open a member in Pin Summary to continue its conversation."},"agentProfile.library":{zh:"记忆、日志与资料库",en:"Memory, journal and library"},"agentProfile.searchModels":{zh:"搜索模型或输入模型 ID",en:"Search models or enter a model ID"},"agentProfile.useModelId":{zh:"使用模型 ID:{id}",en:"Use model ID: {id}"},"agentProfile.customModelId":{zh:"自定义 ID",en:"Custom ID"},"agentProfile.noResults":{zh:"没有匹配的结果",en:"No matching results"},"agentProfile.preview":{zh:"阅读预览",en:"Preview"},"agentProfile.emptyText":{zh:"尚未填写内容",en:"No content yet"},"agentProfile.characters":{zh:"{count} 字符",en:"{count} characters"},"agentProfile.quickSettings":{zh:"运行设置",en:"Run settings"},"agentProfile.agentDefaults":{zh:"Agent 默认配置",en:"Agent defaults"},"agentProfile.sessionModel":{zh:"当前会话模型",en:"Conversation model"},"agentProfile.sessionModelHint":{zh:"此项立即保存,仅影响当前会话。",en:"Saved immediately for this conversation only."},"agentProfile.defaultsHint":{zh:"设置此 Agent 的默认行为;已有会话的单独设置优先。",en:"Set this agent’s defaults. Existing session overrides take precedence."},"agentProfile.identity":{zh:"基本信息",en:"Identity"},"agentProfile.instructions":{zh:"指令与人格",en:"Instructions and persona"},"agentProfile.permissions":{zh:"权限与工具",en:"Permissions and tools"},"agentProfile.advanced":{zh:"高级设置",en:"Advanced settings"},"agentProfile.instructionsHint":{zh:"工作指令定义任务与边界,人格定义表达方式。支持 Markdown 预览。",en:"Instructions define tasks and boundaries; persona defines communication style. Markdown preview is available."},"agentProfile.searchEquipment":{zh:"搜索名称或描述",en:"Search names or descriptions"},"agentProfile.enabledOnly":{zh:"仅看已启用",en:"Enabled only"},"agentProfile.selectedCount":{zh:"已启用 {count} / {total}",en:"{count} of {total} enabled"},"agentProfile.selectAll":{zh:"全部启用",en:"Enable all"},"agentProfile.clearAll":{zh:"全部停用",en:"Disable all"},"agentProfile.loadoutHint":{zh:"全部可用会自动包含未来新增的项目;手动勾选后仅使用选中的项目。",en:"All available includes future additions. Manual selection uses only the items you choose."},"agentProfile.loading":{zh:"正在加载能力…",en:"Loading capabilities…"},"agentProfile.unavailable":{zh:"当前不可用,保留原有选择",en:"Unavailable; existing selection retained"},"agentProfile.retry":{zh:"重新加载",en:"Retry"},"agentProfile.memoryScope":{zh:"记忆归属",en:"Memory scope"},"agentProfile.memoryScopeHint":{zh:"更改归属后保存配置,再查看对应的记忆。",en:"Save scope changes to view the corresponding memory."},"agentProfile.unsaved":{zh:"有未保存的修改",en:"Unsaved changes"},"agentProfile.saving":{zh:"正在保存…",en:"Saving…"},"agentProfile.savedShort":{zh:"配置已保存",en:"Configuration saved"},"agentProfile.currentSection":{zh:"配置分区",en:"Configuration sections"},"agentProfile.nameRequired":{zh:"请填写 Agent 名称。",en:"Enter an agent name."},"agentProfile.loadoutMode":{zh:"启用方式",en:"Availability"},"agentProfile.skillPolicy":{zh:"技能使用方式",en:"Skill use"},"agentProfile.skillPolicyHint":{zh:"自动包含新技能;自选只使用选中的技能;关闭则不使用。",en:"Automatic includes new skills. Selected uses only chosen skills. Off uses none."},"agentProfile.skillPolicy.auto":{zh:"自动使用适用技能,新技能也会加入。可为此 Agent 单独停用某项。",en:"Use relevant skills automatically, including future additions. You can disable any skill for this agent."},"agentProfile.skillPolicy.selected":{zh:"只使用勾选的技能。新技能需手动加入。",en:"Use checked skills only. Add new skills manually."},"agentProfile.skillPolicy.off":{zh:"此 Agent 暂不使用技能。",en:"This agent does not use skills."},"agentProfile.skillLegacyHint":{zh:"当前引擎只提供旧版技能清单。手动取消勾选会切换为自选;新技能不会自动加入。",en:"This engine provides the older skill list. Unchecking switches to a selected list; new skills will need to be added manually."},"agentProfile.skillCatalogUnavailable":{zh:"此引擎暂不提供技能目录。",en:"The skill catalog is unavailable on this engine."},"agentProfile.skillAuto":{zh:"自动",en:"Automatic"},"agentProfile.skillSelected":{zh:"自选",en:"Selected"},"agentProfile.skillOff":{zh:"全部关闭",en:"Off"},"agentProfile.agentSkills":{zh:"此 Agent 专属",en:"For this agent"},"agentProfile.agentSkillsHint":{zh:"只属于这个 Agent,可在此创建和编辑。",en:"Belongs to this agent. Create and edit it here."},"agentProfile.inheritedSkills":{zh:"继承自全局",en:"Inherited from global"},"agentProfile.inheritedSkillsHint":{zh:"全局原件由设置管理;这里的开关只影响此 Agent。",en:"Manage originals in Settings. Switches here affect this agent only."},"agentProfile.otherSkills":{zh:"其他可选技能",en:"Other skills"},"agentProfile.otherSkillsHint":{zh:"云端与跨 Agent 共享技能不属于本机全局原件;原有但当前未找到的选择也会保留。",en:"Cloud and shared skills are separate from local global originals. Existing selections that are currently missing are retained."},"agentProfile.sharedAgentSkill":{zh:"其他 Agent 共享",en:"Shared by another agent"},"agentProfile.localExtraSkill":{zh:"本机其他来源",en:"Other local source"},"agentProfile.cloudExtraSkill":{zh:"云端技能",en:"Cloud skill"},"agentProfile.extraChoose":{zh:"切换为自选后可单独调整",en:"Switch to selected mode to change"},"agentProfile.skillUnavailableKept":{zh:"当前目录不可见;保留原有选择。取消勾选才会移除。",en:"Not in the current catalog. Existing selection is kept until you uncheck it."},"agentProfile.addSkill":{zh:"新建技能",en:"New skill"},"agentProfile.importAgentSkill":{zh:"导入文件夹到此 Agent",en:"Import folder for this agent"},"agentProfile.noAgentSkills":{zh:"还没有专属技能。",en:"No skills for this agent yet."},"agentProfile.noGlobalSkills":{zh:"还没有可继承的全局技能。",en:"No global skills to inherit yet."},"agentProfile.skillForAgent":{zh:"{name} 对此 Agent 可用",en:"Make {name} available to this agent"},"agentProfile.skillAvailable":{zh:"可用",en:"Available"},"agentProfile.skillAgentOff":{zh:"已为此 Agent 停用",en:"Disabled for this agent"},"agentProfile.skillGlobalOff":{zh:"全局已停用",en:"Disabled globally"},"agentProfile.skillShadowed":{zh:"被此 Agent 的专属版本覆盖",en:"Overridden by this agent’s copy"},"agentProfile.skillPolicyOff":{zh:"此 Agent 的技能已关闭",en:"Skills are off for this agent"},"agentProfile.skillNotSelected":{zh:"未加入自选清单",en:"Not in the selected list"},"agentProfile.skillReadOnly":{zh:"原件只读",en:"Original is read only"},"agentProfile.skillLegacyDirectory":{zh:"旧目录名只读;可复制为合法名称的新技能",en:"Legacy folder name is read only. Copy it with a valid new name."},"agentProfile.skillFolder":{zh:"文件夹名",en:"Folder name"},"agentProfile.skillInstructions":{zh:"技能说明",en:"Skill instructions"},"agentProfile.skillFiles":{zh:"附属文件({count})",en:"Attached files ({count})"},"agentProfile.skillDetail":{zh:"技能详情",en:"Skill details"},"agentProfile.copyToAgent":{zh:"复制为此 Agent 专属",en:"Copy for this agent"},"agentProfile.copySkillHint":{zh:"复制后可独立编辑。若已有同名专属技能,请给新副本换一个文件夹名。",en:"Edit the copy independently. Choose a different folder name if this agent already has one with the same name."},"agentProfile.editGlobalSkill":{zh:"在设置中编辑全局原件",en:"Edit global original in Settings"},"agentProfile.skillDelete":{zh:"删除技能",en:"Delete skill"},"agentProfile.skillDeleteConfirm":{zh:"删除此 Agent 的「{name}」技能文件夹?若有同名全局技能,删除后将重新使用全局版本。文件夹会先备份。",en:"Delete this agent’s “{name}” skill folder? A global skill with the same name will become available again. The folder will be backed up first."},"agentProfile.skillDeleteFailed":{zh:"技能未删除。",en:"The skill was not deleted."},"agentProfile.skillEditConflict":{zh:"这份技能已在另一处修改。请关闭编辑并重新打开,避免覆盖新内容。",en:"This skill changed elsewhere. Close and reopen the editor to avoid overwriting the new content."},"agentProfile.skillRemovedElsewhere":{zh:"这份技能已在另一处删除,目录已刷新。",en:"This skill was deleted elsewhere. The catalog has been refreshed."},"agentProfile.skillEnabled":{zh:"此 Agent 现在可使用该技能",en:"This agent can now use the skill"},"agentProfile.skillDisabled":{zh:"已为此 Agent 停用该技能",en:"Skill disabled for this agent"},"agentProfile.skillCreated":{zh:"专属技能已创建",en:"Agent skill created"},"agentProfile.skillImported":{zh:"技能文件夹已导入",en:"Skill folder imported"},"agentProfile.skillSaved":{zh:"技能已保存",en:"Skill saved"},"agentProfile.skillDeleted":{zh:"技能已删除",en:"Skill deleted"},"agentProfile.skillDeletedBackup":{zh:"技能已删除;备份位于 {path}",en:"Skill deleted. Backup: {path}"},"agentProfile.skillCopied":{zh:"已复制到此 Agent",en:"Copied to this agent"},"agentProfile.saveConflict":{zh:"此 Agent 的相同设置已在另一处改变。请放弃本次草稿并重试,避免覆盖新值。",en:"The same setting changed elsewhere. Discard this draft and try again to avoid overwriting the new value."},"agentProfile.allSelectionHint":{zh:"自动包含以后新增的项目。",en:"Includes future additions automatically."},"agentProfile.manualSelectionHint":{zh:"仅使用勾选的项目。",en:"Only checked items are available."},"agentProfile.growth":{zh:"成长",en:"Growth"},"agentProfile.schedule":{zh:"日程",en:"Schedule"},"agentProfile.memoryCaption":{zh:"它记住的事实",en:"What it knows"},"agentProfile.evolutionCaption":{zh:"它总结的做法",en:"How it works"},"agentProfile.builtinSkills":{zh:"内置技能",en:"Built-in skills"},"agentProfile.scheduleLoading":{zh:"正在读取日程…",en:"Loading schedule…"},"agentProfile.scheduleLocalOnly":{zh:"日程只在本地引擎上可用。",en:"Schedules are available on the local engine only."},"agentProfile.scheduleCount":{zh:"{count} 条日程",en:"Schedule entries: {count}"},"agentProfile.scheduleAuto":{zh:"自动执行",en:"Automatic"},"agentProfile.schedulePlan":{zh:"仅规划",en:"Plan only"},"agentProfile.scheduleNoDate":{zh:"未定日期",en:"No date"},"agentProfile.scheduleLastRun":{zh:"上次执行 {time}",en:"Last run {time}"},"agentProfile.schedulePast":{zh:"已过期或未定日期({count})",en:"Past or undated ({count})"},"agentProfile.scheduleRules":{zh:"会唤醒它的自动化规则({count})",en:"Automation rules that wake it ({count})"},"agentProfile.scheduleRuleOff":{zh:"已停用",en:"Disabled"},"agentProfile.scheduleOpenCalendar":{zh:"在日历中查看",en:"View in Calendar"},"agentProfile.scheduleOpenAutomation":{zh:"在自动化中管理",en:"Manage in Automation"},"agentProfile.scheduleDeleteConfirm":{zh:"删除日程「{name}」?到点将不再执行。",en:'Delete the schedule entry "{name}"? It will no longer run.'},"agentProfile.scheduleEmpty":{zh:"还没有日程。在对话里告诉它「每天 9 点帮我整理新闻」这类定时的事,它会自己排进这里,并显示在日历上。",en:'No schedule yet. Ask it in a conversation for something timed, such as "summarize the news every day at 9", and it will add the entry here and to your Calendar.'},"agentProfile.scheduleEmptyMuse":{zh:"还没有日程。Muse 为自己安排的后续跟进会出现在这里;把它的待办交给它执行,也会排进来。两者都会显示在日历上。",en:"No schedule yet. Follow-ups Muse plans for itself appear here, and so do todos you hand over for it to carry out. Both show up in your Calendar."},"agentProfile.folder":{zh:"文件夹名",en:"Folder name"},"agentProfile.folderHint":{zh:"文件夹名也是这个 Agent 的 ID,回车改名",en:"The folder name is also this agent ID. Press Enter to rename"},"agentProfile.folderFixed":{zh:"这个 Agent 的文件夹名不可改",en:"This agent keeps its folder name"},"agentProfile.renamed":{zh:"已改名为 {slug}",en:"Renamed to {slug}"},"agentProfile.renameInvalid":{zh:"只能用小写字母、数字和连字符,且以字母或数字开头",en:"Use lowercase letters, digits and hyphens, starting with a letter or digit"},"agentProfile.renameExists":{zh:"已有同名文件夹",en:"That folder name is already taken"},"agentProfile.renameCloudSynced":{zh:"这个 Agent 同步过云端,改名会在云端留下旧文件夹;请新建一个 Agent 代替",en:"This agent has been synced to the cloud, so renaming would leave the old folder there. Create a new agent instead"},"agentProfile.renamePluginSeeded":{zh:"插件安装的 Agent 不能改文件夹名",en:"Agents installed by a plugin keep their folder name"},"agentProfile.renameBusy":{zh:"它正在会话里工作,等这轮结束再改名",en:"It is busy in a session. Rename once that run finishes"},"agentProfile.renameWarnings":{zh:"已改名为 {slug},但有几处引用没更新:{detail}",en:"Renamed to {slug}, but some references were not updated: {detail}"}});Q({"homeSlot.menuHead":{zh:"主位放哪个 Space",en:"Space in the home slot"},"homeSlot.openInNewWindow":{zh:"在新窗口中打开",en:"Open in new window"}});const He="forsion_home_slot_space",We="home";function Be(){try{return localStorage.getItem(He)||null}catch{return null}}function Ca(){return Be()??We}function Ge(){const e=m.getState().spaces,t=n=>e.some(a=>a.id===n);for(const n of[Ca(),We,v.defaultSpace])if(n&&t(n))return n;return e[0]?.id??null}function Ea(e){try{localStorage.setItem(He,e)}catch{}Y()}function Oa({space:e,expanded:t}){const n=m(i=>i.spaces),[a,o]=le.useState(null),{t:s}=nt();return le.useEffect(()=>{if(!a)return;const i=()=>o(null);return window.addEventListener("click",i),window.addEventListener("contextmenu",i),()=>{window.removeEventListener("click",i),window.removeEventListener("contextmenu",i)}},[a]),y.jsxs("span",{className:"rb-homeslot",onContextMenu:i=>{i.preventDefault(),i.stopPropagation(),o({x:i.clientX,y:i.clientY})},children:[y.jsx(V,{space:e,expanded:t}),a&&dt.createPortal(y.jsxs(ft,{className:"ctx-menu",x:a.x,y:a.y,onClick:i=>i.stopPropagation(),children:[ce()?.openSpace&&y.jsx("button",{onClick:()=>{ce()?.openSpace?.(e.id),o(null)},children:s("homeSlot.openInNewWindow")}),y.jsx("div",{className:"ctx-head",children:s("homeSlot.menuHead")}),n.map(i=>y.jsxs("button",{onClick:()=>{Ea(i.id),o(null)},children:[i.icon?y.jsx(i.icon,{size:13}):y.jsx("span",{style:{width:13}}),Ae(i.name),i.id===e.id&&y.jsx(ut,{size:12,style:{marginLeft:"auto",opacity:.7}})]},i.id))]}),document.body)]})}function Y(){const e=Ge(),t=ct.getState().items;for(const n of m.getState().spaces){const a=`space:${n.id}`,o=n.id===e?"home":"top",s=t.find(i=>i.id===a);!s||s.side===o||q({...s,side:o,component:o==="home"?({expanded:i})=>y.jsx(Oa,{space:n,expanded:i}):({expanded:i})=>y.jsx(V,{space:n,expanded:i})})}}let pe=!1;function Ta(){Y(),!pe&&(pe=!0,m.subscribe((e,t)=>{e.spaces!==t.spaces&&Y()}))}const f=()=>ee.getState(),w=()=>Me.getState(),Va="forsion_default_space",W="__last__",B="__home__";function G(){try{return localStorage.getItem(Va)||B}catch{return B}}function La(e){const t=G();return t===B?Ge()??v.defaultSpace:t===W?e:m.getState().spaces.some(n=>n.id===t)?t:v.defaultSpace}function Na(){const e=G();if(e===W)return null;const t=e===B?Be():e;return t&&!m.getState().spaces.some(n=>n.id===t)?t:null}const ne={type:"workspace",params:{mode:"files"}},J={type:"chat",params:{followActive:!0,reuseKey:"primary"}},j={type:"workspace",params:{mode:"orbits"}},he={left:[j],right:[{type:"tangu-details",params:{}},ne,{type:"outline",params:{}}],bottom:[{type:"terminal",params:{}}]},ja={id:"tangu",mini:{name:"Tangu",view:{type:"mini-tangu",params:{followActive:!0}},mainView:{type:"chat"}},name:()=>w().tr("space.tangu"),icon:_e,autoWorkspaceMode:"orbits",sidebarDefaults:he,pinned:{main:[J],left:[j],right:[{type:"tangu-details",params:{}}]},build(){f().setSidebarDefaults(he),f().openView(J.type,J.params,"main"),f().openView(j.type,j.params,"left"),f().initializeSidebar("right",!1),f().initializeSidebar("bottom",!1)}},$a={id:"agents",name:()=>w().tr("agentProfile.space"),icon:mt,sidebarDefaults:{left:[{type:"agents-roster",params:{}}],right:[],bottom:[]},pinned:{main:[{type:"agent-profile",params:{}}],left:[{type:"agents-roster",params:{}}]},build(){f().setSidebarDefaults({left:[{type:"agents-roster",params:{}}],right:[],bottom:[]}),f().openView("agent-profile",{},"main"),f().openView("agents-roster",{},"left"),f().initializeSidebar("bottom",!1),f().initializeSidebar("right",!1)}},$={type:"workspace",params:{mode:Fe}},me={left:[$],right:[ne]},Ua={id:"inbox",name:()=>w().tr("space.inbox"),icon:Ie,sidebarDefaults:me,pinned:{main:[{type:"inbox-reader",params:{}}],left:[$]},autoWorkspaceMode:Fe,resizableSides:{left:!0},sideDefaultScale:{left:1.3},build(){f().setSidebarDefaults(me),f().openView("inbox-reader",{},"main"),f().openView($.type,$.params,"left"),f().initializeSidebar("right",!1)}},qe=b("tangu"),U={type:"workspace",params:{mode:"notes"}},ye={left:[U,{type:"amadeus-search",params:{}},{type:"amadeus-tags",params:{}}],right:[...qe?[{type:"chat-panel",params:{followActive:!0}}]:[],{type:"outline",params:{}},{type:"amadeus-backlinks",params:{}},{type:"amadeus-graph",params:{}}]},Ra={id:"amadeus",mini:{name:"Amadeus",view:{type:"mini-amadeus"},mainView:{type:"amadeus-editor"}},name:()=>w().tr("space.amadeus"),icon:je,sidebarDefaults:ye,pinned:{left:[U]},launcherViews:[...Object.keys(gt),"amadeus-media","amadeus-plugin-file"].map(e=>({type:e,params:{}})),resizableSides:{left:!0},autoWorkspaceMode:"notes",build(){f().setSidebarDefaults(ye),f().openView("amadeus-editor",{},"main");const e=f().openView(U.type,U.params,"left");f().openView("amadeus-search",{},"left"),f().openView("amadeus-tags",{},"left"),f().initializeSidebar("right",!1),e&&f().activateLeaf(e.id)}},Se={left:[{type:"coding-navigation",params:{}}],right:[ne],bottom:[{type:"terminal",params:{}}]},Fa={id:"coding",name:()=>w().tr("space.coding"),icon:Jt,sidebarDefaults:Se,pinned:{main:[{type:"code-studio",params:{}}],left:[{type:"coding-navigation",params:{}}]},resizableSides:{left:!0},sideDefaultScale:{left:1},build(){f().setSidebarDefaults(Se),w().selectNewChatAgent?.("coding"),f().openView("code-studio",{},"main"),f().openView("coding-navigation",{},"left"),f().initializeSidebar("right",!1),f().initializeSidebar("bottom",!1)}},R={type:"workspace",params:{mode:Le}},ve={left:[R],right:[]},Ha={id:"automation",autoWorkspaceMode:Le,name:()=>w().tr("space.automation"),icon:Xt,sidebarDefaults:ve,pinned:{main:[{type:"automation-detail",params:{}}],left:[R]},resizableSides:{left:!0,right:!0},build(){f().setSidebarDefaults(ve),f().openView("automation-detail",{},"main"),f().openView(R.type,R.params,"left")}},ke={left:[],right:[]},Wa={id:"public",name:()=>w().tr("space.public"),icon:ma,sidebarDefaults:ke,pinned:{main:[{type:"public-view",params:{}}]},build(){f().setSidebarDefaults(ke),f().openView("public-view",{},"main")}},Ke=v.nativeFeatures===void 0||b("amadeus"),D=[...kt()&&M("home")?[pt]:[],...b("tangu")?[ja]:[],...b("amadeus")&&xe()&&Ke?[Ra]:[],...Pt()&&M("calendar")?[ht]:[],...bt()?[Ua]:[],...b("tangu")?[$a]:[],...v.nativeFeatures===void 0&&v.spaces.includes("coding")&&window.tangu?.codePreviewServe?[Fa]:[],...wt()&&M("image-studio")?[yt]:[],...zt()&&M("artificial")?[St]:[],...b("automation")&&window.tangu?.backendStatus?[Ha]:[],...At()&&M("muse")?[vt]:[],...b("public")&&(window.tangu?.connectPublish||window.amadeusCollab)?[Wa]:[]];function kn(){b("tangu")&&Da();for(const t of D)te(t),q({id:`space:${t.id}`,side:"top",component:({expanded:n})=>y.jsx(V,{space:t,expanded:n})});if(Ta(),new URLSearchParams(location.search).get("window")==="mini")return;const e=m.getState().activeSpaceId;if(!De&&D.length&&!D.some(t=>t.id===e)){const t=D.some(n=>n.id===v.defaultSpace)?v.defaultSpace:D[0].id;m.setState({activeSpaceId:t})}try{H()==="main"&&localStorage.getItem("forsion_pinned_layout_v1")!=="1"&&(de(),localStorage.setItem("forsion_pinned_layout_v1","1"))}catch{}try{H()==="main"&&localStorage.getItem("forsion_image_studio_layout_v2")!=="1"&&(de("image-studio"),localStorage.setItem("forsion_image_studio_layout_v2","1"))}catch{}try{if(localStorage.getItem("forsion_rightpanel_collapse_v1")!=="1"){I("space:amadeus"),I("space:tangu");const t=localStorage.getItem("forsion_tangu_active_space");(t==="amadeus"||t==="tangu")&&E(),localStorage.setItem("forsion_rightpanel_collapse_v1","1")}}catch{}if(xe()&&Ke){_t();try{localStorage.getItem("amadeus_layout_v2")!=="1"&&(I("space:amadeus"),localStorage.getItem("forsion_tangu_active_space")==="amadeus"&&E(),localStorage.setItem("amadeus_layout_v2","1")),qe&&localStorage.getItem("amadeus_layout_v3")!=="1"&&(I("space:amadeus"),localStorage.getItem("forsion_tangu_active_space")==="amadeus"&&E(),localStorage.setItem("amadeus_layout_v3","1"))}catch{}}}Q({"spaces.delete":{zh:"删除 Space…",en:"Delete Space…"}});const ie=["tangu","inbox","amadeus","calendar","muse"],Ba={bot:_e,inbox:Ie,mail:fa,"notebook-text":je,"book-open":aa,briefcase:oa,"calendar-days":Bt,"message-circle":Wt,folder:ta,"folder-open":Ht,"file-text":Ft,star:ea,heart:ca,home:Rt,target:ba,zap:Ut,globe:$t,music:ga,image:jt,video:za,code:ra,terminal:Qt,"layout-grid":Zt,sparkles:Nt,boxes:Ne,"list-tree":Yt,server:ka,"server-cog":Sa},Ga=/^data:image\/(png|svg\+xml);base64,[A-Za-z0-9+/=]+$/;function Je(e,t){const n=`url("${e}") center / contain no-repeat`,a=e.startsWith("data:image/svg+xml")?({size:o=18})=>y.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",flex:"none",width:o,height:o,background:"currentColor",mask:n,WebkitMask:n}}):({size:o=18})=>y.jsx("img",{"aria-hidden":"true",alt:"",src:e,width:o,height:o,draggable:!1,style:{flex:"none",borderRadius:"22%",objectFit:"cover"}});return a.imageUrl=e,a.nativeFallback=t,a}const g=()=>ee.getState(),x=()=>Me.getState(),O=new Map,T=new Map,Z=new Map,F=new Map;let Pe=!1;const Xe=new Set;let C=!1,Ye=!1;const qa=e=>O.has(e),Ka=e=>T.get(e);function Ja(){Ye=!0;const e=m.subscribe((t,n)=>{t.activeSpaceId!==n.activeSpaceId&&(e(),C=!0)})}function be(e){return()=>typeof e.name=="string"?e.name:(it()==="zh"?e.name.zh??e.name.en:e.name.en??e.name.zh)??e.id}const z=e=>e.map(t=>({type:t.type,params:t.params??{}})),we="forsion_space_recipe_ver";function Ze(e){if(H()==="mini"||!e.version)return;let t={};try{t=JSON.parse(localStorage.getItem(we)||"{}")}catch{}if((typeof t!="object"||!t)&&(t={}),t[e.id]!==e.version){I(ae(e.id)),Xe.add(e.id),De===e.id?E():m.getState().activeSpaceId===e.id&&ee.getState().resetLayout(),t[e.id]=e.version;try{localStorage.setItem(we,JSON.stringify(t))}catch{}}}function Qe(e,t){const n={left:z(e.layout.left),right:z(e.layout.right),bottom:z(e.layout.bottom??[])},a=Ba[e.icon??""]??Ne;return{id:e.id,mini:e.mini?{...e.mini,name:e.mini.name?be({...e,name:e.mini.name}):void 0}:void 0,name:be(e),icon:t?Je(t,a):a,listFirst:!1,sidebarDefaults:n,pinned:{main:z(e.layout.main.filter(o=>o.pinned)),left:z(e.layout.left.filter(o=>o.pinned)),right:z(e.layout.right.filter(o=>o.pinned))},launcherViews:z(e.layout.main),bottomSpan:e.layout.bottomSpan,build(){g().setSidebarDefaults(n);const o=[];for(const s of _a(e.layout.main)){let i=null;if(s.mode==="first")i=g().openView(s.panel.type,s.panel.params??{},"main");else if(s.mode==="tab")i=g().openView(s.panel.type,s.panel.params??{},"main",{newTab:!0});else{const d=o[s.from];d&&g().activateLeaf(d.id);const l=d?g().splitActive(s.direction):null;i=l?g().navigateLeaf(l.id,s.panel.type,s.panel.params??{}):g().openView(s.panel.type,s.panel.params??{},"main",{newTab:!0})}i&&o.push(i)}o.length>1&&o[0]&&g().activateLeaf(o[0].id);for(const s of["left","right"]){for(const i of n[s])g().openView(i.type,i.params,s);n[s].length||g().initializeSidebar(s,!1)}if(Gt())for(const s of n.bottom??[])g().openView(s.type,s.params,"bottom")}}}function oe(e,t=e.id,n){Ze(e);const a=Qe(e,n);te(a),O.set(e.id,t),q({id:`space:${e.id}`,side:"top",component:({expanded:o})=>y.jsx(V,{space:a,expanded:o}),menu:()=>[{label:x().tr("spaces.delete"),onClick:()=>{window.confirm(x().tr("spaces.deleteConfirm",{name:Ae(a.name)}))&&et(e.id)}}]})}function ze(e,t,n){Ze(e);const a=Qe(e,n);te(a),T.set(e.id,t),q({id:`space:${e.id}`,side:"top",component:({expanded:o})=>y.jsx(V,{space:a,expanded:o})})}function Xa(e){m.getState().activeSpaceId===e&&L("tangu"),Oe(e),Te(`space:${e}`),T.delete(e),Z.delete(e),F.delete(e)}let X=Promise.resolve();function Ya(){return X=X.catch(()=>{}).then(Qa),X}function Za(){if(C||H()!=="main"||Mt==="mobile")return;const e=La(Lt),t=m.getState();if(!t.spaces.some(i=>i.id===e))return;const n=Na()===null,a=n&&Ye&&!!g().api;if(G()===W){let i=null;try{i=localStorage.getItem("forsion_tangu_active_space")}catch{}if(i!==null&&i!==e){C=!0;return}}const o=Xe.delete(e)||Dt()&&t.activeSpaceId!==e,s=()=>{const i=Ve();i&&(g().setSidebarDefaults(i.sidebarDefaults),g().setSideProfile(i.id,i.resizableSides??{},i.sideDefaultScale,i.bottomSpan),g().setPinned(i.pinned))};if(o&&!a){E(),t.activeSpaceId!==e&&fe(e),s(),g().resetLayout(),n&&(C=!0);return}if(t.activeSpaceId!==e)if(G()===W&&!a){const i=Ct();if(fe(e),s(),Kt()||i!==null&&i!==e){const d=ae(e);Et(d)&&g().applyNamed(d)?(g().ensurePinned(),g().saveCurrent()):g().resetLayout()}else g().realignRegions?.()}else L(e);else g().sideProfileKey!==e&&(s(),g().realignRegions?.());n&&(C=!0)}async function Qa(){const e=await window.tangu?.spacesList?.().catch(()=>null);if(!e)return;const t=await window.tangu?.appVersion?.().catch(()=>null)??null,n=new Set(Ot()),a=new Map,o={},s=new Set(Tt.getState().activeIds);for(const{slug:l,json:c,plugin:u,iconUrl:h}of e){const P=typeof h=="string"&&Ga.test(h)?h:void 0;if(u&&n.has(u))continue;const r=Ia(c,{isViewRegistered:S=>!!qt(S),appVersion:t,reservedIds:ie});if(!r.ok){console.warn(`[spaces] 跳过 ${l}: ${r.error}`),u&&s.has(u)&&(o[u]??=[]).push({slug:l,id:r.id,name:r.name,code:r.code??"invalid",views:r.views,need:r.need,...r.code==="min-app-version"?{have:t}:{},detail:r.error});continue}a.has(r.spec.id)||a.set(r.spec.id,{spec:r.spec,dirSlug:l,plugin:u,raw:c,iconUrl:P})}Vt(o);for(const[l,c]of[...T]){const u=a.get(l);(!u||u.plugin!==c||Z.get(l)!==u.raw)&&Xa(l)}const i=new Set(m.getState().spaces.map(l=>l.id));for(const[l,c]of a){if(i.has(l)){c.plugin&&T.get(l)===c.plugin&&F.get(l)!==c.iconUrl&&(ze(c.spec,c.plugin,c.iconUrl),F.set(l,c.iconUrl));continue}i.add(l),c.plugin?(ze(c.spec,c.plugin,c.iconUrl),Z.set(l,c.raw),F.set(l,c.iconUrl)):oe(c.spec,c.dirSlug,c.iconUrl)}!Pe&&v.spaces.length===0&&m.getState().spaces.some(l=>l.id===v.defaultSpace)&&(Pe=!0,m.getState().activeSpaceId!==v.defaultSpace?L(v.defaultSpace):g().mainTabs.length===0&&g().resetLayout());const d=Ve();d&&g().setSidebarDefaults(d.sidebarDefaults)}const en={workspace:["mode"],chat:["followActive","reuseKey"]},tn=new Set(["launcher","wsfile","sidebar-empty","home"]);async function an(e){const t=g().api;if(!t||!window.tangu?.spacesSave)return;const n={main:[],left:[],right:[]},a=new Set;for(const d of t.panels){const l=d.params??{},c=xa(l.__loc);if(!c)continue;const u=typeof l.__type=="string"?l.__type:"";if(!u||tn.has(u)||a.has(`${c}:${u}`))continue;a.add(`${c}:${u}`);const h={};for(const P of en[u]??[])l[P]!==void 0&&(h[P]=l[P]);n[c].push(Object.keys(h).length?{type:u,params:h}:{type:u})}n.main.length||n.main.push({type:"chat",params:{followActive:!0,reuseKey:"primary"}});const o=new Set([...ie,...m.getState().spaces.map(d=>d.id)]),s=Re(Ue(e),o),i={id:s,name:e,icon:"boxes",layout:n};await window.tangu.spacesSave(s,JSON.stringify(i,null,2)),Ce("space.save"),Ee("space.save",{id:s}),oe(i),x().toast(x().tr("spaces.saved",{name:e}))}async function nn(e){if(!window.tangu?.spacesSave)return;const t=new Set([...ie,...m.getState().spaces.map(o=>o.id)]),n=Re(Ue(e)||"space",t),a={id:n,name:e,icon:"boxes",layout:{main:[{type:"launcher"}],left:[],right:[]}};await window.tangu.spacesSave(n,JSON.stringify(a,null,2)),Ce("space.save"),Ee("space.save",{id:n,blank:!0}),oe(a),L(n),x().toast(x().tr("spaces.saved",{name:e}))}async function et(e){const t=O.get(e);if(!t)return!1;try{await window.tangu?.spacesDelete?.(t)}catch(n){return It(xt(n),!0),!1}return tt(e),window.tangu?.requestMainAction?.("space-removed",e),!0}function tt(e){O.has(e)&&(m.getState().activeSpaceId===e&&L("tangu"),Oe(e),Te(`space:${e}`),I(ae(e)),O.delete(e))}const Pn=Object.freeze(Object.defineProperty({__proto__:null,createBlankSpace:nn,deleteUserSpace:et,forgetUserSpace:tt,imageIcon:Je,isUserSpace:qa,loadUserSpaces:Ya,parkOnStartupFallback:Ja,pluginOfSpace:Ka,saveCurrentAsSpace:an,settleAsyncStartupSpace:Za},Symbol.toStringTag,{value:"Module"}));export{Ke as A,ra as C,Va as D,ca as H,Fe as I,W as L,fa as M,je as N,ma as R,ka as S,ba as T,za as V,ga as a,B as b,Ea as c,et as d,yn as e,tt as f,kn as g,Ge as h,qa as i,La as j,Na as k,Ya as l,Ja as m,Za as n,nn as o,Ka as p,an as q,Sn as r,G as s,Pn as u,vn as w};